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



		$clgamid = intval($_REQUEST['id']);
					$document = array();
	$eve = "select * from res_collegeappmanstep_detail where clgamid=$clgamid ";
	
	$re = mysqli_query($conn, $eve);
	 while($rt = mysqli_fetch_assoc($re))
										
	{
		$cdsdid = $rt['cdsdid'];
		
		array_push($document,$cdsdid);
	}
		
		

?>
<input type="hidden" name="clgamid" value="<?php echo $clgamid; ?>">
<div class="row row-cols-1 row-cols-sm-3 rol-cols-md-1 row-cols-lg-3">
<div class="col"><label class=" fw-semibold fs-6 mb-2">Following Steps</label></div>
<div class="col"><label class=" fw-semibold fs-6 mb-2">College Attachements</label> </div>
<div class="col"><label class=" fw-semibold fs-6 mb-2">Submitted document</label></div>
</div>
									<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-3 rol-cols-md-1 row-cols-lg-3">
													<?php
													 $evec = "select * from res_collegedefferalsteps_detail where camdid in (select camdid from res_collegeappman_master where clgamid=$clgamid) ";
													 $rec = mysqli_query($conn, $evec);
																			
													while($rtc = mysqli_fetch_assoc($rec))

													{
														$cdsdid = $rtc['cdsdid'];
														$cdstep = $rtc['cdstep'];
														$cdsdocument1 = $rtc['cdsdocument1'];
														$cdsdocument2 = $rtc['cdsdocument2'];
														
													 
													?>
													<!--begin::Col-->
													<div class="col">
														<!--begin::Input group-->
														<div class="fv-row mb-7">
													<div class="form-check form-check-custom form-check-solid me-10">
															<?php
								
															if (in_array($cdsdid, $document))
															
  {
															?>
															<input type="checkbox"  name="cdsdid[]" value="<?php echo $cdsdid; ?>" class="form-check-input  h-30px w-30px" checked disabled>
															<label class="form-check-label ">
															<?php echo $cdstep; ?></label>
															<?php 
															 }else{
																?>
																<input type="checkbox"  name="cdsdid[]" value="<?php echo $cdsdid; ?>" class="form-check-input  h-30px w-30px" >
															<label class="form-check-label ">
															<?php echo $cdstep; ?></label>
<?php																
															 }
															?>
															
														</div>
														</div>
														</div>
														<div class="col">
														<?php
														if($cdsdocument1 != '')
														{
														?>
														<a href='./docs/<?php echo $cdsdocument1; ?>' target='_blank' >view</a>
														<?php } ?>
														</div>
													<div class="col">
														<?php
														
								
															if (in_array($cdsdid, $document))
															
  {
															$eve23 = "select * from res_collegeappmanstep_detail where cdsdid=$cdsdid and clgamid = $clgamid";
															$re23 = mysqli_query($conn, $eve23);
	 while($rt23 = mysqli_fetch_assoc($re23))
										
	{
		$cdsdocument2 = $rt23['cdsdocument2'];
	}
		
														if($cdsdocument2 != '')
														{
														?>
															<a href='./docs/<?php echo $cdsdocument2; ?>' target='_blank' download>download</a>
															
															<?php 
  }}else{
																?>
														
														<?php																
															 }
  
															?>
														</div>
													<?php 
													}
													?>
													</div>
													<!--end::Input-->
												
																			
