File manager - Edit - /home/autoph/public_html/projects/Rating-AutoHub/public/css/religion.php.tar
Back
home/autoph/public_html/connectv1/api/religion/religion.php 0000644 00000001500 15030162242 0020067 0 ustar 00 <?php include_once("../../cfg/db.php"); include_once("../controllers/religion.php"); include_once("../controllers/utility.php"); $religion = new Religion(); $utility = new Utility(); $server_method = $_SERVER["REQUEST_METHOD"]; if(isset($_REQUEST['apiKey']) ){ $apiKey = $_REQUEST['apiKey']; if($apiKey === '2011315786548487' && $utility->isPostMethod($server_method)){ //Get Religion Content $search = isset($_REQUEST['search']) ? $db -> escape($_REQUEST['search']) : '' ; $religion->read_religion_content($search,$db); }else{ $return_arr["message"]=" You are not allowed to do this action."; echo $return_arr["message"]; return; } }else{ $return_arr["message"]=" You are not allowed to do this action."; echo $return_arr["message"]; return; } ?> home/autoph/public_html/connectv1/api/controllers/religion.php 0000644 00000001714 15030252602 0020634 0 ustar 00 <?php class Religion{ function read_religion_id_by_name($name,$db){ return $db -> select("SELECT id FROM `source_religion` WHERE status=1 AND `name` = '$name' "); } function create_religion($name,$db){ return $db -> sql_query_id("INSERT INTO source_religion (name,status) VALUES ('$name','1')"); } function read_religion_name_by_id($id,$db){ return $db -> select("SELECT name FROM `source_religion` WHERE status=1 AND `id` = '$id' "); } function read_religion_content($search,$db){ $religions = $db -> return_result("SELECT id,name FROM `source_religion` WHERE status=1 AND `name` LIKE '%$search%' ORDER BY name ASC"); $json = []; foreach($religions as $religion){ $json[] = ['id'=>$religion['name'], 'text'=>$religion['name']]; } echo json_encode($json); } } ?>
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings