<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;">
<meta http-equiv="X-UA-Compatible" content="IE=11">
<script type="text/javascript" src="../css/jquery-1.6.1.min.js"></script>
<title>CashSale</title>
<style>
html, body{
  margin:0;
  padding:0;
  height:100%;
}
section {
  position: relative;
  border: 2px solid #dee2e6;
  padding-top: 37px;
  background:tomato;
}
section.positioned {
  position: absolute;
  top:100px;
  left:100px;
  width:800px;
  box-shadow: 0 0 15px #333;
}
.container {
  overflow-y: auto;
  height: 250px;
}
table {
  border-spacing: 0;
  width:100%;
}

td + td {
  border-left:1px solid #eee;
}
 th,td {
  border-bottom:1px solid #eee;
  
  color: #000;
  padding: 10px 25px;
}
th {
  height: 0;
  line-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: transparent;
  border: none;
  white-space: nowrap;
}
th div{
  position: absolute;
  background: transparent;
  color: #fff;
  padding: 9px 25px;
  top: 0;
  margin-left: -25px;
  line-height: Normal;
  border-left: 1px solid tomato;
}
th:first-child div{
  border: none;
}
tr:nth-child(even) {background: #f2f2f2;}
tr:nth-child(odd) {background: #ddd;}
div.relative{
position:fixed;
bottom:0;
}
</style>
<script>
function calculateHead(tsndr){
   var showpdisc='';
   var tq=document.getElementById('txtQty');
   var tp=document.getElementById('txtPrice');
   var tf=document.getElementById('txtFree');
   var td=document.getElementById('txtDiscount');
 
   var tqty, tprice, tdisc, tfree;
   if (isNaN(tq.value) || tq.value==''){tqty=0;}else{tqty=tq.value;}
   if (isNaN(tp.value) || tp.value==''){tprice=0;}else{tprice=tp.value;}
   if (isNaN(td.value) || td.value==''){tdisc=0;}else{tdisc=td.value;}
   if (isNaN(tf.value) || tf.value==''){tfree=0;}else{tfree=tf.value;}
 
   var tt=document.getElementById('txtTotal');
   var tn=document.getElementById('txtNet');
   var ttq=document.getElementById('txtTqty');
   tt.value=parseFloat(tqty)*parseFloat(tprice);  
   if (isNaN(parseFloat(td.value))){td.value='0';}
   if (showpdisc=='false' || parseFloat(tt.value)==0)
   {tn.value=parseFloat(tt.value)-parseFloat(tdisc);}
   else
   {
   tn.value=parseFloat(tt.value)-(parseFloat(tdisc)*100/parseFloat(tt.value));
   }
   ttq.value=parseFloat(tqty)+parseFloat(tfree);
}
</script>
<script>
function deleteRowFunction(sndr){
var trf='vfps://thisform.deleterow('+sndr+')';
window.location.href=trf;
}
</script>
<script>
function focusNext(form, elemName, evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        form.elements[elemName].focus( );
        return false;
    }
    return true;
}
</script>
<script>
function initialFocus(){
document.getElementById('txtUnit').focus();
}
</script>
<script>
function runvfpCode(tcod){
document.body.style.cursor='wait' ;
var newrf='vfps://'+tcod;
window.location.href=newrf;
document.body.style.cursor='default' ;
}
</script>

</head>

<body>
<nav>Nav text</nav>
<section class="" id='bodytext'>
    <%
    use ([d:\shahprjs\supermarket\works\tcsdata])
    SELECT [tcsdata]
    GO top
    numsr=1
    %>
    <div class="container">
    <table>
		<thead>
		<tr class="header">
          <th>
           SR#
            <div>SR#</div>
          </th>
          <th>
           ITEM#
            <div>ITEM#</div>
          </th>
		<th>
           NAME
            <div>NAME</div>
          </th>
			
		<th>
           QTY
           <div>QTY</div>
          </th>
		<th>
           PRICE
            <div>PRICE</div>
          </th>
		<th>
           TOTAL
            <div>TOTAL</div>
          </th>
				
<th>
           DISC
            <div>DISC</div>
          </th>
<th>
           NET
            <div>NET</div>
          </th>
		<th>
           ACTION
            <div>ACTION</div>
          </th>
		</tr>
		</thead>
		<tbody>
<%SCAN%>
		<tr>
			<td><<ALLTRIM(TRANSFORM(numsr))>></td>
			<td><<ALLTRIM(TRANSFORM(itemid))>></td>
			<td><<ALLTRIM(TRANSFORM(name))>></td>
			<td align='right'><<ALLTRIM(TRANSFORM(qty))>></td>
			<td align='right'><<ALLTRIM(TRANSFORM(rate))>></td>
			<td align='right'><<ALLTRIM(TRANSFORM(rate*qty))>></td>
			<td align='right'><<ALLTRIM(TRANSFORM(discount))>></td>
			<td align='right'><<ALLTRIM(TRANSFORM(rate*qty-discount))>></td>
			<td>Action</td>
		</tr>
	<%numsr=numsr+1%> 
<%endscan%>
  </tbody>
</table>
  </div>
</section>
</body>
</html>