query($sql)){ die('There was an error running the query [' . $conn->error . ']'); } else { $sql = " INSERT INTO complaint_timeline ( meta_id, meta_name, meta_description, meta_user, meta_type, form_created_on, form_created_time ) VALUES ( '".$complaint_id."', 'complaint form', '".$message."', '".$_POST["applicant_name"]."', 'out', '".$form_created_on_date."', '".$form_created_on_time."' ) "; $result = $conn->query($sql); if ($result) { // $post = [ // 'complaint_id' => $complaint_id, // 'form_name' => 'Complaint Form', // 'applicant_name' => $_POST["applicant_name"], // 'mobile_number' => $_POST["mobile_number"], // 'email_id' => $_POST["email_id"], // 'docs' => $_POST["docs"], // '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/crm.techlounge.co.in/api/complaint-new.php'); // } else { // $ch = curl_init('https://crm.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); $post = [ 'business' => 'GEM', 'complaint_id' => $complaint_id, 'form_name' => 'Complaint Form', 'applicant_name' => $_POST["applicant_name"], 'mobile_number' => $_POST["mobile_number"], 'email_id' => $_POST["email_id"], 'docs' => $_POST["docs"], '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'); $ch = curl_init('https://crm5.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; header ('location: ./complaint-success.php?complaint_id='.$complaint_id.''); } } } ?>