/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
main
/
ajax
/
account_receipt
/
up file
home
<?php session_start(); include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); if ($connection) { //// head $receipt_id = getRandomID2(10, 'tbl_receipt_head', 'receipt_id'); $receipt_no = getRunNO($size = 4, "REC" . $text = date('y') + 43. . date('m'), 'tbl_receipt_head', 'receipt_no'); $create_user_id = mysqli_real_escape_string($connection, $_POST['create_user_id']); $temp_id = explode(".", $create_user_id); $create_user_id = bigsara_decode($temp_id[0], $temp_id[1]); $date = explode('/', $_POST['receipt_date']); $receipt_date = date('Y-m-d', strtotime($date['0'] ."-" . $date['1'] . "-" . $date['2'])); $ref_number = mysqli_real_escape_string($connection, $_POST['ref_number']); $customer_name = mysqli_real_escape_string($connection, $_POST['member_name']); $customer_tax_no = mysqli_real_escape_string($connection, $_POST['customer_tax_no']); $customer_phone = mysqli_real_escape_string($connection, $_POST['customer_phone']); $customer_address = mysqli_real_escape_string($connection, $_POST['customer_address']); $customer_email = mysqli_real_escape_string($connection, $_POST['customer_email']); $recipt_remark = mysqli_real_escape_string($connection, $_POST['recipt_remark']); $job_name = mysqli_real_escape_string($connection, $_POST['job_name']); $member_id = mysqli_real_escape_string($connection, $_POST['member_id']); $sql_head = "INSERT INTO tbl_receipt_head SET receipt_id = '$receipt_id', create_user_id = '$create_user_id', receipt_no = '$receipt_no', receipt_date = '$receipt_date', job_name = '$job_name', member_id = '$member_id', ref_invoice_id = '$ref_number', customer_name = '$customer_name', customer_tax_no = '$customer_tax_no', customer_phone = '$customer_phone', customer_address = '$customer_address', customer_email = '$customer_email', remark = '$recipt_remark' "; $res_head = mysqli_query($connection, $sql_head) or die($connection->error); if ($res_head) { $arr['result'] = 1; } else { $arr['result'] = 0; } } else { $arr['result'] = 9; } echo json_encode($arr); ?>