golden hour
/home4/theinves/public_html/seshaasschool.com/dashboard/apis
⬆️ Go Up
Upload
File/Folder
Size
Actions
api
-
Del
OK
banner.php
1.8 KB
Del
OK
category.php
4.37 KB
Del
OK
flash_news.php
1.92 KB
Del
OK
latest_events.php
1.81 KB
Del
OK
settings.php
3.49 KB
Del
OK
sub-category.php
0 B
Del
OK
Edit: settings.php
<?php ob_start(); session_start(); include "../config/config.php"; $session_id = $_SESSION['hrm']['id']; if(isset($_POST['type']) && $_POST['type']=='update_salem_ip_address'){ try{ $salem_ip_address_1 = $_POST['salem_ip_address_1']; $salem_ip_address_2 = $_POST['salem_ip_address_2']; $salem_ip_address_3 = $_POST['salem_ip_address_3']; $statement_1 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=1"); $result_1 = $statement_1->execute(array($salem_ip_address_1)); $statement_2 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=2"); $result_2 = $statement_2->execute(array($salem_ip_address_2)); $statement_3 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=3"); $result_3 = $statement_3->execute(array($salem_ip_address_3)); if($result_1 && $result_2 && $result_3){ $return_arr['message']='Salem Ip Address Updated Successfully...'; $return_arr['status']=200; } else{ $return_arr['message']='Something Went Wrong..'; $return_arr['status']=400; } }catch(PDOException $e){ $return_arr['message']="$e"; $return_arr['status']=500; } echo json_encode($return_arr); } if(isset($_POST['type']) && $_POST['type']=='update_erode_ip_address'){ try{ $erode_ip_address_1 = $_POST['erode_ip_address_1']; $erode_ip_address_2 = $_POST['erode_ip_address_2']; $erode_ip_address_3 = $_POST['erode_ip_address_3']; $statement_4 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=4"); $result_4 = $statement_4->execute(array($erode_ip_address_1)); $statement_5 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=5"); $result_5 = $statement_5->execute(array($erode_ip_address_2)); $statement_6 = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=6"); $result_6 = $statement_6->execute(array($erode_ip_address_3)); if($result_4 && $result_5 && $result_6){ $return_arr['message']='Erode Ip Address Updated Successfully...'; $return_arr['status']=200; } else{ $return_arr['message']='Something Went Wrong..'; $return_arr['status']=400; } }catch(PDOException $e){ $return_arr['message']="$e"; $return_arr['status']=500; } echo json_encode($return_arr); } if(isset($_POST['type']) && $_POST['type']=='update_ot_hours_per_price'){ try{ $ot_per_hour_price = $_POST['ot_per_hour_price']; $statements = $pdo->prepare("UPDATE `tbl_config` SET value=? WHERE id=7"); $results = $statements->execute(array($ot_per_hour_price)); if($results){ $return_arr['message']='OT Value Updated Successfully...'; $return_arr['status']=200; } else{ $return_arr['message']='Something Went Wrong..'; $return_arr['status']=400; } }catch(PDOException $e){ $return_arr['message']="$e"; $return_arr['status']=500; } echo json_encode($return_arr); } ?>
Save