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_rejected_give_help_history_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.commit_id AS commit_id, h.give_uid AS give_uid, h.receive_uid AS receive_uid, h.datetime AS datetime, h.amount AS amount, u.email AS email, u.mobile AS mobile, "
        . " CONCAT(u.name,'&nbsp;(',u.login_id,')') AS user_name ";
$query = " FROM help h INNER JOIN user u ON u.uid = h.receive_uid WHERE h.lock_status=1 AND h.give_uid= '$uid' ";
$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";

$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['accepted'] = date("d/m/Y h:i A", strtotime($row['accepted']));
//    $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);
?>