File manager - Edit - /home/autoph/public_html/connectv1/app/table/shorten_link.php
Back
<?php include_once("../../cfg/db.php"); include_once("../../api/controllers/utility.php"); $utility = new Utility(); $json_arr['rows'] = array(); $search = ""; $offset = ""; $limit = ""; $offset_limit = ""; $type = ""; if(isset($_GET['search'])){ $search = $db -> escape(trim($_GET['search'])); } else { $search = ""; } if(isset($_GET['offset'])){ $offset = $db -> escape(trim($_GET['offset'])); } else { $offset = ""; } if(isset($_GET['limit'])){ $limit = $db -> escape(trim($_GET['limit'])); $offset_limit = " LIMIT ". $offset.",".$limit; } else { $offset_limit = ""; } $type = $db->escape($_GET['type']); if($type == 1){ $count = " COUNT(*) "; $fields = " id, name, generated_url, target_link, status "; $query = "SELECT %s FROM shorten_links WHERE 1"; $link_list = $db->sql_query(sprintf($query, $fields) . $offset_limit); $link_list_count = $db->select(sprintf($query, $count)); while($row = $link_list->fetch_assoc()){ $json_arr['rows'] = array_merge($json_arr['rows'], array(array( 'id'=>$row['id'], 'name'=>$row['name'], 'generated_url'=>$row['generated_url'], 'target_link'=>$row['target_link'], 'status'=>$row['status'] == 0 ? "<span class='badge bg-danger'>INACTIVE</span>" : "<span class='badge bg-success'>ACTIVE</span>" ))); } $json_arr['total'] = $link_list_count; echo json_encode($json_arr); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings