<?php
$pageRef='Clients';
include('includes/header.php');
?>
<script>
function createNewClient(){
window.location.href = 'http://127.0.0.1/Oreste/newClient.php';
}
function showClientDetails(elem){
var args = elem.name.split("_");
var clientId = args[0];
window.location.href = 'http://127.0.0.1/Oreste/viewClientDetailed.php?cl='+clientId;
}
function setClientEventHandlers(){
setTimeout("$$('a.aClientNominative').each(function(s){Event.observe(s,'click',function(){showClientDetails(s);})})", 1);
}
</script>
<div id="qResult" class="OpResult"></div>
<div class="Columns">
<div class="Column1">
<!-- *********************************************************** -->
<!-- * Menu tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Actions") ?></span></span><div class="BlockContentBorder">
<ul>
<?php echo "<li><a href=\"javascript:createNewClient();\">" . _T("New client") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
<!-- *********************************************************** -->
<!-- * Search tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Search for client") ?></span></span><div class="BlockContentBorder">
<table style="width:100%; font-size:0.8em;">
<tr><td style="width:10%;"><?php echo _T("Name") ?></td> <td style="align:center; width:90%;"><input style="width:80%;" name="sName" id="sName" type="text"/></td></tr>
<tr><td style="width:10%;"><?php echo _T("Surname") ?></td> <td style="align:center; width:90%;"><input style="width:80%;" name="sSurname" id="sSurname" type="text"/></td></tr>
<tr><td style="width:10%;"><?php echo _T("Town") ?></td> <td style="align:center; width:90%;"><input style="width:80%;" name="sCity" id="sCity" type="text"/></td></tr>
</table>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<!-- *********************************************************** -->
<!-- * Clients table * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Customer list") ?></span></span><div class="BlockContentBorder" id="clientTable">
</div>
</div>
</div>
</div>
</div>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// *****************************************
// * Load clients table for the first time *
// *****************************************
OL_clientTableLoad('', '', '', {elementToFill: 'clientTable', onSuccess: setClientEventHandlers});
// **************************
// * Install event handlers *
// **************************
Event.observe('sName', 'keyup', function(){OL_clientTableLoad($F('sName'), $F('sSurname'), $F('sCity'), {elementToFill: 'clientTable', onSuccess: setClientEventHandlers});});
Event.observe('sSurname', 'keyup', function(){OL_clientTableLoad($F('sName'), $F('sSurname'), $F('sCity'), {elementToFill: 'clientTable', onSuccess: setClientEventHandlers});});
Event.observe('sCity', 'keyup', function(){OL_clientTableLoad($F('sName'), $F('sSurname'), $F('sCity'), {elementToFill: 'clientTable', onSuccess: setClientEventHandlers});});
Event.observe('qResult', 'mouseover', function(){OL_makeThisElementInvisible('qResult');});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>