<?php
$errmsg='';
$sucmsg='';
if(isset($_POST['update'])){
    extract($_POST);
    $errmsg='';
    $sucmsg='';
    
		//update record
	$qry2=mysqli_query($con, "UPDATE pci_application SET ... WHERE id=$applicant_idpci");
	if($qry2){
		$sucmsg='Successful!';
	}else{
		$errmsg='Not Successful!';
	}
	
    
}



//GET DETAILS FROM DB

	$q = "Select * from pci_application where id=$applicant_idpci limit 1";
    $qry=mysqli_query($con, $q);
    $row=mysqli_fetch_assoc($qry);
    extract($row);
?>

<div class="graph-visual tables-main">
<h2 class="inner-tittle">PERSONAL DETAILS</h2>
	<div class="graph-form">
    		<div class="form-body">
    			<form method="post" name="mydetailsform" action="index.php?page=mydetails"> 
                <?php 
                if($errmsg!=''){
                    echo '<div class="alert alert-danger">'.$errmsg.'</div>';
                }elseif($sucmsg!=''){
                    echo '<div class="alert alert-success">'.$sucmsg.'</div>';
                }
                
                ?>
                    <div class="form-group"> 
                        <label>Membership Number</label> 
                        <input type="text" class="form-control" name="memberNumber" value="<?php echo $memberNo; ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Name</label> 
                        <input type="text" class="form-control" name="memberSurname" value="<?php echo $memberTitle." ".strtoupper($memberSurname)." ".strtoupper($memberOthernames); ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Gender</label> 
                        <input type="text" class="form-control" name="memberGender" value="<?php echo strtoupper($memberGender); ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Phone Number(s)</label> 
                        <input type="text" class="form-control" name="memberPhone" value="<?php echo $memberPhone1.", ".$memberPhone2; ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Email Address</label> 
                        <input type="text" class="form-control" name="memberEmail" value="<?php echo $memberEmail; ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Postal Address</label> 
                        <input type="text" class="form-control" name="memberAddress" value="<?php echo strtoupper($memberAddress); ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Current Membership Grade</label> 
						<?php
						switch($memberGrade)
						{
							case 1: $memberGrade="Fellow";
							break;
							
							case 2: $memberGrade="Member";
							break;
							
							case 3: $memberGrade="Probationer";
							break;
							
							case 4: $memberGrade="Technician";
							break;
							
							case 5: $memberGrade="Student";
							break;
							
							case 6: $memberGrade="Practicing Firm";
							break;
							
							case 7: $memberGrade="Graduate";
							break;
							
							case 8: $memberGrade="State Chapter";
							break;
							
							case 9: $memberGrade="Past President";
							break;
							
						}
						?>
                        <input type="text" class="form-control" name="memberGrade" value="<?php echo strtoupper($memberGrade); ?>" readonly/> 
                    </div> 
                    
					<div class="form-group"> 
                        <label>Preferred Interview Centre</label> 
                        <input type="text" class="form-control" name="memberAddress" value="<?php echo strtoupper($examCentre); ?>" readonly/>  
                    </div> 
					
					
                    <!--input name="update" type="submit" class="btn btn-default" value="Update"/--> 
                </form> 
               
    		</div>
    
    </div>

</div>

<div> <a href='?page=passport'><button class='btn'>Next</button></a> </div>