ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/admin/api/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/admin/api/astrologer_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']; 
        $remarks = $_POST['remarks'];
        
        $statement = $pdo->prepare("SELECT * FROM tbl_astrologer  WHERE id =".$ids);
        $statement->execute();
        $datas = $statement->fetchAll(PDO::FETCH_ASSOC);
        $totalData = $statement->rowCount();
        if( $status_ver == 0){
            
        // Prepare and execute the SQL statement
        $statement = $pdo->prepare("UPDATE `tbl_astrologer` SET  `verification_status`=?, `remarks`=? WHERE `id`=?");
        $result = $statement->execute(array(3, $remarks, $ids));

            $return_arr['message'] = 'User test Rejected.';
            $return_arr['status'] = 400;
        } else {
            $statement = $pdo->prepare("UPDATE `tbl_astrologer` SET  `verification_status`=?, `remarks`=? WHERE `id`=?");
            $result = $statement->execute(array(3, $remarks, $ids));
          
            $return_arr['message'] = 'User approved success';
            $return_arr['status'] = 200;
        }
        


    } 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') {
    try {
        
        
        error_log('adhaar verification starts');
        $aadhar = $_POST['aadhar_no'];
        $aadhar_get = $_POST['aadhar_no'];
        $aadhar_mbl = $_POST['aadhar_mbl'];
        $aadhar_name = $_POST['aadhar_name'];
        $ids=$_POST['ids'];
        error_log( $aadhar.":aadhar". $aadhar_get.":aadhar_get". $aadhar_mbl.":aadhar_mbl". $aadhar_name.":aadhar_name". $ids.":ids");

        $statement = $pdo->prepare("SELECT * FROM tbl_astrologer  WHERE id =".$ids);
        $statement->execute();
        $datas = $statement->fetchAll(PDO::FETCH_ASSOC);
        $totalData = $statement->rowCount();
        $dob = $_POST['dob'];
        $gender = $_POST['gender'];
        $remarks = $_POST['remarks'];
        $aadhar_db=$datas[0]['v_aadhar_no'];
        $aadhar_namedb=$datas[0]['v_aadhar_name'];
        $db_dob=$datas[0]['dob'];
        $db_gender=$datas[0]['gender'];
        $aadhar_mbldb=$datas[0]['astrologer_mobile'];
        
        error_log("From database".$dob.":dob". $gender.":gender". $remarks.":remarks". $aadhar_db.":aadhar_db". $aadhar_namedb.":aadhar_namedb". $db_dob.":db_dob". $db_gender.":db_gender". $aadhar_mbldb.":aadhar_mbldb"); 
        
        
        
        
        $text.='Mismatched aadhar details :';
        $text .= $aadhar_db != $aadhar_get ? "ID number &nbsp;" : "";
        $text .= $aadhar_mbl != $aadhar_mbldb ? " Mobile No. &nbsp;" : "";
        $text .= $aadhar_namedb != $aadhar_name ? " Name &nbsp;" : "";
        $text .= $db_dob != $dob ? " DOB &nbsp;" : "";
        $text .= $db_gender != $gender ? " Gender &nbsp;" : "";
        if($aadhar_db==$aadhar  && $aadhar_mbl == $aadhar_mbldb && $aadhar_namedb == $aadhar_name && $db_dob == $dob &&  $db_gender== $gender   ){
        $statement = $pdo->prepare("UPDATE `tbl_astrologer` SET  `verification_status`=?  WHERE `id`=?");
        $result = $statement->execute(array(1, $ids));
            $return_arr['message'] = 'Details Verified successfully.';
            $return_arr['status'] = 200;
        } else {
                 $statement = $pdo->prepare("UPDATE `tbl_astrologer` SET  `verification_status`=?  WHERE `id`=?");
                 $result = $statement->execute(array(2, $ids));
         
            $return_arr['message'] = $text;
            $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);
}
?>

Zerion Mini Shell 1.0