
<?php include_once("settings.php");
echo '<br>';
$cauta=$_POST['incarca']; 
echo $cauta;

$sql=mysqli_query($connect, "SELECT agent, doc, firma, sum(sticlaH), sum(navetaH), sum(keg30H), sum(keg50H), sum(sticlaT), sum(navetaT), sum(keg30T), sum(keg50T), sum(palet_euro), sum(palet_neuro), sum(keg20H), sum(vitrina_romaqua), sum(vitrina_aquacarpatica) 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="98%" border="1" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>
	<td >Agent</td>
		<td width="180px">Data Document</td>
		<td >Document</td>
		<td width="150px">Firma</td>
		<td >Sticle<br />Heineken</td>
		<td >Navete<br />Heineken</td>
			<td >Keg 20L<br />Heineken</td>
		<td >Keg 30L<br />Heineken</td>
		<td >Keg 50L<br />Heineken</td>
		<td >Sticle<br />Tuborg</td>
		<td >Navete<br />Tuborg</td>
		<td >Keg 30L<br />Tuborg</td>
		<td >Keg 50L<br />Tuborg</td>
		<td >Palet<br />EURO</td>
		<td >Palet<br />N-EURO</td>
		<td >Palet CHEP<br />Albastru</td>
		<td >Palet<br />ROSE</td>
	</tr>';
while ($row=mysqli_fetch_row($sql)) {
	echo '
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td>'.$row[2].'</br></td>
			<td>'.$row[3].'</td>
			<td>'.$row[4].'</td>
			<td>'.$row[13].'</td>
			<td>'.$row[5].'</td>
			<td>'.$row[6].'</td>
			<td>'.$row[7].'</td>
			<td>'.$row[8].'</td>
			<td>'.$row[9].'</td>
			<td>'.$row[10].'</td>
			<td>'.$row[11].'</td>
			<td>'.$row[12].'</td>
			<td>'.$row[14].'</td>
			<td>'.$row[15].'</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 ><select name="zi">
	<option value="01" selected>01</option>
	<option value="02">02</option>
	<option value="03">03</option>
	<option value="04">04</option>
	<option value="05">05</option>
	<option value="06">06</option>
	<option value="07">07</option>
	<option value="08">08</option>
	<option value="09">09</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	<option value="13">13</option>
	<option value="14">14</option>
	<option value="15">15</option>
	<option value="16">16</option>
	<option value="17">17</option>
	<option value="18">18</option>
	<option value="19">19</option>
	<option value="20">20</option>
	<option value="21">21</option>
	<option value="22">22</option>
	<option value="23">23</option>
	<option value="24">24</option>
	<option value="25">25</option>
	<option value="26">26</option>
	<option value="27">27</option>
	<option value="28">28</option>
	<option value="29">29</option>
	<option value="30">30</option>
	<option value="31">31</option>
	</select>
	<select name="luna">
	<option value="01" selected>01</option>
	<option value="02">02</option>
	<option value="03">03</option>
	<option value="04">04</option>
	<option value="05">05</option>
	<option value="06">06</option>
	<option value="07">07</option>
	<option value="08">08</option>
	<option value="09">09</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	</select>
	<select name="an">
	<option value="2010">2010</option>
	<option value="2011" selected>2011</option>
	<option value="2012">2012</option>
	<option value="2013">2013</option>
	<option value="2014">2014</option>
	<option value="2015">2015</option>
	<option value="2016">2016</option>
	<option value="2017">2017</option>
	<option value="2018">2018</option>
	<option value="2019">2019</option>
	<option value="2020">2020</option>
	<option value="2021">2021</option>
	<option value="2022">2022</option>
	<option value="2023">2023</option>
	<option value="2024">2024</option>
	<option value="2025">2025</option>
	<option value="2026">2026</option>
	<option value="2027">2027</option>
	<option value="2028">2028</option>
	</select></td>
		<td ><input  name="doc" value="0000000000" size="10"></td>

		<td ><input name="02" value="'.$cauta.'" size="20" readonly></td>
		<td ><input  name="03" value="00" size="2"></td>
		<td ><input  name="04" value="00" size="2"></td>
		<td ><input  name="keg20H" value="00" size="2"></td>
		<td ><input  name="05" value="00" size="2"></td>
		<td ><input  name="06" value="00" size="2"></td>
		<td ><input  name="07" value="00" size="2"></td>
		<td ><input  name="08" value="00" size="2"></td>
		<td ><input  name="09" value="00" size="2"></td>
		<td ><input  name="10" value="00" size="2"></td>
		<td ><input  name="11" value="00" size="2"></td>
		<td ><input  name="12" value="00" size="2"></td>
		<td ><input  name="vitrina_romaqua" value="00" size="2"></td>
		<td ><input  name="vitrina_aquacarpatica" value="00" size="2"></td>
	</tr>';
echo '<tr>
	<td colspan="17"><center>Observatii :<br><textarea name="1000" rows="8" cols="60"></textarea></center></td>
	</tr>';
echo '<tr>
	<td colspan="17"><input name="submit" type="submit" id="submit" value="Actualizeaza stoc"></td>
	</tr>';
}
echo '</table>';
echo '</form>';
?>	

