<?php
session_start();
if (!isset($_SESSION['reusername'])) { echo 'Sorry You Dont Have permissions to View this Page!'; exit();}
include 'includes/database.php';
include 'includes/display.php';
include 'includes/funcs.php';
echo  $htmlheaders;
echo $jquery;
echo $recss;	
echo '<link rel="stylesheet" href="css/m.css" type="text/css" /> ';
?>

<script type="text/javascript">

 var perm = <?php echo $_SESSION['reusergroup']; ?>;

</script>

<style>
.ui-autocomplete {
            max-height: 300px;
            overflow-y: auto;
            /* prevent horizontal scrollbar */
            overflow-x: hidden;
            /* add padding to account for vertical scrollbar */
            padding-right: 10px;
        } 
		
</style>

<?php 
echo '<head><title>QoolPoint Information System &nbsp;|&nbsp; QPL QIS</title>';
echo '</head><body>';
echo '<div id="form">';
//later set variable to session
$admin = $_SESSION['reusername']; 

echo '<table id="dskfullbox" style="font-family:"Trebuchet MS"; font-size:12px; font-weight:bold; text-align:left;">
<tr> <td valign="top" style="width:700px;">'.str_repeat("&nbsp;", 5).$logopath.'<span id="licbox">QOOLPOINT INFORMATION SYSTEM</span></td>';
//echo '<td>'. str_repeat("&nbsp;", 5).'</td> ';
echo '<td align="right" valign="bottom"><h2><div id="loggedin">'.$loggedin.'|'.$admin.'|'.$clock.'   '.$time.'   '.$userlogd.'</h2></td>'; 
echo '</tr>';
echo '<tr><td colspan="2" valign="top">';
echo '<center>
<div class="line_1">
<div class="drop_container">
  <div class="always_visible" onclick="searchbxf();">Search Docs</div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="cusf();">Customers</div>
</div>
 <div class="drop_container">
  <div class="always_visible">Tracking</div>
  <div class="hidden_container">
  <a href="#" id="ea1" onclick="trajcf();" class="link">Tracker Job Card</a>
  <a href="#" id="ea2"  onclick="trainvf();" class="link">Tracker Invoice</a>
  <a href="#" onclick="trackf();" class="link">Trackers</a>
  </div>
</div>

<div class="drop_container">
  <div class="always_visible">Insurance</div>
  <div class="hidden_container">
  <a href="#" id="m1"  onclick="insaff();" class="link">Insurance Sale</a>
  <a href="#" id="m2"  onclick="insdetf();" class="link">Provider Info</a>
  </div>
</div>

<div class="drop_container">
  <div class="always_visible">Reposession</div>
  <div class="hidden_container">
  <a href="#" onclick="repoof();" class="link">Reposession Orders</a>
  <a href="#" onclick="repoexpf();" class="link">Reposession Expenses</a>
  </div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="othersf();">Others</div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="recpmf();">Receipts</div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="paymf();">Payments</div>
</div>
<div class="drop_container">
  <div class="always_visible"  onclick="accsmf();">Accounts</div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="samf();">Masters</div>
</div>
<div class="drop_container">
  <div class="always_visible" onclick="logoff();">Logout</div>
</div>
<div style="clear:both;"></div>
</div>
</center>';		
echo '</td></tr>';

echo '<tr> <td colspan="2" valign="top" align="center" style="width:800px;height:500px;margin:5px;">';

	echo '<div id=scrblok>';
	echo '<table cellspacing="5px" id="searchbox">';
    echo '<tr>Search Records</tr>'.
		'<tr><td align="left"> <img style="vertical-align:middle" class="iconbtn" onclick="searchres();" src="images/searchic.png">&nbsp;&nbsp;</img> <label for="schtid"> Search Vehicle &nbsp;&nbsp;</label> <input type="text" id="schtid" name="schtid" value="" size="70"/></td></tr>';
	echo '<tr><td><span style="float:middle;background-color:beige;padding: 0 10px 0 10px;" onclick="searchclr();">Clear</span></td></tr>';
	echo '</table> </div>';
	
    echo '<div id=propblok>';
    echo '</div>';	
	
echo '';
echo '</td></tr></table>';
echo '</div>';

echo '</body></html>';

?>
<script type="text/javascript">
$('#schtid').autocomplete({ source: "allsearchrecs.php?str="+$('#schtid').val(), minLength: 3  });

                                                                        /* Customer Form		*/
function cusf(){  	
	 var selbox = 'Customer Operations <br/><br/><input type="radio"  id="cusel" name="added" value="add" onclick ="cusaddf();"/><b>Add</b>&nbsp;&nbsp;&nbsp;'+
              '<input type="radio"  id="addsel" name="added" value="edit" onclick="cusmodself();"/><b>Edit</b>&nbsp;&nbsp;&nbsp;';
	$('#scrblok').html(selbox); 
	$('#propblok').html('');
};

function cusaddf(){ 
	$('#propblok').html('');
	window.open("cusops.php?e=0","Customer Operations","width=500px,height=400px;scrollbar=1");
};

function cusmodself(){ var modsel = '<img style="vertical-align:middle;margin:3px;" class="iconbtn" src="images/custsel.png">&nbsp;&nbsp;</img> <label for="mcid"> Customer &nbsp;&nbsp;</label> <input type="text" id="mcid" name="mcid" value="" onchange="cusmodf();" size="40"/>';
	$('#propblok').html(modsel);
	$('#mcid').autocomplete({ source: "allcustomers.php", minLength: 2  });
};

function cusmodf(){ 
if((parseInt(perm) <= 2) || (parseInt(perm) === 4)){ 
	window.open("cusops.php?e=1"+"&cname="+$('#mcid').val(),"Customer Operations","width=500px,height=400px;scrollbar=1");
}	
};

Reposession orders menu
function repoof(){ 
if((parseInt(perm) === 1) || (parseInt(perm) === 4)){  
	var selbox = 'Reposession Operations <br/><br/><input type="radio"  id="repoadd" name="repord" value="add" onclick ="repoaddf();"/><b>Reposession Order</b>&nbsp;&nbsp;&nbsp;'+
              '<input type="radio"  id="inssel" name="repord" value="edit" onclick="repomodself();"/><b>Edit Order</b>&nbsp;&nbsp;&nbsp;'+
			  '<input type="radio"  id="insac"  name="repord" value="acc" onclick="repoaccf();"/><b>Reposession Customer Accounts</b>&nbsp;&nbsp;&nbsp;<br>'+
			  '<input type="radio"  id="agesel" name="repord" value="age" onclick="repoacagef();"/><b>Aged Summary</b>&nbsp;&nbsp;&nbsp';
	$('#scrblok').html(selbox); 
	$('#propblok').html('');
}	
};
															// reposession order add
function repoaddf(){ 
	$('#propblok').html('');
	window.open("repoops.php?e=0","Reposession Operations","width=600px,height=550px;scrollbar=1");
};
																// Select Repo Order to Modify
function repomodself(){ var modsel = '<img style="vertical-align:middle;margin:3px;" class="iconbtn" src="images/repomodsel.png" onclick="repomodf();">&nbsp;&nbsp;</img> <label for="repon"> Order No. &nbsp;&nbsp;</label> <input type="text" id="repon" name="repon" size="40"/> &nbsp;&nbsp; <input type="button" id="delrepo" name="delrepo" value=" Delete " onclick="delrepof();"/>';
	$('#propblok').html(modsel);
	$('#repon').autocomplete({ source: "allreponos.php", minLength: 2  });
};
																// modify repo order
function repomodf(){ 
	var repono = $('#repon').val();
	var myno = repono.slice(0, (repono.indexOf("-"))-1); 
	window.open("repoops.php?e=1"+"&repono="+myno,"Repo Edit Operations","width=600px,height=530px;scrollbar=1");
};

																// del repo order
function delrepof(){ 
if($('#repon').val() !==''){
	var repono = $('#repon').val();
	var myno = repono.slice(0, (repono.indexOf("-"))-1); 
	var confdel = confirm("Delete All Transactions for this Reposession Order ?");
	if(confdel){ var deldone = $.get("delrepo.php?d="+myno, function(data){
					alert(data);
			   });}
}	
};

																// Reposession Customer Account selection
function repoaccf(){ 
var cuss = $.get("selcus.php",function(cusdata){
	var modsel = '<img style="vertical-align:middle;margin:3px;" class="iconbtn" src="images/repoacc.png" onclick="repoaccdet();">&nbsp;&nbsp;</img> <label for="repoacsd"> Start Date &nbsp;</label> <input type="text" id="repoacsd" name="repoacsd" value="<?php echo date('d-m-Y');?>" size="10"/> &nbsp;<label for="repoaced"> End Date &nbsp;</label> <input type="text" id="repoaced" name="repoaced" value="<?php echo date('d-m-Y');?>" size="10"/>'+
								   '<br/><label for="repocust"> Customer &nbsp;&nbsp;</label>&nbsp;&nbsp; <select id="repocust" name="repocust"><option value=""></option> '+ cusdata +' </select><br/><br/>';						   
	$('#propblok').html(modsel);	
	$('#repoacsd').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"}); 
	$('#repoaced').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"}); 
	});	
};
															// Reposession customer report
function repoaccdet(){  
	window.open("repoacc.php?s="+$('#repoacsd').val()+"&e="+$('#repoaced').val()+"&c="+$('#repocust').val(),"Reposession Customer Account","width=800px,height=800px;scrollbar=1");
};

function repoacagef(){ var modsel = '<img style="vertical-align:middle;margin:3px;" class="iconbtn" src="images/repoage.png" onclick="repoaged();">&nbsp;&nbsp;</img> <label for="repoaged"> Inquiry Date &nbsp;&nbsp;</label> <input type="text" id="repoaged" name="repoaged" value="<?php echo date('d-m-Y');?>" size="10"/>';
	$('#propblok').html(modsel);
	$('#repoaged').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"});
};

function repoaged(){ 
	window.open("repoaged.php?a="+$('#repoaged').val(),"Reposession Aged Summary","width=900px,height=800px;scrollbar=1");
	
};
																	// Reposession expense menu
function repoexpf(){  
if((parseInt(perm) === 1) || (parseInt(perm) === 4)){  	
	var cuss = $.get("selcus.php", function(cusdata){
	 var selbox = 'Reposession Reports <br/><br/><img style="vertical-align:middle" class="iconbtn" src="images/repoexlist.png" onclick="repoexlist();">&nbsp;&nbsp;</img><label for="repoexlist">Expenses List &nbsp;&nbsp;</label><label for="repoexsdate"> Start Date</label>&nbsp;&nbsp;<input type="text" id="repoexsdate" name="repoexsdate" value="<?php echo date('d-m-Y'); ?>" size="10">&nbsp;&nbsp;'+
	 '<label for="repoexedate"> End Date</label>&nbsp;&nbsp;<input type="text" id="repoexedate" name="repoexedate" value="<?php echo date('d-m-Y'); ?>" size="10"/><br/>'+
	 '<br/><label for="repoexcust"> Customer &nbsp;&nbsp;</label>&nbsp;&nbsp; <select id="repoexcust" name="repoexcust"><option value=""></option>'+ cusdata +' </select><br/><br/>'+
	 '<img style="vertical-align:middle" class="iconbtn" src="images/repordlist.png" onclick="repordlist();">&nbsp;&nbsp;</img><label for="repordlist">Orders List &nbsp;&nbsp;</label><label for="repordsdate"> Start Date</label>&nbsp;&nbsp;<input type="text" id="repordsdate" name="repordsdate" value="<?php echo date('d-m-Y'); ?>" size="10">&nbsp;&nbsp;'+
	 '<label for="repordedate"> End Date</label>&nbsp;&nbsp;<input type="text" id="repordedate" name="repordedate" value="<?php echo date('d-m-Y'); ?>" size="10"><br/>'+
	 '<label for="auctsel"> Auctioneer</label>&nbsp;&nbsp;<input type="text" id="auctsel" name="auctsel" value="" size="20"/>&nbsp;&nbsp; <label for="filt"> Filter </label>&nbsp;&nbsp;<select id="filt" name="filt"><option value="ALL">ALL</option> <option value="PENDING">PENDING</option> </select><br/><br/>';
	$('#scrblok').html(selbox); 
	$('#propblok').html('');
	$('#repordsdate').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"}); 
	$('#repordedate').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"});
	$('#repoexsdate').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"});
	$('#repoexedate').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd-mm-yy"});
	$('#auctsel').autocomplete({ source: <?php echo allauctioneers(); ?>, minLength: 2  });
	});
 }	
};

function repoexlist(){ 
	$('#propblok').html('');
	window.open("repoexlist.php?s="+$('#repoexsdate').val()+"&e="+$('#repoexedate').val()+"&c="+$('#repoexcust').val(),"Repoex List","width=800px,height=700px;scrollbar=1");
};

function repordlist(){ 
	$('#propblok').html('');
	window.open("repordlist.php?s="+$('#repordsdate').val()+"&e="+$('#repordedate').val()+"&a="+$('#auctsel').val()+"&f="+$('#filt').val(),"Repo Orders List","width=800px,height=700px;scrollbar=1");
};

                                                                    // Accountant Menu
function accsmf(){ 
if(parseInt(perm) < 3){      
 var selbox = '<form id="accform" method="post" enctype="multipart/form-data" action="#" ><center>'+
    '<table cellspacing="5px" id="accbox">'+
    '<tr>Accounts Operations</tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/cnote.png" onclick="cuscr();">&nbsp;&nbsp;</img><label for="expv">Credit Note &nbsp;&nbsp;</label></td></tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/expv.png" onclick="setexpvouch();">&nbsp;&nbsp;</img><label for="expv">Expense Voucher &nbsp;&nbsp;</label>&nbsp;<label for="dexpvch">Exp. Vch. No. &nbsp;&nbsp;</label>&nbsp;&nbsp;<select id="dexpvch" name="dexpvch" style="width:220px; height:20px;"><?php echo selexpvouchs();?></select> </td></tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/expvr.png" onclick="revexpvouch();">&nbsp;&nbsp;</img><label for="expvr">Expense Voucher Reversal&nbsp;&nbsp;</label>&nbsp;<select id="exprev" name="exprev"> <?php selexpvouchs(); ?> </select></td></tr>'+
    '<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/explist.png" onclick="setexpvchlist();">&nbsp;&nbsp;</img><label for="explist">Expenses List &nbsp;&nbsp;</label><label for="sedate"> Start Date</label>&nbsp;&nbsp;<input type="text" id="sedate" name="sedate" value="<?php echo date('d-m-Y'); ?>" size="10">&nbsp;&nbsp; <label for="edate"> End Date</label>&nbsp;&nbsp;<input type="text" id="eedate" name="ebdldate" value="<?php echo date('d-m-Y'); ?>" size="10"></td></tr>'+
    '<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/bankjv.png" onclick="setbankjv();">&nbsp;&nbsp;</img><label for="bankjv">Bank Journal Voucher &nbsp;&nbsp;</label>&nbsp;&nbsp;<label for="baccv">JV No. &nbsp;&nbsp;</label>&nbsp;&nbsp;<select id="baccv" name="baccv" style="width:220px; height:20px;"><?php echo selbankjvs();?></select></td></tr>'+
	'<tr><td align="middle"> <label for="bank">Bank &nbsp;&nbsp;</label>&nbsp;&nbsp;<select id="bacc" name="bacc" style="width:220px; height:20px;"><?php echo selallbanks();?></select></td></tr>'+
    '<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/bankledge.png" onclick="setbankledge();">&nbsp;&nbsp;</img><label for="explist">Bank Ledger &nbsp;&nbsp;</label><label for="sbdldate"> Start Date</label>&nbsp;&nbsp;<input type="text" class="dpicker" id="sbdldate" name="sbdldate" value="<?php echo date('d-m-Y'); ?>" size="10">&nbsp;&nbsp; <label for="ebdldate"> End Date</label>&nbsp;&nbsp;<input type="text" class="dpicker" id="ebdldate" name="ebdldate" value="<?php echo date('d-m-Y'); ?>" size="10"></td></tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/cashlist.png" onclick="setcashlist();">&nbsp;&nbsp;</img><label for="cashlist">Cash Flow &nbsp;&nbsp;</label><label for="cfsdate"> Start Date</label>&nbsp;&nbsp;<input type="text" class="dpicker" id="cfsdate" name="cfsdate" value="<?php echo date('d-m-Y'); ?>" size="10">&nbsp;&nbsp; <label for="cfedate"> End Date</label>&nbsp;&nbsp;<input type="text" class="dpicker" id="cfedate" name="cfedate" value="<?php echo date('d-m-Y'); ?>" size="10"></td></tr>'+
	'</table></center></form>';
 $('#scrblok').html(selbox);  
 $('#propblok').html('<p></p>');
 $('#sbdldate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' });
 $('#ebdldate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' }); 
 $('#cfsdate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' });
 $('#cfedate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' }); 
 $('#sedate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' });
 $('#eedate').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy' });
 }
};
																// Credit Note
function cuscr(){ 
	$('#propblok').html('');
	window.open("credops.php","Insurance Credit","width=600px,height=550px;scrollbar=1");
};
                                                                   //  Expense Voucher
function setexpvouch(){   
if((parseInt(perm) === 1) || (parseInt(perm) === 2)){      
if($("#dexpvch").val() !== ''){  window.open('expvchadd.php?e=1&dexpno='+$("#dexpvch").val(),"Expense Voucher","width=620px,height=500px"); }
else { window.open('expvchadd.php?e=0',"Expense Voucher","width=620px,height=500px"); };           
} 
}; 

																	//  Expense Voucher Reversal
function revexpvouch(){  
 if((parseInt(perm) === 1) || (parseInt(perm) === 2)){     
    $( "#propblok" ).after('<div id="confexprevdiag" title="Expense Voucher Reversal Confirmation"></div>');  
	$( "#confexprevdiag" ).dialog({
            autoOpen: true,
			modal: true,
			width: 550,
			buttons: [{text:"OK", click: function(){ $.get('expvchrev.php?r='+$("#exprev").val(),function(data){  $( "#confexprevdiag" ).dialog( "close" );}); }},
                      {text:"Close", click: function(){ window.location.replace("desktop.php");}}]
                        });             
 }
 }; 
 
function setexpvchlist(){   
 if($("#sedate").val() !=='' && $("#eedate").val() !==''){
           window.open('explist.php?sdate='+$("#sedate").val()+'&edate='+$("#eedate").val(),"Expenses List","width=950px,height=800px,scrollbar=1");            
 }
 }; 
                                                                   //  Make Bank JV
function setbankjv(){ 
if((parseInt(perm) === 1) ){ 
	
	if($("#baccv").val() !== ''){ window.open('bankjvadd.php?e=1&jvno='+$('#baccv').val(),"Modify Bank JV","width=620px,height=500px"); 
									}
	else {  window.open('bankjvadd.php?e=0',"New Bank JV","width=620px,height=500px");   }
}           
 }; 
                                                                   //  bank Ledger
 function setbankledge(){ 
 if((parseInt(perm) === 1)){     
	if($("#sbldate").val() !=='' && $("#ebldate").val() !==''){
           window.open('bankledger.php?bacc='+$("#bacc").val()+'&sbldate='+$("#sbdldate").val()+'&ebldate='+$("#ebdldate").val(),"Bank Ledger","width=900px,height=700px,scrollbar=1");            
	}
 }
 }; 
																			// Cash Flow Report
function setcashlist(){ 
if((parseInt(perm) === 1)){     
 if($("#cfsdate").val() !=='' && $("#cfedate").val() !==''){
           window.open('cashlist.php?sdate='+$("#cfsdate").val()+'&edate='+$("#cfedate").val(),"Cash Flow","width=950px,height=800px,scrollbar=1");            
 }
 }
 }; 

                                                                    // System Admin Menu
function samf(){ 
 if((parseInt(perm) === 1)){     
 var selbox = '<form id="saform" method="post" enctype="multipart/form-data" action="#" ><center>'+
    '<table cellspacing="5px" id="sabox">'+
    '<tr>Master File Operations</tr>'+
	'<tr><td align="left"> <img style="vertical-align:middle" class="iconbtn" src="images/modsupp.png" onclick="modsupps();">&nbsp;&nbsp;</img> <label for="pharspri"> Modify Suppliers &nbsp;&nbsp;</label> </td></tr>'+
    '<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/modexps.png" onclick="modexps();">&nbsp;&nbsp;</img><label for="mexpacc">Modify Expense Accounts &nbsp;&nbsp;</label>&nbsp;&nbsp;</td></tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/modbks.png" onclick="modbanks();">&nbsp;&nbsp;</img><label for="mbanks">Modify Banks &nbsp;&nbsp;</label>&nbsp;&nbsp;</td></tr>'+
	'<tr><td align="left"><img style="vertical-align:middle" class="iconbtn" src="images/modpass.png" onclick="modpawd();">&nbsp;&nbsp;</img><label for="bankjv">Modify Passwords &nbsp;&nbsp;</label>&nbsp;&nbsp;</td></tr>'+
    '</table></center></form>';
 $('#scrblok').html(selbox);  
 $('#propblok').html('<p></p>');
 } 
 }; 
                                                                  //  Modify Passwords
function modpawd(){ 
if((parseInt(perm) === 1)){     
           window.open('modpss.php',"Modify Passwords","width=600px,height=600px,scrollbar=yes");            
       } 
}; 
                                                                  //  Modify Providers
function modsupps(){ 
if((parseInt(perm) === 1)){     
           window.open('modsups.php',"Modify Provider Accounts","width=800px,height=900px,scrollbar=yes");            
       } 
};
                                                                  //  Modify Expense accounts
function modexps(){ 
if((parseInt(perm) === 1)){     
           window.open('modexps.php',"Modify Expense Accounts","width=800px,height=900px,scrollbar=yes");            
       } 
};
                                                                  //  Modify Banks
function modbanks(){ 
if((parseInt(perm) === 1)){     
           window.open('modbanks.php',"Modify Bank Accounts","width=800px,height=900px,scrollbar=yes");            
       } 
};

															// searcher
function searchres(){ 
var sch= $('#schtid').val();
sch = sch.replace(/(^\s+|\s+$)/g,'');
if(( sch !== '')  ){
	 var str = $.get("showvehdet.php?schtid="+sch, function(data){ 	
			$('#propblok').html(data);		
			});		
}
};
																	// Clears search box
function searchclr(){ $('#propblok').html('<p></p>');
					  document.getElementById('schtid').value="";
};

                                                                     // Search Screen
function searchbxf(){  
    $('#scrblok').html('<table cellspacing="5px" id="searchbox"> <tr>Search Records</tr> <tr><td align="left"> <img style="vertical-align:middle" onclick="searchres();" class="iconbtn" src="images/searchic.png">&nbsp;&nbsp;</img>'+
		'<label for="schtid"> Search Vehicle &nbsp;&nbsp;</label> <input type="text" id="schtid" name="schtid" value="" size="70"/></td></tr>'+
		'<tr><td><span style="float:middle;background-color:beige;padding: 0 10px 0 10px;" onclick="searchclr();">Clear</span></td></tr> </table>');  
    $('#propblok').html('<p></p>');
	$('#schtid').autocomplete({ source: "allsearchrecs.php", minLength: 3  });
}; 

function logoff(){  
	window.location.replace("index.php");
};


function userslogd(){  
	var str = $.get("showusers.php", function(data){ 	
			$('#propblok').html(data);		
			});
};
 </script>
  