<?php
    session_start();
    include "../../../db.php";
    date_default_timezone_set('Asia/Kolkata');
    $currentTime = date('jS  F Y');

    if ( !isset($_SESSION['uid']) && !isset($_SESSION['uref']) && !isset($_SESSION['utype']) )
        header("Location: index.php");

    $fetch_file = mysqli_query($con, "SELECT users_id FROM dataregistration ORDER BY users_id DESC");

    // echo "<pre>";print_r($fetch_file);exit();
    // $count = myqsli_num_rows($fetch_file);
    // $count = 1;

    // if ( $count == 0 ) {
    //     $bref = 1;
    // } else {
        $row = mysqli_fetch_assoc($fetch_file);

        
    // }
    

    // $bref = mt_rand()."_".time();
?>
<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Write a Blog</title>

    <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> -->
    <link href="css/sb-admin-2.min.css" rel="stylesheet">
    <link href="css/all.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="vendor/croppie/croppie.css" />


    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.easing.min.js"></script>
    <script src="js/sb-admin-2.min.js"></script>
    <script src="vendor/croppie/croppie.js"></script>
    <script src="js/custom.js"></script>

    <script src="vendor/ckeditor.js"></script>

    <style>
        .custom-file-label::after {
            height: 8.25rem;
            padding-top: 50px;
        }
        .custom-file-label-edit::after{
            height: 2.25rem;
            padding-top: 5px;
        }
        #uploadimageModal .modal-dialog{
            max-width: 100% !important;
        }
    </style>
</head>

<body>
    <?php// include "includes/topbar.php"; ?>
	
	
	<!-- section -->
    <div class="sec tion margin-top_50" style="padding-top:80px;">
        <div class="container">
            	<div class="container">
			<div class="row"> 
			
	<?php
                    if ( isset($_GET["edit_id"]) ) {

                       
						$edit_sql = "SELECT * FROM intranjob AS b INNER JOIN users  AS c ON b.branch = c.uid WHERE id = '$_GET[edit_id]'";
                      
                        $edit_run = mysqli_query($con, $edit_sql);
                        $edit_row = mysqli_fetch_assoc($edit_run);
                        ?>
			
						<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; background-color: #003366
; border: 2px solid #4d4d4d;
  border-radius: 5px;"  >
  <form id="form" name="form" method="post" action="" autocomplete="off" onSubmit="return validate()" enctype="multipart/form-data">
					
					<font color="white" size="4">Payment Details:</font>
					</div>
						<div class="col-md-3">
					
					<h3><small style="font-weight:bold;color:#000;">Payment Date </small></h3>
						<input type="text" class="form-control" id="paydate" name="paydate" value="<?php echo $edit_row['paydate'];?>"  />
					</div>
			<div class="col-md-3">
					
					<h3><small style="font-weight:bold;color:#000;">Amount </small></h3>
						<input type="text" class="form-control" id="payamount" name="payamount" value="<?php echo $edit_row['payamount'];?>"  />
					</div>
					<div class="col-md-3">
					<h3><small style="font-weight:bold;color:#000;"> Paumet Method </small></h3>
					
						<select  class="form-control" id="paymethod" name="paymethod">
						<option value="<?php echo $edit_row["paymethod"]; ?>" > Previous Status : <?php echo $edit_row["paymethod"]; ?> </option>
                            
							         	<option  value="Cash"> Cash </option>
							<option  value="Online ">Online </option>
							</select>	</div>
					
					<div class="col-md-3">
					<h3><small style="font-weight:bold;color:#000;">Transaction/Receipt id</small></h3>
						<input type="text" class="form-control" id="payid" name="payid" value="<?php echo $edit_row['payid'];?>"  />
					</div>
		
		
		<div class="col-md-4">
					
				
						<input type="hidden"class="form-control" id="paydate" name="insname" value="<?php echo $edit_row['uname'];?>"  />
					</div>
					<div class="col-md-4">
					
					
						<input type="hidden" class="form-control" id="paydate" name="iaddress1" value="<?php echo $edit_row['uaddress1'];?>"  />
					</div>
					<div class="col-md-4">
					
				
						<input type="hidden" class="form-control" id="iaddress2" name="iaddress2" value="<?php echo $edit_row['uaddress2'];?>"  />
					</div>
					
		<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; backg round-color: #003366
; bor er: 2px solid #4d4d4d;
  border-radius: 5px;"  >
					<font color="white" size="4"></font>
					</div>
				<div class="col-md-6">
				
					
 	
					<h3><small style="font-weight:bold;color:#000;">Aplying for *</small></h3>
					<div cl ass="text-center bg-danger custom-select">
						<select  class="form-control" id="dept" name="dept">
							<option value="<?php echo $edit_row["dept"]; ?>" > Previous Status : <?php echo $edit_row["dept"]; ?> </option>
                                     	<option  value="B.Sc in Hotel Manahement."> B.Sc in Hotel Manahement </option>
							<option  value="Advance Diploma in Hotel Manahement ">Advance Diploma in Hotel Manahement </option>
							<option  value=" Diploma in Hotel Management "> Diploma in Hotel Management </option>
							<option  value=" Certificate Courses in Hotel Management "> Certificate Courses in Hotel Management </option>
						</select>
					</div>
					
					<br/>
					</div>
				
					<div class="col-md-6">
					<h3><small style="font-weight:bold;color:#000;"> Branch </small></h3>
						<select class="form-control"  >
							<option  > Previous Status : <?php echo $edit_row["uname"]; ?> </option>
                           
							
						</select>
					</div>
						<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; background-color: #003366
; border: 2px solid #4d4d4d;
  border-radius: 5px;"  >
					<font color="white" size="4">Personal Details:</font>
					</div>
					<div class="col-md-12"></div>
					<hr/>
					<div class="col-md-4">
					
			Student Name 
						<input type="text" class="form-control" id="fname" name="fname" value="<?php echo $edit_row['fname'];?>"  />
					</div>
					<div class="col-md-4">
				Guardian Name
						<input type="text" class="form-control" id="mdname" name="mdname" value="<?php echo $edit_row['mdname'];?>"  />
					</div>
					
					<div class="col-md-4">
					Mother Name
						<input type="text" class="form-control" id="lname" name="lname" value="<?php echo $edit_row['lname'];?>"  />
					</div>
					
					<div class="col-md-6">
				Email Id *
						<input type="text" class="form-control" id="email" name="email"value="<?php echo $edit_row['email'];?>"  />
					</div>
					
					
					
					
					<div class="col-md-6">
					Mobile No *
						<input type="text" class="form-control" id="mobileno" name="mobileno" value="<?php echo $edit_row['mobileno'];?>" maxlength="10" />
					</div>
					
				
					<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; background-color: #003366
; border: 2px solid #4d4d4d;
  border-radius: 5px;"  >
					<font color="white" size="4">Academy Details:</font>
					</div>
				<div class="col-md-12">
						<h3><small style="font-weight:bold;color:#000;">10/Madhyamik </small></h3>
				</div>
					<div class="col-md-3">	 Institute Name							
						<input type="text" class="form-control" id="iname1" name="iname1" value="<?php echo $edit_row['iname1'];?>"  />				
					</div>
					<div class="col-md-3">	Marks %							
						<input type="text" class="form-control" id="marks1" name="marks1" value="<?php echo $edit_row['marks1'];?>"  />				
					</div>					
					<div class="col-md-3">Board/university					
						<input type="text" class="form-control" id="board1" name="board1" value="<?php echo $edit_row['board1'];?>"  />
					</div>					
					<div class="col-md-3">	
year					
						<input type="text" class="form-control" id="pyear1" name="pyear1" value="<?php echo $edit_row['pyear1'];?>"  />
					</div>
					
					
				<div class="col-md-12">
						<h3><small style="font-weight:bold;color:#000;">10+2/H.S </small></h3>
				</div>
					<div class="col-md-3">Institute Name								
						<input type="text" class="form-control" id="iname2" name="iname2" value="<?php echo $edit_row['iname2'];?>"  />				
					</div>
					<div class="col-md-3">		Marks 						
						<input type="text" class="form-control" id="marks2" name="marks2" value="<?php echo $edit_row['marks2'];?>"  />				
					</div>					
					<div class="col-md-3">	Board/University				
						<input type="text" class="form-control" id="board2" name="board2" value="<?php echo $edit_row['board2'];?>"  />
					</div>					
					<div class="col-md-3">	
Year					
						<input type="text" class="form-control" id="pyear2" name="pyear2" value="<?php echo $edit_row['pyear2'];?>"  />
					</div>


					
					
					<br/>
					<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; background-color: #003366
; border: 2px solid #4d4d4d;
  border-radius: 5px;"  >
					<font color="white" size="4">Address Details:</font>
					</div>
					
					<div class="col-md-12"></div>
					<div class="col-md-12">
					<h3><small style="font-weight:bold;color:#000;"></small></h3>
					
					</div>
					<div class="col-md-4">
address line 1
						<input type="text" class="form-control" id="address1" name="address1" value="<?php echo $edit_row['address1'];?>"  />
					</div>
					<div class="col-md-4">
				address line2
						<input type="text" class="form-control" id="address2" name="address2" value="<?php echo $edit_row['address2'];?>" />
					</div>
					<div class="col-md-4">
	address line3
						<input type="text" class="form-control" id="address3" name="address3" value="<?php echo $edit_row['address3'];?>"  />
					</div>
					<br/>
					<br/>
					
					<div class="col-md-4">State
		
						<input type="text" class="form-control" id="state" name="state" value="<?php echo $edit_row['state'];?>"  />
					</div>
					<div class="col-md-4">
	city
						<input type="text" class="form-control" id="city" name="city" value="<?php echo $edit_row['city'];?>" />
					</div>
					<div class="col-md-4">
	pin
						<input type="text" class="form-control" id="pin" name="pin" value="<?php echo $edit_row['pin'];?>"  />
					</div>
					
		

					
					<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; background-color: #003366
; border: 2px solid #4d4d4d;
  border-radius: 5px;"  >
					<font color="white" size="4">Document Upload: &nbsp;&nbsp;&nbsp;   &nbsp; <font color="white"size="">Max 200kb  </font></font>
					</div>
					
				  <div class="col-md-4">
				Student Photo
						<input id="filephoto" type="file" name="filephoto" /><br />
						 
					</div>
					<div class="col-md-4">
				Student Signature
						<input id="filephoto9" type="file" name="filephoto9" /><br />
						
					</div>
					<div class="col-md-4">
				Adhar Card 
						<input id="filephoto2" type="file" name="filephoto2" /><br />
						 
					</div>
						<div class="col-md-12" style="padding:10px 0px 10px 30px; margin 5px 0px 5px 0px; ;
  border-radius: 5px;"  >
					
					</div>
					<div class="col-md-4">
				Madhyamik Admit Card
						<input id="filephoto3" type="file" name="filephoto3" /><br />
						
					</div>
					
					
					<div class="col-md-4" >
				Madhyamik Result
						<input id="filephoto4" type="file" name="filephoto4" /><br />
						 
					</div>
					
					
				
					<div class="col-md-4">
				Madhyamik Certificate
						<input id="filephoto5" type="file" name="filephoto5" /><br />
						
					</div>
						<div class="col-md-12" style="padding:10px 0px 10px 30px; margin 5px 0px 5px 0px; ;
  border-radius: 5px;"  >
					
					</div>
					<div class="col-md-4">
				H.S. Result
						<input id="filephoto6" type="file" name="filephoto6" /><br />
						
					</div>
					
					
					<div class="col-md-4">
				H.S. Certificate
						<input id="filephoto7" type="file" name="filephoto7" /><br />
						
					</div>
					<div class="col-md-4">
				School leaving Certificate
						<input id="filephoto8" type="file" name="filephoto8" /><br />
						
					</div>
				

					
					<div class="col-md-12" style="padding:10px 0px 10px 30px; margin:10px 0px 10px 0px; ;
  border-radius: 5px;"  >
					
					</div>
					
					<div class="col-md-6">
						<input type="submit" name="update_blog" id="update_blog" class="btn btn-success btn-block" />
					</div>
					<div class="col-md-6">
						<input type="Reset" class="btn btn-warning btn-block" value="Reset"/>
					</div>
					
					</form>
					 
                        <?php
                    }
                ?>
				</div>
			</div>
		</div>
		
        
				
                  
                </div>

				<div class="col-md-12">.</div><div class="col-md-12">.</div>
    
	<!-- end section -->

		
		<?php
		
	    if(isset($_POST['update_blog'])){
        $fname = mysqli_real_escape_string($con, strip_tags($_POST['fname']));
        $mdname = mysqli_real_escape_string($con, strip_tags($_POST['mdname']));
		 $lname= mysqli_real_escape_string($con, strip_tags($_POST['lname']));

	  $dept= mysqli_real_escape_string($con, strip_tags($_POST['dept']));
		   $email = mysqli_real_escape_string($con, strip_tags($_POST['email']));
		   $mobileno = mysqli_real_escape_string($con, strip_tags($_POST['mobileno']));
		   	   $iname1= mysqli_real_escape_string($con, strip_tags($_POST['iname1']));
		   $marks1 = mysqli_real_escape_string($con, strip_tags($_POST['marks1']));
		   $board1= mysqli_real_escape_string($con, strip_tags($_POST['board1']));
		   $pyear1 = mysqli_real_escape_string($con, strip_tags($_POST['pyear1']));
		   $iname2 = mysqli_real_escape_string($con, strip_tags($_POST['iname2']));
		   $marks2 = mysqli_real_escape_string($con, strip_tags($_POST['marks2']));
		   $board2 = mysqli_real_escape_string($con, strip_tags($_POST['board2']));
		   $pyear2 = mysqli_real_escape_string($con, strip_tags($_POST['pyear2']));
		   $address1 = mysqli_real_escape_string($con, strip_tags($_POST['address1']));
		      $address2 = mysqli_real_escape_string($con, strip_tags($_POST['address2']));
		      $address3 = mysqli_real_escape_string($con, strip_tags($_POST['address3']));
		      $state = mysqli_real_escape_string($con, strip_tags($_POST['state']));
		      $city = mysqli_real_escape_string($con, strip_tags($_POST['city']));
		      $pin = mysqli_real_escape_string($con, strip_tags($_POST['pin']));
		  
		      $insname = mysqli_real_escape_string($con, strip_tags($_POST['insname']));
		      $iaddress1 = mysqli_real_escape_string($con, strip_tags($_POST['iaddress1']));
		      $iaddress2 = mysqli_real_escape_string($con, strip_tags($_POST['iaddress2']));
			  
			   $paydate = mysqli_real_escape_string($con, strip_tags($_POST['paydate']));
		      $payamount = mysqli_real_escape_string($con, strip_tags($_POST['payamount']));
		      $paymethod = mysqli_real_escape_string($con, strip_tags($_POST['paymethod']));
		      $payid= mysqli_real_escape_string($con, strip_tags($_POST['payid']));
				      $insname = mysqli_real_escape_string($con, strip_tags($_POST['insname']));
		      $iaddress1 = mysqli_real_escape_string($con, strip_tags($_POST['iaddress1']));
		      $iaddress2 = mysqli_real_escape_string($con, strip_tags($_POST['iaddress2']));

  // Getting file name
       $filename = $_FILES['filephoto']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname = '../upload/photo/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
    
			

// Getting file name
       $filename = $_FILES['filephoto2']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname2 = '../upload/photo2/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname2;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto2']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
    
			


  // Getting file name
       $filename = $_FILES['filephoto3']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname3 = '../upload/photo3/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname3;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto3']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
			
			
			
			  // Getting file name
       $filename = $_FILES['filephoto4']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname4 = '../upload/photo4/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname4;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto4']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
		
		  // Getting file name
       $filename = $_FILES['filephoto5']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname5 = '../upload/photo5/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname5;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto5']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
		
		  // Getting file name
       $filename = $_FILES['filephoto6']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname6 = '../upload/photo6/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname6;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto6']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
		
		  // Getting file name
       $filename = $_FILES['filephoto7']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photoname7 = '../upload/photo7/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photoname7;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto7']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
		
		
		
// Getting file name
       $filename = $_FILES['filephoto8']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photonam8 = '../upload/photo8/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photonam8;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto8']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
    
			
			
			
			
			
	 // Getting file name
       $filename = $_FILES['filephoto9']['name'];
         
       // Valid extension
       $valid_ext = array('png','jpeg','jpg');

			
	   $photoExt1 = @end(explode('.', $filename)); // explode the image name to get the extension
	   $phototest1 = strtolower($photoExt1);
			
	   $photonam9 = '../upload/photo9/'.time().'.'.$phototest1;
			
       // Location
       $location = "".$photonam9;

       // file extension
       $file_extension = pathinfo($location, PATHINFO_EXTENSION);
       $file_extension = strtolower($file_extension);

       // Check extension
       if(in_array($file_extension,$valid_ext)){  

            // Compress Image
            compressedImage($_FILES['filephoto9']['tmp_name'],$location,20);
				
		    //Here i am enter the insert code in the step ........

        }
	    else
        {
                echo "File format is not correct.";
        }
    
			
			
 // $ins_sql = "INSERT INTO blog (bby, blog, bcat, bcreated) VALUES ('$_SESSION[uid]', '$blog', '$bcat', '$currentTime')";
            $up_sql = "UPDATE intranjob SET fname = '$fname',
       mdname = '$mdname',
		lname= '$lname',
dept= '$dept',
		  email = '$email',
		  mobileno = '$mobileno',
	  iname1= '$iname1',
		  marks1 = '$marks1',
		  board1= '$board1',
		  pyear1 = '$pyear1',
		  iname2 = '$iname2',
		  marks2 = '$marks2',
		  board2 = '$board2',
		  pyear2 = '$pyear2',
		  
		 
		 address1 = '$address1',
		     address2 = '$address2',
		     address3 = '$address3',
		     state = '$state',
		     city = '$city',
		     pin = '$pin',
		
		     insname = '$insname',
		     iaddress1 = '$iaddress1',
		     iaddress2 = '$iaddress2',
		 
		     paydate = '$paydate',
		     payamount = '$payamount',
		     paymethod = '$paymethod',
		     payid= '$payid',
			   insname = '$insname',
		     iaddress1 = '$iaddress1',
		     iaddress2 = '$iaddress2'
		
			
		 ";

            if(!empty($_FILES["filephoto"]["name"])){
            $up_sql .=", photo='$photoname'";
        }
		
	if(!empty($_FILES["filephoto2"]["name"])){
            $up_sql .=", photo2='$photoname2'";
        }
		
		if(!empty($_FILES["filephoto3"]["name"])){
            $up_sql .=", photo3='$photoname3'";
        }
		
		if(!empty($_FILES["filephoto4"]["name"])){
            $up_sql .=", photo4='$photoname4'";
        }
		
		if(!empty($_FILES["filephoto5"]["name"])){
            $up_sql .=", photo5='$photoname5'";
        }
		
		if(!empty($_FILES["filephoto6"]["name"])){
            $up_sql .=", photo6='$photoname6'";
        }
		
		if(!empty($_FILES["filephoto7"]["name"])){
            $up_sql .=", photo7='$photoname7'";
        }
		
		
		if(!empty($_FILES["filephoto8"]["name"])){
            $up_sql .=", photo8='$photonam8'";
        }
		
		if(!empty($_FILES["filephoto9"]["name"])){
            $up_sql .=", photo9='$photonam9'";
        }

            $up_sql .= " WHERE id = '$_GET[edit_id]'";
            if(mysqli_query($con, $up_sql)){
                ?>
                <script>window.location = 'admission.php';</script>
                <?php
            }
            else{
                ?>
                <script>
                    alert('OOPS !!!!');
                    setTimeout(() => {
                        window.location = 'admissionedit.php';
                    }, 500);
                </script>
                <?php
            
        } 
    }
    
?>
		
		
<?php

// Compress image
    function compressedImage($source, $path, $quality) {

            $info = getimagesize($source);

            if ($info['mime'] == 'image/jpeg') 
                $image = imagecreatefromjpeg($source);

            elseif ($info['mime'] == 'image/gif') 
                $image = imagecreatefromgif($source);

            elseif ($info['mime'] == 'image/png') 
                $image = imagecreatefrompng($source);

            imagejpeg($image, $path, $quality);

    }

?>

</body>

</html>