<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/show_hide_layers.js"  type="text/javascript"></script>  
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<?php
include('../include/session.php');

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 
$today = date("Y-m-d");	
$page_display='';
$input_type='';
//$size=$_GET['sizes'];
$set = $_GET['set'];
$list = $_GET['list'];  
   $list_item = "";
   $page = $_GET['page_select'];
   
   
$table_name = $_SESSION['db_prefix']."_employee";
$dropDownQuery = "SELECT emp_id, emp_first_name, emp_last_name FROM $table_name WHERE  end_employ_date > '".$today."' AND premature_end_date > '".$today."' ORDER BY emp_first_name ASC";
$dropDownResult = execsql($dropDownQuery);
	$num = mysql_num_rows($dropDownResult);
	$a = 0;
	$arrId = array ();
	$arrName = array ();
	while ($a < $num) {
		$arrId[$a] = mysql_result($dropDownResult, $a, "emp_id");
		$arrName[$a] = mysql_result($dropDownResult, $a, "emp_first_name")." ".mysql_result($dropDownResult, $a, "emp_last_name");
		$a++;
	}
   
   
   
   
   if ($page=="stores_location") { $table_name = $_SESSION['db_prefix']."_list_stores_location";}
   if ($page=="maintenance_clusters") { $table_name = $_SESSION['db_prefix']."_list_clusters";}
   if ($page=="area") { $table_name = $_SESSION['db_prefix']."_list_area";}
   if ($page=="places") { $table_name = $_SESSION['db_prefix']."_list_places";}
   if ($page=="country") { $table_name = $_SESSION['db_prefix']."_list_country";}
   if ($page=="nationality") { $table_name = $_SESSION['db_prefix']."_list_nationality";}
   if ($page=="department") { $table_name = $_SESSION['db_prefix']."_list_department";}
   if ($page=="scale") { $table_name = $_SESSION['db_prefix']."_list_salary_scale";}
   if ($page=="absent") { $table_name = $_SESSION['db_prefix']."_list_absent";}
   if ($page=="branch") { $table_name = $_SESSION['db_prefix']."_list_branch";}
   if ($page=="banks") { $table_name = $_SESSION['db_prefix']."_list_banks";}
   if ($page=="early") { $table_name = $_SESSION['db_prefix']."_list_early";}
   if ($page=="late") { $table_name = $_SESSION['db_prefix']."_list_late";}
   if ($page=="absent") { $table_name = $_SESSION['db_prefix']."_list_absent";}
   if ($page=="not_clocked") { $table_name = $_SESSION['db_prefix']."_list_not_clocked";}
   if ($page=="overtime") { $table_name = $_SESSION['db_prefix']."_list_overtime";}
   if ($page=="position") { $table_name = $_SESSION['db_prefix']."_list_positions";}
   if ($page=="warnings") { $table_name = $_SESSION['db_prefix']."_list_warnings";}
   if ($page=="account") { $table_name = $_SESSION['db_prefix']."_list_account";}
   if ($page=="sellers") { $table_name = $_SESSION['db_prefix']."_list_sellers";}
   if ($page=="quotation_subjects") { $table_name = $_SESSION['db_prefix']."_list_quotation_subjects";}
   if ($page=="petty_cash") { $table_name = $_SESSION['db_prefix']."_list_petty_cash";}
   if ($page=="loans") { $table_name = $_SESSION['db_prefix']."_list_loans";}
   if ($page=="leave_reason") { $table_name = $_SESSION['db_prefix']."_list_leave_reason";}
   if ($page=="sick_reason") { $table_name = $_SESSION['db_prefix']."_list_sick_reason";}
  
   if ($page=="company") { $table_name = $_SESSION['db_prefix']."_list_company";}
   if ($page=="account") { $table_name = $_SESSION['db_prefix']."_list_account";}
   
   if ($page=="quote_validity") { $table_name = $_SESSION['db_prefix']."_list_quote_validity";}
   if ($page=="names_admin") { $table_name = $_SESSION['db_prefix']."_list_names_admin";}
   if ($page=="names_discipline") { $table_name = $_SESSION['db_prefix']."_list_names_discipline";}
   if ($page=="names_authorise") { $table_name = $_SESSION['db_prefix']."_list_names_authorise";}
   if ($page=="names_foreman") { $table_name = $_SESSION['db_prefix']."_list_names_foreman";}
      
   if ($page=="vehicle_make") { $table_name = $_SESSION['db_prefix']."_list_vehicle_make"; $input_type="capitals";}
   if ($page=="vehicle_model") { $table_name = $_SESSION['db_prefix']."_list_vehicle_model"; $input_type="capitals";}
   if ($page=="service_interval") { $table_name = $_SESSION['db_prefix']."_list_service_interval";}
   if ($page=="fuel_provider") { $table_name = $_SESSION['db_prefix']."_list_fuel_provider";}
   if ($page=="service") { $table_name = $_SESSION['db_prefix']."_list_service";}
   if ($page=="service_workshops") { $table_name = $_SESSION['db_prefix']."_list_garages";}
   if ($page=="transport_admin") { $table_name = $_SESSION['db_prefix']."_list_transport_admin";}
   if ($page=="transport_admin_provider") { $table_name = $_SESSION['db_prefix']."_list_transport_admin_provider";}
  
   if ($page=="stores_location") { $table_name = $_SESSION['db_prefix']."_list_stores_location"; }
   if ($page=="maintenance_clusters") { $table_name = $_SESSION['db_prefix']."_list_clusters"; }
   

   
 
if ($set==0) {
	
	
	if ($table_name==$_SESSION['db_prefix'].'_list_area') { $page_display='Area';}
	if ($table_name==$_SESSION['db_prefix'].'_list_places') { $page_display='Places';}
	if ($table_name==$_SESSION['db_prefix'].'_list_country') { $page_display='Countries';}
	if ($table_name==$_SESSION['db_prefix'].'_list_nationality') { $page_display='Nationality';}
	if ($table_name==$_SESSION['db_prefix'].'_list_petty_cash') { $page_display='Petty cash';}
	if ($table_name==$_SESSION['db_prefix'].'_list_loans') { $page_display='Loans';}
	if ($table_name==$_SESSION['db_prefix'].'_list_leave_reason') { $page_display='Leave reason';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sick_reason') { $page_display='Sick reason';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_department') { $page_display='Company departments';}
	if ($table_name==$_SESSION['db_prefix'].'_list_salary_scale') { $page_display='Salary scales';}
	//if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteeism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_branch') { $page_display='Bank branches';}
	if ($table_name==$_SESSION['db_prefix'].'_list_banks') { $page_display='Banks';}
	if ($table_name==$_SESSION['db_prefix'].'_list_early') { $page_display='Reasons for early dismiss';}
	if ($table_name==$_SESSION['db_prefix'].'_list_late') { $page_display='Reasons for late coming';}
	if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_not_clocked') { $page_display='Reasons for not clocking';}
	if ($table_name==$_SESSION['db_prefix'].'_list_overtime') { $page_display='Reasons for overtime';}
	if ($table_name==$_SESSION['db_prefix'].'_list_positions') { $page_display='Employee positions';}
	if ($table_name==$_SESSION['db_prefix'].'_list_warnings') { $page_display='Disciplinairy warnings';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sellers') { $page_display='Sales representatives';}
	if ($table_name==$_SESSION['db_prefix'].'_list_quotation_subjects') { $page_display='Quotation subjects';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_company') { $page_display='Internal Companies';}
	if ($table_name==$_SESSION['db_prefix'].'_list_account') { $page_display='Type of account';}
	if ($table_name==$_SESSION['db_prefix'].'_list_quote_validity') { $page_display='Validity period of quotes';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_admin') { $page_display='Admin personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_discipline') { $page_display='Discipline personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_authorise') { $page_display='Authorising personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_foreman') { $page_display='Foreman personnel';}
	
	
	
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_make') { $page_display='Make';}
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_model') { $page_display='Model';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service_interval') { $page_display='Service interval';}
	if ($table_name==$_SESSION['db_prefix'].'_list_fuel_provider') { $page_display='Fuel provider';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service') { $page_display='Service';}
	if ($table_name==$_SESSION['db_prefix'].'_list_garages') { $page_display='Service workshops';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin') { $page_display='Transport admin';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin_provider') { $page_display='Transport admin provider';}
	
	
	if ($table_name==$_SESSION['db_prefix'].'_list_clusters') { $page_display='Maintenance clusters';}
	if ($table_name==$_SESSION['db_prefix'].'_list_stores_location') { $page_display='Different stores locations';}
	
	
    $page_query = "SELECT item_name FROM $table_name  ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$page_result = execsql($page_query);
	if ($page_result!="") {
	$page_num = mysql_num_rows($page_result);
	$b = 0;
	while ($b < $page_num) {
		$arrId2[$b] = mysql_result($page_result, $b, "item_name");
		$arrName2[$b] = mysql_result($page_result, $b, "item_name");
		$b++;
	}
	}
}

if ($set==1) {
	
	if ($list==0) {
	$item = $_GET['item_text'];
	$item = trim($item," ");
	$item_query  = "INSERT INTO $table_name (item_name) VALUES ('".$item."')";
    execsql($item_query);
	}
	
	if ($list==1){
	$emp_id = $_GET['employee_select'];
	$table_name2 = $_SESSION['db_prefix']."_employee";
	$employee_query = "SELECT emp_first_name, emp_last_name FROM $table_name2 WHERE emp_id ='".$emp_id."' ";
	$employee_result = mySQL_query($employee_query);
	$employee_num = mysql_num_rows($employee_result);	
	$item = mysql_result($employee_result, 0, "emp_first_name").' '.mysql_result($employee_result, 0, "emp_last_name"); 
	$item_query  = "INSERT INTO $table_name (item_name, emp_id) VALUES ('".$item."', '".$emp_id."')";
    execsql($item_query);
	}
    
	if ($table_name==$_SESSION['db_prefix'].'_list_area') { $page_display='Area';}
	if ($table_name==$_SESSION['db_prefix'].'_list_places') { $page_display='Places';}
	if ($table_name==$_SESSION['db_prefix'].'_list_country') { $page_display='Countries';}
	if ($table_name==$_SESSION['db_prefix'].'_list_nationality') { $page_display='Nationality';}
	if ($table_name==$_SESSION['db_prefix'].'_list_department') { $page_display='Company departments';}
	if ($table_name==$_SESSION['db_prefix'].'_list_salary_scale') { $page_display='Salary scales';}
	if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteeism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_branch') { $page_display='Bank branches';}
	if ($table_name==$_SESSION['db_prefix'].'_list_banks') { $page_display='Banks';}
	if ($table_name==$_SESSION['db_prefix'].'_list_early') { $page_display='Reasons for early dismiss';}
	if ($table_name==$_SESSION['db_prefix'].'_list_late') { $page_display='Reasons for late coming';}
	if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_not_clocked') { $page_display='Reasons for not clocking';}
	if ($table_name==$_SESSION['db_prefix'].'_list_overtime') { $page_display='Reasons for overtime';}
	if ($table_name==$_SESSION['db_prefix'].'_list_positions') { $page_display='Employee positions';}
	if ($table_name==$_SESSION['db_prefix'].'_list_warnings') { $page_display='Disciplinairy warnings';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sellers') { $page_display='Sales representatives';}
	if ($table_name==$_SESSION['db_prefix'].'_list_quotation_subjects') { $page_display='Quotation subjects';}
	if ($table_name==$_SESSION['db_prefix'].'_list_petty_cash') { $page_display='Petty cash';}
	if ($table_name==$_SESSION['db_prefix'].'_list_loans') { $page_display='Loans';}
	if ($table_name==$_SESSION['db_prefix'].'_list_leave_reason') { $page_display='Leave reason';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sick_reason') { $page_display='Sick reason';}
	if ($table_name==$_SESSION['db_prefix'].'_list_company') { $page_display='Internal Companies';}
	if ($table_name==$_SESSION['db_prefix'].'_list_account') { $page_display='Type of account';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_qaote_validity') { $page_display='Validity period of quotes';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_admin') { $page_display='Admin personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_discipline') { $page_display='discipline personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_authorise') { $page_display='Authorising personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_foreman') { $page_display='Foreman personnel';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_make') { $page_display='Make';}
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_model') { $page_display='Model';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service_interval') { $page_display='Service interval';}
	if ($table_name==$_SESSION['db_prefix'].'_list_fuel_provider') { $page_display='Fuel provider';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service') { $page_display='Service';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_garages') { $page_display='Service workshops';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin') { $page_display='Transport admin';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin_provider') { $page_display='Transport admin provider';}
		
	if ($table_name==$_SESSION['db_prefix'].'_list_stores_location') { $page_display='Different stores locations';}
	
    $page_query = "SELECT item_name FROM $table_name  ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$page_result = execsql($page_query);
	if ($page_result!="") {
	$page_num = mysql_num_rows($page_result);
	$b = 0;
	while ($b < $page_num) {
		$arrId2[$b] = mysql_result($page_result, $b, "item_name");
		$arrName2[$b] = mysql_result($page_result, $b, "item_name");
		$b++;
	}
	}
}	
	

if ($set==2) {
	
	$list_item = $_GET['list_select'];
	
	$del_query = "DELETE FROM $table_name WHERE  item_name ='".$list_item."'";
	$del_result = execsql($del_query);
    $message= "<font color=red><b>Permission was removed.</b></font>";
	
	
	
	if ($table_name==$_SESSION['db_prefix'].'_list_area') { $page_display='Area';}
	if ($table_name==$_SESSION['db_prefix'].'_list_places') { $page_display='Places';}
	if ($table_name==$_SESSION['db_prefix'].'_list_country') { $page_display='Countries';}
	if ($table_name==$_SESSION['db_prefix'].'_list_nationality') { $page_display='Nationality';}
	if ($table_name==$_SESSION['db_prefix'].'_list_department') { $page_display='Company departments';}
	if ($table_name==$_SESSION['db_prefix'].'_list_salary_scale') { $page_display='Salary scales';}
	if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteeism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_branch') { $page_display='Bank branches';}
	if ($table_name==$_SESSION['db_prefix'].'_list_banks') { $page_display='Banks';}
	if ($table_name==$_SESSION['db_prefix'].'_list_early') { $page_display='Reasons for early dismiss';}
	if ($table_name==$_SESSION['db_prefix'].'_list_late') { $page_display='Reasons for late coming';}
	if ($table_name==$_SESSION['db_prefix'].'_list_absent') { $page_display='Reasons for absenteism';}
	if ($table_name==$_SESSION['db_prefix'].'_list_not_clocked') { $page_display='Reasons for not clocking';}
	if ($table_name==$_SESSION['db_prefix'].'_list_overtime') { $page_display='Reasons for overtime';}
	if ($table_name==$_SESSION['db_prefix'].'_list_positions') { $page_display='Employee positions';}
	if ($table_name==$_SESSION['db_prefix'].'_list_warnings') { $page_display='Disciplinairy warnings';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sellers') { $page_display='Sales representatives';}
	if ($table_name==$_SESSION['db_prefix'].'_list_quotation_subjects') { $page_display='Quotation subjects';}
	if ($table_name==$_SESSION['db_prefix'].'_list_roofcover') { $page_display='Type of roof covers used';}
	if ($table_name==$_SESSION['db_prefix'].'_list_company') { $page_display='Internal Companies';}
	if ($table_name==$_SESSION['db_prefix'].'_list_account') { $page_display='Type of account';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_loans') { $page_display='Loans';}
	if ($table_name==$_SESSION['db_prefix'].'_list_leave_reason') { $page_display='Leave reason';}
	if ($table_name==$_SESSION['db_prefix'].'_list_sick_reason') { $page_display='Sick reason';}
	if ($table_name==$_SESSION['db_prefix'].'_list_admin') { $page_display='Admistrative employees';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_admin') { $page_display='Admin personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_discipline') { $page_display='discipline personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_authorise') { $page_display='Authorising personnel';}
	if ($table_name==$_SESSION['db_prefix'].'_list_names_foreman') { $page_display='Foreman personnel';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_make') { $page_display='Make';}
	if ($table_name==$_SESSION['db_prefix'].'_list_vehicle_model') { $page_display='Model';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service_interval') { $page_display='Service interval';}
	if ($table_name==$_SESSION['db_prefix'].'_list_fuel_provider') { $page_display='Fuel provider';}
	if ($table_name==$_SESSION['db_prefix'].'_list_service') { $page_display='Service';}
	
	if ($table_name==$_SESSION['db_prefix'].'_list_garages') { $page_display='Service workshops';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin') { $page_display='Transport admin';}
	if ($table_name==$_SESSION['db_prefix'].'_list_transport_admin_provider') { $page_display='Transport admin provider';}
	
	
	if ($table_name==$_SESSION['db_prefix'].'_list_clusters') { $page_display='Maintenance clusters';}
	if ($table_name==$_SESSION['db_prefix'].'_list_stores_location') { $page_display='Different stores locations';}
	
    $page_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$page_result = execsql($page_query);
	if ($page_result!="") {
	$page_num = mysql_num_rows($page_result);
	$b = 0;
	while ($b < $page_num) {
		$arrId2[$b] = mysql_result($page_result, $b, "item_name");
		$arrName2[$b] = mysql_result($page_result, $b, "item_name");
		$b++;
	}
	}
}
	
if ($set==5) {
$user_id = $_SESSION['username'];

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 

}
?>
</head>



<body  onload="<?php if ($set==5) { ?> document.getElementById('section_table').style.display = 'none'; <?php } else { ?> document.getElementById('section_table').style.display = 'block'; <?php } ?>" >
<?php 

include ('../include/tooltip.php'); 
include ("../navigation/header.php");
$page_name = "AD-pre defined";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>
<div class="main_frame">
<div class="page_head_frame">
        <table width="809" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="385"><label class="label_page_head">Pre-defined lists</label></td>
            <td align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
<div class="page_middle_frame">        
<div class="page_inside_frame"><form name="form1" id="form1" action="list_definitions.php" method="get"> <label class="label_std">Select a pre-defined list to manage: &nbsp;&nbsp;</label>
    <select name="page_select" class="selectbox300" id="page_select" onchange="window.location.href= this.form.page_select.options[this.form.page_select.selectedIndex].value">
    <option selected="selected" disabled="disabled"></option>

      <option disabled="disabled" style="font-weight:700; color:#209949">General</option>
      <option value="list_definitions.php?page_select=area&set=0&list=0">Area</option>
      <option value="list_definitions.php?page_select=department&set=0&list=0">Company departments</option>
      <option value="list_definitions.php?page_select=country&set=0&list=0">Country</option>
      <option value="list_definitions.php?page_select=nationality&set=0&list=0">Nationality</option>
      <option value="list_definitions.php?page_select=places&set=0&list=0">Places</option>
      
      
      
      
      
      <option disabled="list_definitions.php?page_select=disabled" style="font-weight:700; color:#209949">Admin</option>
      <option value="list_definitions.php?page_select=names_admin&set=0&list=0">Admin personnel</option>
      <option value="list_definitions.php?page_select=names_authorise&set=0&list=0">Authorising personnel</option>
      <option value="list_definitions.php?page_select=names_discipline&set=0&list=0">Discipline personnel</option>
      <option value="list_definitions.php?page_select=names_foreman&set=0&list=1">Foreman personnel</option>
      
      
      <option disabled="list_definitions.php?page_select=disabled&set=0&list=0" style="font-weight:700; color:#209949">HR</option>
      <option value="list_definitions.php?page_select=banks&set=0&list=0">Banks</option>
      <option value="list_definitions.php?page_select=branch&set=0&list=0">Branch</option>
      <option value="list_definitions.php?page_select=position&set=0&list=0">Employee position</option>
      <option value="list_definitions.php?page_select=loans&set=0&list=0">Loans</option>
      <option value="list_definitions.php?page_select=petty_cash&set=0&list=0">Petty cash</option>
      <option value="list_definitions.php?page_select=absent&set=0&list=0">Reasons absent</option>
      <option value="list_definitions.php?page_select=early&set=0&list=0">Reasons early leaving</option>
      <option value="list_definitions.php?page_select=late&set=0&list=0">Reasons late</option>
      <option value="list_definitions.php?page_select=not_clocked&set=0&list=0">Reasons not clocking</option>
      <!--<option value="list_definitions.php?page_select=leave_reason&set=0&list=0">Reason leave</option>-->
      <option value="list_definitions.php?page_select=overtime&set=0&list=0">Reasons overtime</option>
      <!--<option value="list_definitions.php?page_select=sick_reason&set=0&list=0">Reason sick leave</option>-->
      <option value="list_definitions.php?page_select=scale&set=0&list=0">Salary scales</option>
      <option value="list_definitions.php?page_select=warnings&set=0&list=0">Type of offences</option>
      
      
      
      
      <option disabled="disabled" style="font-weight:700; color:#209949">Production</option>
      
      
      <option disabled="disabled" style="font-weight:700; color:#209949">Sales</option>
      <option value="list_definitions.php?page_select=sellers&set=0&list=0">Sales representatives</option>
      <option value="list_definitions.php?page_select=quotation_subjects&set=0&list=0">Quotation subjects</option>
      <!--<option value="list_definitions.php?page_select=account&set=0&list=0">Type customer account</option>-->
      <!--<option value="list_definitions.php?page_select=quote-validity&set=0&list=0">Quote validity period</option>-->
      
      <option disabled="disabled" style="font-weight:700; color:#209949">Maintenance</option>
      <option value="list_definitions.php?page_select=maintenance_clusters&set=0&list=0">Maintenance clusters</option>
            
      <option disabled="disabled" style="font-weight:700; color:#209949">Stores</option>
      <option value="list_definitions.php?page_select=stores_location&set=0&list=0">Stores location</option>
      
      
      
      <option disabled="disabled" style="font-weight:700; color:#209949">Transport</option>
      <option value="list_definitions.php?page_select=fuel_provider&set=0&list=0">Fuel provider</option>
      <option value="list_definitions.php?page_select=transport_admin&set=0&list=0">Transport admin</option>
      <option value="list_definitions.php?page_select=transport_admin_provider&set=0&list=0">Transport admin provider</option>
      <option value="list_definitions.php?page_select=service&set=0&list=0">Service</option>
      <option value="list_definitions.php?page_select=service_interval&set=0&list=0">Service interval</option>
      <option value="list_definitions.php?page_select=service_workshops&set=0&list=0">Service workshops</option>
      <option value="list_definitions.php?page_select=vehicle_make&set=0&list=0">Vehicle make</option>
      <option value="list_definitions.php?page_select=vehicle_model&set=0&list=0">Vehicle model</option>
      

    </select>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="set" type="hidden" id="set" value="0" />
           <?php
$infoTT = "";

?>
           <a href="" onMouseover="ddrivetip('<?php echo $infoTT ?>  ', 300)"; onMouseout="hideddrivetip()"></a>
</form>
</div>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("page_select","req","Please select a page.");
</script>
<br />
<br />
<br />
<div class="hidden_frame" id="hidden_frame">
<div class="page_inside_frame">
<?php
if ($set==0) {
$table_name = $_SESSION['db_prefix']."_tracking_admin";
    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '9', '".$_SESSION['username']."' ,'".$page_display."','','' )";
   $trackingResult = mySQL_query($trackingQuery);
}
?>
<table width="650" border="0" cellspacing="0" cellpadding="0" id="section_table">
  <tr>
    <td height="83" colspan="3"><div class="caption_frame" style="width:600px;">
      <label class="label_std" style="font-size:16px;">Pre-defined list for:&nbsp;&nbsp;&nbsp;<?php echo $page_display ?></label></div></td>
    </tr>
  <tr>
    <td>
    <div class="standard_frame">
          <form action="list_definitions.php" name="remove_form" method="get">
            <select name="list_select" size="15" class="selectbox300"  >
              <?php
        	for ($j = 0; $j < count($arrId2); $j++) {
    		echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
	}
?>
              </select>
            <br />
            
            
            
            <label class="label_std">To remove an item, select the item<br />
              in the above list and click 'Remove'.</label><br />
              <br />
              <input name="button3" type="submit" class="imagebutton" id="button3" value="Remove" />
              <input name="page_select" type="hidden" id="page_select" value="<?php echo $page?>" />
              <input name="set" type="hidden" id="set" value="2" />
              <input name="list" type="hidden" id="list" value="<?php echo $list ?>" />
              <br />
              </form>
          <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("remove_form");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("list_select","req","- select item to remove.");
</script>
          
          </div>
          </td>
    <td>&nbsp;</td>
    <td valign="top">
    <?php if ($list==0) { ?>
    <div class="standard_frame" id='general_div'><label class="label_std">Type the name of the item and<br />
      click &quot;add&quot; to add it to the list.</label><br />
            <br />
           <form action="list_definitions.php" name="set_form" method="get">
              &nbsp;&nbsp;
              <input name="item_text" type="text" class="text300" id="item_text"  onBlur="capitalize(this)"  <?php if($input_type=="number") {?> onkeypress="return numbersonly(this, event)" <?php } ?>   onkeyup="<?php if($input_type=='capitals'){echo 'ToUpper(this)'; } else { echo 'ToLower(this)';} ?>" autofocus />
              &nbsp;&nbsp;&nbsp;&nbsp;<br />
              &nbsp;&nbsp;
              <br />
              &nbsp;&nbsp;&nbsp;<br />
              &nbsp;
              <input name="button2" type="submit" class="imagebutton" id="button2" value="Add" />
              <input name="page_select" type="hidden" id="page_select" value="<?php echo $page ?>" />
              <input name="list" type="hidden" id="list" value="0" />
              <input name="set" type="hidden" id="set" value="1" />
              </form>
            <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("set_form");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("item_text","req","- item to add to list.");
</script></div>
<?php } ?>
<?php if ($list==1) { ?>
    <div class="standard_frame" id='general_div'>
      <label class="label_std">Select the name of the foreman from the list and<br />
      click &quot;add&quot; to add it to the list.</label><br />
            <br />
           <form action="list_definitions.php" name="set_form" method="get">
              &nbsp;&nbsp;
              <select name="employee_select" id="employee_select" class="select200" >
                    <option value="" ></option>
                    <?php
    	for ($i = 0; $i < count($arrId); $i++) {
		echo "<option value=" . "\"" . $arrId[$i] . "\"" . ">" . $arrName[$i] . "</option>";
		}
     ?>
                  </select>
              &nbsp;&nbsp;&nbsp;&nbsp;<br />
              &nbsp;&nbsp;
              <br />
              &nbsp;&nbsp;&nbsp;<br />
              &nbsp;
              <input name="button2" type="submit" class="imagebutton" id="button2" value="Add" />
              <input name="page_select" type="hidden" id="page_select" value="<?php echo $page ?>" />
              <input name="set" type="hidden" id="set" value="1" />
              <input name="list" type="hidden" id="list" value="1" />
              </form>
            <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("set_form");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("item_text","req","- item to add to list.");
</script></div>
<?php } ?>
</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</div>
        
          </td>
    </tr>
    </table>
 
</div>
</div>
</div>




<?php include ('../navigation/side_bar.php'); ?>


<?php } else { 
$_SESSION['denied_return'] = "admin_module/user_list.php";	
include ("../navigation/admin_sidebar.php");?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>
</body>
</html>