D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
aviscollection.com
/
Filename :
enquiry_submit.php
back
Copy
<?php include'config.php'; error_reporting(0); $html = ""; if (isset($_POST['action']) && $_POST['action'] == 'contact_enquiry') { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $subject = $_POST['subject']; $message = $_POST['message']; $date = date('Y-m-d'); // print_r($_POST); $insrt_item = "INSERT INTO `contactus`(`name`, `phone`, `email`, `subject`, `message`, `date`) VALUES ('$name','$phone', '$email', '$subject', '$message', '$date')"; $run_item = mysqli_query($conn, $insrt_item) or die(mysqli_error($conn)); if ($run_item) { echo "Contact inquiry submitted."; $html="<table> <tr><td colspan='2'><h3>Contact Enquiry</h3></td></tr> <tr><td>Name :</td><td>$name</td></tr> <tr><td>Email :</td><td>$email</td></tr> <tr><td>Mobile :</td><td>$phone</td></tr> <tr><td>Subject :</td><td>$subject</td></tr> <tr><td>Message :</td><td>$message</td></tr> </table>"; // echo $html; // include('smtp/PHPMailerAutoload.php'); // $mail=new PHPMailer(true); // $mail->isSMTP(); // $mail->Host="smtp.gmail.com"; // $mail->SMTPSecure="tls"; // $mail->Port=587; // $mail->SMTPAuth=true; // $mail->Username="kalpantpoddar420@gmail.com"; // $mail->Password="rqxpfjguixcglrxb"; // $mail->SetFrom("kalpant.k.poddar@gmail.com", "$company Contact Inquiry"); // $mail->addAddress("kalpantpoddar420@gmail.com", "Contact Enquiry"); // $mail->IsHTML(true); // $mail->Subject="New Contact Enquiry"; // $mail->Body=$html; // $mail->SMTPOptions=array('ssl'=>array( // 'verify_peer'=>false, // 'verify_peer_name'=>false, // 'allow_self_signed'=>false // )); // if($mail->send()){ // echo "Enquiry mail send."; // // echo '<script>window.history.go(-1)</script>'; // }else{ // echo $mail->ErrorInfo; // } } else{ echo "Contact inquiry did not submitted."; // echo '<script>alert("Contact inquiry did not submitted.")</script>'; } } if (isset($_POST['action']) && $_POST['action'] == 'membership_enquiry') { $name = $_POST['name']; $email = $_POST['email']; $phone1 = $_POST['phone1']; $phone2 = $_POST['phone2']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $postalcode = $_POST['postalcode']; $country = $_POST['country']; $status = 0; $date = date('Y-m-d'); // print_r($_POST); $insrt_item = "INSERT INTO `membership_enquiries`() VALUES ('','$name','$email','$phone1','$phone2','$address','$city','$state','$postalcode','$country','$status','$date')"; $run_item = mysqli_query($conn, $insrt_item) or die(mysqli_error($conn)); if ($run_item) { echo "Membership inquiry submitted."; $html="<table> <tr><td colspan='2'><h3>Contact Enquiry</h3></td></tr> <tr><td>Name :</td><td>$name</td></tr> <tr><td>Email :</td><td>$email</td></tr> <tr><td>Mobile :</td><td>$phone1</td></tr> </table>"; // echo $html; // include('smtp/PHPMailerAutoload.php'); // $mail=new PHPMailer(true); // $mail->isSMTP(); // $mail->Host="smtp.gmail.com"; // $mail->SMTPSecure="tls"; // $mail->Port=587; // $mail->SMTPAuth=true; // $mail->Username="kalpantpoddar420@gmail.com"; // $mail->Password="rqxpfjguixcglrxb"; // $mail->SetFrom("kalpant.k.poddar@gmail.com", "$company Contact Inquiry"); // $mail->addAddress("kalpantpoddar420@gmail.com", "Contact Enquiry"); // $mail->IsHTML(true); // $mail->Subject="New Contact Enquiry"; // $mail->Body=$html; // $mail->SMTPOptions=array('ssl'=>array( // 'verify_peer'=>false, // 'verify_peer_name'=>false, // 'allow_self_signed'=>false // )); // if($mail->send()){ // echo "Enquiry mail send."; // // echo '<script>window.history.go(-1)</script>'; // }else{ // echo $mail->ErrorInfo; // } } else{ echo "Membership inquiry did not submitted."; // echo '<script>alert("Contact inquiry did not submitted.")</script>'; } } if(isset($_POST['customer_login'])){ $userphone = $_POST['cust_phone']; $userpswd = $_POST['cust_pswd']; $cust_phone = get_safeStr($userphone); $cust_pswd = get_safeStr($userpswd); $view_cust = "SELECT * FROM customers WHERE customer_phone = '$cust_phone' AND customer_password = '$cust_pswd'"; $result = mysqli_query($conn, $view_cust) or mysqli_error($conn); $data = mysqli_num_rows($result); if ($data == 1){ $user = mysqli_fetch_assoc($result); $_SESSION['customer_id'] = $user['customer_id']; $_SESSION['customer_name'] = $user['customer_name']; $_SESSION['customer_phone'] = $user['customer_phone']; echo '<script> window.location.href = "./";</script>'; } else{ echo '<script>alert("Login Failed.")</script>'; echo '<script>window.history.go(-1)</script>'; } } if(isset($_POST['action']) && $_POST['action'] == 'add_wishlist') { $product_id = $_POST['productId']; $customer_id = $_SESSION['customer_id']; $date = date('Y-m-d'); // $arr = array("product_id"=>$product_id, "customer_id"=>$customer_id,"Date"=>$date); // pr($arr); $wish_result = ''; $product_id = get_safeStr($product_id); $customer_id = get_safeStr($customer_id); $check_wishlist = "SELECT * FROM `wishlist` WHERE `product_id` = '$product_id' AND `customer_id` = '$customer_id'"; $run_wishlist = mysqli_query($conn, $check_wishlist) or mysqli_error($conn); if ($_SESSION['customer_id']=='') { echo 'Please! Log In to add product in wishlist.'; } else{ if (mysqli_num_rows($run_wishlist) > 0) { echo 'Product already have in wishlist.'; } else{ $add_wishlist = mysqli_query($conn, "INSERT INTO wishlist(product_id, product_qty, wish_date, customer_id) values('$product_id', 1, '$date', '$customer_id')"); if ($add_wishlist) { echo 'Product added in wishlist.'; } } } } if (isset($_GET['wish_action'])) { if ($_GET['wish_action'] == "delete-item") { delete_wishItem(); } } function delete_wishItem(){ global $conn; $id = encryptor('decrypt', $_GET['wish_id']); $del_query = mysqli_query($conn, "DELETE FROM wishlist where wish_id = $id"); if($del_query){ echo '<script>window.history.go(-1)</script>'; } else{ echo '<script>alert("Action Failed.")</script>'; } } if (isset($_POST['action']) && $_POST['action'] == 'order_action') { error_reporting(0); $name = $_POST['name']; $phone = $_POST['phone']; $location = $_POST['location']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $pin = $_POST['pin']; $product = $_POST['product']; $category = $_POST['category']; $date = date('Y-m-d'); // $arr = array($name, $location, $phone,$address,$city,$state,$pin,$product,$category, $date); // pr($arr); $viewCustomer = "SELECT * FROM customers WHERE customer_phone = '$phone'"; $runQuery = mysqli_query($conn, $viewCustomer) or mysqli_error($conn); // $custRow = mysqli_num_rows($runQuery); $res = mysqli_fetch_array($runQuery); $custname = $res['customer_name']; $custphone = $res['customer_phone']; if($custname != $name && $custphone != $phone){ echo $insrtCust = mysqli_query($conn, "INSERT INTO customers(customer_id, customer_name, customer_phone, customer_address, customer_location, customer_city, customer_pin, customer_state, addon_date) VALUES('', '$name', '$phone', '$address', '$location', '$city', '$pin', '$state', '$date')") or mysqli_error($conn); if($insrtCust){ echo "New customer details is uploaded."; }else{ echo "New customer details is not updated.".mysqli_error($conn); } } else{ $editCust = mysqli_query($conn, "UPDATE `customers` SET `customer_name`='$name',`customer_address`='$address',`customer_location`='$location',`customer_city`='$city',`customer_pin`='$pin',`customer_state`='$state',`addon_date`='$date' WHERE customer_phone = '$phone'"); if($editCust){ echo "customer details updated."; } else{ echo "customer details not updated."; } } $checkOrdr = "SELECT * FROM orders WHERE cust_phone = '$phone' AND product_id = '$product'"; $viewOrdr = mysqli_query($conn, $checkOrdr) or mysqli_error($conn); // $ordrData = mysqli_fetch_array($viewOrdr, MYSQLI_NUM); // if($ordrData[0] > 0){ if(mysqli_num_rows($viewOrdr) > 0){ echo "Order already accepted."; die(); } else{ $insert_ordr = "INSERT INTO orders() VALUES('', $product, $category, '', '$date', '', '$name', '$phone')"; $query_ordr = mysqli_query($conn, $insert_ordr) or mysqli_error($conn); if($query_ordr){ echo "New order booking is successful."; }else{ echo "Your order booking failed.".mysqli_error($conn); } } // if ($query_ordr) { // echo "Costomer ".$name." submitted."; // $html="<table> // <tr><td colspan='2'><h3>New Customer Registered.</h3></td></tr> // <tr><td>Name :</td><td>$name</td></tr> // <tr><td>Email :</td><td>$email</td></tr> // <tr><td>Mobile :</td><td>$phone</td></tr> // </table>"; // // echo $html; // include('smtp/PHPMailerAutoload.php'); // $mail=new PHPMailer(true); // $mail->isSMTP(); // $mail->Host="smtp.gmail.com"; // $mail->SMTPSecure="tls"; // $mail->Port=587; // $mail->SMTPAuth=true; // $mail->Username="kalpantpoddar420@gmail.com"; // $mail->Password="rqxpfjguixcglrxb"; // $mail->SetFrom("kalpant.k.poddar@gmail.com", "ICP Customer Registration"); // $mail->addAddress("kalpantpoddar420@gmail.com", "New Customer Registration"); // $mail->IsHTML(true); // $mail->Subject="New Customer Registration."; // $mail->Body=$html; // $mail->SMTPOptions=array('ssl'=>array( // 'verify_peer'=>false, // 'verify_peer_name'=>false, // 'allow_self_signed'=>false // )); // if($mail->send()){ // echo "<script>alert('Order Booking mail send.');</script>"; // echo '<script> window.location.href = "login";</script>'; // }else{ // echo $mail->ErrorInfo; // } // echo "Your order booked."; // }else{ // echo "Your order booking failed."; // } } if (isset($_POST['action']) && $_POST['action'] == 'signup_action') { $name = $_POST['name']; $phone = $_POST['phone']; $dob = $_POST['dob']; $address = $_POST['address']; $password = $_POST['password']; $date = date('Y-m-d'); // $arr = array($name, $dob, $phone,$address,$password, $date); // pr($arr); echo $insrt_cust = mysqli_query($conn, "INSERT INTO customers(customer_id, customer_name, customer_phone, customer_dob, customer_address, customer_password, addon_date) VALUES('', '$name', '$phone', '$dob','$address', '$password', '$date')") or mysqli_error($conn); if($insrt_cust){ echo "Your customer details is uploaded."; }else{ echo "Your customer details is not updated.".mysqli_error($conn); } // if ($query_ordr) { // echo "Costomer ".$name." submitted."; // $html="<table> // <tr><td colspan='2'><h3>New Customer Registered.</h3></td></tr> // <tr><td>Name :</td><td>$name</td></tr> // <tr><td>Email :</td><td>$email</td></tr> // <tr><td>Mobile :</td><td>$phone</td></tr> // </table>"; // // echo $html; // include('smtp/PHPMailerAutoload.php'); // $mail=new PHPMailer(true); // $mail->isSMTP(); // $mail->Host="smtp.gmail.com"; // $mail->SMTPSecure="tls"; // $mail->Port=587; // $mail->SMTPAuth=true; // $mail->Username="kalpantpoddar420@gmail.com"; // $mail->Password="rqxpfjguixcglrxb"; // $mail->SetFrom("kalpant.k.poddar@gmail.com", "ICP Customer Registration"); // $mail->addAddress("kalpantpoddar420@gmail.com", "New Customer Registration"); // $mail->IsHTML(true); // $mail->Subject="New Customer Registration."; // $mail->Body=$html; // $mail->SMTPOptions=array('ssl'=>array( // 'verify_peer'=>false, // 'verify_peer_name'=>false, // 'allow_self_signed'=>false // )); // if($mail->send()){ // echo "<script>alert('Order Booking mail send.');</script>"; // echo '<script> window.location.href = "login";</script>'; // }else{ // echo $mail->ErrorInfo; // } // echo "Your order booked."; // }else{ // echo "Your order booking failed."; // } } ?>