ok
Direktori : /home2/selectio/public_html/wedding-info/api/ |
Current File : /home2/selectio/public_html/wedding-info/api/alliance_verification.php |
<?php include_once('config/config.php'); include_once('config/custom-functions.php'); include 'config/send-sms.php'; $return_arr = array(); // Initialize the return arrayallaiance_verified if (isset($_POST['type']) && $_POST['type'] == 'upload') { try { $ids=$_GET['ids']; $status_ver = $_POST['status_ver']; $aadhar_get = $_POST['aadhar_no']; $remarks = $_POST['remarks']; error_log($ids.$status_ver.$aadhar_no."hello"); $statement = $pdo->prepare("SELECT * FROM tbl_alliances_register WHERE id =".$ids); $statement->execute(); $datas = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); $aadhar_db=$datas[0]['v_aadhar_no']; if($aadhar_db==$aadhar_get){ // Prepare and execute the SQL statement $statement = $pdo->prepare("UPDATE `tbl_alliances_register` SET `allaiance_verified`=?, `alliance_verified_remarks`=? WHERE `id`=?"); $result = $statement->execute(array($status_ver, $remarks, $ids)); // } // if ($result) { $return_arr['message'] = 'Category updated successfully.'; $return_arr['status'] = 200; } else { $statement = $pdo->prepare("UPDATE `tbl_alliances_register` SET `allaiance_verified`=?, `alliance_verified_remarks`=? WHERE `id`=?"); $result = $statement->execute(array(0, $remarks, $ids)); $return_arr['message'] = 'Aadhar No not matched Rejected.'; $return_arr['status'] = 400; } } catch (Exception $e) { $return_arr['message'] = $e->getMessage(); $return_arr['status'] = 500; error_log($e->getMessage()); } echo json_encode($return_arr); } if (isset($_POST['types']) && $_POST['types'] == 'check') { error_log("Ajax Page Calleing Well 123"); try { $aadhar = $_POST['aadhar_no']; $ids=$_POST['ids']; $statement = $pdo->prepare("SELECT * FROM tbl_alliances_register WHERE id =".$ids); $statement->execute(); $datas = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); $aadhar_db=$datas[0]['v_aadhar_no']; if($aadhar_db==$aadhar){ // Prepare and execute the SQL statement $statement = $pdo->prepare("UPDATE `tbl_alliances_register` SET `aadhar_no_ver`=? WHERE `id`=?"); $result = $statement->execute(array(1, $ids)); // } // if ($result) { $return_arr['message'] = 'Category updated successfully.'; $return_arr['status'] = 200; } else { $statement = $pdo->prepare("UPDATE `tbl_alliances_register` SET `aadhar_no_ver`=? WHERE `id`=?"); $result = $statement->execute(array(0, $ids)); $return_arr['message'] = 'Aadhar No not matched Rejected.'; $return_arr['status'] = 400; } } catch (Exception $e) { $return_arr['message'] = $e->getMessage(); $return_arr['status'] = 500; error_log($e->getMessage()); } echo json_encode($return_arr); } ?>