Files
Testing/expire_users-segpay.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

185 lines
4.8 KiB
PHP

<?php
//ob_start();
$adminredirect=2;
header("Content-Type: text/html\n\n");
//chdir('../bwadmin/');
$redirect=1;
include('header.php');
if($_GET["purchaseid"]!=""){
ini_set('display_errors', true);
ini_set("error_log", "/home/bateworldcom/public_html/bwadmin/errors/error_log");
//mail("leprakhauns@gmail.com", "Expire Users2", $var);
$plan = new semods_plan(1, 1);
$are_expiring_members = FALSE; // only run query if there are expiring members
$subscription_id_where = " WHERE";
//preg_match('/\d{19}/', $expired_user, $subscription_id_match);
// if($subscription_id_match[0]) :
$subscription_id_where .= " userplan_metadata LIKE '%".$database->database_real_escape_string($_GET["purchaseid"])."%'";
$are_expiring_members = TRUE;
//endif;
//$subscription_id_where .= '1=0;'; // tacked onto the WHERE ORs to avoid syntax snafu
if($are_expiring_members) :
$sql = "SELECT * FROM se_semods_userplans " . $subscription_id_where;
$query=$database->database_query($sql);
if($database->database_num_rows($query)==0)
{
//mail("leprakhauns@gmail.com", "Expire user", $sql);
}
while($row=$database->database_fetch_array($query)){
//if($row["userplan_expiredate"] < time()){
$plan_to_expire = new semods_plan($row['userplan_plan_id'], $row['userplan_user_id']);
if($plan_to_expire->plan_exists) :
$plan_to_expire->userplan->expire_plan();
else:
$database->database_query("UPDATE se_users SET user_level=5 WHERE user_id='".$database->database_real_escape_string($_GET["username"])."'");
mail("bateworldhelp@gmail.com", "Problem with downgrading user", $_GET["username"]."'s transaction cannot be found.");
mail("leprakhauns@gmail.com", "Problem with downgrading user", $_GET["username"]."'s transaction cannot be found.");
//email Wayne and make them basic
endif;
//}else{mail("leprakhauns@gmail.com", "Check this ID", $subscription_id_where);}
if($row["userplan_expiredate"]==0||$row["userplan_expiredate"]=="")
{
mail("bateworldhelp@gmail.com", "Problem with downgrading user", $_GET["username"]."'s transaction cannot be found.");
mail("leprakhauns@gmail.com", "Problem with downgrading user", $_GET["username"]."'s transaction cannot be found.");
}
//var_dump($row);
//exit;
}
endif;
//mail("leprakhauns@gmail.com", "Expire Users3", $var);
/*
* WHERE for grabbing appropriate plan rows
* SELECT * FROM se_semods_userplans WHERE userplan_metadata LIKE '%0110284102000000367%';
*
*/
exit;
subscriber_scheduler_daily();
/*
* https://datalink.ccbill.com/data/main.cgi?startTime=20100901000000&endTime=20101003000000&transactionTypes=NEW,EXPIRE&clientAccnum=940183&username=peterr24&password=MICKEY12
*/
/*
File sample:
"NEW","940183","0000","0310283701000000753","20101010044319","Mr AJ le","Roux","poppersp","Expl1c1t","28 Huntstile","Goathurst","XX","TA5 2DQ","GB","antler62@gmail.com","","Y","15.00","90","15.00","90","99","VISA"
"NEW","940183","0000","0110283701000011916","20101010051505","L STEVEN","JAEGER","hangnjo","drrcjcbm","15 Ridge Dr.","Melville","NY","11747","US","hangnjo@yahoo.com","","Y","15.00","90","15.00","90","99","VISA"
"NEW","940183","0000","0210283701000006619","20101010101301","MARIOS","AIVATOGLOU","marios74","040674","Efessou 6","N.Smirni","XX","17121","GR","marios00aiv@hotmail.com","","Y","15.00","90","15.00","90","99","VISA"
"NEW","940183","0000","0210283701000006771","20101010102315","Justin","Rodriguez","jdawg069","jtotharo","1656 Sand Canyon Drive","Las Vegas","NV","89128","US","justinmrodriguez@gmail.com","","Y","45.00","365","0","0","0","VISA"
"NEW","940183","0000","0210283701000007009","20101010104202","Cirillo","Benitez","rillo420","rillo1","91 Conaskonk Circle","Royal Palm Beach","FL","33411","US","big_boy20_98@yahoo.com","","Y","15.00","90","15.00","90","99","VISA"
"NEW","940183","0000","0210283701000007236","20101010105823","Don R Day","Jr","gwinnett","31761768","3778 Creekstone Drive","Nocross","GA","30092","US","gwinnett6ft4@hotmail.com","","Y","45.00","365","0","0","0","VISA"
"NEW","940183","0000","0210283701000009463","20101010133248","David","Gaita","stroking","teacher3","10 Wampus Ave #23","Acton","MA","01720","US","teach2U1229@msn.com","","Y","15.00","90","15.00","90","99","VISA"
"NEW","940183","0000","0210283701000015072","20101010204754","Elvin","Cook","reckless","cartoon7","2004 Mimosa Trail","Round Rock","TX","78664","US","zoglet@austin.rr.com","","Y","25.00","180","0","0","0","VISA"
"NEW","940183","0000","0310283701000003432","20101010220734","Mr Kevin B","Sharp","budd44","vernon","93 Adam Street , Wynnum","Brisbane","QLD","4178","AU","womm26@me.com","","Y","45.00","365","0","0","0","VISA"
"EXPIRE","940183","0000","0210193101000013017","2010-10-10","NULL","N"
"EXPIRE","940183","0000","0210193101000022578","2010-10-10","NULL","N"
*/
//$var = ob_get_clean();
}
include('footer.php');
?>