
<?php include_once("settings.php");
echo '<br>';
$cauta=$_POST['firma']; 
echo $cauta;
//$sql = mysql_query("SELECT firma FROM `clienti` WHERE firma LIKE '%$cauta%'");

$sql=mysqli_query($connect, "SELECT agent, firma, sum(sticlaH), sum(navetaH), sum(keg30H), sum(keg50H), sum(sticlaT), sum(navetaT), sum(keg30T), sum(keg50T) AS firma FROM clienti WHERE firma LIKE '$cauta' GROUP BY firma");

echo '<form method="post" action="index.php?page=modifica-in-db" enctype="multipart/form_data">';

echo '<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>
	
	<td >Agent</td>
	<td >Firma</td>
	<td >Sticle Heineken</td>
	<td >Navete Heineken</td>
	<td >Keg 30L Heineken</td>
	<td >Keg 50L Heineken</td>
	<td >Sticle Tuborg</td>
	<td >Navete Tuborg</td>
	<td >Keg 30L Tuborg</td>
	<td >Keg 50L Tuborg</td>
	</tr>';
while ($row=mysqli_fetch_row($sql)) {
	echo '
		<tr>
		<td>'.$row[0].'</td>
		<td>'.$row[1].'</td>
		<td>'.$row[2].'</td>
		<td>'.$row[3].'</td>
		<td>'.$row[4].'</td>
		<td>'.$row[5].'</td>
		<td>'.$row[6].'</td>
		<td>'.$row[7].'</td>
		<td>'.$row[8].'</td>
		<td>'.$row[9].'</td>
		</tr>';
echo '
	<tr >
	<td ><select name="01">
	<option value="Agent 01" selected>Agent 01</option>
	<option value="Agent 02" >Agent 02</option>
	<option value="Agent 03" >Agent 03</option>
	<option value="Agent 04" >Agent 04</option>
	<option value="Agent 05" >Agent 05</option>
	<option value="Agent 06" >Agent 06</option>
	<option value="Agent 07" >Agent 07</option>
	<option value="Agent 08" >Agent 08</option>
	<option value="Agent 09" >Agent 09</option>
	<option value="Agent 10" >Agent 10</option>
	<option value="Agent 11" >Agent 11</option>
	<option value="Agent 12" >Agent 12</option>
	<option value="Agent 13" >Agent 13</option>
	<option value="Agent 14" >Agent 14</option>
	<option value="Agent 15" >Agent 15</option>
	<option value="Agent 16" >Agent 16</option>
	<option value="Agent 17" >Agent 17</option>
	<option value="Agent 18" >Agent 18</option>
	<option value="Agent 19" >Agent 19</option>
	<option value="Agent 20" >Agent 20</option>
	<option value="Agent 21" >Agent 21</option>
	<option value="Agent 22" >Agent 22</option>
	<option value="Agent 23" >Agent 23</option>
	<option value="Agent 24" >Agent 24</option>
	<option value="Agent 25" >Agent 25</option>
	</select></td>
    <td ><input name="02" value="'.$cauta.'" size="20" "readonly"></td>
	<td ><input  name="03" value="00" size="4"></td>
	<td ><input  name="04" value="00" size="4"></td>
	<td ><input  name="05" value="00" size="4"></td>
	<td ><input  name="06" value="00" size="4"></td>
	<td ><input  name="07" value="00" size="4"></td>
	<td ><input  name="08" value="00" size="4"></td>
	<td ><input  name="09" value="00" size="4"></td>
	<td ><input  name="10" value="00" size="4"></td>
	</tr>';
echo '<tr>
	<td colspan="10">
<center>
<input name="submit" type="submit" id="submit" value="Retrage ambalaj de la client">
</center>
	</td>

	</tr>';
}
echo '</form>';
?>	
