Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.19 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require_once 'class.user.php';
  4. $user_home = new USER();
  5.  
  6. if(!$user_home->is_logged_in())
  7. {
  8. $user_home->redirect('index.php');
  9. }
  10.  
  11. $stmt = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid");
  12. $stmt->execute(array(":uid"=>$_SESSION['userSession']));
  13. $row = $stmt->fetch(PDO::FETCH_ASSOC);
  14.  
  15. ?>
  16.  
  17.  
  18. <!doctype html>
  19. <html lang="en">
  20. <head>
  21. <meta charset="utf-8" />
  22. <link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
  23. <link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicon.png">
  24. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  25.  
  26. <title>Paper Dashboard by Creative Tim</title>
  27.  
  28. <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
  29. <meta name="viewport" content="width=device-width" />
  30.  
  31.  
  32. <!-- Bootstrap core CSS -->
  33. <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
  34.  
  35. <!-- Animation library for notifications -->
  36. <link href="assets/css/animate.min.css" rel="stylesheet"/>
  37.  
  38. <!-- Paper Dashboard core CSS -->
  39. <link href="assets/css/paper-dashboard.css" rel="stylesheet"/>
  40.  
  41.  
  42. <!-- CSS for Demo Purpose, don't include it in your project -->
  43. <link href="assets/css/demo.css" rel="stylesheet" />
  44.  
  45.  
  46. <!-- Fonts and icons -->
  47. <link href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet">
  48. <link href='https://fonts.googleapis.com/css?family=Muli:400,300' rel='stylesheet' type='text/css'>
  49. <link href="assets/css/themify-icons.css" rel="stylesheet">
  50.  
  51. <link rel="stylesheet" href="datesselect/assets/style.css">
  52. <link rel="stylesheet" href="datesselect/assets/dateTimePicker.css">
  53.  
  54.  
  55.  
  56. </head>
  57. <body>
  58.  
  59. <div class="wrapper">
  60. <div class="sidebar" data-background-color="white" data-active-color="danger">
  61.  
  62. <!--
  63. Tip 1: you can change the color of the sidebar's background using: data-background-color="white | black"
  64. Tip 2: you can change the color of the active button using the data-active-color="primary | info | success | warning | danger"
  65. -->
  66.  
  67. <div class="sidebar-wrapper">
  68. <div class="logo">
  69. <a href="#" class="simple-text">
  70. <img src="assets/img/dash-logo.png">
  71. </a>
  72. </div>
  73.  
  74. <ul class="nav">
  75.  
  76. <li>
  77. <a href="home.php">
  78. <i class="ti-panel"></i>
  79. <p>Dashboard</p>
  80. </a>
  81. </li>
  82. <li>
  83. <a href="profile.php">
  84. <i class="ti-user"></i>
  85. <p>User Profile</p>
  86. </a>
  87. </li>
  88. <li>
  89. <a href="request-history.php">
  90. <i class="ti-view-list-alt"></i>
  91. <p>Request History</p>
  92. </a>
  93. </li>
  94. <li class="active">
  95. <a href="submit-new-request.php">
  96. <i class="ti-text"></i>
  97. <p>Submit New Request</p>
  98. </a>
  99. </li>
  100. <li>
  101. <a href="billing.php">
  102. <i class="ti-pencil-alt2"></i>
  103. <p>Billing History</p>
  104. </a>
  105. </li>
  106. <li>
  107. <a href="support.php">
  108. <i class="ti-map"></i>
  109. <p>Support Tickets</p>
  110. </a>
  111. </li>
  112. <li>
  113. <a href="notifications.php">
  114. <i class="ti-bell"></i>
  115. <p>Notifications</p>
  116. </a>
  117. </li>
  118.  
  119. </ul>
  120. </div>
  121. </div>
  122.  
  123. <div class="main-panel">
  124. <nav class="navbar navbar-default">
  125. <div class="container-fluid">
  126. <div class="navbar-header">
  127. <button type="button" class="navbar-toggle">
  128. <span class="sr-only">Toggle navigation</span>
  129. <span class="icon-bar bar1"></span>
  130. <span class="icon-bar bar2"></span>
  131. <span class="icon-bar bar3"></span>
  132. </button>
  133. <a class="navbar-brand" href="#">Dashboard</a>
  134. </div>
  135. <div class="collapse navbar-collapse">
  136. <ul class="nav navbar-nav navbar-right">
  137.  
  138. <li class="dropdown">
  139. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  140. <i class="ti-bell"></i>
  141. <p class="notification">5</p>
  142. <p>Notifications</p>
  143. <b class="caret"></b>
  144. </a>
  145. <ul class="dropdown-menu">
  146. <li><a href="#">Notification 1</a></li>
  147. <li><a href="#">Notification 2</a></li>
  148. <li><a href="#">Notification 3</a></li>
  149. <li><a href="#">Notification 4</a></li>
  150. <li><a href="#">Another notification</a></li>
  151. </ul>
  152. </li>
  153. <li>
  154. <a href="profile.php">
  155. <i class="ti-settings"></i>
  156. <p>User Profile</p>
  157.  
  158. </a>
  159. </li>
  160. <li>
  161. <a href="logout.php">
  162. <i class="ti-angle-double-right"></i>
  163. <p>Logout</p>
  164. </a>
  165. </li>
  166. </ul>
  167.  
  168. </div>
  169. </div>
  170. </nav>
  171.  
  172.  
  173. <div class="content">
  174.  
  175.  
  176.  
  177. <div class="container-fluid">
  178. <div class="row">
  179.  
  180. <div class="col-lg-12 col-md-12">
  181. <div class="card">
  182. <div class="header">
  183. <h4 class="title">Submit New Request</h4>
  184. </div>
  185. <div class="content">
  186. <form action="" method="POST">
  187.  
  188. <div class="row">
  189.  
  190. <div class="col-md-2">
  191. <div class="form-group">
  192. <label>Client Code</label>
  193.  
  194. <input type="text" name="userID" id="userID" class="form-control border-input" placeholder="Client Code" value="<?php echo $row['userID']; ?>" readonly>
  195.  
  196. </div>
  197. </div>
  198. <div class="col-md-3">
  199. <div class="form-group">
  200. <label>First Name(s)</label>
  201. <input type="text" name="UserFname" id="UserFname" class="form-control border-input" placeholder="Your Name" value="<?php echo $row['UserFname']; ?>" readonly>
  202. </div>
  203. </div>
  204. <div class="col-md-3">
  205. <div class="form-group">
  206. <label>Last Name</label>
  207. <input type="text" name="UserLname" id="UserLname" class="form-control border-input " placeholder="Your Last Name" value="<?php echo $row['UserLname']; ?>" readonly>
  208. </div>
  209. </div>
  210. <div class="col-md-4">
  211. <div class="form-group">
  212. <label>Email</label>
  213. <input type="text" name="userEmail" id="userEmail" class="form-control border-input " placeholder="Your Last Name" value="<?php echo $row['userEmail']; ?>" readonly>
  214. </div>
  215. </div>
  216.  
  217.  
  218. </div>
  219. <div class="row">
  220. <div class="col-md-4">
  221.  
  222. <label>Selected Service</label>
  223.  
  224. <select class="form-control" name="selectService" id="selectService">
  225. <option>Shop and Drop Service</option>
  226. <option>Welfare Check Service</option>
  227. <option>Web and Graph Service</option>
  228.  
  229. </select>
  230.  
  231.  
  232. </div>
  233. <div class="col-md-4">
  234.  
  235. <label>Location of Request</label>
  236.  
  237. <select class="form-control" name="selectLocation" id="selectLocation">
  238. <option>Amanzimtoti</option>
  239. <option>Umkomaas</option>
  240. <option>Scottburgh</option>
  241. <option>Park Rynie</option>
  242. <option>Umzinto</option>
  243. <option>Pennington</option>
  244. <option>Ifafa</option>
  245. <option>Hibberdene</option>
  246. <option>Port Shepstone</option>
  247.  
  248. </select>
  249.  
  250.  
  251. </div>
  252. <div class="col-md-4">
  253.  
  254. <label>Service Date Slot</label>
  255.  
  256. <input type="datetime-local" class="form-control" name="selectDate" id="selectDate">
  257.  
  258. </div>
  259.  
  260.  
  261. </div>
  262. <div class="row">
  263. <div class="col-md-12">
  264. <div class="form-group">
  265. <label>Task Description</label>
  266.  
  267. <textarea class="form-control border-input" rows="5" name="task_desc" id="task_desc" placeholder="Place Task Description Here"> </textarea>
  268.  
  269.  
  270. </div>
  271. </div>
  272.  
  273.  
  274. </div>
  275.  
  276. <div class="row">
  277. <div class="col-md-12">
  278. <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 />
  279. 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>
  280. </div>
  281. </div>
  282.  
  283.  
  284.  
  285.  
  286. <div class="text-center">
  287. <button type="submit" name="submit" id="submit" class="btn btn-info btn-fill btn-wd">Send Request</button>
  288. </div>
  289. <div class="clearfix"></div>
  290.  
  291. </form>
  292.  
  293. </div>
  294. </div>
  295. </div>
  296.  
  297.  
  298. </div>
  299. </div>
  300. </div>
  301.  
  302. <?php
  303.  
  304. if(isset($_POST["submit"])){
  305. $hostname='localhost';
  306. $username='root';
  307. $password='';
  308.  
  309. try {
  310. $dbh = new PDO("mysql:host=$hostname;dbname=dbtest",$username,$password);
  311.  
  312. $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
  313. $sql = "INSERT INTO task_requests (userID, UserFname, UserLname, selectService, selectLocation, selectDate, task_desc)
  314.  
  315. VALUES ('".$_POST["userID"]."','".$_POST["UserFname"]."','".$_POST["UserLname"]."','".$_POST["selectService"]."','".$_POST["selectLocation"]."','".$_POST["selectDate"]."','".$_POST["task_desc"]."')";
  316. if ($dbh->query($sql)) {
  317. echo "<script type= 'text/javascript'>alert('Your Task Request has been Submitted. Please check your email for confirmation.');</script>";
  318. }
  319. else{
  320. echo "<script type= 'text/javascript'>alert('Data not successfully Inserted.');</script>";
  321. }
  322.  
  323. $dbh = null;
  324. }
  325. catch(PDOException $e)
  326. {
  327. echo $e->getMessage();
  328. }
  329.  
  330. }
  331. ?>
  332.  
  333. <?php
  334. if(isset($_POST['submit'])){
  335.  
  336. require 'PHPMailer/PHPMailerAutoload.php';
  337. $task_id=$_POST['task_id'];
  338. $userID=$_POST['userID'];
  339. $UserFname=$_POST['UserFname'];
  340. $UserLname=$_POST['UserLname'];
  341. $selectService=$_POST['selectService'];
  342. $selectLocation=$_POST['selectLocation'];
  343. $selectDate=$_POST['selectDate'];
  344. $task_desc=$_POST['task_desc'];
  345. $userEmail=$_POST['userEmail'];
  346.  
  347.  
  348. $mail = new PHPMailer;
  349.  
  350.  
  351. //$mail->SMTPDebug = 3; // Enable verbose debug output
  352.  
  353. $mail->isSMTP(); // Set mailer to use SMTP
  354. $mail->Host = 'alpha-1-jhb.smartvps.co.za'; // Specify main and backup SMTP servers
  355. $mail->SMTPAuth = true; // Enable SMTP authentication
  356. $mail->Username = 'no-reply@here2help.co.za'; // SMTP username
  357. $mail->Password = '90Bk4WYK'; // SMTP password
  358. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  359. $mail->Port = 465; // TCP port to connect to
  360.  
  361. $mail->setFrom('no-reply@here2help.co.za', 'Here 2 Help Errands (Pty) Ltd');
  362. $mail->addAddress($userEmail); // Add a recipient
  363. $mail->addReplyTo('support@here2help.co.za', 'Here 2 Help Errands (Pty) Ltd');
  364.  
  365. $mail->isHTML(true); // Set email format to HTML
  366.  
  367. $mail->Subject = 'Task Request Received';
  368. $mail->Body = "
  369. <html>
  370. <style>
  371. img {
  372. max-width: 100%;
  373. height: auto;
  374. }
  375. </style
  376. <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 />
  377. <p>Hi $UserFname, <br /><br />
  378. We have received your task request and will be in contact with you shortly.<br /><br />
  379.  
  380. Your task reference number is <b>$task_id</b><br />
  381. Your selected services: <b>$selectService</b><br />
  382. Your selected location of the errands: <b>$selectLocation</b><br />
  383. Your chosen date and time for this task is <b> $selectDate </b><br />
  384. Your task description: <b>$task_desc</b><br /><br />
  385. 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 />
  386. Kind Regards,<br /><br />
  387. Here 2 Help Errands (Pty) Ltd<br />
  388. Tel: 039 976 0628<br />
  389. Email: support@here2help.co.za</p>
  390. </html>";
  391.  
  392. if(!$mail->send()) {
  393. echo 'Message could not be sent.';
  394. echo 'Mailer Error: ' . $mail->ErrorInfo;
  395. } else {
  396. echo 'Message has been sent';
  397. }
  398. }
  399. ?>
  400.  
  401.  
  402. <footer class="footer">
  403. <div class="container-fluid">
  404. <nav class="pull-left">
  405. <ul>
  406.  
  407. <li>
  408. <a href="terms.php">
  409. Terms of Service
  410. </a>
  411. </li>
  412. <li>
  413. <a href="webterms.php">
  414. Terms of Webiste
  415. </a>
  416. </li>
  417. <li>
  418. <a href="privacy.php">
  419. Privacy Policy
  420. </a>
  421. </li>
  422. <li>
  423. <a href="fees.php">
  424. Our Fees
  425. </a>
  426. </li>
  427. </ul>
  428. </nav>
  429. <div class="copyright pull-right">
  430. <?php
  431. echo "<p>&copy; 2015-" . date("Y") . " Here 2 Help Errands (Pty) Ltd</p>";
  432. ?>
  433. </div>
  434. </div>
  435. </footer>
  436.  
  437. </div>
  438. </div>
  439.  
  440.  
  441. </body>
  442.  
  443. <!-- Core JS Files -->
  444. <script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
  445. <script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
  446.  
  447. <!-- Checkbox, Radio & Switch Plugins -->
  448. <script src="assets/js/bootstrap-checkbox-radio.js"></script>
  449.  
  450. <!-- Charts Plugin -->
  451. <script src="assets/js/chartist.min.js"></script>
  452.  
  453. <!-- Notifications Plugin -->
  454. <script src="assets/js/bootstrap-notify.js"></script>
  455.  
  456. <!-- Google Maps Plugin -->
  457. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
  458.  
  459. <!-- Paper Dashboard Core javascript and methods for Demo purpose -->
  460. <script src="assets/js/paper-dashboard.js"></script>
  461.  
  462. <!-- Paper Dashboard DEMO methods, don't include it in your project! -->
  463. <script src="assets/js/demo.js"></script>
  464.  
  465. <script type="text/javascript" src="datesselect/scripts/components/jquery.min.js"></script>
  466. <script type="text/javascript" src="datesselect/scripts/dateTimePicker.min.js"></script>
  467.  
  468.  
  469.  
  470.  
  471. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement