-
Notifications
You must be signed in to change notification settings - Fork 4
/
activate-clients.php
36 lines (27 loc) · 1.09 KB
/
activate-clients.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// SET YOUR BOXBILLING DATABASE DETAUKS HERE
$DBHOST = 'localhost';
$DBUSER = 'whmcs-database-user';
$DBPASS = 'whmcs-database-password';
$DBNAME = 'whmcs-database-name';
// DONT MAKE CHANGES AFTER THIS LINE
$con = mysql_connect($DBHOST, $DBUSER, $DBPASS) or die (mysql_error());
$sdb = mysql_select_db($DBNAME) or die (mysql_error());
$QueryIDSet = mysql_query("SELECT MIN(id) AS min, MAX(id) AS max FROM tblclients") or exit(mysql_error());
$FetchIDSet = mysql_fetch_assoc($QueryIDSet);
$FirID = $FetchIDSet['min'];
$SecID = $FetchIDSet['max'];
while ( $FirID <= $SecID ):
$GetStatus = mysql_fetch_array(mysql_query("SELECT status FROM tblclients WHERE id='$FirID'"));
$ClientStatus = $GetStatus['status'];
if ( $ClientStatus !== 'Active' ):
$ActivateQuery = mysql_query("UPDATE $DBNAME.`tblclients` SET `status` = 'Active' WHERE `tblclients`.`id` = $FirID");
endif;
$FirID++;
endwhile;
// SCRIPT BY SHYAMIN AYESH
// fb.me/Shyamin.Ayesh
// please contact me if you have any issue with this script
// https://www.hostinglions.com <- Sri Lankan Cheap web Hosting
?>