<?php 
include '../config.php';
$query = "SELECT * FROM admin";
$result = mysqli_query($conn,$query);

$Time=date('h:i A');

if (mysqli_num_rows($result)) {
        $list = array();
        while ($rows = mysqli_fetch_assoc($result))
        {
            
            $withdrwal_open_time=$rows['withdrwal_open_time'];
            $withdrwal_close_time=$rows['withdrwal_close_time'];
            $iswithdrwaltenable=false;
             
            if(strtotime($Time)>strtotime($withdrwal_open_time)  && strtotime($Time)<strtotime($withdrwal_close_time) )
            {
               $iswithdrwaltenable=true ;
            }
            
                 $temp = ["name"=>$rows['name'],
                         "mobile"=>$rows['mobile'],
                         "whatsapp_number"=>$rows['whatsapp_number'],
                         "upi_id"=>$rows['upi_payment_id'],
                        //  "paytm_upiid"=>$rows['paytm_upiid'],
                        //  "phonpe_upiid"=>$rows['phonpe_upiid'],
                        //  "googlepay_upiid"=>$rows['googlepay_upiid'],
                        //   "otherupi_id"=>$rows['upi_payment_id'],
                        
                        "paytm_upiid"=>$rows['upi_paytm_id'],
                         "phonpe_upiid"=>$rows['upi_phonepay_id'],
                         "googlepay_upiid"=>$rows['upi_googlePay_id'],
                          "otherupi_id"=>$rows['otherupi_id'],
                          "telegram_id"=>$rows['telegramid'],
                          "gamename"=>$rows['Market_name_one'],
                          "gamename2"=>$rows['Market_name_two'],
                          "gamename3"=>$rows['Market_name_three'],
                           "paytm_upinote"=>$rows['paytm_upinote'],
                            "phonepe_upinote"=>$rows['phonepe_upinote'],
                             "google_paynote"=>$rows['google_paynote'],
                              "other_paynote"=>$rows['other_paynote'],
                              
                         "marchant_code"=>$rows['marchant_code'],
                          "contact_email"=>$rows['contact_email'], 
                          "iswithdrwaltenable"=>$iswithdrwaltenable, 
                          "WithdrwalOpenTime"=>$withdrwal_open_time, 
                          "WithdrwalCloseTime"=>$withdrwal_close_time, 
                          
                          "app_url"=>$rows['app_url'],
                          "offer_description"=>$rows['offer_description'],
                          "min_betting_rate"=>$rows['min_betting_rate'],
                          
                          "min_starlinebetting_one"=>$rows['min_starlinebetting_one'],
                          "min_starlinebetting_two"=>$rows['min_starlinebetting_two'],
                          "min_starlinebetting_three"=>$rows['min_starlinebetting_three'],
                          
                          "min_deposit_rate"=>$rows['min_deposit_rate'],
                          "min_withdreal_rate"=>$rows['min_withdreal_rate'],
                          "max_deposite_rate"=>$rows['max_deposite_rate'],
                          "max_withdrawal_rate"=>$rows['max_withdrawal_rate'],
                          "minimum_transfer"=>$rows['minimum_transfer'],
                          "maximum_transfer"=>$rows['maximum_transfer'],
                          "minimum_bid_money"=>$rows['minimum_bid_money'],
                          "maximum_bid_amount"=>$rows['maximum_bid_amount'],
                          "welcome_bonus"=>$rows['welcome_bonus'],
                          "youtube_link"=>$rows['youtube_link'],
                          "youtube_description"=>$rows['youtube_description'],
                          "refer_description"=>$rows['refer_description'],
                          "refer_amount"=>$rows['refer_amount'],
                          "welcome_title"=>$rows['welcome_title'],
                          "welcome_description"=>$rows['welcome_description'],
                          "home_title_message1"=>$rows['home_title_message1'],
                          "home_title_message2"=>$rows['home_title_message2'],
                          "pending_account_message"=>$rows['pending_account_message'],

                  ];
                array_push($list,$temp);
        } 
        $response = ["status"=>"success","admin Details"=>$list];
}
else{
        $response = ["status"=>"failure"];
}
echo json_encode($response);
?>
