<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Xpress</title>
    <script src=" rightclick_deactive.js"></script> 
    <script type="text/javascript" src="scripts/jquery-latest.js"></script>
	<link type="text/css" href="includes/style1.css" rel="stylesheet" />
      <link type="text/css" href="css/form.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>

    <script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
    </script>
	<script type="text/javascript">
    $(document).ready(function() {
        var cont_left = $("#container").position().left;
        $("a img").hover(function() {
            // hover in
            //$(this).parent().parent().css("z-index", 1);
            $(this).animate({
               height: "110",
               width: "110",
              
            }, "fast");
        }, function() {
            // hover out
         //   $(this).parent().parent().css("z-index", 0);
            $(this).animate({
                height: "80",
                width: "80",
                
            }, "fast");
        });
        
        $(".img").each(function(index) {
            var left = (index * 160) + cont_left;
            $(this).css("left", left + "px");
        });
    });




    </script>

<!-- js code below for active enter with textfield-->


<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script
* This notice must stay intact for use
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      


function chkvalue(str)
 {
   if(str.indexOf('&')>-1) 
     {
      alert ('Invalid Labour.');
      document.f1.labname.value='';
     }
 }


</script>


<style>
.cont
	{


       background-color:#3b5998;

	//background:url(images/bg-inner.jpg) #e9e0c3 repeat-x;
  	width: 100%;position: absolute ;
	height:99%;
    	/* Optional - just for DIV)*/
    	//border: solid 1px #000000;
	-moz-box-shadow: 0px 5px 5px #888;
	-webkit-box-shadow: 0px 5px 5px #888;
	box-shadow: 0px 5px 10px #888;
    
	}
</style>


<link href="css/form.css" type="text/css" rel="stylesheet" media="screen"  />

<div class='cont'>

<?
session_start();
include("opendb.php");
include("test.php");
include('includes/top.php');



print "<center>"
?>

<script>
function valid()
{
 if(document.f1.labname.value.length<=0)
 { alert ('Invalid Labour.'); return false;}
 if(confirm('Do you want to save?'))
  return true;
 else
  return false;
}
function popwar()
{
 if(document.f1.war.selectedIndex==2)
   window.open('popwar.php',menubar=false,resizable=false);
}
cellspacing=1 cellpadding=5
</script>

<script type="text/javascript">

/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
	}      

function pgnfn(str){
            document.getElementById('pgbtn'+str).style.background = "#ccc";
}
</script>


<style>
th{background-color:steelblue;color:white}

#pg{
       text-decoration:none;
}
#pg button{
       background-color:#3b5998;
}
</style>

<body bgcolor="#0033FF" onload='pgnfn(<? echo $xx;?>)'>
<center>
<form name='f1' action='svlabour.php' onSubmit="return valid()"> 
<input type=hidden name='mtype' value='WH'>
<table cellspacing=1 cellpadding=5 border=2 class="form">
<tr><th colspan=6 ><font color='white'>LABOUR DETAILS</th></tr>
<tr><td><font color='black'>Master Entry</font></td></tr>
<tr>
  <td >LabourName</td><td><input type=text name='labname' onKeyup='chkvalue(this.value)' onKeyPress="return handleEnter(this, event)"></td>
 <td>Amount </td><td><input type=text name='amt' onKeyPress="return handleEnter(this, event)"></td></tr>

</tr>






<tr><th colspan=8 align=center bgcolor='steelblue'><input type=submit value='Save'></th></tr>
</table>

</tr>
</table>






<table class="form">
<th align=left><font color='white'>No. </font><th align=left><font color='white'>LabourName</font> <th align=center><font color='white'>Amount</font><th align=center><font color='white'>Action</font>
<?

$k=1;
$re=mysqli_query($db,"select * from labourmaster order by labname ")or die(mysqli_error($db));


  

while($row=mysqli_fetch_array($re))

{
print "\n<tr bgcolor=aliceblue><td>".$k++."</td><td>$row[labname]</td><td align=right>$row[totallcv]</td>";
print "\n<td><input type=button value='Edit' onClick=delfun('".$row[0]."'); ></td></tr>";

}
?>
</table>
<script>
function delfun(x)
{
 window.open('edlabmast.php?code='+x);
}
</script>
