			<?


include("../php/configi.php");
			



$queryac2="SELECT * FROM " . $_COOKIE['phxcrmclient_id'] . "_prod_search WHERE main_uid = " . $uid . " and header = 0  order by Option1_Value;";
//echo $queryac2;
$resultac2=mysqli_query($conn, $queryac2);

//mysql_close();                
?>

<div class="table-responsive nomargin">
	<table class="table table-bordered table-striped" style=";">
<?
$iacv = 0;

$numrows = mysqli_num_rows($resultac2);

//echo "numrows is " . $numrows;

if ($numrows == 0){
	
	echo "<label>There are no variants for this product</label>";
	
	
}else{
	
		?>	
		
		

        <thead>
            <tr style="max-height: 10px">


			<th>SKU:</th>
				<th>Name: <br> Price: </th>
				<th>Barcode: <br> Cost:</th>
		<th>Status: <br>Qty on Hand:</th>
				


		    </tr>
        </thead>
		
				        <tbody>

<?php
	

 while($rowac2=mysqli_fetch_array($resultac2)) { 
 
	$sel_uid_var		 = $rowac2['sel_uid']; 
	$sku				 = $rowac2['sku']; 
	$title		 		 = $rowac2["Option1_Value"];	
	$price	 			 = $rowac2["price"];
	$prod_cost_price	 = $rowac2["prod_cost_price"];
	$barcode	 		 = $rowac2["barcode"];
	$qty_on_hand 		 = $rowac2["qty_on_hand"];
	$prod_status		 = $rowac2["prod_status"];
	
	?>
	
           <tr style="">


			<td>
			<input readonly style="" type="text" class="form-control" name="sku"  id="sku" value="<?php echo htmlspecialchars($sku);?>" onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'sku', 'input', this.value)"   class="form-control required">
			</td>
			<td >
			<input readonly  style="" type="text" class="form-control" name="title"  id="title" value="<?php echo htmlspecialchars($title);?>" onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'Option1_Value', 'input', this.value)"   class="form-control required"> <br>
			
					<input readonly  style=";  text-align: right;" type="text" class="form-control" name="price"  id="price" value="<?php echo htmlspecialchars(number_format($price, 2, '.', ','));?>" onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'price', 'inputint', this.value)"   class="form-control required">
			</td>
			<td>
			<input readonly  style="; " type="text" class="form-control" name="barcode"  id="barcode" value="<?php echo htmlspecialchars($barcode);?>" onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'barcode', 'input', this.value)"    class="form-control required"> 
			<br>
						<input readonly  style=";  text-align: right;" type="text" class="form-control" name="prod_cost_price"  id="prod_cost_price" value="<?php echo htmlspecialchars(number_format($prod_cost_price, 2, '.', ','));?>"  onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'prod_cost_price', 'inputint', this.value)"    class="form-control required">
			</td>

			<td style="">
														<?php
include_once("../php/configi.php");



$querystatus="SELECT * FROM 1_general_codes  where code_type = 'stockstatus' order by code_value";
//echo $querystaff;
$resultstatus=mysqli_query($conn, $querystatus);
	?>	
<select readonly disabled id = "prod_status" name="prod_status"   class="form-control"   onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>,'prod_status', 'input', this.options[this.selectedIndex].text)" >

<?



//mysql_close();



$i = 0;

while($rowstatus=mysqli_fetch_array($resultstatus)) { 

		?>

		<option <?php if ($rowstatus['code_value'] == $prod_status){echo " selected ";} ?>
		value='<?php echo $rowstatus['code_value']?>'><?php echo $rowstatus['code_value']; ?></option> 	

<?php

}


	 
?>
</select>

			
			<br>
						<input  readonly  style=";  text-align: right;" type="text" class="form-control" name="qty_on_hand"  id="qty_on_hand" value="<?php echo htmlspecialchars($qty_on_hand);?>"  onchange="javascript: update_field_product_var(<?php echo $sel_uid_var?>, 'qty_on_hand', 'inputint', this.value)"    class="form-control required">

			</td>
            </tr>



	<?php
	
	$iacv = $iacv + 1;
}

}
	

?>



</table>
</div>