<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
?>
<?php
include "connection.php";
include('assets/inc/config.php');

		if(isset($_POST['submit']))
		{
		   $servicename = $_POST['servicename'];
			$area1 = $_POST['area1'];
			$area2 = $_POST['area2'];
			$area3 = $_POST['area3'];
			$area4 = $_POST['area4'];
			$area5 = $_POST['area5'];
			$area6 = $_POST['area6'];
			$area7 = $_POST['area7'];
			$area8 = $_POST['area8'];
			$area9 = $_POST['area9'];
			$area10 = $_POST['area10'];
			$area11 = $_POST['area11'];
			$area12 = $_POST['area12'];
			$area13 = $_POST['area13'];
			$area14 = $_POST['area14'];
			$area15 = $_POST['area15'];
			$area16 = $_POST['area16'];
			$area17 = $_POST['area17'];
			$area18 = $_POST['area18'];
			$area19 = $_POST['area19'];
			$area20 = $_POST['area20'];
			$area21 = $_POST['area21'];
			$area22 = $_POST['area22'];
			$area23 = $_POST['area23'];
			$area24 = $_POST['area24'];
			$area25 = $_POST['area25'];
			$area26 = $_POST['area26'];
			$area27 = $_POST['area27'];
			$area28 = $_POST['area28'];
			$area29 = $_POST['area29'];
			$area30 = $_POST['area30'];
			$area31 = $_POST['area31'];
			$area32 = $_POST['area32'];
			$area33 = $_POST['area33'];
			$area34 = $_POST['area34'];
			$area35 = $_POST['area35'];
			$area36 = $_POST['area36'];
			$area37 = $_POST['area37'];
            $area38 = $_POST['area38'];
            $area39 = $_POST['area39'];
            $area40 = $_POST['area40'];
            $area41 = $_POST['area41'];
            $area42 = $_POST['area42'];
            $area43 = $_POST['area43'];
            $area44 = $_POST['area44'];
            $area45 = $_POST['area45'];
            $area46 = $_POST['area46'];
            $area47 = $_POST['area47'];
            $area48 = $_POST['area48'];
            $area49 = $_POST['area49'];
            $area50 = $_POST['area50'];
            $area51 = $_POST['area51'];
            //sql to insert captured values
    $update="UPDATE `nhis_reg` SET `history`='$area1', `history1`='$area2', `history2`='$area3', `history3`='$area4', `history4`='$area5', `history5`='$area6', `history6`='$area7', `history7`='$area8', `history8`='$area9', `history9`='$area10', `history10`='$area11', `history11`='$area12', `history12`='$area13', `history13`='$area14', `history14`='$area15', `history15`='$area16', `history16`='$area17', `history17`='$area18', `history18`='$area19', `history19`='$area20', `history20`='$area21', `history21`='$area22', `history22`='$area23', `history23`='$area24', `history24`='$area25', `history25`='$area26', `history26`='$area27', `history27`='$area28', `history28`='$area29', `history29`='$area30', `history30`='$area31', `history31`='$area32', `history32`='$area33', `history33`='$area34', `history34`='$area35', `history35`='$area36', `history36`='$area37', `history37`='$area38', `history38`='$area39', `history39`='$area40', `history40`='$area41', `history41`='$area42', `history42`='$area43', `history43`='$area44', `history44`='$area45', `history45`='$area46', `history46`='$area47', `history47`='$area48', `history48`='$area49', `history49`='$area50', `history50`='$area51' WHERE receiptno = '".$servicename."'";
 $run = mysqli_query($mysqli,$update);
 if(mysqli_query($mysqli,$update)){
  echo"<script typetext/javascript> alert('success');

  </script>"; 
              }
			
		}
 ?>
<section class="chat-area">
<div class="container" style="padding: 5px;">

<div style="display: flex; flex-direction: column; align-items: center;" class="row">

  <?php
 $service=$_GET['patient_no'];
  $query = mysqli_query($mysqli,"SELECT * FROM nhis_reg WHERE phoneno ='".$service."'");
  if($row = mysqli_fetch_array($query)) 
{
  foreach($query as $row)
  {
?><div style="display: flex; flex direction: row;">
      <form style="padding-left: 10px;" action="" method="post">
    <div style="display: flex; flex direction: row;" class="row">
      <div class="col-md-8">
        <input type="hidden" name="new" value="1" />
		<input style="" type="text" name="fname" readonly value="<?php echo $row['fname'];?>" class=""  >
				<input style="" type="text" name="lname" readonly value="<?php echo $row['lname'];?>" class=""  >
        <input style="" type="text" name="dept" value="<?php echo $row['age'];?>" readonly class=""  >
        <input style="" type="text" name="servicename" value="<?php echo $row['receiptno'];?>" class="" >
        
        
        
        <textarea name="area1" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history'];?></textarea>
        
        <textarea name="area2" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history1'];?></textarea>
        
                <textarea name="area3" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history2'];?></textarea>
                
                <textarea name="area4" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history3'];?></textarea>
                
                <textarea name="area5" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history4'];?></textarea>
                
                <textarea name="area6" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history5'];?></textarea>
                
                <textarea name="area7" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history6'];?></textarea>
                
                <textarea name="area8" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history7'];?></textarea>
                
                <textarea name="area9" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history8'];?></textarea>
                
                <textarea name="area10" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history9'];?></textarea>
                
                <textarea name="area11" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history10'];?></textarea>
                
                
        <textarea name="area12" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history11'];?></textarea>
        
                <textarea name="area13" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history12'];?></textarea>
                
                <textarea name="area14" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history13'];?></textarea>
                
                <textarea name="area15" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history14'];?></textarea>
                
                <textarea name="area16" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history15'];?></textarea>
                
                <textarea name="area17" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history16'];?></textarea>
                
                <textarea name="area18" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history17'];?></textarea>
                
                <textarea name="area19" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history18'];?></textarea>
                
                <textarea name="area20" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history19'];?></textarea>
                
                <textarea name="area21" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history20'];?></textarea>



        <textarea name="area22" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history21'];?></textarea>
        
                <textarea name="area23" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history22'];?></textarea>
                
                <textarea name="area24" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history23'];?></textarea>
                
                <textarea name="area25" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history24'];?></textarea>
                
                <textarea name="area26" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history25'];?></textarea>
                
                <textarea name="area27" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history26'];?></textarea>
                
                <textarea name="area28" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history27'];?></textarea>
                
                <textarea name="area29" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history28'];?></textarea>
                
                <textarea name="area30" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history29'];?></textarea>
                
                <textarea name="area31" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history30'];?></textarea>
                
                
                
             <textarea name="area32" style="width:100%; max-width:100%; height:30%;" rows="5" cols="4"><?php echo $row['history31'];?></textarea>
        
                <textarea name="area33" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history32'];?></textarea>
                
                <textarea name="area34" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history33'];?></textarea>
                
                <textarea name="area35" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history34'];?></textarea>
                
                <textarea name="area36" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history35'];?></textarea>
                
                <textarea name="area37" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history36'];?></textarea>
                
                <textarea name="area38" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history37'];?></textarea>
                
                <textarea name="area39" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history38'];?></textarea>
                
                <textarea name="area40" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history39'];?></textarea>
                
                <textarea name="area41" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history40'];?></textarea>
                
            
                <textarea name="area42" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history41'];?></textarea>
        
                <textarea name="area43" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history42'];?></textarea>
                
                <textarea name="area44" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history43'];?></textarea>
                
                <textarea name="area45" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history44'];?></textarea>
                
                <textarea name="area46" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history45'];?></textarea>
                
                <textarea name="area47" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history46'];?></textarea>
                
                <textarea name="area48" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history47'];?></textarea>
                
                <textarea name="area49" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history48'];?></textarea>
                
                <textarea name="area50" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history49'];?></textarea>
                
                <textarea name="area51" style="width:100%; max-width:100%; height:10%;" rows="5" cols="4"><?php echo $row['history50'];?></textarea>
                
                
                <div>
                    <input type="submit" name="submit" value="Update">
                </div>
      </div>
      <div class="col-md-4">

      </div>
    </div>
  </form>
  </div>
  <?php
  }
}


?>
</div>
     




</div>
</section>