Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting( ~E_NOTICE ); // avoid notice
- session_start();
- ob_start();
- $passwordd = $_SESSION['passwordd'];
- $userid = $_SESSION['usernamee'];
- $empno = $_SESSION['employee_no'];
- $cartrn = $_SESSION["cartno"];
- ?>
- <?php
- if(isset($_POST['submit']))
- {
- //SMTP needs accurate times, and the PHP time zone MUST be set
- //This should be done in your php.ini, but this is how to do it if you don't have access to that
- date_default_timezone_set('Etc/UTC');
- include('connectdb.php');
- //get cart no
- $sql = "SELECT * FROM cart_rec WHERE cartrn = '$cartrn'";
- $result = $conn->query($sql);
- while($data = $result->fetch_assoc()) {
- $fn = $data['cartfn'];
- $pname = $data['cartname'];
- $email = $data['cartemail'];
- $To = $data['cartemail']; }
- require 'PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //Tell PHPMailer to use SMTP
- $mail->isSMTP();
- //Enable SMTP debugging
- // 0 = off (for production use)
- // 1 = client messages
- // 2 = client and server messages
- $mail->SMTPDebug = 2;
- //Ask for HTML-friendly debug output
- $mail->Debugoutput = 'html';
- //Set the hostname of the mail server
- $mail->Host = 'shop.onemarketglobal.com.ph';
- // use
- // $mail->Host = gethostbyname('smtp.gmail.com');
- // if your network does not support SMTP over IPv6
- //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
- $mail->Port = 587;
- //Set the encryption system to use - ssl (deprecated) or tls
- $mail->SMTPSecure = 'tls';
- //Whether to use SMTP authentication
- $mail->SMTPAuth = true;
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- //Username to use for SMTP authentication - use full email address for gmail
- $mail->Username = "no-reply@shop.onemarketglobal.com.ph";
- //Password to use for SMTP authentication
- $mail->Password = "amcvillamar";
- //Set who the message is to be sent from
- $mail->setFrom('no-reply@shop.onemarketglobal.com.ph', 'One Market Global');
- //Set an alternative reply-to address
- $mail->addReplyTo('no-reply@shop.onemarketglobal.com.ph', 'One Market Global');
- //Set who the message is to be sent to
- $address = $To;
- $mail->addAddress($address);
- //Set the subject line
- $mail->Subject = 'Good Day!';
- //Read an HTML message body from an external file, convert referenced images to embedded,
- //convert HTML into a basic plain-text alternative body
- $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
- //Replace the plain text body with one created manually
- $mail->Body = 'Good day! This is Angela Villamar from On.Ma.Glo Marketing. We would like to inform you that you have completed your order. Wait for the admins to approve your order. Thank you!';
- $mail->AltBody = 'Regarding your Order..';
- //send the message, check for errors
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else {
- include('connect.php');
- $sql = "INSERT INTO comments(comment_subject, comment_text, comment_user)
- VALUES ('$fn', '$pname', '$userid')";
- if ($conn->query($sql) === TRUE) {
- header("Location: shoppaymentok.php");
- }
- else {
- echo "Error updating record: " . $conn->error;
- }
- }
- exit();
- //Section 2: IMAP
- //Uncomment these to save your message in the 'Sent Mail' folder.
- #if (save_mail($mail)) {
- # echo "Message saved!";
- #}
- //Section 2: IMAP
- //IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php
- //Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php
- //You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can
- //be useful if you are trying to get this working on a non-Gmail IMAP server.
- function save_mail($mail) {
- //You can change 'Sent Mail' to any other folder or tag
- $path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail";
- //Tell your server to open an IMAP connection using the same username and password as you used for SMTP
- $imapStream = imap_open($path, $mail->Username, $mail->Password);
- $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage());
- imap_close($imapStream);
- return $result;
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en-US" dir="ltr">
- <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
- <style>
- /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
- .multi-steps > li.is-active:before, .multi-steps > li.is-active ~ li:before {
- content: counter(stepNum);
- font-family: inherit;
- font-weight: 500;
- font-size: 20px;
- }
- .multi-steps > li.is-active:after, .multi-steps > li.is-active ~ li:after {
- background-color: #ededed;
- }
- .multi-steps {
- display: table;
- table-layout: fixed;
- width: 100%;
- }
- .multi-steps > li {
- counter-increment: stepNum;
- text-align: center;
- display: table-cell;
- position: relative;
- color: tomato;
- }
- .multi-steps > li:before {
- content: '\f00c';
- content: '\2713;';
- content: '\10003';
- content: '\10004';
- content: '\2713';
- display: block;
- margin: 0 auto 4px;
- background-color: #fff;
- width: 40px;
- height: 36px;
- line-height: 32px;
- text-align: center;
- font-weight: bold;
- border-width: 4px;
- border-style: solid;
- border-color: tomato;
- border-radius: 80%;
- }
- .multi-steps > li:after {
- content: '';
- height: 2px;
- width: 100%;
- background-color: tomato;
- position: absolute;
- top: 16px;
- left: 50%;
- z-index: -1;
- }
- .multi-steps > li:last-child:after {
- display: none;
- }
- .multi-steps > li.is-active:before {
- background-color: #fff;
- border-color: tomato;
- }
- .multi-steps > li.is-active ~ li {
- color: #808080;
- }
- .multi-steps > li.is-active ~ li:before {
- background-color: #ededed;
- border-color: #ededed;
- }
- .shop-Cart-totalbox {
- background-color: #fcfcfc;
- padding: 5px 20px 15px 20px;
- border: 1px solid lightgrey;
- }
- </style>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <!--================TITLE, HEADER, NAVIGATION=================-->
- <?php
- //get prod id
- if(isset($_GET['id']) && !empty($_GET['id']))
- {
- $code = $_GET['id'];
- }
- if(!empty($code)) {
- include('naviguest.php'); }
- else {
- include('naviall.php');
- }
- ?>
- <div class="main">
- <section class="module">
- <div class="container">
- <div class="row">
- <div class="col-sm-6 col-sm-offset-3">
- <h1 class="module-title font-alt">FINISH</h1>
- <div class="container-fluid">
- <br /><br />
- <ul class="list-unstyled multi-steps">
- <li>Start</li>
- <li>First Step</li>
- <li>Middle Stage</li>
- <li class="is-active">Finish</li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <section class="module pt-0 pb-0" id="about">
- <div class="row position-relative m-0">
- <div class="col-xs-12 col-md-6 side-image" data-background="assets/images/ty.jpg"></div>
- <div class="col-xs-12 col-md-6 col-md-offset-6 side-image-text">
- <div class="row">
- <div class="col-sm-12">
- <form method="POST">
- <input type="hidden" name="subject" id="subject" value="ORDER COMPLETE!" class="form-control">
- <input type="hidden" name="comment" id="comment" class="form-control" value="<a href='myorder.php' style='color:#ffffff'><h5> My Order</h5></a>" rows="5">
- <h2 class="module-title font-alt align-left" style="color:#846e01">Your Order Details</h2>
- <?php
- if(!empty($code)) { ?>
- <div class="module-subtitle font-serif align-left">Please take note of your order details. Click here to view your Order: <a href="myorder.php?id=<?php echo $code;?>" style="color:#b73e66"><u><h3> View my Order</h3></u></a></div><br>
- <?php } else { ?>
- <div class="module-subtitle font-serif align-left">Please take note of your order details. Click here to view your Order: <a href="myorder.php" style="color:#b73e66"><u><h3> Please go here to view the Order </h3></u></a></div>
- <?php } ?>
- <?php include('connectdb.php');
- //get cart no
- $sql = "SELECT * FROM cart_rec WHERE cartrn = '$cartrn'";
- $result = $conn->query($sql);
- while($data = $result->fetch_assoc()) {
- $fn = $data['cartfn'];
- $add = $data['cartadd'];
- $lm = $data['cartland'];
- $cn = $data['cartcn'];
- $mop = $data['cartbdo'] . $data['cartcomp'];
- $pname = $data['cartname'];
- $price = $data['cartprice'];
- $qty = $data['cartqty'];
- $sub = $data['cartsub'];
- $email = $data['cartemail']; }
- ?>
- <h4>Receipt ID: <b><?php echo $cartrn ?></b></h4>
- <h4>Mode of Payment: <b><?php echo $mop ?></b></h4>
- <hr>
- <h4>Full Name: <strong><?php echo $fn ?></strong></h4>
- <h4>Shipping Address: <b><?php echo $add ?></b></h4>
- <h4>Landmark: <b><?php echo $lm ?></b></h4>
- <h4>Contact No: <b><?php echo $cn ?></b></h4>
- <hr>
- <h4>Product Name: <b><?php echo $pname ?></b></h4>
- <h4>Product Price: <b>₱<?php echo $price ?>.00</b></h4>
- <h4>Quantity: <b><?php echo $qty ?></b></h4>
- <h4>Subtotal: <b>₱<?php echo $sub ?>.00</b></h4>
- <hr>
- <h4>Email: <b><?php echo $email ?></b></h4>
- <button onClick='return checkMe()' type="submit" name="submit" class="btn btn-lg btn-block btn-round btn-add">CLICK HERE TO SEND YOU AN EMAIL</button>
- <style type="text/css">
- .btn.btn-add {
- background: #f74794;
- color: #fff;
- }
- .btn.btn-add:hover,
- .btn.btn-add:focus {
- background: rgba(17, 17, 17, 0.8);
- }
- </style>
- </form>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- </section>
- </div>
- <!-- FOOTER -->
- <?php include('footer.php'); ?>
- <!-- END OF PAGE -->
- <!-- EMAIL -->
- <script type="text/javascript">
- function checkMe() {
- if (confirm("Are you sure?")) {
- alert("Email Sent!");
- return true;
- } else {
- alert("Email Not Sent");
- return false;
- }
- }
- </script>
- <script type="text/javascript">
- $(document).ready(function(){
- function load_unseen_notification(view = '')
- {
- $.ajax({
- url:"fetch.php",
- method:"POST",
- data:{view:view},
- dataType:"json",
- success:function(data)
- {
- $('.dropdown-menu').html(data.notification);
- if(data.unseen_notification > 0)
- {
- $('.count').html(data.unseen_notification);
- }
- }
- });
- }
- load_unseen_notification();
- $('#comment_form').on('submit', function(event){
- event.preventDefault();
- if($('#subject').val() != '' && $('#comment').val() != '')
- {
- var form_data = $(this).serialize();
- $.ajax({
- url:"insert.php",
- method:"POST",
- data:form_data,
- success:function(data)
- {
- $('#comment_form')[0].reset();
- load_unseen_notification();
- }
- });
- }
- else
- {
- alert("Both Fields are Required");
- }
- });
- $(document).on('click', '.dropdown', function(){
- $('.count').html('');
- load_unseen_notification('yes');
- });
- setInterval(function(){
- load_unseen_notification();;
- }, 5000);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement