<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("../opendb.php");
include("../test.php");
?>
<head>
<script>
var cur=1;
var cur_D=1;
var als=[];
var als_D=[];
als[0]='<option></option>';
var pfce;
var esice;
var pfp;
var esip;

//als[0]="</option>";
als_D[0]="<option></option>";

function chk(x)
{
 if(isNaN(x.value))
 {
  alert('Invalid Entry');x.value='';
  return false;
 }
}
function valid()
{
 if(document.f1.basic.value<=0)
  {
    alert('Invalid Basic');
    return false;
  }
}
function calc()
{

document.f1.basic.value=parseInt(document.f1.totsal.value)*60/100;
document.f1.da.value=parseInt(document.f1.totsal.value)*20/100;
document.f1.ta.value=parseInt(document.f1.totsal.value)*10/100;
document.f1.hra.value=parseInt(document.f1.totsal.value)*10/100;
//document.f1.pf.value=(parseInt(document.f1.totsal.value)*pfp/100)+parseInt(document.f1.da.value);

}
function insRow()
{
var x=document.getElementById('myTable').insertRow(cur)
var a1=x.insertCell(0)
var a=x.insertCell(1)
var y=x.insertCell(2)
var z=x.insertCell(3)	
a1.innerHTML="<center><input type=button value='-' onClick='delRow(this)'>";
a.innerHTML=cur
var value="<select name=dr[]>";

for(k=0;k<als.length;k++)
 value=value+"<option>"+als[k]+"</option>";

value=value+"</select>";
y.innerHTML=value

z.innerHTML="<input type=text name=amt[] id=dr"+cur+" size=10>"
cur++; 

}


function insRow_D()
{
var x=document.getElementById('myTable_D').insertRow(cur_D)
var a1=x.insertCell(0)
var a=x.insertCell(1)
var y=x.insertCell(2)
var z=x.insertCell(3)	
a1.innerHTML="<center><input type=button value='-' onClick='delRow_D(this)'>";
a.innerHTML=cur_D
var value="<select name=dr_D[]>";

for(k=0;k<als_D.length;k++)
 value=value+"<option>"+als_D[k]+"</option>";

value=value+"</select>";
y.innerHTML=value


z.innerHTML="<input type=text name=amt_D[] id=dr_D"+cur_D+" size=10>"
cur_D++; 

}

function delRow(r)
{
 var i=r.parentNode.parentNode.parentNode.rowIndex;
 document.getElementById('myTable').deleteRow(i);
cur--;
}

function delRow_D(r)
{
 var i=r.parentNode.parentNode.parentNode.rowIndex; 
 document.getElementById('myTable_D').deleteRow(i);
cur_D--;
}

</script>


<style>
body,td{font-family:'arial narrow';letter-spacing:1;}
tr{background-color:e3ecd2}
th{background-color:c1d799}
.mnu{margin-left:5}
body{BACKGROUND-COLOR:fcfff1}
input{text-align:right}
</style>

<?
if($pswd=='patmz')
{
?>
<form name='f1' action='edpaymast2.php'>
<fieldset>
<legend style="color:red"><b>EDIT SALARY DETAILS</font></b></legend>
<center>
<table>
<tr><td>Select Employee</td><td colspan=5><select name='empcode'>
<?
$re=mysqli_query($db,"select empcode,empname,br from empmaster where brcode='$brcode' order by br,empname") or die("ERR :".mysqli_error());
while($row=mysqli_fetch_array($re))
{
 print "\n<option value='$row[0]'>$row[1]-$row[2]</option>";
}
?>
</select>
</td></tr>
<tr><td colspan=2><input type=submit value='Go ->'></td></tr>
</table>
</form>
<?
return;
}
?>
<form action='<?print $PHP_SELF?>'>
<table>
<tr><td>Password </td><td><input type=password name='pswd'></td></tr>
<tr><td colspan=2 align=center><input type=submit value='Go' name='go'></td></tr>
</table>
</form>

