require_once 'includes/header.php'; if($_POST['status']=='update') { if(empty($_FILES['image']['name'])) { $con->query("UPDATE `students` SET `payable_amount` = '".$_POST['payable_amount']."',`dur_start` = '".$_POST['dur_start']."',`dur_ends` = '".$_POST['dur_ends']."',`name` = '".$_POST['name']."', `gender` = '".$_POST['gender']."', `father` = '".$_POST['father']."', `mother` = '".$_POST['mother']."', `dob` = '".$_POST['dob']."', `mobile` = '".$_POST['mobile']."',`address` = '".$_POST['address']."', `email` = '".$_POST['email']."', `state` = '".$_POST['state']."', `distric` = '".$_POST['distric']."', `exam_pass` = '".$_POST['exam_pass']."', `marks` = '".$_POST['marks']."', `board` = '".$_POST['board']."', `year` = '".$_POST['year']."', `username` = '".$_POST['username']."', `password` = '".$_POST['password']."', `course_id` = '".$_POST['course_id']."' WHERE `students`.`id` = '".$_GET['id']."'"); echo ''; } else { $img = photo_upload('image','students'); if($img['status']) { $con->query("UPDATE `students` SET `payable_amount` = '".$_POST['payable_amount']."',`dur_start` = '".$_POST['dur_start']."',`dur_ends` = '".$_POST['dur_ends']."',`name` = '".$_POST['name']."', `gender` = '".$_POST['gender']."', `father` = '".$_POST['father']."', `mother` = '".$_POST['mother']."',`address` = '".$_POST['address']."', `dob` = '".$_POST['dob']."', `mobile` = '".$_POST['mobile']."', `email` = '".$_POST['email']."', `state` = '".$_POST['state']."', `distric` = '".$_POST['distric']."', `exam_pass` = '".$_POST['exam_pass']."', `marks` = '".$_POST['marks']."', `board` = '".$_POST['board']."', `year` = '".$_POST['year']."', `username` = '".$_POST['username']."', `password` = '".$_POST['password']."', `course_id` = '".$_POST['course_id']."', `photo` = '".$img['file_name']."' WHERE `students`.`id` = '".$_GET['id']."'"); if(file_exists("../uploads/students/".$_POST['file'])) unlink("../uploads/students/".$_POST['file']); echo ''; } else { echo ''; } } } $get = $con->query("SELECT * FROM students where center_id = '".$_SESSION['center']['id']."' AND id = '".$_GET['id']."'")->fetch_assoc(); ?>