Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once 'class.user.php';
- $user_home = new USER();
- if(!$user_home->is_logged_in())
- {
- $user_home->redirect('index.php');
- }
- $stmt = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid");
- $stmt->execute(array(":uid"=>$_SESSION['userSession']));
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
- <link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicon.png">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <title>Paper Dashboard by Creative Tim</title>
- <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
- <meta name="viewport" content="width=device-width" />
- <!-- Bootstrap core CSS -->
- <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
- <!-- Animation library for notifications -->
- <link href="assets/css/animate.min.css" rel="stylesheet"/>
- <!-- Paper Dashboard core CSS -->
- <link href="assets/css/paper-dashboard.css" rel="stylesheet"/>
- <!-- CSS for Demo Purpose, don't include it in your project -->
- <link href="assets/css/demo.css" rel="stylesheet" />
- <!-- Fonts and icons -->
- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet">
- <link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
- <link href="assets/css/themify-icons.css" rel="stylesheet">
- <link rel="stylesheet" href="datesselect/assets/style.css">
- <link rel="stylesheet" href="datesselect/assets/dateTimePicker.css">
- </head>
- <body>
- <div class="wrapper">
- <div class="sidebar" data-background-color="white" data-active-color="danger">
- <!--
- Tip 1: you can change the color of the sidebar's background using: data-background-color="white | black"
- Tip 2: you can change the color of the active button using the data-active-color="primary | info | success | warning | danger"
- -->
- <div class="sidebar-wrapper">
- <div class="logo">
- <a href="#" class="simple-text">
- <img src="assets/img/dash-logo.png">
- </a>
- </div>
- <ul class="nav">
- <li>
- <a href="home.php">
- <i class="ti-panel"></i>
- <p>Dashboard</p>
- </a>
- </li>
- <li>
- <a href="profile.php">
- <i class="ti-user"></i>
- <p>User Profile</p>
- </a>
- </li>
- <li>
- <a href="request-history.php">
- <i class="ti-view-list-alt"></i>
- <p>Request History</p>
- </a>
- </li>
- <li class="active">
- <a href="submit-new-request.php">
- <i class="ti-text"></i>
- <p>Submit New Request</p>
- </a>
- </li>
- <li>
- <a href="billing.php">
- <i class="ti-pencil-alt2"></i>
- <p>Billing History</p>
- </a>
- </li>
- <li>
- <a href="support.php">
- <i class="ti-map"></i>
- <p>Support Tickets</p>
- </a>
- </li>
- <li>
- <a href="notifications.php">
- <i class="ti-bell"></i>
- <p>Notifications</p>
- </a>
- </li>
- </ul>
- </div>
- </div>
- <div class="main-panel">
- <nav class="navbar navbar-default">
- <div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar bar1"></span>
- <span class="icon-bar bar2"></span>
- <span class="icon-bar bar3"></span>
- </button>
- <a class="navbar-brand" href="#">Dashboard</a>
- </div>
- <div class="collapse navbar-collapse">
- <ul class="nav navbar-nav navbar-right">
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <i class="ti-bell"></i>
- <p class="notification">5</p>
- <p>Notifications</p>
- <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li><a href="#">Notification 1</a></li>
- <li><a href="#">Notification 2</a></li>
- <li><a href="#">Notification 3</a></li>
- <li><a href="#">Notification 4</a></li>
- <li><a href="#">Another notification</a></li>
- </ul>
- </li>
- <li>
- <a href="profile.php">
- <i class="ti-settings"></i>
- <p>User Profile</p>
- </a>
- </li>
- <li>
- <a href="logout.php">
- <i class="ti-angle-double-right"></i>
- <p>Logout</p>
- </a>
- </li>
- </ul>
- </div>
- </div>
- </nav>
- <div class="content">
- <div class="container-fluid">
- <div class="row">
- <div class="col-lg-12 col-md-12">
- <div class="card">
- <div class="header">
- <h4 class="title">Submit New Request</h4>
- </div>
- <div class="content">
- <form action="" method="POST">
- <div class="row">
- <div class="col-md-2">
- <div class="form-group">
- <label>Client Code</label>
- <input type="text" name="userID" id="userID" class="form-control border-input" placeholder="Client Code" value="<?php echo $row['userID']; ?>" readonly>
- </div>
- </div>
- <div class="col-md-3">
- <div class="form-group">
- <label>First Name(s)</label>
- <input type="text" name="UserFname" id="UserFname" class="form-control border-input" placeholder="Your Name" value="<?php echo $row['UserFname']; ?>" readonly>
- </div>
- </div>
- <div class="col-md-3">
- <div class="form-group">
- <label>Last Name</label>
- <input type="text" name="UserLname" id="UserLname" class="form-control border-input " placeholder="Your Last Name" value="<?php echo $row['UserLname']; ?>" readonly>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label>Email</label>
- <input type="text" name="userEmail" id="userEmail" class="form-control border-input " placeholder="Your Last Name" value="<?php echo $row['userEmail']; ?>" readonly>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <label>Selected Service</label>
- <select class="form-control" name="selectService" id="selectService">
- <option>Shop and Drop Service</option>
- <option>Welfare Check Service</option>
- <option>Web and Graph Service</option>
- </select>
- </div>
- <div class="col-md-4">
- <label>Location of Request</label>
- <select class="form-control" name="selectLocation" id="selectLocation">
- <option>Amanzimtoti</option>
- <option>Umkomaas</option>
- <option>Scottburgh</option>
- <option>Park Rynie</option>
- <option>Umzinto</option>
- <option>Pennington</option>
- <option>Ifafa</option>
- <option>Hibberdene</option>
- <option>Port Shepstone</option>
- </select>
- </div>
- <div class="col-md-4">
- <label>Service Date Slot</label>
- <input type="datetime-local" class="form-control" name="selectDate" id="selectDate">
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="form-group">
- <label>Task Description</label>
- <textarea class="form-control border-input" rows="5" name="task_desc" id="task_desc" placeholder="Place Task Description Here"> </textarea>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <p> <strong>NB**</strong> Submitting this form does not mean your booking is 100% confirmed for a timeslot on your chosen date. One of our representitives will contact you shortly after you submit this form to confirm an available time slot.<br /><br />
- Please make sure that you add support@here2help.co.za and no-reply@here2help.co.za to your address book to prevent our automated emails from entering your spam folder.</p>
- </div>
- </div>
- <div class="text-center">
- <button type="submit" name="submit" id="submit" class="btn btn-info btn-fill btn-wd">Send Request</button>
- </div>
- <div class="clearfix"></div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php
- if(isset($_POST["submit"])){
- $hostname='localhost';
- $username='root';
- $password='';
- try {
- $dbh = new PDO("mysql:host=$hostname;dbname=dbtest",$username,$password);
- $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
- $sql = "INSERT INTO task_requests (userID, UserFname, UserLname, selectService, selectLocation, selectDate, task_desc)
- VALUES ('".$_POST["userID"]."','".$_POST["UserFname"]."','".$_POST["UserLname"]."','".$_POST["selectService"]."','".$_POST["selectLocation"]."','".$_POST["selectDate"]."','".$_POST["task_desc"]."')";
- if ($dbh->query($sql)) {
- echo "<script type= 'text/javascript'>alert('Your Task Request has been Submitted. Please check your email for confirmation.');</script>";
- }
- else{
- echo "<script type= 'text/javascript'>alert('Data not successfully Inserted.');</script>";
- }
- $dbh = null;
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- }
- }
- ?>
- <?php
- if(isset($_POST['submit'])){
- require 'PHPMailer/PHPMailerAutoload.php';
- $task_id=$_POST['task_id'];
- $userID=$_POST['userID'];
- $UserFname=$_POST['UserFname'];
- $UserLname=$_POST['UserLname'];
- $selectService=$_POST['selectService'];
- $selectLocation=$_POST['selectLocation'];
- $selectDate=$_POST['selectDate'];
- $task_desc=$_POST['task_desc'];
- $userEmail=$_POST['userEmail'];
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'alpha-1-jhb.smartvps.co.za'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'no-reply@here2help.co.za'; // SMTP username
- $mail->Password = '90Bk4WYK'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- $mail->setFrom('no-reply@here2help.co.za', 'Here 2 Help Errands (Pty) Ltd');
- $mail->addAddress($userEmail); // Add a recipient
- $mail->addReplyTo('support@here2help.co.za', 'Here 2 Help Errands (Pty) Ltd');
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Task Request Received';
- $mail->Body = "
- <html>
- <style>
- img {
- max-width: 100%;
- height: auto;
- }
- </style
- <a href='https://www.here2help.co.za'><img src='https://www.here2help.co.za/emailsigimages/emailheader1.jpg' width='900' height='197' alt='Here 2 Help Errand Services' title='Here 2 Help Errand Services' /></a><br /><br />
- <p>Hi $UserFname, <br /><br />
- We have received your task request and will be in contact with you shortly.<br /><br />
- Your task reference number is <b>$task_id</b><br />
- Your selected services: <b>$selectService</b><br />
- Your selected location of the errands: <b>$selectLocation</b><br />
- Your chosen date and time for this task is <b> $selectDate </b><br />
- Your task description: <b>$task_desc</b><br /><br />
- NB* Please note that your chosen time-slot is not a 100% guaranteed booking. One of our friendly representitives will contact you in the next 5-10min to confirm your request. 50% deposit is required upfront.<br /><br />
- Kind Regards,<br /><br />
- Here 2 Help Errands (Pty) Ltd<br />
- Tel: 039 976 0628<br />
- Email: support@here2help.co.za</p>
- </html>";
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- }
- ?>
- <footer class="footer">
- <div class="container-fluid">
- <nav class="pull-left">
- <ul>
- <li>
- <a href="terms.php">
- Terms of Service
- </a>
- </li>
- <li>
- <a href="webterms.php">
- Terms of Webiste
- </a>
- </li>
- <li>
- <a href="privacy.php">
- Privacy Policy
- </a>
- </li>
- <li>
- <a href="fees.php">
- Our Fees
- </a>
- </li>
- </ul>
- </nav>
- <div class="copyright pull-right">
- <?php
- echo "<p>© 2015-" . date("Y") . " Here 2 Help Errands (Pty) Ltd</p>";
- ?>
- </div>
- </div>
- </footer>
- </div>
- </div>
- </body>
- <!-- Core JS Files -->
- <script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
- <script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
- <!-- Checkbox, Radio & Switch Plugins -->
- <script src="assets/js/bootstrap-checkbox-radio.js"></script>
- <!-- Charts Plugin -->
- <script src="assets/js/chartist.min.js"></script>
- <!-- Notifications Plugin -->
- <script src="assets/js/bootstrap-notify.js"></script>
- <!-- Google Maps Plugin -->
- <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
- <!-- Paper Dashboard Core javascript and methods for Demo purpose -->
- <script src="assets/js/paper-dashboard.js"></script>
- <!-- Paper Dashboard DEMO methods, don't include it in your project! -->
- <script src="assets/js/demo.js"></script>
- <script type="text/javascript" src="datesselect/scripts/components/jquery.min.js"></script>
- <script type="text/javascript" src="datesselect/scripts/dateTimePicker.min.js"></script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement