File: /var/www/html/wp-content/themes/ormedia/keylabData/tenant/r_tenant.php
<?php
if(isset($_REQUEST['checking_api_file'])){
exit();
}
$tenant_id = $_REQUEST['tenant_id'];
$property_id = $_REQUEST['property_id'];
$platform = $_REQUEST['platform'];
$sql_statment = "select * from keylab_property_tenant";
$where = " where ";
if (!empty($tenant_id)){
$where = $where."tenant_id = ".$tenant_id." and ";
}
if (!empty($property_id)){
$where = $where."property_id = ".$property_id." and ";
}
$where = substr($where, 0, -5);
if(strlen($where) > 5){
$sql_statment = $sql_statment.$where;
}
$sql_statment = $sql_statment.' ORDER BY tenant_id DESC';
$result = $wpdb->get_results($sql_statment);
$rv->list = $result;
exit(json_encode($rv));
?>