MMCT TEAM
Server IP : 82.112.239.40  /  Your IP : 18.225.98.59
Web Server : LiteSpeed
System : Linux in-mum-web1676.main-hosting.eu 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
User : u641149403 ( 641149403)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u641149403/domains/cabz4you.com/public_html/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u641149403/domains/cabz4you.com/public_html/admin/server.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include('lib/config.php');

$vendor_type = $_REQUEST['type'];
    if ($vendor_type=='blocked') {
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and up.profile_status in(0)";
    }elseif($vendor_type=='minus wallet'){
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and w_amount<0"; 
    }elseif($vendor_type=='wallet'){
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and w_amount>0"; 
    }elseif($vendor_type=='null'){
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and w_amount=0"; 
    }elseif ($vendor_type=='active') {
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and up.profile_status in(1)";
    }else{
        $sql = "select * from vendor_login u,vendor_profile up where u.id=up.vendor_id and up.profile_status in(1)"; 
    }

// Fetch data
$result = $conn->query($sql);
$totalData = $result->num_rows;


// Server-side processing

if (!empty($_REQUEST['search']['value'])) {
    $sql .= " AND (full_name LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR id LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR contact LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR email LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR city LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR state LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR pincode LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR pan_on_name LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR pan_no LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR upi_id LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR timestamp LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR bank_name LIKE '%" . $_REQUEST['search']['value'] . "%' ";
    $sql .= " OR ifsc_code LIKE '%" . $_REQUEST['search']['value'] . "%' )";
}

$query = mysqli_query($conn, $sql);
$totalFiltered = mysqli_num_rows($query);



// Server-side processing
$sql .= " ORDER BY id DESC";
if($_REQUEST['length']!=-1){
$sql .= " LIMIT " . $_REQUEST['start'] . ", " . $_REQUEST['length'];
}

$result = $conn->query($sql);
$totalFiltered = $totalData;

$data = array();
$serial = $_REQUEST['start'] + 1; // Serial number counter
while ($row = $result->fetch_assoc()) {
    $membership_vendor=$conn->query("SELECT * FROM membership_log WHERE status=1 AND vendor_id='".$row['id']."'");

    $bookings=$conn->query("select * from bookings where vendor_id='".$row['id']."'");
    $row['total_booking']=$bookings->num_rows;

    $post_bookings=$conn->query("select * from bookings where post_by_id='".$row['id']."'");
    $row['total_post_booking']=$post_bookings->num_rows;
    $row['reg_date']=date("d-m-Y H:i:s",strtotime($row['timestamp']));

    $nestedData = array();
    $nestedData[] = '<input type="checkbox" name="VendorID" class="selectvendorid" value="'.$row['id'].'">';
    $nestedData[] = $serial++; // Serial number
     // Custom action column
    $nestedData[] = '<div class="dropdown">
    <button class="btn btn-dark btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">Action
    <span class="caret"></span></button>
    <ul class="dropdown-menu p-2">
    <li> 
    <a class="btn btn-success w-100 mb-2" href="view-vendor?vendor_id='.$row['id'].'" target="_blank">View Vendor</a>
    </li>
    <li> 
    <a class="btn btn-success w-100 mb-2" href="edit_vendor?token='.$row['id'].'" value="'.$serial.'">Edit Vendor</a>
    </li>

    <li>
    <button value="'.$row['id'].'" id="'.$row['contact'].'" onclick="add_money(this.value,this.id)" class="btn btn-primary w-100 mb-2" data-toggle="modal" data-target="#money" value="'.$serial.'">Money</button>
    </li>

    <li>
    <button value="'.$row['id'].'" id="'.$row['commission'].'" onclick="withdrawal(this.value,this.id)" class="btn btn-primary w-100 mb-2" data-toggle="modal" data-target="#withdrawal">Withdrawal</button>
    </li>
    <li>
    <button value="'.$row['id'].'" id="'.$row['contact'].'" onclick="add_security(this.value,this.id)" class="btn btn-warning w-100 mb-2" data-toggle="modal" data-target="#security">Membership</button>
    </li>
    <li>
    <a href="transaction_log?id='.$row['id'].'" class="btn btn-info border-0 w-100 text-white" target="_blank">
    View Transaction
    </a>
    </li>

    </ul>
    </div>';
    if ($membership_vendor->num_rows>0) {
        $nestedData[] = '<label class="badge badge-success">Prime</label>';
    }else{
        $nestedData[] = '<label class="badge badge-danger">Not Prime</label>';
    }

    $nestedData[] = $row['id'];
    $nestedData[] = $row['full_name'];
    $nestedData[] = $row['contact'];
    $nestedData[] = $row['email'];
    $nestedData[] = $row['city'];
    $nestedData[] = $row['state'];

    $nestedData[] = '<a href="vendor_booking?post_id='.$row['id'].'" target="_blank"><span>'.$row['total_post_booking'].'</span></a>';
    $nestedData[] = '<a href="vendor_booking?vendor_id='.$row['id'].'" target="_blank"><span>'.$row['total_booking'].'</span></a>';

    $nestedData[] = $row['w_amount'];
    $nestedData[] = $row['pincode'];
    $nestedData[] = $row['pan_on_name'];
    $nestedData[] = $row['pan_no'];
    $nestedData[] = $row['account_no'];
    $nestedData[] = $row['benificiary_name'];
    $nestedData[] = $row['bank_name'];
    $nestedData[] = $row['ifsc_code'];
    $nestedData[] = $row['acc_type'];
    $nestedData[] = $row['upi_id'];
    $nestedData[] = '<a href="../cabzvendor_api/'.$row['qr_code'].'" data-fancybox="gallery"><img src="../cabzvendor_api/'.$row['qr_code'].'" width="100px"></a>';
    $nestedData[] = $row['commission'];
    $nestedData[] = $row['reg_date'];
    if ($row['profile_status']==1) {
        $nestedData[] = '<label class="badge badge-success">Active</label>';
    } else if($row['profile_status'] == 0){
        $nestedData[] = '<label class="badge badge-danger">Blocked</label>';
    }else{
        $nestedData[] = '<label class="badge badge-danger">Blocked</label>';
    }

    $data[] = $nestedData;
}

// Prepare JSON data
$json_data = array(
    "draw" => intval($_REQUEST['draw']),
    "recordsTotal" => intval($totalData),
    "recordsFiltered" => intval($totalFiltered),
    "data" => $data
);

echo json_encode($json_data);
?>

MMCT - 2023