/
home
/
desid573
/
public_html
/
app
/
/home/desid573/public_html/app
mkdir
upload
Name
Size
Mode
Actions
braintree/
-
0755
rm
lib/
-
0755
rm
twilio-php-master/
-
0755
rm
vendor/
-
0755
rm
after_booking_page.php
2595
0644
edit
dl
rm
appoff.php
4782
0644
edit
dl
rm
booking.php
9655
0644
edit
dl
rm
cancel_booking.php
4925
0644
edit
dl
rm
composer.json
65
0644
edit
dl
rm
composer.lock
2355
0644
edit
dl
rm
confirmsend.php
2983
0644
edit
dl
rm
contact_us_mail.php
890
0644
edit
dl
rm
copy_account_to_homekey.php
4334
0644
edit
dl
rm
dispatch.php
877
0644
edit
dl
rm
emailConfirmReset.php
401
0644
edit
dl
rm
error_log
586874
0644
edit
dl
rm
family-cab_small.jpg
98853
0644
edit
dl
rm
generate_credit.php
3098
0644
edit
dl
rm
generate_referall.php
2779
0644
edit
dl
rm
getuser_byid.php
2341
0644
edit
dl
rm
getuser_bymail.php
2183
0644
edit
dl
rm
get_all_booking.php
779
0644
edit
dl
rm
get_booking_bybooking_id.php
813
0644
edit
dl
rm
get_booking_byuser.php
1057
0644
edit
dl
rm
get_booking_status.php
2170
0644
edit
dl
rm
get_completed_bookings.php
710
0644
edit
dl
rm
get_ETA.php
6332
0644
edit
dl
rm
get_lead_message.php
673
0644
edit
dl
rm
get_open_bookings.php
1399
0644
edit
dl
rm
get_payment_byuser.php
1064
0644
edit
dl
rm
get_price.php
760
0644
edit
dl
rm
get_recipes.php
6361
0644
edit
dl
rm
get_TE.php
1217
0644
edit
dl
rm
index.php
10411
0644
edit
dl
rm
index_backup.php
4791
0644
edit
dl
rm
lib_tr.zip
105047
0644
edit
dl
rm
login_api.php
5789
0644
edit
dl
rm
noteconfirm.php
8208
0644
edit
dl
rm
off.php
2854
0644
edit
dl
rm
passwordResetLink.php
5190
0644
edit
dl
rm
pay_file.php
7302
0644
edit
dl
rm
pay_file_back.php
5326
0644
edit
dl
rm
placehold.html
2141
0644
edit
dl
rm
post.php
2535
0644
edit
dl
rm
reset_email.php
1775
0644
edit
dl
rm
reset_phone.php
5717
0644
edit
dl
rm
test_222.php
845
0644
edit
dl
rm
update_api.php
5910
0644
edit
dl
rm
update_api_on_mail.php
4723
0644
edit
dl
rm
validatecode.php
1094
0644
edit
dl
rm
validatephone.php
1055
0644
edit
dl
rm
Edit:
/home/desid573/public_html/app/generate_referall.php
(2779B)
<?php require("lib/config.php"); // =============== Get referral code api =================================== $data = $_REQUEST; $sql = "SELECT * FROM customers where email = '".$_REQUEST['username']."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $customer[] = $row; $cid = $row["id"]; } $seed = str_split('abcdefghijklmnopqrstuvwxyz' .'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .'0123456789!@'); shuffle($seed); // probably optional since array_is randomized; this may be redundant $rand = ''; foreach (array_rand($seed, 6) as $k) $rand .= $seed[$k]; $sql = "SELECT * FROM `referrals` WHERE `customer_id` = '".$cid."'"; $exist = $conn->query($sql); if ($exist->num_rows >0) { $cell = $exist->fetch_assoc(); $code = $cell["code"]; $value = $cell["value"]; $sql = "SELECT * FROM `referal_claim` WHERE `customer_id` = '".$cid."'"; $claims = $conn->query($sql); if($claims->num_rows >0) { $claimsRow = $claims->fetch_assoc(); $ref_created = $claimsRow["referrals_generated"]; $ref_claimed = $claimsRow["referrals_claimed"]; $value = $claimsRow["value"]; } else { $ref_created = 0; $ref_claimed = 0; $value = 0; } $Res["message"] = "Referral Code Already Exists"; $Res["status"] = "OK"; $Res["code"] = $code; $Res["value"] = $value; $Res["ref_created"] = $ref_created; $Res["ref_claimed"] = $ref_claimed; $Res["value"] = $value; } else { $code = "RF".$rand; $value = "0.8"; $sql = "INSERT INTO `referrals` (`id`, `customer_id`, `code`, `value`, `date_created`, `date_modified`) VALUES (NULL, '".$cid."', '".$code."', '".$value."', NOW() ,NOW() )"; $success = $conn->query($sql); if($success) { $Res["message"] = "Referral Code Generated"; $Res["status"] = "OK"; $Res["code"] = $code; $Res["ref_created"] = 0; $Res["ref_claimed"] = 0; $Res["value"] = 0; } else { $Res["message"] = "Error Generating Referral Code"; $Res["status"] = "error"; echo $conn->error; } } $sql = "SELECT * FROM credits where customer_id = '".$cid."' and is_used = 0"; $result = $conn->query($sql); $credit_value = 0; if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $credit_value = $credit_value + $row['value']; } $Res["credit_value"] = $credit_value; } else { $Res["credit_value"] = 0; } } else { $Res["message"] = "Customer not found"; $Res["status"] = "error"; error_log("add to customers error: ".$conn->error); } echo json_encode(new ArrayObject($Res)); /*echo "<pre>"; print_r($Res); //print_r($response); echo "</pre>";*/ $conn->close(); ?>
Save
cmd:
run