  <script type="text/javascript" src="calendar1.js"></script>

  <?
  // Tab -----------------------------------------
  $tab_quantity=2;
  $tab_style=1;	// (single-row)
  $tab_name=array("&nbsp;&nbsp;<b>GUI</b>&nbsp;&nbsp;","&nbsp;<b>Security</b>&nbsp;");
  include_once('tab.php');
  //----------------------------------------------
  ?>
  <table width="99%" border="0" cellspacing="0" cellpadding="0">
  <form action="controllers/inputController.php" method="post" name="systemform" id="systemform">
  <tr valign=top>
  <td valign=top>

  <div id='tab-body:0' class='tab-body' style='display: block;'>
  <table border=0 cellspacing=1 cellpadding=2 width=760>
  <tr valign=top>
  <td valign=top width=760 colspan=2 class=newscontent style="border-bottom: 1px solid; background: #f0f0f0;">
  <b>USER INTERFACE SETTINGS</b>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=760 colspan=2 class=newscontent style="border-bottom: 1px solid;">
  <b>User Interface</b>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>CSS File</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="text" name="system_gui_cssfile" id="system_gui_cssfile" value="<?=$systemsettings_data['system_gui_cssfile'];?>" style="width: 240px;">&nbsp;
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Login Count Date</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="text" name="system_gui_logincountdate" id="system_gui_logincountdate" value="<?=unconverttounix($systemsettings_data['system_gui_logincountdate']);?>" size=12 maxlength=10 onkeypress="dateOnly();">
  <a href="javascript:cal1.popup();"><img src="images/icon/cal.gif" width="16" height="16" border="0" alt="Click to select date"></a>&nbsp;
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Horizontal Scrolling</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="checkbox" name="system_gui_hscroll" id="system_gui_hscroll" value="yes" <? if ($systemsettings_data['system_gui_hscroll']=="yes") echo "checked"; ?>>&nbsp;Yes
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Vertical Scrolling</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="checkbox" name="system_gui_vscroll" id="system_gui_vscroll" value="yes" <? if ($systemsettings_data['system_gui_vscroll']=="yes") echo "checked"; ?>>&nbsp;Yes
  </td>
  </tr>
  </table>
  </div>

  <div id='tab-body:1' class='tab-body' style='display: none;'>
  <table border=0 cellspacing=1 cellpadding=2 width=760>
  <tr valign=top>
  <td valign=top width=760 colspan=2 class=newscontent style="border-bottom: 1px solid; background: #f0f0f0;">
  <b>SECURITY SETTINGS</b>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=760 colspan=2 class=newscontent style="border-bottom: 1px solid;">
  <b>System Security</b>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Emergency Lockdown</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="checkbox" name="system_security_lockdown" id="system_security_lockdown" value="yes" <? if ($systemsettings_data['system_security_lockdown']=="yes") echo "checked"; ?>>&nbsp;Activate Emergency Lockdown</input>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Logins</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="checkbox" name="system_security_nologin" id="system_security_nologin" value="yes" <? if ($systemsettings_data['system_security_nologin']=="yes") echo "checked"; ?>>&nbsp;Disable User Logins</input>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=760 colspan=2 class=newscontent style="border-bottom: 1px solid;">
  <b>Audit Trail</b>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Purge Option</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;<input type="checkbox" name="system_audit_purge" id="system_audit_purge" value="yes" <? if ($systemsettings_data['system_audit_purge']=="yes") echo "checked"; ?>>&nbsp;Purge Audit Trail automatically</input>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Purge Threshold</td>
  <td valign=top width=610 class=newscontent style="border-bottom: 1px solid;">
  &nbsp;Purge Audit Trails older than 
  <select name="system_audit_purgeage" id="system_audit_purgeage" style="width:40px;">
  <option value="0" selected>NA</option>
  <option value="12" <? if ($systemsettings_data['system_audit_purgeage']=="12") echo "selected"; ?>>12</option>
  <option value="24" <? if ($systemsettings_data['system_audit_purgeage']=="24") echo "selected"; ?>>24</option>
  <option value="36" <? if ($systemsettings_data['system_audit_purgeage']=="36") echo "selected"; ?>>36</option>
  <option value="48" <? if ($systemsettings_data['system_audit_purgeage']=="48") echo "selected"; ?>>48</option>
  <option value="60" <? if ($systemsettings_data['system_audit_purgeage']=="60") echo "selected"; ?>>60</option>
  </select> months.
  </td>
  </tr>
  </table>
  </div>

  </td>
  </tr>
  <input type="hidden" name="fullsettings" id="fullsettings" value="">
  <input type="hidden" name="fullvalues" id="fullvalues" value="">
  <input type="hidden" name="job" id="job" value="system_settingsedit">
  </form>
  </table>

  <script type="text/javascript">

    var cal1 = new calendar1(document.forms['systemform'].elements['system_gui_logincountdate']);
    cal1.year_scroll = true;
    cal1.time_comp = false;

  function validateForm() {

    var isvalid=true;
    var errmsg="";
    var logindate=document.getElementById('system_gui_logincountdate');
    if ((logindate.value!="")&&(!isValidDate(logindate.value))) {
      errmsg+='Login Count Date is not a valid date!\n';
      isvalid=false;
    }
    if (isvalid==false) alert('Error:\n'+errmsg);
    return isvalid;

  }

  </script>
