<?php /* Smarty version 2.6.10, created on 2010-02-07 15:18:18
         compiled from admin.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'admin.tpl', 171, false),array('function', 'html_options', 'admin.tpl', 219, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'header.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


  <h2>Administration</h2>
  <p class="mcenter">
    <span style="color:#aaaaaa;">
    <?php if ($this->_tpl_vars['access']): ?>
      &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
      <a style="color:#aaaaaa;" href="#apiupdate" title="API Data Updates">API Data</a>
      &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
      <a style="color:#aaaaaa;" href="#apikeys" title="API Key Management">API Keys</a>
      &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
      <a style="color:#aaaaaa;" href="admin.php?action=moons" title="Moons Management">Moons</a>
      &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
      <a style="color:#aaaaaa;" href="#users" title="Users Management">Users</a>
      &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;
      <a style="color:#aaaaaa;" href="admin.php?op=modules" title="Addons Management">Addons</a>
      &nbsp; &nbsp; &nbsp; |
    <?php endif; ?>
      <br /><br />
    </span>
  </p>

  <hr />
  <?php if ($this->_tpl_vars['action']): ?>
    <?php if ($this->_tpl_vars['action'] == 'updatealliance'): ?>
      <p>
        Success<br />
        Total Number of Alliances: <?php echo $this->_tpl_vars['results']['counttotal']; ?>
<br />
        Total Number of Updates: <?php echo $this->_tpl_vars['results']['updatestotal']; ?>

        <br /><br />
        <a class="arialwhite14 txtunderlined" href="admin.php" title="Done">Done</a>
        <br /><br />
        <?php if ($this->_tpl_vars['results']['updatestotal']): ?>
        Alliances Added:<br />
        <table class="mcenter tracktable" style="width:640px;">
        <?php $_from = $this->_tpl_vars['results']['alladded']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['all']):
?>
          <tr>
            <td><?php echo $this->_tpl_vars['all']['name']; ?>
</td>
            <td><?php echo $this->_tpl_vars['all']['shortName']; ?>
</td>
          </tr>
        <?php endforeach; endif; unset($_from); ?>
        </table>
        <?php endif; ?>
      </p>
    <?php elseif ($this->_tpl_vars['action'] == 'updatedatafromapi'): ?>
      <p>
        Success<br />
        Total Number of POS Added: <?php echo $this->_tpl_vars['results']['count_added']; ?>
<br />
        Total Number of POS Updated: <?php echo $this->_tpl_vars['results']['count_updated']; ?>
<br />
        Total POSes updated from API: <?php echo $this->_tpl_vars['results']['count_towers']; ?>
<br />
	<br />
        <a class="arialwhite14 txtunderlined" href="admin.php" title="Done">Done</a>
        <br /><br />
        <?php if ($this->_tpl_vars['results']): ?>
        Towers List:<br />
        <table class="mcenter tracktable" style="width:640px;">
                <?php $_from = $this->_tpl_vars['posupdate']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['evetowerID'] => $this->_tpl_vars['posinfo']):
?>
          <tr>
            <td><?php echo $this->_tpl_vars['evetowerID']; ?>
</td>
            <td><?php echo $this->_tpl_vars['posinfo']; ?>
</td>
          </tr>
        <?php endforeach; endif; unset($_from); ?>
        </table>
        <?php endif; ?>
      </p>
    <?php elseif ($this->_tpl_vars['action'] == 'updatesovereignty'): ?>
      <p>
      <?php if ($this->_tpl_vars['sovcount']): ?>
        Success<br />
        Systems Updated: <?php echo $this->_tpl_vars['sovcount']; ?>
<br />
      <?php else: ?>
        ERROR!!
      <?php endif; ?>
        <br /><br />
        <a class="arialwhite14 txtunderlined" href="admin.php" title="Done">Done</a>
      </p>

    <?php elseif ($this->_tpl_vars['action'] == 'getcharacters'): ?>
      <?php $_from = $this->_tpl_vars['characters']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['character']):
?>
      <?php $this->assign('alliance', $this->_tpl_vars['character']['alliance']); ?>
      <div style="margin-bottom:25px;">
      <form id="u_<?php echo $this->_tpl_vars['character']['characterID']; ?>
" method="post" action="admin.php">
      <div>
        <input type="hidden" name="action" value="saveapi" />
        <input type="hidden" name="apikey" value="<?php echo $this->_tpl_vars['apikey']; ?>
" />
        <input type="hidden" name="userid" value="<?php echo $this->_tpl_vars['userid']; ?>
" />
        <input type="hidden" name="characterID" value="<?php echo $this->_tpl_vars['character']['characterID']; ?>
" />
        <input type="hidden" name="corporationName" value="<?php echo $this->_tpl_vars['character']['corporationName']; ?>
" />
        <input type="hidden" name="corporationID" value="<?php echo $this->_tpl_vars['character']['corporationID']; ?>
" />
        <input type="hidden" name="allianceName" value="<?php echo $this->_tpl_vars['alliance']['allianceName']; ?>
" />
        <input type="hidden" name="allianceID" value="<?php echo $this->_tpl_vars['alliance']['allianceID']; ?>
" />
        <input type="submit" value="Save <?php echo $this->_tpl_vars['character']['name']; ?>
 API Key" />
      </div>
      </form>
      </div>
      <?php endforeach; endif; unset($_from); ?>


    <?php endif; ?>
  <?php else: ?>
    <h4><a style="color:#ffffff;" name="moons"></a>Manage Moons</h4>
    <div class="mcenter">
      <a href="admin.php?action=moons" title="Moon Database">Managed Moon Database</a>
      <br />
    </div>
    <hr />

    <h4><a style="color:#ffffff;" name="apiupdates"></a>API Data</h4>
    <div>
      <?php if ($this->_tpl_vars['allyupdate']): ?>
      <span style="color:red;font-weight:bold;">Warning, Your Alliance data is out of date. <?php echo $this->_tpl_vars['allytime']; ?>
</span><br />
      <?php endif; ?>
      <?php if ($this->_tpl_vars['systupdate']): ?>
      <span style="color:red;font-weight:bold;">Warning, Your Sovereignty data is out of date. <?php echo $this->_tpl_vars['sovtime']; ?>
</span><br />
      <?php endif; ?>
      <?php if ($this->_tpl_vars['apiupdate']): ?>
      <span style="color:red;font-weight:bold;">Warning, Your API POS data is out of date. <?php echo $this->_tpl_vars['apitime']; ?>
</span><br />
      <?php endif; ?>

      
      <div>
        <table class="mcenter tracktable" style="width:640px;">
        <thead>
          <tr class="trackheader">
            <th>API Type</th>
            <th>Last Updated</th>
            <th>Manual Update</th>
          </tr>
        </thead>
        <tbody>
	  <tr>
	    <td>Alliance Database</td>
	    <td><?php echo $this->_tpl_vars['allytime']; ?>
</td>
	    <td><form method="post" action="admin.php"><input type="hidden" name="action" value="updatealliance" /><input type="submit" value="UPDATE NOW" /></form></td>
	  </tr>
	  <tr>
	    <td>Sovereignty Database</td>
	    <td><?php echo $this->_tpl_vars['sovtime']; ?>
</td>
	    <td><form method="post" action="admin.php"><input type="hidden" name="action" value="updatesovereignty" /><input type="submit" value="UPDATE NOW" /></form></td>
	  </tr>
	  <tr>
	    <td>POS Update from API</td>
	    <td><?php echo $this->_tpl_vars['apitime']; ?>
</td>
	    <td><form method="post" action="admin.php"><input type="hidden" name="action" value="updatedatafromapi" /><input type="submit" value="UPDATE NOW" /></form></td>
	  </tr>
	</table>
      </div>
    </div>
    <hr />

    <h4><a name="apikeys"></a>API Key Manager</h4>
    <div class="mcenter">
      <form method="post" action="admin.php">
      <div>
        <input type="hidden" name="action" value="updatekey" />
        <table class="mcenter tracktable" style="width:640px;">
        <thead>
          <tr class="trackheader">
            <th>Corp</th>
            <th>UserID</th>
            <th>API Key (first 5 characters)</th>
            <th>Remove</th>
          </tr>
        </thead>
        <tbody>
        <?php $_from = $this->_tpl_vars['keys']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key']):
?>
          <tr>
            <td><?php echo ((is_array($_tmp=@$this->_tpl_vars['key']['corp'])) ? $this->_run_mod_handler('default', true, $_tmp, "&nbsp;") : smarty_modifier_default($_tmp, "&nbsp;")); ?>
</td>
            <td><?php echo ((is_array($_tmp=@$this->_tpl_vars['key']['userID'])) ? $this->_run_mod_handler('default', true, $_tmp, "&nbsp;") : smarty_modifier_default($_tmp, "&nbsp;")); ?>
</td>
            <td><?php echo ((is_array($_tmp=@$this->_tpl_vars['key']['shortkey'])) ? $this->_run_mod_handler('default', true, $_tmp, "&nbsp;") : smarty_modifier_default($_tmp, "&nbsp;")); ?>
</td>
            <td><?php if ($this->_tpl_vars['userinfo']['access'] > 4): ?><input type="checkbox" name="keyremove[<?php echo $this->_tpl_vars['key']['id']; ?>
]" /><?php else: ?>&nbsp;<?php endif; ?></td>
           </tr>
        <?php endforeach; endif; unset($_from); ?>
          <tr>
            <td colspan="4"><input type="submit" value="Update/Remove" /></td>
          </tr>
        </tbody>
        </table>
      </div>
      </form>
     <h4>Add an API Key</h4>
      <form method="post" action="admin.php?action=getcharacters">
      <div>
        USERID: <input type="text" name="userid" size="10" /> APIKEY: <input type="text" name="apikey" size="35" /> <input type="submit" value="Select Character" />
      </div>
      </form>
     <br />
    </div>

    <hr />
    <h4><a style="color:#ffffff;" name="users"></a>Registered Users</h4>
    <div class="mcenter">
      <form method="post" action="admin.php">
      <div>
        <input type="hidden" name="action" value="updateusers" />
        <table class="mcenter tracktable" style="width:640px;">
        <thead>
          <tr class="trackheader">
            <th>Name</th>
            <th>Corp</th>
            <th>Email</th>
            <th>Away</th>
            <th>Access</th>
            <th>Highly Trusted</th>
            <th>Remove</th>
            <!--<th>Modify</th>-->
          </tr>
        </thead>
        <tbody>
        <?php $_from = $this->_tpl_vars['users']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['user']):
?>
          <tr>
            <td><?php echo $this->_tpl_vars['user']['name']; ?>
</td>
            <td><?php echo ((is_array($_tmp=@$this->_tpl_vars['user']['corp'])) ? $this->_run_mod_handler('default', true, $_tmp, "&nbsp;") : smarty_modifier_default($_tmp, "&nbsp;")); ?>
</td>
            <td><?php echo ((is_array($_tmp=@$this->_tpl_vars['user']['email'])) ? $this->_run_mod_handler('default', true, $_tmp, "&nbsp;") : smarty_modifier_default($_tmp, "&nbsp;")); ?>
</td>
            <td><?php echo $this->_tpl_vars['awaylevel'][$this->_tpl_vars['user']['away']]; ?>
</td>
            <td><?php if ($this->_tpl_vars['user']['access'] < $this->_tpl_vars['userinfo']['access']): ?><select name="useraccess[<?php echo $this->_tpl_vars['user']['id']; ?>
]"><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['optaccess'],'selected' => $this->_tpl_vars['user']['access']), $this);?>
</select><?php else:  echo $this->_tpl_vars['accesslevel'][$this->_tpl_vars['user']['access']]; ?>
<input type="hidden" name="access[<?php echo $this->_tpl_vars['user']['id']; ?>
]" value="<?php echo $this->_tpl_vars['user']['access']; ?>
" /><?php endif; ?></td>
            <td><?php if ($this->_tpl_vars['userinfo']['access'] > 4): ?><select name="usertrust[<?php echo $this->_tpl_vars['user']['id']; ?>
]"><?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['opttrust'],'selected' => $this->_tpl_vars['user']['highly_trusted']), $this);?>
</select><?php else:  echo $this->_tpl_vars['opttrust'][$this->_tpl_vars['user']['highly_trusted']]; ?>
<input type="hidden" name="usertrust[<?php echo $this->_tpl_vars['user']['id']; ?>
]" value="<?php echo $this->_tpl_vars['user']['highly_trusted']; ?>
" /><?php endif; ?></td>
            <td><?php if ($this->_tpl_vars['user']['access'] < $this->_tpl_vars['userinfo']['access']): ?><input type="checkbox" name="userremove[<?php echo $this->_tpl_vars['user']['id']; ?>
]" /><?php else: ?>&nbsp;<?php endif; ?></td>
          </tr>
        <?php endforeach; endif; unset($_from); ?>
          <tr>
            <td colspan="7"><input type="submit" value="Update/Remove" /></td>
          </tr>
        </tbody>
        </table>
      </div>
      </form>
    </div>
  <?php endif; ?>


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'footer.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>