[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: function_payout.php
<?php //include '../settings/settings.php'; $date = strtotime(date('Y-m-d')); //Custom Date //echo date('D'); if(date('D') === 'Sat'){ $previous_friday= strtotime("last week friday",$date); $yesterday=date('Y-m-d',strtotime("-1 days")); $friday=date('Y-m-d',$previous_friday); //$coming_friday= strtotime("next friday",$date); //$friday_coming=date('Y-m-d',$coming_friday); //echo $friday; $sq="select * from payout_log where from_date='$friday' and to_date='$yesterday' order by id desc"; //echo $sq; $s1=$con->prepare($sq); $s1->execute(); $num=$s1->rowCount();// echo $num; if($num==0){ $s="insert into payout_log(maker_id,total_amount,p_amount,payout,comission,from_date,to_date,payout_status) SELECT place_order.maker_id,sum(place_order.total),sum(place_order.amount),sum(place_order.amount)-sum(place_order.amount)*(food_maker.comi_percent/100),food_maker.comi_percent,'$friday','$yesterday','PENDING' FROM `place_order` left join food_maker on food_maker.maker_id=place_order.maker_id WHERE cast(place_order.date as date) between '$friday' and '$yesterday' and place_order.status='PLACED' group by place_order.maker_id"; //echo $s; $st=$con->prepare($s); $st->execute(); $sck1="select p1.* from payout_log as p1 left join payout_log as p2 on p1.maker_id=p2.maker_id and p1.id<p2.id where p2.id is null "; $sck=$con->prepare($sck1); $sck->execute(); while ($row = $sck->fetch(PDO::FETCH_ASSOC)){ $mid=$row['maker_id']; $pay=$row['payout']; //echo $mid; $check_total=$show->readwithdata('payout_log_total','maker_id',$mid); $num1=$check_total->rowCount(); echo $num1; if($num1>0){ $row1 = $check_total->fetch(PDO::FETCH_ASSOC); $status=$row1['status']; if($status=='CLEARED'){ $s="update payout_log_total set amount=".$pay." where maker_id='$mid'"; $s12=$con->prepare($s); $s12->execute(); }else{ $s3="update payout_log_total set amount=amount+".$pay." where maker_id='$mid'"; $s123=$con->prepare($s3); $s123->execute(); } }else{ $s124="insert into payout_log_total(maker_id,amount,status) values('$mid','$pay','PENDING')"; $s1245=$con->prepare($s124); $s1245->execute(); } } //$s2="SELECT * from (select id,sum(amount) as a,status,maker_id,max(date) from place_order where status='PLACED' group by maker_id) as y where a>=250 order by id asc "; //$s="insert into payout_log(maker_id,total_amount,p_amount,from_date,to_date,payout_status) SELECT * from (select id,sum(amount) as a,status,maker_id,max(date) from place_order where status='PLACED' group by maker_id) as y where a>=250 order by id asc"; } }else{ echo date('D', $timestamp); } ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.58 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619