Файловый менеджер - Редактировать - /home/d46091/udyog-adhaar.in/complaint-submit-re.php
Назад
<?php require("./config.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'; if(($_POST["complaint_id"] != '')) { $sql_select_form = 'SELECT * FROM complaint_forms WHERE complaint_id = "'.$_POST["complaint_id"].'"'; $result_select_form = $conn->prepare($sql_select_form); $result_select_form -> execute(); if ($result_select_form->rowCount() == 1) { $row_select_form = $result_select_form->fetch(PDO::FETCH_ASSOC); $meta_user = $row_select_form['applicant_name']; $message = urlencode($_POST["message"]); $metaType='out'; $formName='complaint form'; } $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, :metaUser,:metaType,:formCreatedOn, :formCreatedOnTime)"; $result = $conn->prepare($sql_insert_into_timeline); $result->execute( [ 'complaintId' => $_POST["complaint_id"], 'formName' => $formName, 'message' => $message, 'metaUser' => $meta_user, 'metaType' => $metaType, 'formCreatedOn' => $form_created_on_date, 'formCreatedOnTime' => $form_created_on_time, ] ); if(!$result = $conn->prepare($sql_insert_into_timeline)){ die('There was an error running the query [' . $conn->error . ']'); }else { $post = [ 'complaint_id' => $_POST["complaint_id"], 'message' => $message ]; // if ($_SERVER['HTTP_HOST'] == 'localhost') { // $ch = curl_init('http://localhost/crm.techlounge.co.in/api/complaint-re.php'); // } else { // $ch = curl_init('https://crm.techlounge.co.in/api/complaint-re.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/crm2.techlounge.co.in/api/complaint-re.php'); } else { $ch = curl_init('https://crm2.techlounge.co.in/api/complaint-re.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/crm11.techlounge.co.in/api/complaint-re.php'); } else { $ch = curl_init('https://crm11.techlounge.co.in/api/complaint-re.php'); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); echo $response; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка