<?php
session_start();
include "connect.php";



		$camdid = intval($_REQUEST['id']);
		$eve11 = "select * from  res_collegeappmanagement_detail where camdid=$camdid ";
															$re11 = mysqli_query($conn, $eve11);
															while($rt11 = mysqli_fetch_assoc($re11))
															{
																
																$camdid=$rt11['camdid'];
																$collegemid=$rt11['collegemid'];
				$collegeappliacationmid=$rt11['collegeapplicationmid'];
				$eve2= "select collegeappliacationname from res_collegeappliacation_master where collegeappliacationmid=$collegeappliacationmid";
					$re2 = mysqli_query($conn, $eve2);
					 while($row2 = mysqli_fetch_assoc($re2))
					{
						$collegeappliacationname=$row2['collegeappliacationname'];
					}
				$camstartdate=date("d-m-Y",strtotime($rt11['camstartdate']));
				$camdeadline=date("d-m-Y",strtotime($rt11['camdeadline']));
				
				$camdocumentname=$rt11['camdocumentname'];
				$camdocumnet=$rt11['camdocumnet'];
				$camcondition=$rt11['camcondition'];
				$camprocessdetail=$rt11['camprocessdetail'];
				$camdocumnet1 ='';
					
?>

						<!--begin::Row-->
						<input type="hidden" name="camdid" value="<?php echo $camdid; ?>">
						<input type="hidden" name="collegemid" value="<?php echo $collegemid; ?>">
																		<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													
																
																<h2><?php echo $collegeappliacationname; ?></h2>
													<!--end::Col-->
													</div>
												<!--end::Row-->
												
												<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2">
												<div class="col">
														<!--begin::Input group-->
														<div class="fv-row mb-7">
															<!--begin::Label-->
															<label class="fs-6 fw-semibold form-label mt-3">
																<span class="required">Start Date</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
													
													<input class="form-control form-control-solid fw-bold pe-5" placeholder="Select date" name="camstartdate" value="<?php echo $camstartdate; ?>" id="kt_daterangepicker_11"/>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													
													<!--begin::Col-->
													<div class="col" >
														<!--begin::Input group-->
														<div class="fv-row mb-7">
															<!--begin::Label-->
															<label class="fs-6 fw-semibold form-label mt-3">
																<span class="required">End Date</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<input class="form-control form-control-solid fw-bold pe-5" placeholder="Select date" name="camdeadline"  value="<?php echo $camdeadline; ?>" id="kt_daterangepicker_12"/>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
													
													</div>
												<!--end::Row-->
													<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													<!--begin::Col-->
												<!--begin::Col-->
													<div class="col">
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="">Specific Condition </span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<textarea type="text" class="form-control form-control-solid" name="camcondition" value="" ><?php echo $camcondition; ?></textarea>
													<!--end::Input-->
												</div>
												<!--end::Input group-->
												</div>
												<!--begin::Col-->
													<div class="col">
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="">Process Detail</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<textarea type="text" class="form-control form-control-solid" name="camprocessdetail" value="" ><?php echo $camprocessdetail; ?></textarea>
													<!--end::Input-->
												</div>
												<!--end::Input group-->
												</div>
												
												</div>
												<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2">
													<!--begin::Col-->
													<div class="col">
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="">Document Name</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<input type="text" class="form-control form-control-solid" name="camdocumentname" value="<?php echo $camdocumentname; ?>" >
													<!--end::Input-->
												</div>
												<!--end::Input group-->
												</div>
												
												<!--begin::Col-->
													<div class="col">
													
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="">Upload Document</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<input type="file" class="form-control form-control-solid" name="camdocumnet" value="" >
													<!--end::Input-->
												</div>
												<!--end::Input group-->
												</div>
												</div>
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
												<!--begin::Col-->
												<!--begin::Col-->
													<div class="col" id="slab">
														<!--begin::Input group-->
														<div class="fv-row mb-7" >
													<table id="items1" border="0" style="width:100%">
											<tr>
												<th>Steps </th>
												
												</tr>
										</table>
										<input type="button"  id="add_item1" value="Add" class="btn btn-primary btn-sm"/>
										
												</div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
													</div>
												
											
															<?php } ?>
															<script type="text/javascript">
		$(document).ready(function(){
			
			
 $("#kt_daterangepicker_11").flatpickr({
        enableTime:!1,dateFormat:"d-m-Y"
    }
   
);
		});
		</script>
		<script type="text/javascript">
		$(document).ready(function(){
			
			
 $("#kt_daterangepicker_12").flatpickr({
        enableTime:!1,dateFormat:"d-m-Y"
    }
   
);
		});
		</script>
		<script>
		<?php
		  $eve23 = "select * from res_collegedefferalsteps_detail where camdid=$camdid";
		  $re23 = mysqli_query($conn, $eve23);
		  if(mysqli_num_rows($re23) > 0)
		  {
			while($rt23 = mysqli_fetch_assoc($re23))
			{
				$cdstep=$rt23['cdstep'];
		?>
$(document).ready(function(){

		$("#items1").append(" <tr><td> <input type=\"text\" class=\"form-control form-control-solid\" id=\"cdstep" + $('#mycounter').val()  + "\" name=\"cdstep[]\" value=\"<?php echo $cdstep; ?>\"></td><td> <input type=\"file\" class=\"form-control form-control-solid\" id=\"cdsdocument1" + $('#mycounter').val()  + "\" name=\"cdsdocument1[]\"></td></tr>.");

		$('#mycounter').val( parseInt($('#mycounter').val()) + 1);
});
</script>
<?php
			}
		  }
?>

				
<script>
$(document).ready(function(){
	$("#add_item1").click(function(){

		$("#items").append(" <tr><td> <input type=\"text\" class=\"form-control form-control-solid\" id=\"cdstep" + $('#mycounter').val()  + "\" name=\"cdstep[]\"></td><td> <input type=\"file\" class=\"form-control form-control-solid\" id=\"cdsdocument1" + $('#mycounter').val()  + "\" name=\"cdsdocument1[]\"></td></tr>.");

		$('#mycounter').val( parseInt($('#mycounter').val()) + 1);
	});
});
</script>