require_once 'includes/header.php'; if($_POST['status']=='update') { if(empty($_FILES['image']['name'])) { $con->query("UPDATE `centers` SET `name` = '".$_POST['name']."', `institute_name` = '".$_POST['institute_name']."', `dob` = '".$_POST['dob']."', `pan_number` = '".$_POST['pan_number']."', `aadhar_number` = '".$_POST['aadhar_number']."', `center_full_address` = '".$_POST['center_full_address']."', `state_id` = '".$_POST['state_id']."', `city_id` = '".$_POST['city_id']."', `no_of_computer_operator` = '".$_POST['no_of_computer_operator']."', `no_of_class_room` = '".$_POST['no_of_class_room']."', `total_computer` = '".$_POST['total_computer']."', `space_of_computer_center` = '".$_POST['space_of_computer_center']."', `whatsapp_number` = '".$_POST['whatsapp_number']."', `contact_number` = '".$_POST['contact_number']."', `email_id` = '".$_POST['email_id']."', `qualification_of_center_head` = '".$_POST['qualification_of_center_head']."', `staff_room` = '".$_POST['staff_room']."', `water_supply` = '".$_POST['water_supply']."', `toilet` = '".$_POST['toilet']."', `reception` = '".$_POST['reception']."', `username` = '".$_POST['username']."', `password` = '".$_POST['password']."' WHERE `centers`.`id` = '".$_GET['id']."'"); echo ''; } else { $img = photo_upload('image','centers'); if($img['status']) { $con->query("UPDATE `centers` SET `name` = '".$_POST['name']."', `institute_name` = '".$_POST['institute_name']."', `dob` = '".$_POST['dob']."', `pan_number` = '".$_POST['pan_number']."', `aadhar_number` = '".$_POST['aadhar_number']."', `center_full_address` = '".$_POST['center_full_address']."', `state_id` = '".$_POST['state_id']."', `city_id` = '".$_POST['city_id']."', `no_of_computer_operator` = '".$_POST['no_of_computer_operator']."', `no_of_class_room` = '".$_POST['no_of_class_room']."', `total_computer` = '".$_POST['total_computer']."', `space_of_computer_center` = '".$_POST['space_of_computer_center']."', `whatsapp_number` = '".$_POST['whatsapp_number']."', `contact_number` = '".$_POST['contact_number']."', `email_id` = '".$_POST['email_id']."', `qualification_of_center_head` = '".$_POST['qualification_of_center_head']."', `staff_room` = '".$_POST['staff_room']."', `water_supply` = '".$_POST['water_supply']."', `toilet` = '".$_POST['toilet']."', `reception` = '".$_POST['reception']."', `username` = '".$_POST['username']."', `password` = '".$_POST['password']."', `image` = '".$img['file_name']."' WHERE `centers`.`id` = '".$_GET['id']."'"); if(file_exists("../uploads/centers/".$_POST['file'])) unlink("../uploads/centers/".$_POST['file']); echo ''; } else { echo ''; } } } $get = $con->query("SELECT * FROM centers where id = '".$_GET['id']."'")->fetch_assoc(); ?>