/home/desid573/public_html/fc_api
NameSizeModeActions
lib/-0755rm
twilio-php-master/-0755rm
vendor/-0755rm
after_booking_page.php25950644editdlrm
appoff.php47820644editdlrm
booking.php176800644editdlrm
booking_edit_request.php101960644editdlrm
cancel_booking.php60640644editdlrm
check_open.php00644editdlrm
composer.json650644editdlrm
composer.lock23550644editdlrm
confirmsend.php29830644editdlrm
confirm_booking_change.php63050644editdlrm
confirm_booking_change_ajax.php66960644editdlrm
contact_us_mail.php8900644editdlrm
copy_account_to_homekey.php43380644editdlrm
dispatch.php8770644editdlrm
emailConfirmReset.php4860644editdlrm
error_log307610210644editdlrm
family-cab_small.jpg988530644editdlrm
generate_credit.php30980644editdlrm
generate_referall.php27790644editdlrm
getuser_byid.php23410644editdlrm
getuser_bymail.php34190644editdlrm
get_all_booking.php7790644editdlrm
get_booking_bybooking_id.php8130644editdlrm
get_booking_byuser.php10570644editdlrm
get_booking_status.php32460644editdlrm
get_completed_bookings.php7100644editdlrm
get_ETA.php50130644editdlrm
get_lead_message.php6730644editdlrm
get_open_bookings.php15370644editdlrm
get_payment_byuser.php10640644editdlrm
get_price.php410644editdlrm
get_recipes.php63610644editdlrm
get_request_details.php9760644editdlrm
get_TE.php12170644editdlrm
index.php137220644editdlrm
index_backup.php47910644editdlrm
lib_tr.zip1050470644editdlrm
login_api.php86790644editdlrm
noteconfirm.php92280644editdlrm
off.php28540644editdlrm
passwordResetLink.php51700644editdlrm
pay_file.php73020644editdlrm
pay_file_back.php53260644editdlrm
placehold.html21470644editdlrm
reset_email.php17550644editdlrm
reset_phone.php57170644editdlrm
test2.php00644editdlrm
test_222.php8450644editdlrm
update_api.php59100644editdlrm
update_api_on_mail.php47230644editdlrm
validatecode.php10940644editdlrm
validatephone.php10340644editdlrm
Edit: /home/desid573/public_html/fc_api/generate_referall.php (2779B)
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 "
";
print_r($Res);
//print_r($response);
echo "
";*/ $conn->close(); ?>