Файловый менеджер - Редактировать - /home/d46091/udyogaadhaaronline.com/complaint-submit-new.php
Назад
<?php require("./config/db.php"); date_default_timezone_set('Asia/Kolkata'); $date=date('d-m-Y H:i:s'); $form_created_on_date = date('d-m-Y'); $form_created_on_time = date('H:i:s'); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require './vendor/autoload.php'; $applicant_name = urlencode($_POST['applicant_name']); $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); if(isset($_POST["submit"])) { $complaint_id = 'CMP-2020-'.(rand(100000000,999999999)); $message = urlencode($_POST["complaint_details"]); $orderId = $_POST["order_id"]; $sql_search_order="SELECT * FROM complaint_forms WHERE order_id = :orderId AND status= :status"; $result = $conn->prepare($sql_search_order); $result -> execute([':orderId' => $orderId , ':status' => '']); if ($result->rowCount() > 0){ echo "<script>alert('You cannot file new complaint as your complaint id is already generated. Please use TRACK COMPLAINT Section to track your complaint status.'); location.href='./complaint-track-submit.php';</script>"; }else{ $formName = 'complaint form'; $sql_insert=" INSERT INTO complaint_forms ( complaint_id,form_name,applicant_name,mobile_number,email_id,order_id,transaction_date,transaction_amount,complaint_details,form_created_date ) VALUES(:complaintId,:formName, :applicantName,:mobileNumber,:emailId,:orderId, :transactionDate, :transactionAmount, :message, :date)"; $stmt = $conn->prepare($sql_insert); $stmt->execute( [ 'complaintId' => $complaint_id, 'formName' => $formName, 'applicantName' => $_POST['applicant_name'], 'mobileNumber' => $_POST['mobile_number'], 'emailId' => $_POST['email_id'], 'orderId' => $orderId, 'transactionDate' => $_POST["transaction_date"], 'transactionAmount' => $_POST["transaction_amount"], 'message' => $message, 'date' => $date, ] ); if(!$stmt = $conn->prepare($sql_insert)){ die('There was an error running the query [' . $conn->error . ']'); } else { $metaType='out'; $sql_insert_into_timeline = " INSERT INTO complaint_timeline ( meta_id, meta_name, meta_description, meta_user, meta_type, form_created_on, form_created_time ) VALUES(:complaintId,:formName, :message, :applicantName,:metaType,:formCreatedOn, :formCreatedOnTime)"; $result = $conn->prepare($sql_insert_into_timeline); $result->execute( [ 'complaintId' => $complaint_id, 'formName' => $formName, 'message' => $message, 'applicantName' => $_POST['applicant_name'], 'metaType' => $metaType, 'formCreatedOn' => $form_created_on_date, 'formCreatedOnTime' => $form_created_on_time, ] ); if ($result) { $post = [ 'business' => 'MSME', 'complaint_id' => $complaint_id, 'form_name' => 'Complaint Form', 'applicant_name' => $_POST["applicant_name"], 'mobile_number' => $_POST["mobile_number"], 'email_id' => $_POST["email_id"], 'order_id' => $_POST["order_id"], 'transaction_date' => $_POST["transaction_date"], 'transaction_amount' => $_POST["transaction_amount"], 'complaint_details' => $message, // 'website' => 'UDYOGADHARCERTIFICATE.IN' 'website' => strtoupper($_SERVER['SERVER_NAME']) ]; if ($_SERVER['HTTP_HOST'] == 'localhost') { $ch = curl_init('http://localhost/crm2.techlounge.co.in/api/complaint-new.php'); } else { $ch = curl_init('https://crm2.techlounge.co.in/api/complaint-new.php'); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); // echo $response; if ($_SERVER['HTTP_HOST'] == 'localhost') { $ch = curl_init('http://localhost/crm5.in/api/complaint-new.php'); } else { $ch = curl_init('https://crm11.techlounge.co.in/api/complaint-new.php'); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); header ('location: ./complaint-success.php?complaint_id='.$complaint_id.''); exit(); } } } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка