<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
ini_set('memory_limit', '256M');
// error_reporting(0);
require('connect.php');
include('header.php');
date_default_timezone_set("Europe/Athens");
require('includes/resizeImage.class.php');
?>
<link rel="stylesheet" href="css/control_styles.css">
<script src="js/plupload.full.min.js"></script>
<script src="js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
<script src="js/control_functions.js"></script>
<script>
$(document).ready(function(){
	check_fishsum(-1);
	check_totals(-1, false);
	check_varoskiv();
	check_ice();
	check_thermpsar();
	check_ratings();
	$('.col-sm-1').prop("style", "padding-right:5px !important;");
	$('.form-control').prop("style", "padding: 6px 6px !important;");
});
</script>
<?php
date_default_timezone_set("Europe/Athens");
$cqry = "SELECT * FROM control_form4 as control_form WHERE id=".$_GET['cID'];
$qry = "SELECT * FROM companies";
$qry2 = "SELECT * FROM packing";
$qrymon = "SELECT * FROM monada";
$qryusr = "SELECT * FROM users";
$cres = mysqli_query($dbC,$cqry);
$res = mysqli_query($dbC,$qry);
$res2 = mysqli_query($dbC,$qry2);
$resmon = mysqli_query($dbC,$qrymon);
$resusr = mysqli_query($dbC,$qryusr);
$crow = mysqli_fetch_assoc($cres);
$kefalh = json_decode($crow['kefalh'],1);
$koilia = json_decode($crow['koilia'],1);
$swma = json_decode($crow['swma'],1);
$vragxia = json_decode($crow['bragxia'],1);
$matia = json_decode($crow['matia'],1);
$dusmorfies = json_decode($crow['dusmorfies'],1);
$apobolh_trofhs = json_decode($crow['apobolh_trofhs'],1);
$alloiwseis = json_decode($crow['alloiwseis'],1);
$parasita = json_decode($crow['parasita'],1);
$pinpar = json_decode($crow['pinakas_par']);
$pinsum = json_decode($crow['pinsum']);
$varos_kiv = json_decode($crow['varos_kiv2']);
$megethos = json_decode($crow['megethos']);
$pics = json_decode($crow['picture']);
$etiketeza = ["-","A","B","D","E","F","K","L","M","N","O","P","Q","R","S","T","TW","Y","Z","KL","LR","LV","Δεν αναγράφεται"];
$metatopish = ["Όχι","1 ημέρα","2 ημέρες","3 ημέρες","4 ημέρες","5 ημέρες","6 ημέρες","7 ημέρες","Άλλο"];
// print_r($koilia['khlides']);
// print_r($crow['kefalh']);
// echo json_decode($crow['sn_kib'])[0];
?>
<!-- <div style="display:none;overflow:auto;"> -->
	<div id="piczoom" style="display:none;padding:1rem;">
	</div>
<!-- </div> -->
<form id="uploadimage" action="" method="post" enctype="multipart/form-data"></form>
<div class="container-fluid">
	<div class="panel-group">
		<div class="panel panel-default">
			 <div class="panel-body">
					<div class="row">
						 <div class="col-sm-5">
								<div class="form-group">
									 <label for="hm_paralav">Ημ/νία Παραλαβής</label>
									 <input class="form-control hmfrm" type="date" name="hm_paralav" id="hm_paralav" value="<?php echo $crow['hm_paralav']; ?>"/>
								</div>
						 </div>
						 <div class="col-sm-5">
							 <label>Δελτίο Αποστολής</label>
							 <div class="form-group">
									<input class="form-control" type="text" value="<?php echo $crow['deltio_apost']; ?>" name="deltio_apost" />
							 </div>
						 </div>
						 <div class="col-sm-2">
								<div class="form-group">
									 <label for="hm_paralav2">Καμία ημερομηνία</label>
									 <input type="checkbox" class="form-control" name="hm_paralav2" value="-" id="hm_paralav2" <?php echo ($crow['hm_paralav']=="" ? 'checked' : ''); ?> />
								</div>
						 </div>
					</div>
			 </div>
		</div>

		<div class="panel panel-default">
			 <div class="panel-body">
					<div class="row">
						 <div class="col-sm-4">
								<label for="etairia">Εταιρία:</label>
								<div class="form-group">
									 <select class="selectpicker" name="etairia" data-live-search="true" id="etairia">
											<?php
												 while($row=mysqli_fetch_array($res)){
														echo "<option data-compid=\"".$row['id']."\" ".($crow['etairia']==$row['company_name'] ? 'selected' : '').">".$row['company_name']."</option>";
												 }
											?>
									 </select>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label for="monada_paxunshs">Μονάδα Πάχυνσης:</label>
								<div class="form-group">
									 <select class="selectpicker" name="monada_paxunshs" id="monada_paxunshs" data-live-search="true">
											<?php
												 while($rowmon=mysqli_fetch_array($resmon)){
														echo "<option ".($crow['monada_paxunshs']==$rowmon['text'] ? 'selected' : '').">".$rowmon['text']."</option>";
												 }
											?>
									 </select>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label for="kwd_sus">Συσκευαστήριο:</label>
								<div class="form-group">
									 <select class="selectpicker" name="kwd_sus" id="kwd_sus" data-live-search="true">
											<?php
												 while($row=mysqli_fetch_array($res2)){
														echo "<option ".($crow['kwd_sus']==$row['text'] ? 'selected' : '').">".$row['text']."</option>";
												 }
											?>
									 </select>
								</div>
						 </div>
					</div>

					<div class="row">
						 <div class="col-sm-4">
								<label for="etiketeza">Ετικετέζα:</label>
								<div class="form-group">
									 <select class="selectpicker" name="etiketeza" id="etiketeza">
											<?php
												foreach($etiketeza as $etiket){
													echo "<option ".($crow['etiketeza']==$etiket ? 'selected' : '').">".$etiket."</option>";
												}
											?>
									 </select>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label for="metatopish">Μετατόπιση:</label>
								<div class="form-group">
									 <select class="selectpicker" name="metatopish" id="metatopish">
										 <?php
											 foreach($metatopish as $metat){
												 echo "<option ".($crow['metatopish']==$metat ? 'selected' : '').">".$metat."</option>";
											 }
										 ?>
									 </select>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label for="elegkths">Ελεγκτής:</label>
								<div class="form-group">
									 <select class="selectpicker" name="elegkths" id="elegkths">
											<option <?php echo ($crow['metatopish']=="Άλλο" ? 'selected' : ''); ?>>Άλλο</option>
											<?php
												while($usr = mysqli_fetch_array($resusr)){
													echo "<option ".($crow['elegkths']==$usr['ALogin'] ? 'selected' : '')." value='".$usr['ALogin']."' >".$usr['fullname']."</option>";
												}
											?>
									 </select>
								</div>
						 </div>
					</div>
			 </div>
		</div>

		<div class="panel panel-default">
			 <div class="panel-body">
					<div class="row">
						 <div class="col-sm-4">
								<label>Ημ/νία Ελέγχου:</label>
								<div class="form-group">
									 <input class="form-control" type="date" name="hm_elegxou" value="<?php echo $crow['hm_elegxou']; ?>"/>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label>Ώρα Ελέγχου:</label>
								<div class="form-group">
									 <input class="form-control" type="time" name="wra_elegxou" value="<?php echo $crow['wra_elegxou']; ?>"/>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label>Ημερομηνία Λήξης - Παραγωγής:</label>
								<div class="form-group">
									 <input class="form-control hmfrm" type="date" name="hm_lixpar" value="<?php echo $crow['hm_lixpar']; ?>" />
									 &nbsp;Καμία Ημ/νία&nbsp;
									 <input class="incheck" type="checkbox" name="no_lixpar" value="1" class="form-control" <?php echo ($crow['hm_lixpar']=="" ? 'checked' : ''); ?> />
								</div>
						 </div>
					</div>
			 </div>
		</div>

		<div class="panel panel-default">
			 <div class="panel-body">
					<div class="row">
						 <div class="col-sm-4">
								<label>Είδος Ψαριών</label>
								<div class="row">
									<div class="col-sm-8 col-sm-offset-2">
										<select class="form-control" name="eidos">
											 <option <?php echo ($crow['eidos']=="Κ" ? 'selected' : ''); ?>>Κ</option>
											 <option <?php echo ($crow['eidos']=="Λ" ? 'selected' : ''); ?>>Λ</option>
											 <option <?php echo ($crow['eidos']=="Μ" ? 'selected' : ''); ?>>Μ</option>
											 <option <?php echo ($crow['eidos']=="Τ" ? 'selected' : ''); ?>>Τ</option>
											 <option <?php echo ($crow['eidos']=="Άλλο" ? 'selected' : ''); ?>>Άλλο</option>
										</select>
									</div>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label>Είδος Κιβωτίου</label>
								<div class="form-group">
									 <select class="selectpicker" name="eidos_kiv">
											<option <?php echo ($crow['eidos_kiv']=="Κανονικό" ? 'selected' : ''); ?> >Κανονικό</option>
											<option <?php echo ($crow['eidos_kiv']=="Ροκάκι" ? 'selected' : ''); ?> >Ροκάκι</option>
											<option <?php echo ($crow['eidos_kiv']=="Καστράκι" ? 'selected' : ''); ?> >Καστράκι</option>
									 </select>
								</div>
						 </div>
						 <div class="col-sm-4">
								<label>Παρτίδα</label>
								<div class="form-group">
									 <input class="form-control" type="number" name="partida" value="<?php echo $crow['partida']; ?>"/>
								</div>
						 </div>
					</div>
			 </div>
		</div>

		<div class="panel panel-default">
			 <div class="panel-body">
					<div class="row">
						 <div class="col-sm-3 col-sm-offset-3">
								<div class="checkbox">
									 <label><input type="checkbox" value="1" name="apousia_swmatwn" <?php echo ($crow['apousia_swmatwn']=="1" ? 'checked' : ''); ?>> Απουσία ξένων σωμάτων</label>
								</div>
						 </div>
						 <div class="col-sm-3">
							<button class="btn btn-info" onClick="copy_id(<?php echo $_GET['cID']; ?>);">Αντιγραφή ID</button>
							<?php
								if(isset($_GET['type']) && $_GET['type']=='edit'){
							?>
							<button class="btn btn-danger" onClick="control2db('update',<?php echo $_GET['cID']; ?>);">Αποθήκευση Αλλαγών</button>
							<?php } ?>
						 </div>
					</div>
			 </div>
		</div>
	</div>

			<div class="panel panel-default">
				 <div class="panel-heading" id="toggle_partbl" style="cursor:pointer;">Πίνακας Παραγωγής <span class="pull-right"><i id="toggle_partbl2" class="glyphicon glyphicon-plus"></i></span></div>
				 <div class="panel-body" style="display: none;" id="partbl_body">
						<table class="table table-striped table-responsive table-bordered">
							 <thead>
									<tr>
										 <th></th>
										 <th>Κιβώτιο 1</th>
										 <th>Κιβώτιο 2</th>
										 <th>Κιβώτιο 3</th>
										 <th>Κιβώτιο 4</th>
										 <th>Κιβώτιο 5</th>
										 <th>Κιβώτιο 6</th>
										 <th>Κιβώτιο 7</th>
										 <th>Κιβώτιο 8</th>
										 <th>Κιβώτιο 9</th>
										 <th>Κιβώτιο 10</th>
									</tr>
									<tr>
										<th><!--<button class="btn btn-default"><i title="Προσθήκη νέας γραμμής" style="text-align:center;" class="glyphicon glyphicon-plus" onClick="add_row();"></i></button>--></th>
										<?php
											for($i=1;$i<=10;$i++){
												echo '<th>
																<select class="form-control megethos" name="megethos[]" data-order="'.$i.'">
													 				<option '.($megethos[$i-1]=="2/3" ? "selected" : "").'>2/3</option>
													 				<option '.($megethos[$i-1]=="3/4" ? "selected" : "").'>3/4</option>
																	<option '.($megethos[$i-1]=="400/500" ? "selected" : "").'>400/500</option>
													 				<option '.($megethos[$i-1]=="300/500" ? "selected" : "").'>300/500</option>
													 				<option '.($megethos[$i-1]=="500/600" ? "selected" : "").'>500/600</option>
													 				<option '.($megethos[$i-1]=="500/1000" ? "selected" : "").'>500/1000</option>
													 				<option '.($megethos[$i-1]=="4/6" ? "selected" : "").'>4/6</option>
															 		<option '.($megethos[$i-1]=="6/8" ? "selected" : "").'>6/8</option>
													 				<option '.($megethos[$i-1]=="8/1000" ? "selected" : "").'>8/1000</option>
													 				<option '.($megethos[$i-1]=="1000+" ? "selected" : "").'>1000+</option>
													 				<option '.($megethos[$i-1]=="1500+" ? "selected" : "").'>1500+</option>
													 				<option '.($megethos[$i-1]=="Άλλο" ? "selected" : "").'>Άλλο</option>
																</select>
															</th>';
											}
										?>
									</tr>
									<tr>
										<th></th>
										<?php
											for($i=1;$i<=10;$i++){
												echo "<th>
																<select class=\"form-control varos_kiv\" name=\"varos_kiv2[]\" data-order=\"".$i."\">
													 				<option ".($varos_kiv[$i-1]==3 ? 'selected' : '').">3</option>
													 				<option ".($varos_kiv[$i-1]==6 ? 'selected' : '').">6</option>
													 				<option ".($varos_kiv[$i-1]==10 ? 'selected' : '').">10</option>
																</select>
															</th>";
											}
										?>
									</tr>
							 </thead>
							 <tbody id="pinpar">
									<?php
										 for($y=1;$y<=count($pinpar[0]);$y++){
												echo
												"<tr class=\"partr\" id=".$y.">
													 <td class='parrow'>".$y."</td>
													 <td><center><input class=\"form-control\" type='number' data-order='1' name='par_kiv1[]' value='".$pinpar[0][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='2' name='par_kiv2[]' value='".$pinpar[1][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='3' name='par_kiv3[]' value='".$pinpar[2][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='4' name='par_kiv4[]' value='".$pinpar[3][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='5' name='par_kiv5[]' value='".$pinpar[4][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='6' name='par_kiv6[]' value='".$pinpar[5][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='7' name='par_kiv7[]' value='".$pinpar[6][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='8' name='par_kiv8[]' value='".$pinpar[7][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='9' name='par_kiv9[]' value='".$pinpar[8][$y-1]."' /></center></td>
													 <td><center><input class=\"form-control\" type='number' data-order='10' name='par_kiv10[]' value='".$pinpar[9][$y-1]."' /></center></td>
												</tr>";
										 }
									?>
									<tfoot>
										<tr>
											<td>sum</td>
											<td id="athr1"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[0]; ?>"/></center></td>
											<td id="athr2"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[1]; ?>"/></center></td>
											<td id="athr3"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[2]; ?>"/></center></td>
											<td id="athr4"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[3]; ?>"/></center></td>
											<td id="athr5"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[4]; ?>"/></center></td>
											<td id="athr6"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[5]; ?>"/></center></td>
											<td id="athr7"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[6]; ?>"/></center></td>
											<td id="athr8"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[7]; ?>"/></center></td>
											<td id="athr9"><center><input class="form-control" name="pinsum[]" type="number"  value="<?php echo $pinsum[8]; ?>"/></center></td>
											<td id="athr10"><center><input class="form-control" name="pinsum[]" type="number" value="<?php echo $pinsum[9]; ?>"/></center></td>
										</tr>
									</tfoot>
							 </tbody>
						</table>
				 </div>
			</div>

			<div class="panel-group">
				<div class="panel panel-info">
					<div class="panel-heading" style="font-weight:600;">
						<div class="row">
							<div class="col-sm-2"></div>
							<?php
								for($i=1;$i<=10;$i++){
									echo "<div class=\"col-sm-1\">".$i."</div>";
								}
							?>
						</div>
					</div>
					<div class="panel-body ">
							<?php
								make_rows("sn_kib","S/N Κιβωτίου", $crow['sn_kib']);
								make_rows("posothta_pagou","Ποσότητα Πάγου %", $crow['posothta_pagou']);
								make_rows("pagos_kg","Ποσότητα Πάγου σε Kg", $crow['pagos_kg']);
								make_rows("therm_kiv","Θερμοκρασία Κιβωτίου", $crow['therm_kiv']);
								make_rows("therm_psariwn","Θερμοκρασία Ψαριού", $crow['therm_psariwn']);
								make_rows("ar_psariwn","Αριθμός Ψαριών", $crow['ar_psariwn']);
								make_rows("varos_kiv","Αναγραφόμενο Βάρος Κιβωτίου", $crow['varos_kiv']);
								make_rows("apobolh_trofhs","Αποβολή Τροφής", $crow['apobolh_trofhs']);
								make_rows("apobolh_genul","Αποβολή Γενετικού Υλικού", $crow['apobolh_genul']);
								make_rows("upomege8h","Υπομεγέθη", $crow['upomege8h']);
								make_rows("upermege8h","Υπερμεγέθη", $crow['upermege8h']);
							?>
					</div>
				</div>
				<div class="panel panel-info">
					<div class="panel-heading" style="font-weight:600;">
						<div class="row">
							<div class="col-sm-2">Αιματώματα</div>
							<?php
								for($i=1;$i<=10;$i++){
									echo "<div class=\"col-sm-1\">".$i."</div>";
								}
							?>
						</div>
					</div>
					<div class="panel-body ematomata">
						<div class="panel panel-default">
							<div class="panel-heading" style="font-weight:600;">Κεφαλή</div>
							<div class="panel-body">
								<?php
									make_rows("kefalh_elafra","Ελαφρά", $kefalh['elafra']);
									make_rows("kefalh_mesaia","Μεσαία", $kefalh['mesaia']);
									make_rows("kefalh_entona","Έντονα", $kefalh['entona']);
								?>
							</div>
						</div>
						<div class="panel panel-default">
							<div class="panel-heading" style="font-weight:600;">Κοιλιά</div>
							<div class="panel-body">
								<?php
									make_rows("koilia_khlides","Κηλίδες", $koilia['khlides']);
									make_rows("koilia_stikta","Στικτά", $koilia['stikta']);
									make_rows("koilia_diaxuta","Διάχυτα", $koilia['diaxuta']);
								?>
							</div>
						</div>
						<div class="panel panel-default">
							<div class="panel-heading" style="font-weight:600;">Σώμα</div>
								<div class="panel-body">
									<?php
										make_rows("swma_khlides","Κηλίδες", $swma['khlides']);
										make_rows("swma_stikta","Στικτά", $swma['stikta']);
										make_rows("swma_diaxuta","Διάχυτα", $swma['diaxuta']);
									?>
								</div>
							</div>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading" style="font-weight:600;">
							<div class="row">
								<div class="col-sm-2">Βράγχια</div>
								<?php
									for($i=1;$i<=10;$i++){
										echo "<div class=\"col-sm-1\">".$i."</div>";
									}
								?>
							</div>
						</div>
						<div class="panel-body vragchia">
							<?php
								make_rows("vragxia_rodina","Ρόδινα", $vragxia['rodina']);
								make_rows("vragxia_faia","Φαιά", $vragxia['faia']);
								make_rows("vragxia_mebn","Μ.Ε.Β.Ν.", $vragxia['mebn']);
								make_rows("vragxia_aimat","Αιματώματα", $vragxia['aimat']);
								make_rows("vragxia_kafe","Καφέ", $vragxia['kafe']);
								make_rows("vragxia_apoxrwm","Αποχρωματισμένα", $vragxia['apoxrwm']);
								make_rows("vragxia_vlenna","Βλέννα", $vragxia['vlenna']);
								make_rows("vragxia_aim_vlenna","Αιματηρή Βλέννα", $vragxia['aim_vlenna']);
							?>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading" style="font-weight:600;">
							<div class="row">
								<div class="col-sm-2">Μάτια</div>
								<?php
									for($i=1;$i<=10;$i++){
										echo "<div class=\"col-sm-1\">".$i."</div>";
									}
								?>
							</div>
						</div>
						<div class="panel-body matia">
							<?php
								make_rows("matia_lampera","Λαμπερά", $matia['lampera']);
								make_rows("matia_thola","Θολά", $matia['thola']);
								make_rows("matia_leuka","Λευκά", $matia['leuka']);
								make_rows("matia_epoulwmena","Επουλωμένα", $matia['epoulwmena']);
								make_rows("matia_tufla","Τυφλά", $matia['tufla']);
								make_rows("matia_aimoragika","Αιμοραγικά", $matia['aimoragika']);
							?>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading" style="font-weight:600;">
							<div class="row">
								<div class="col-sm-2">Δυσμορφίες</div>
								<?php
									for($i=1;$i<=10;$i++){
										echo "<div class=\"col-sm-1\">".$i."</div>";
									}
								?>
							</div>
						</div>
						<div class="panel-body dismorfies">
							<?php
								make_rows("stravo_stoma","Στραβό Στόμα", $dusmorfies['stravo_stoma']);
								make_rows("eksogkoma_katw","Εξόγκωμα κάτω σιαγώνας", $dusmorfies['eksogkoma_katw']);
								make_rows("proekt_katw","Προέκταση κάτω σιαγώνας", $dusmorfies['proekt_katw']);
								make_rows("paramorf_kefali","Παραμορφωμένο κεφάλι", $dusmorfies['paramorf_kefali']);
								make_rows("katheto_kefali","Κάθετο εμπρός κεφάλι", $dusmorfies['katheto_kefali']);
								make_rows("papagalaki","Παπαγαλάκι", $dusmorfies['papagalaki']);
								make_rows("vragxiokaluma","Μόνο Βραγχιοκάλυμμα", $dusmorfies['vragxiokaluma']);
								make_rows("raxitika","Ραχιτικά Βλέννα", $dusmorfies['raxitika']);
								make_rows("lordwsh","Λόρδωση", $dusmorfies['lordwsh']);
								make_rows("kontoxontra","Κοντόχοντρα", $dusmorfies['kontoxontra']);
								make_rows("klish_ouras","Κλίση ουράς", $dusmorfies['klish_ouras']);
							?>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading" style="font-weight:600;">
							<div class="row">
								<div class="col-sm-2">Αλλοιώσεις</div>
								<?php
									for($i=1;$i<=10;$i++){
										echo "<div class=\"col-sm-1\">".$i."</div>";
									}
								?>
							</div>
						</div>
						<div class="panel-body Αlliosis">
							<?php
								make_rows("fagwmenes_oures","Φαγωμένες ουρές/πτερύγια", $alloiwseis['fagwmenes_oures']);
								make_rows("plhges_gdarmena","Πληγές & γδαρμένα", $alloiwseis['plhges_gdarmena']);
							?>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading" style="font-weight:600;">
							<div class="row">
								<div class="col-sm-2">Παράσιτα</div>
								<?php
									for($i=1;$i<=10;$i++){
										echo "<div class=\"col-sm-1\">".$i."</div>";
									}
								?>
							</div>
						</div>
						<div class="panel-body parasita">
							<?php
								make_rows("pseires","Ψείρες", $parasita['pseires']);
								make_rows("lamanthropus","lernanthropus", $parasita['lamanthropus']);
							?>
						</div>
					</div>
				</div>

				<div class="row">
					<table border="1" style="text-align: center;" class="table table-striped table-bordered table-condensed  table-responsive">
						 <tr>
								<th>Κατάσταση Δέρματος</th>
								<th></th>
								<th>Κατάσταση Οφθαλμού</th>
								<th></th>
								<th>Κατάσταση Βραγχίων</th>
								<th></th>
						 </tr>
						 <tr>
								<td>Ζωηρό και ιριδίζον χρώμα χωρίς αποχρωματισμό. <br />Υδαρή και διαυγή επικαλύπτουσα γλοιώδη ουσία.</td>
								<td>Βαθ.<br />4<br /><input type="radio" class="form-control rating" name="katast_dermatos" value="4" <?php echo ($crow['katast_dermatos']==4 ? 'checked' : ''); ?> /></td>
								<td>Κυρτός (bombe). Κερατοειδής διαυγής, <br />κόρη μαύρη και στίλβουσα.</td>
								<td>Βαθ.<br />4<br /><input type="radio" class="form-control rating" name="katast_ofthalmou" value="4" <?php echo ($crow['katast_ofthalmou']==4 ? 'checked' : ''); ?>  /></td>
								<td>Στίλβοντα. Άνευ βλέννας.</td>
								<td>Βαθ.<br />4<br /><input type="radio" class="form-control rating" name="katast_bragxiwn" value="4" <?php echo ($crow['katast_bragxiwn']==4 ? 'checked' : ''); ?>  /></td>
						 </tr>
						 <tr>
								<td>Ζωηρό χρώμα χωρίς λάμψη. <br />Επικαλύπτουσα γλοιώδη ουσία, ελαφρώς θολή.</td>
								<td>Βαθ.<br />3<br /><input type="radio" class="form-control rating" name="katast_dermatos" value="3" <?php echo ($crow['katast_dermatos']==3 ? 'checked' : ''); ?>  /></td>
								<td>Κυρτός ελαφρώς αποκυρτούμενος. <br />Κερατοειδής ελαφρώς αδιαφανής, μαύρη κόρη, θαμπή.</td>
								<td>Βαθ.<br />3<br /><input type="radio" class="form-control rating" name="katast_ofthalmou" value="3" <?php echo ($crow['katast_ofthalmou']==3 ? 'checked' : ''); ?>  /></td>
								<td>Λιγότερο χρωματισμένα. <br />Ελαφρά ίχνη διαυγούς επικαλύπτουσας γλοιώδους ουσίας.</td>
								<td>Βαθ.<br />3<br /><input type="radio" class="form-control rating" name="katast_bragxiwn" value="3" <?php echo ($crow['katast_bragxiwn']==3 ? 'checked' : ''); ?>  /></td>
						 </tr>
						 <tr>
								<td>Αποχρωματισμένο & θαμπό με<br />θολή γλοιώδης ουσία.</td>
								<td>Βαθ.<br />2<br /><input type="radio" class="form-control rating" name="katast_dermatos" value="2" <?php echo ($crow['katast_dermatos']==2 ? 'checked' : ''); ?>  /></td>
								<td>Επίπεδος, αδιαφανής, κόρη διαφανής.</td>
								<td>Βαθ.<br />2<br /><input type="radio" class="form-control rating" name="katast_ofthalmou" value="2" <?php echo ($crow['katast_ofthalmou']==2 ? 'checked' : ''); ?>  /></td>
								<td>Αποχρωματισμένα με ελαφρώς θολή<br />γλοιώδης ουσία.</td>
								<td>Βαθ.<br />2<br /><input type="radio" class="form-control rating" name="katast_bragxiwn" value="2" <?php echo ($crow['katast_bragxiwn']==2 ? 'checked' : ''); ?>  /></td>
						 </tr>
						 <tr>
								<td>Χρώμα θαμπό. Αδιαφανή επιλύπτουσα γλοιώδη ουσία.</td>
								<td>Βαθ.<br />1<br /><input type="radio" class="form-control rating" name="katast_dermatos" value="1" <?php echo ($crow['katast_dermatos']==1 ? 'checked' : ''); ?>  /></td>
								<td>Κοίλος εις το μέσον. <br />Κερατοειδής γαλακτόχρους, κόρη γκρίζα.</td>
								<td>Βαθ.<br />1<br /><input type="radio" class="form-control rating" name="katast_ofthalmou" value="1" <?php echo ($crow['katast_ofthalmou']==1 ? 'checked' : ''); ?>  /></td>
								<td>Κιτρινωπά. <br />Γαλακτόχροα επικαλύπτουσα γλοιώδη ουσία.</td>
								<td>Βαθ.<br />1<br /><input type="radio" class="form-control rating" name="katast_bragxiwn" value="1" <?php echo ($crow['katast_bragxiwn']==1 ? 'checked' : ''); ?>  /></td>
						 </tr>
					</table>
				</div>

				<div class="row">
					<table border="1" id="rate_tbl" class="table table-bordered table-condensed  table-responsive">
						 <tr>
								<th>Βαθμοί</th>
								<th>Χαρακτηρισμός</th>
						 </tr>
						 <tr class="ratings">
								<td>10 - 12</td>
								<td>EXTRA</td>
						 </tr>
						 <tr class="ratings">
								<td>7 - 9</td>
								<td>A</td>
						 </tr>
						 <tr class="ratings">
								<td>4 - 6</td>
								<td>B</td>
						 </tr>
						 <tr class="ratings">
								<td>4</td>
								<td>Απορριπτέο</td>
						 </tr>
					</table>
				</div>

				<div class="row">
					<center><b>Γενικά</b></center>
					<table border="1" class="table table-striped table-bordered table-condensed  table-responsive">
						 <tr>
								<th>Κατάσταση Σάρκας</th>
								<th></th>
								<th>Χρώμα</th>
								<th></th>
								<th>Απολέπιση</th>
								<th></th>
								<th>Αιματώματα</th>
								<th></th>
								<th>Κοιλιά</th>
						 </tr>
						 <tr>
								<td>Λεία & Υγρή <input class="form-control" type="radio" name="stat_sarkas" value="Λεία & Υγρή" <?php echo ($crow['stat_sarkas']=='Λεία & Υγρή' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Ιριδίζον <input class="form-control" type="radio" name="stat_xrwma" value="Ιριδίζον" <?php echo ($crow['stat_xrwma']=='Ιριδίζον' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Ελαφρή <input class="form-control" type="radio" name="stat_apolepish" value="Ελαφρή" <?php echo ($crow['stat_apolepish']=='Ελαφρή' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Κεφαλή <input class="form-control" type="radio" name="stat_aimatwmata" value="Κεφαλή" <?php echo ($crow['stat_aimatwmata']=='Κεφαλή' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Κυλινδρική <input class="form-control" type="radio" name="stat_koilia" value="Κυλινδρική" <?php echo ($crow['stat_koilia']=='Κυλινδρική' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Κέρινη <input class="form-control" type="radio" name="stat_sarkas" value="Κέρινη" <?php echo ($crow['stat_sarkas']=='Κέρινη' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Ζωηρό <input class="form-control" type="radio" name="stat_xrwma" value="Ζωηρό"<?php echo ($crow['stat_xrwma']=='Ζωηρό' ? 'checked' : ''); ?> /></td>
								<td></td>
								<td>Μεσαία <input class="form-control" type="radio" name="stat_apolepish" value="Μεσαία" <?php echo ($crow['stat_apolepish']=='Μεσαία' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Σώμα <input class="form-control" type="radio" name="stat_aimatwmata" value="Σώμα" <?php echo ($crow['stat_aimatwmata']=='Σώμα' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Διογκωμένη <input class="form-control" type="radio" name="stat_koilia" value="Διογκωμένη" <?php echo ($crow['stat_koilia']=='Διογκωμένη' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Στεγνή <input class="form-control" type="radio" name="stat_sarkas" value="Στεγνή" <?php echo ($crow['stat_sarkas']=='Στεγνή' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Θαμπό <input class="form-control" type="radio" name="stat_xrwma" value="Θαμπό" <?php echo ($crow['stat_xrwma']=='Θαμπό' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Έντονη <input class="form-control" type="radio" name="stat_apolepish" value="Έντονη" <?php echo ($crow['stat_apolepish']=='Έντονη' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Περιοχές <input class="form-control" type="radio" name="stat_aimatwmata" value="Περιοχές" <?php echo ($crow['stat_aimatwmata']=='Περιοχές' ? 'checked' : ''); ?>/></td>
								<td></td>
								<td>Μαλακή <input class="form-control" type="radio" name="stat_koilia" value="Μαλακή" <?php echo ($crow['stat_koilia']=='Μαλακή' ? 'checked' : ''); ?>/></td>
						 </tr>
					</table>
				</div>

				<div class="row">
					<table border="1" class="table table-striped table-bordered table-condensed  table-responsive">
						 <tr>
								<th></th>
								<th>Τυπική</th>
								<th>Προβληματική</th>
								<th>Μη Αποδεκτή</th>
								<th>Διόρθωση</th>
						 </tr>
						 <tr>
								<td>Κουρμπάρισμα</td>
								<td><input class="form-control" type="radio" name="susk_kourmparisma" value="Τυπική" <?php echo ($crow['susk_kourmparisma']=='Τυπική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_kourmparisma" value="Προβληματική" <?php echo ($crow['susk_kourmparisma']=='Προβληματική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_kourmparisma" value="Μη Αποδεκτή" <?php echo ($crow['susk_kourmparisma']=='Μη Αποδεκτή' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_kourmparisma" value="Διόρθωση" <?php echo ($crow['susk_kourmparisma']=='Διόρθωση' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Κατάσταση Φελιζόλ</td>
								<td><input class="form-control" type="radio" name="susk_felizol" value="Τυπική" <?php echo ($crow['susk_felizol']=='Τυπική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_felizol" value="Προβληματική" <?php echo ($crow['susk_felizol']=='Προβληματική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_felizol" value="Μη Αποδεκτή" <?php echo ($crow['susk_felizol']=='Μη Αποδεκτή' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_felizol" value="Διόρθωση" <?php echo ($crow['susk_felizol']=='Διόρθωση' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Κατάσταση Πάγου</td>
								<td><input class="form-control" type="radio" name="susk_pagos" value="Τυπική" <?php echo ($crow['susk_pagos']=='Τυπική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_pagos" value="Προβληματική" <?php echo ($crow['susk_pagos']=='Προβληματική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_pagos" value="Μη Αποδεκτή" <?php echo ($crow['susk_pagos']=='Μη Αποδεκτή' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_pagos" value="Διόρθωση" <?php echo ($crow['susk_pagos']=='Διόρθωση' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Κατάσταση Παλέτας</td>
								<td><input class="form-control" type="radio" name="susk_paleta" value="Τυπική" <?php echo ($crow['susk_paleta']=='Τυπική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_paleta" value="Προβληματική"<?php echo ($crow['susk_paleta']=='Προβληματική' ? 'checked' : ''); ?> /></td>
								<td><input class="form-control" type="radio" name="susk_paleta" value="Μη Αποδεκτή" <?php echo ($crow['susk_paleta']=='Μη Αποδεκτή' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_paleta" value="Διόρθωση" <?php echo ($crow['susk_paleta']=='Διόρθωση' ? 'checked' : ''); ?>/></td>
						 </tr>
						 <tr>
								<td>Κατάσταση Σήμανσης</td>
								<td><input class="form-control" type="radio" name="susk_shmansh" value="Τυπική" <?php echo ($crow['susk_shmansh']=='Τυπική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_shmansh" value="Προβληματική" <?php echo ($crow['susk_shmansh']=='Προβληματική' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_shmansh" value="Μη Αποδεκτή" <?php echo ($crow['susk_shmansh']=='Μη Αποδεκτή' ? 'checked' : ''); ?>/></td>
								<td><input class="form-control" type="radio" name="susk_shmansh" value="Διόρθωση" <?php echo ($crow['susk_shmansh']=='Διόρθωση' ? 'checked' : ''); ?>/></td>
						 </tr>
					</table>

				</div>
				<div class="row">
					<div class="panel panel-default">
						 <div class="panel-body">
								<div class="row">
									 <div class="col-sm-6 col-sm-offset-3" style="text-align:center;">
											<div class="checkbox">
												 <label><input type="checkbox" value="1" name="apodekth" <?php echo ($crow['apodekth']==1 ? 'checked' : ''); ?>>Η παρτίδα είναι αποδεκτή</label>
											</div>
									 </div>
								</div>
						 </div>
					</div>
				</div>
				<div class="row">
					<div class="panel panel-default">
						<div class="panel-heading">Φωτογραφίες</div>
						<div class="panel-body" id="pics">
							<div class="row" style="<?php echo (!isset($_GET['type']) || $_GET['type']!='edit') ? 'display:none;' : ''; ?>">
								<div class="col-sm-6 col-sm-offset-3" style="text-align:center;">
									<div id="filelist">Your browser doesn't have Flash, Silverlight or HTML5 support.</div>
									<div id="console"></div>
									<div id="upcontainer">
										<a id="pickfiles" href="javascript:;" class="btn btn-default">Select files</a>
										<a id="uploadfiles" href="javascript:;" class="btn btn-default">Upload files</a>
									</div>
									<input type="hidden" name="picture" id="picinp" value='<?php echo $crow['picture']; ?>' /><input type="hidden" id="freskothta" name="freskothta" value="" />
								</div>
							</div>
							<div class="row" style="margin-top:1rem;">
								<?php
								if(sizeof($pics)>0){
									$ii=1;
									foreach($pics as $pic){
										try{
											$resize = new ResizeImage('uploads/images/'.$pic);
											$resize->resizeTo(300, 300, 'maxHeight');
											$resize->saveImage('uploads/images/temp/'.$pic);
											echo "<div class='pic col-sm-4' data-name='".$pic."'><center>
											<div class='row' style='margin-bottom:1rem;margin-top:1rem;".((!isset($_GET['type']) || $_GET['type']!='edit') ? 'display:none;' : '')."'>
												<div class='col-sm-12'>
													<button class='btn btn-danger' onclick=\"delphoto('".$pic."');\">Διαγραφή <i class='glyphicon glyphicon-remove' style=\"font-size:1rem;\"></i></button>
												</div>
											</div>
											<div class='row'>
												<div class='col-sm-12'>
													<img class='img-responsive' height=\"300\" onclick=\"zoom('".$pic."');\" src=\"uploads/images/temp/".$pic."\" />
												</div>
											</div>
										</center></div>";

								} catch (Exception $e) {
								 // echo 'Caught exception: ',  $e->getMessage(), "\n";
								}

								 if($ii%3==0){
									 echo "</div><div class='row'>";
								 }
								 $ii++;
								}
								}
								?>
							</div>
						</div>
					</div>
				</div>
<div class="row" style="margin-top:1rem;margin-bottom:2.5rem;text-align:center;">
	 <p><b>ΠΑΡΑΤΗΡΗΣΕΙΣ: Οι θερμογράφοι να είναι σε ετοιμότητα 24ωρης εγγραφής!!! <br />Σύντομη Περιγραφή του Δείγματος</b></p>
	 <textarea class="form-control" name="parathrhseis" style="height:200px;width:400px;margin-left: auto;margin-right: auto;text-align: justify;-moz-text-align-last: center;text-align-last: center;"><?php echo $crow['parathrhseis']; ?></textarea>
	 <br />
<?php
	if(isset($_GET['type']) && $_GET['type']=='edit'){
?>
 <input class="btn btn-default" type="submit" name="submit" value="Αποθήκευση Αλλαγών" onClick="control2db('update',<?php echo $_GET['cID']; ?>);" style="height:70px;width:200px;margin-left: auto;margin-right: auto;" id="form-submit" />

<?php
}
?>
    </div>
</div>
</body>
<footer>
	<div class="row">
		<div class="col-sm-6 col-sm-offset-3" style="text-align:center;">
			<h3 class="h3"><b><u>Selonda Group - Δ09Ε09 ΕΝΤΥΠΟ ΕΛΕΓΧΟΥ ΠΑΡΑΛΑΜΒΑΝΟΜΕΝΩΝ ΝΩΠΩΝ ΜΑΝΔΡΑ v03 d20090101</u></b></h3>
		</div>
	</div>
</footer>
<?php require 'footer.php';
