Skip to content

Commit e3a735d

Browse files
authored
Update gift2all.php
1 parent 17a4f63 commit e3a735d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

settings/gift2all.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
include_once '../config.php';
44
$time = time();
55

6+
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
7+
68
$stmt = $connection->prepare("SELECT * FROM `gift_list` LIMIT 1");
79
$stmt->execute();
810
$giftList = $stmt->get_result();
@@ -101,15 +103,15 @@
101103
if($rowCount < $offset) continue;
102104
$found = true;
103105
$clientRemark = $client['email'];
104-
$uuid = $client['id'];
106+
$uuid = $client['id']??$client['password'];
105107
$clientTotal = $client['totalGB'];
106108
$clientUp = $client['up'];
107109
$clientDown = $client['down'];
108110
$clientExpiry = $client['expiryTime'];
109111
$clientEnable = $client['enable'];
110112

111-
112-
if(count($clients) > 1 && $clientTotal > 0 && $clientExpiry > 0 && $clientEnable){
113+
$responseEdit = null;
114+
if(count(value: $clients) > 1 && $clientTotal > 0 && $clientExpiry > 0 && $clientEnable){
113115
$responseEdit = editClientTraffic($server_id, $inbound_id, $uuid, ($volume / 1024), $day);
114116
$orderExistStmt = $connection->prepare("SELECT * FROM `orders_list` WHERE `server_id` = ? AND `inbound_id` = ? AND `uuid` = ?");
115117
$orderExistStmt->bind_param("iis", $server_id, $inbound_id, $uuid);
@@ -154,7 +156,7 @@
154156
$rowCount++;
155157
if($rowCount < $offset) continue;
156158
$found = true;
157-
$uuid = $clients[0]['id'];
159+
$uuid = $clients[0]['id']??$clients[0]['password'];
158160
if($total > 0 && $expiry_time > 0 && $inboundEnable){
159161
$responseEdit = editInboundTraffic($server_id, $uuid, ($volume/1024), $day);
160162
if(!is_null($responseEdit)){

0 commit comments

Comments
 (0)