ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/api/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/api/available_time.php

<?php

include_once('config/config.php');
    $return_arr = array();
if (1==1) {

    try {
    
if($_SESSION['user']!=""){$u_id = $_SESSION['user']['id'];}
if($_SESSION['buyer']!=""){$u_id = $_SESSION['buyer']['id'];}
if($_SESSION['seller']!=""){$u_id = $_SESSION['seller']['id'];}
if($_SESSION['astrologer']!=""){$u_id = $_SESSION['astrologer']['id'];}

// doubt start
if ($_SESSION['astrologer'] != "") {
    $user_of = 3;
}
// doubt end

    error_log("start ".$u_id." time..............");

$mon_start_time = $_POST['mon_start_time'] ?? null;
$mon_end_time = $_POST['mon_end_time'] ?? null;
$tue_start_time = $_POST['tue_start_time'] ?? null;
$tue_end_time = $_POST['tue_end_time'] ?? null;
$wed_start_time = $_POST['wed_start_time'] ?? null;
$wed_end_time = $_POST['wed_end_time'] ?? null;
$thur_start_time = $_POST['thur_start_time'] ?? null;
$thur_end_time = $_POST['thur_end_time'] ?? null;
$fri_start_time = $_POST['fri_start_time'] ?? null;
$fri_end_time = $_POST['fri_end_time'] ?? null;
$sat_start_time = $_POST['sat_start_time'] ?? null;
$sat_end_time = $_POST['sat_end_time'] ?? null;
$sun_start_time = $_POST['sun_start_time'] ?? null;
$sun_end_time = $_POST['sun_end_time'] ?? null;

error_log($u_id."u_id".$mon_start_time."mon_start_time".$mon_end_time."mon_end_time".$tue_start_time."tue_start_time".$tue_end_time."tue_end_time".$wed_start_time."wed_start_time".$wed_end_time."wed_end_time".$thur_start_time."thur_start_time".$thur_end_time."thur_end_time".$fri_start_time."fri_start_time".$fri_end_time."fri_end_time".$sat_start_time."sat_start_time".$sat_end_time."sat_end_time".$sun_start_time."sun_start_time".$sun_end_time."sun_end_time");
        $statement = $pdo->prepare("UPDATE `tbl_avl` SET 
    `monday_start` = ?,
    `monday_end` = ?,
    `tuesday_start` = ?,
    `tuesday_end` = ?,
    `wednesday_start` = ?,
    `wednesday_end` = ?,
    `thursday_start` = ?,
    `thursday_end` = ?,
    `friday_start` = ?,
    `friday_end` = ?,
    `saturday_start` = ?,
    `saturday_end` = ?,
    `sunday_start` = ?,
    `sunday_end` = ?
    WHERE `user_id` = ? and `user_of`=? ");

$result = $statement->execute(array(
    $mon_start_time, $mon_end_time,
    $tue_start_time, $tue_end_time,
    $wed_start_time, $wed_end_time,
    $thur_start_time, $thur_end_time,
    $fri_start_time, $fri_end_time,
    $sat_start_time, $sat_end_time,
    $sun_start_time, $sun_end_time,
    $u_id,$user_of
));

            if ($result) {
                $return_arr['status'] = 200;
                $return_arr['ids'] = $id;

            } else {
                $return_arr['message'] = 'Error';
                $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