<?
include("../include/config.php");
require_once "../include/Database_functions.php";
$container_drp_val='';
$sqlObj=new sqlclass();

if(isset($_REQUEST['div'])){
$div=$_GET['div'];
$div1=$div;
$div=$div+1;
if(isset($_REQUEST['container_drp_val'])){
$container_drp_val=$_REQUEST['container_drp_val'];
$container_drp_val=stripslashes($container_drp_val);
}
?>
<script type="text/javascript" >
function showDealer1(str)
{


var xmlhttp;    
if (str=="")
  {
  document.getElementById("txtDealer1").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
	   document.getElementById("txtDealer1").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","testdealer.php?str="+str,true);
xmlhttp.send();
}

</script>
<div id="hidediv<?php echo $div1; ?>">
<?php 
	
?>

<style>
.lableentrytext{
font-size: 12px;
color: #505050;
clear: both;
margin-bottom: 5px;
text-transform: capitalize;
}

body {
	padding:0px;
	margin:0px;
	font-family:Arial, Helvetica, sans-serif;
	color:#000000;
}
.div01 {
	width:80%;
	margin:0 70px;
	padding-bottom:15px;
}
.ptForm {
	/*border:1px solid #000000;*/
	width:100%;
	margin:0 auto;
	padding:4px;
}
.ptText01 {
	font-size:20px;
	font-weight:bold;
}
.ptText02 {
	font-size:12px;
}
.ptText03 {
	font-size:16px;
	font-weight:bold;
}
.ptText04 {
	font-size:16px;
	font-weight:bold;
	border-left:solid 1px #000000;
	border-right:solid 1px #000000;
	border-top:solid 1px #000000;
}
.ptText05 {
	font-size:14px;
	font-weight:bold;
}
.field01 {
	border-bottom:#333333 dotted 1px;
	border-left:none;
	border-top:none;
	border-right:none;
	color:#000000;
	font-size:12px;
	font-weight:bold;
	background-color:#f1f1f1;
}
.field02 {
	border:none;
	color:#000000;
	font-size:12px;
	font-weight:bold;
	background-color:#f1f1f1;
}
.ptText06 {
	font-size:12px;
	font-weight:bold;
}
.rightTd {
	border-bottom:solid 1px #000000;
}
.leftTd {
	border-bottom:solid 1px #000000;
	border-right:solid 1px #000000;
	padding:4px;
}
.leftTd1 {
	border-bottom:solid 1px #000000;
	border-right:solid 1px #000000;
	border-left:solid 1px #000000;
	padding:4px;
}
.tdItem {
	border-bottom:solid 1px #000000;
	border-right:solid 1px #000000;
	padding:4px;
}
.rightTd {
	border-bottom:solid 1px #000000;
	padding:4px;
}
.rightTd1 {
	border-bottom:solid 1px #000000;
	border-right:solid 1px #000000;
	padding:4px;
}
/*.rightTdBtm {
	border:none;
	padding:4px;
}
.leftTdBtm {
	border-right:solid 1px #000000;
	padding:4px;
}*/
.tdItemBtm {
	
	padding:4px;
}

</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0"   class="List" align="center" >
  <tr>
  		<td class="tdItem">
              <select class="input1" name="product_ids<?=$div1?>" id="product_ids<?=$div1?>" >
     			<option value="">Select Product</option>
     			<?php 
					$sq_product="select * from cf_open_oil";
					$array1=mysql_query($sq_product);
					while($resprd=mysql_fetch_array($array1))
					{
					?>     	
        				<option value="<?=$resprd['open_stock_id']?>" ><?=$resprd['item_name']?></option>
               		<?php
					}
	 				?>
     		</select>
		</td>
  	    <td width="16%" class="leftTd1">
			<select class="input1 fxwidth" name="branch<?=$div1?>" id="branch<?=$div1?>" onChange="showLiter(this.value,'<?=$div1?>')">
     			<option value="">-Select Brand-</option>
                <?php 
					$sq_brand="select * from cf_brand";
					$array1=mysql_query($sq_brand);
					while($res=mysql_fetch_array($array1))
					{
					?>     	
        				<option value="<?=$res['brand_id']?>"><?=$res['brand_name']?></option>
               		<?php
					}
	 				?>
     		</select>
    	 </td>
              
<td width="19%" class="tdItem">
<div id="txtLiter<?=$div1?>">
              <select class="input1 fxwidth" name="literqty<?=$div1?>" id="literqty<?=$div1?>" onChange="showDealer(this.value,'<?=$div1?>')">
     			<option value="">-Select Liter-</option>
     			 <?php 
                            $sq_liter1="select * from cf_liter";
                            $arr1=mysql_query($sq_liter1);
                            while($resliter1=mysql_fetch_array($arr1))
                            {
                        ?>
                            <option value="<?=$resliter1['liter_id']?>" <? if($resliter1['liter_id']==$literqty) {?>selected<? }?> ><?=$resliter1['liter_qty']?></option>
                        <?php
                            }
                     ?>
     		</select>
            </div>
      </td>
     <td class="tdItem" ><div id="txtKglitre<?=$div1?>" style="float:left;"><input type="text" name="kg_liter<?=$div1?>" id="kg_liter<?=$div1?>" class="input1 fxwidth" value=""  ></div></td>      
     <td class="tdItem"><input type="text" name="boxqty<?=$div1?>" id="boxqty<?=$div1?>" class="input1 input3 fxwidth" value="" onKeyUp="qtytotal();"></td>  
     <td class="tdItem"><input type="text" name="rateboxs<?=$div1?>" id="rateboxs<?=$div1?>" class="input1 input3 fxwidth" value="" onKeyUp="qtytotal()" ></td>      
     <td class="tdItem"><input type="text" name="linetot<?=$div1?>" id="linetot<?=$div1?>" class="input1 input3 fxwidth" value=""  ></td>
     <td width="5%" align="center" class="tr_td tr_td_r  rightTd1" style="padding:8px;">
	<a style="cursor:pointer;" onclick="addmoresales('<?=$div?>')">
	<span id="min<?=$div1?>"><img src="images/addmore.jpg" /></span>	  </a>
	  
	   <span id="max<?=$div1?>" style="display:none;" onclick="minmore('<?=$div?>');"><img src="images/minus.jpg" /></span>
	<!--<a style="cursor:pointer;" onclick="addmore('<?//=$div?>')"><img src="images/addmore.jpg" /></a> --></td>
  </tr>
</table>
</div>
<div id="div<?=$div?>">
</div>
<? }?>


