Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/member/report/
Upload File :
Current File : /home2/wtmwscom/public_html/member/report/report_receiver_json.php

<?php
session_start();
include "../../connection.php";
include '../../function_lib.php';
$data = array();
//$uid = $_SESSION['userid'];
$child_ids = get_child_ids($_SESSION['userid']);
$uids = '';
foreach($child_ids as $key => $level){
    foreach($level as $key => $value){
        if($uids==''){
            $uids = $value;
        }
        else{
            $uids .= ', '.$value;
        }
    }
}
$query_select = " h.help_id AS help_id , h.give_uid as give_uid, h.receive_uid AS receive_uid, h.amount AS amount, h.datetime AS datetime, h.confirm_status AS confirm_status, h.lock_status AS lock_status, h.extend AS extend, "
        . " CONCAT(u.name,'&nbsp;(',u.login_id,')') AS user_name, CONCAT(u1.name,'&nbsp;(',u1.login_id,')') AS user_name1 ";
$query = " FROM help AS h LEFT JOIN user AS u ON h.give_uid = u.uid LEFT JOIN user AS u1 ON h.receive_uid = u1.uid  WHERE h.receive_uid  IN ($uids) ";
$query .=!empty($_REQUEST['login_id']) ? " AND u.login_id='" . $_REQUEST['login_id'] . "'" : '';
//$query .=!empty($_REQUEST['name']) ? " AND u.name='" . $_REQUEST['name'] . "'" : '';

$query .= " ORDER BY h.datetime DESC";

$totalRecordCount = mysqli_fetch_object(mysqli_query($connection, "SELECT COUNT(u.uid) as count ".$query))->count;
$query_limit = $_REQUEST['length'] == -1 ? '': " LIMIT ".$_REQUEST['start'].", ".$_REQUEST['length'];
$query_final = "SELECT ".$query_select.$query.$query_limit;
//echo $query_final;
$result = mysqli_query($connection, $query_final);
//echo $result;
$sno = $_REQUEST['start'] +1;
while ($row = mysqli_fetch_assoc($result)) {
    $row['sno'] = $sno;
//    $uid = $row['uid'];
    $row['datetime'] = date("d/m/Y h:i A", strtotime($row['datetime']));
//    $row['topup_date'] = !empty($row['topup_date']) ? date("d/m/Y h:i A", strtotime($row['topup_date'])) : '' ;
    $data[] = $row;
//    echo '.....';
//    print_r($data);
    $sno++;
}

$json_array = array('data' => $data, 'recordsFiltered'=>$totalRecordCount, 'recordsTotal'=>$totalRecordCount);
echo json_encode($json_array);
?>