ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/wedding-info-new/admin/api/
Upload File :
Current File : //proc/self/root/home2/selectio/www/wedding-info-new/admin/api/seller_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_alliances_register  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_seller` 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_seller` 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'];

        $statement = $pdo->prepare("SELECT * FROM tbl_seller  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]['aadh_no'];
        $aadhar_namedb=$datas[0]['aadhar_name'];
        $db_dob=$datas[0]['dob'];
        $db_gender=$datas[0]['gender'];
        $aadhar_mbldb=$datas[0]['mobile_no'];
        
        
        
        
        
        $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   ){ //dob not working perfectly
        if($aadhar_db==$aadhar  && $aadhar_mbl == $aadhar_mbldb && $aadhar_namedb == $aadhar_name   ){
        $statement = $pdo->prepare("UPDATE `tbl_seller` 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_seller` 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