File manager - Edit - /home/autoph/public_html/connectv1/app/menu/menu_list.php
Back
<?php include_once("../../cfg/db.php"); if(isset($_GET['search'])){ $search = $db -> escape(trim($_GET['search'])); } else { $search = ""; } // $json_arr['menu_content'] = ""; $json_menus = []; $menu_category = "SELECT * FROM `menu_category` WHERE status = 1 ORDER BY position ASC"; $menu_category_query = $db -> sql_query($menu_category); $category_counter = 0; while($row = $menu_category_query->fetch_assoc()) { $category_counter++; $menu_content = "SELECT * FROM `menu_content` WHERE `status` = 1 AND menu_category_id = ".$row['id']." ORDER BY position ASC"; $menu_content_query = $db -> sql_query($menu_content); $json_content = []; while($row1 = $menu_content_query->fetch_assoc()) { if(intval($row1['id']) == 1){ //ASA PORTAL $new_url = $row1['url'].'?token='.$_SESSION['user']['login_token']; } else if(intval($row1['id']) == 3){ // TASKS $address_ref = 'connect.autohub.ph'; $api_key = '4fdc94ab-6840-11ec-a574-00ff70631b9a'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://tasks.autohub.ph/api/v1/enc_keys.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('api' => $api_key,'ref'=>$address_ref,'value'=>$_SESSION['user']['asa_id']))); // Receive server response ... curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec($ch); curl_close ($ch); $user_keys_arr = json_decode($server_output,true); $new_url = $row1['url'].'?key='.$user_keys_arr['key'].'&value='.$user_keys_arr['value']; }else{ $new_url = $row1['url']; } $json_content[] = ['name'=>$row1['name'] ,'description'=>$row1['information'],'image'=>$row1['image'],'url'=>$new_url,'new_tab'=>$row1['new_tab']]; } // $json_arr['menu_content'] = $json_arr['menu_content']."</div>"; $json_menus[$row['code']] =$json_content; } echo json_encode($json_menus); function isNotEmpty($data){ return preg_match('/\S/', $data); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings