Advertisement
Guest User

Untitled

a guest
May 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.18 KB | None | 0 0
  1. <?php
  2. include 'bancheck.php';
  3. session_start();
  4. $user_check=$_SESSION['username'];
  5. if(!isset($user_check))
  6. {
  7. header("Location: login/index.php");
  8. }
  9.  
  10. ?>
  11. <?php
  12. $servername = "localhost";
  13. $username = "////";
  14. $password = "/////";
  15. $dbname = "/////";
  16.  
  17. // Create connection
  18. $conn = new mysqli($servername, $username, $password, $dbname);
  19. // Check connection
  20. if ($conn->connect_error) {
  21. die("Connection failed: " . $conn->connect_error);
  22. }
  23.  
  24.  
  25.  
  26. $sql2 = "SELECT email FROM users WHERE username='$user_check'";
  27. $result5 = $conn->query($sql2);
  28.  
  29. if ($result5->num_rows > 0) {
  30. // output data of each row
  31. while($row = $result5->fetch_assoc()) {
  32. $emailValue = $row['email'];
  33. }
  34. } else {
  35. echo "0 results";
  36. }
  37. $conn->close();
  38.  
  39. //Submit 2
  40.  
  41. if (isset($_POST["submit2"])) {
  42. $name = $_SESSION['username'];
  43. $title = $_POST['title'];
  44. $help = $_POST['help'];
  45. $from = "$emailValue";
  46. $to = 'info@shadowhcf.com';
  47. $subject = "General Ticket - $name";
  48.  
  49. $body = "";
  50.  
  51. if (!isset($title)) {
  52. $errTitle = 'Please enter a title';
  53. } else if (!isset($help)) {
  54. $errHelp = 'Please enter this field';
  55.  
  56. } else {
  57. if (@mail ($to,$subject,$body,$from)) {
  58. $result = '<div class="alert alert-danger">Your ticket has been sent! You"ll receive response on your email.</div>';
  59. mail ($to,$subject,$body,$from);
  60. } else {
  61. $result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later</div>';
  62. }
  63. }
  64.  
  65. }
  66.  
  67. //Submit 1
  68.  
  69. if (isset($_POST["submit"])) {
  70.  
  71. $name = $_SESSION['username'];
  72. $title2 = $_POST['title2'];
  73. $issue = $_POST['issue'];
  74. $from = "$emailValue";
  75. $to = 'info@shadowhcf.com';
  76. $subject = "Donation Ticket $name";
  77. $choice = $_POST['choice'];
  78.  
  79. $body = 'From: $name\n Title: $title2\n Issue:\n $issue\nHas relogged: $choice_status';
  80.  
  81. if (!$title2) {
  82. $errTitle2 = 'Please enter a title';
  83. } else if (!isset($issue)) {
  84. $errIssue = 'Please enter this field';
  85. } else if (!isset($choice)) {
  86. $errChoice = 'Please enter a choice';
  87. } else {
  88. if (@mail ($to, $subject, $body, $from)) {
  89. $result = '<div class="alert alert-danger">Your ticket has been sent! You"ll receive response on your email.</div>';
  90. mail ($to, $subject, $body, $from);
  91. } else {
  92. $result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later</div>';
  93. }
  94. }
  95.  
  96. }
  97.  
  98.  
  99.  
  100. ?>
  101.  
  102. <!DOCTYPE html>
  103. <html lang="en">
  104.  
  105. <head>
  106.  
  107. <meta charset="utf-8">
  108. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  109. <meta name="viewport" content="width=device-width, initial-scale=1">
  110. <meta name="description" content="">
  111. <meta name="author" content="">
  112. <title>ShadowHCF :: Ticketsystem</title>
  113.  
  114. <!-- Bootstrap Core CSS -->
  115. <script src="https://shadowhcf.com/bootstrap/jquery/jquery.js"></script>
  116. <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
  117. <!-- THIS LINE -->
  118. <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  119. <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
  120.  
  121. <script type="text/javascript" src='https://shadowhcf.com/js/bootstrap.min.js'></script>
  122. <link rel="stylesheet" href="https://shadowhcf.com/css/bootstrap.css" />
  123.  
  124. <!-- Custom CSS -->
  125. <link href="https://shadowhcf.com/css/half-slider.css" rel="stylesheet">
  126.  
  127. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  128. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  129. <!--[if lt IE 9]>
  130. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  131. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  132. <![endif]-->
  133.  
  134. </head>
  135.  
  136. <body>
  137.  
  138. <?php include($_SERVER['DOCUMENT_ROOT']."/inc/navbar.php"); ?>
  139. </div>
  140.  
  141.  
  142.  
  143. <style>
  144. .label-moderator {
  145. background-color: #00AAAA;
  146. }
  147.  
  148. .label-admin {
  149. background-color: #d9534f;
  150. }
  151.  
  152. .label-owner {
  153. background-color: #E6302B;
  154. }
  155.  
  156. .label-defaultrank {
  157. background-color: #BDBDBD;
  158. }
  159.  
  160. .label-country {
  161. background-color: #2A79DB;
  162. }
  163.  
  164. .text-muted {
  165. color: #777;
  166. }
  167. </style>
  168. <div class="container">
  169. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
  170. <script>
  171. $(document).ready(function(){
  172. $('[data-toggle="tooltip"]').tooltip();
  173. });
  174. </script>
  175. <div style="margin-top: 80px;">
  176. <div class="jumbotron" style="margin-bottom: 0px;border-bottom-left-radius: 0px;border-bottom-right-radius: 0px;">
  177. <h1>ShadowHCF Ticketsystem</h1>
  178. <p>Welcome to the ShadowHCF ticket system.</p>
  179. <hr>
  180. <b>Send only ticket a time, otherwise you'll be banned from our ticketsystem.</b>
  181. </div>
  182. <h5 class="pull-right">
  183. Staff Applications Closed <i class="fa fa-times-circle-o" aria-hidden="true" style="color:#d9534f"></i>
  184. </h5>
  185. <h3>Select a Category to Get Started.</h3>
  186.  
  187. <?php echo $result; ?>
  188. <?php echo "<h4 class='text-danger'><b>$error</b></h4>"; ?><br>
  189.  
  190. <script type="text/javascript">
  191. $(function() {
  192. $('.submit-ticket').on('click', function(e){
  193. e.preventDefault();
  194. var category = $("#category-box").val();
  195. var errors = 0;
  196. var title = $("div[data-category='" + category + "']").find('.' + category + '-title').val();
  197. $("div[data-category='" + category + "']").find('.' + category + '-title-form').removeClass('has-error');
  198. $("div[data-category='" + category + "']").find('.' + category + '-title-form').find('.error-msg').remove();
  199. if(typeof title === 'undefined' || title.length == 0){
  200. errors++;
  201. $("div[data-category='" + category + "']").find('.' + category + '-title-form').addClass('has-error');
  202. $("div[data-category='" + category + "']").find('.' + category + '-title-form').prepend('<label class="control-label error-msg">This field is required.</label>')
  203. }
  204. data = {
  205. csrfmiddlewaretoken: 'rYmZ9ExMxVuOY34MydWuKcRb9nnt48OX',
  206. category: $(this).data('category'),
  207. title: title
  208. }
  209.  
  210. var fields = {}
  211. $("div[data-category='" + category + "'] .field-group").each(function(index){
  212. var fieldid = $( this ).find('.field-question').data('field-id');
  213. var answer;
  214. if(typeof $( this ).find('.field-text').val() !== 'undefined'){
  215. answer = $( this ).find('.field-text').val();
  216. } else if (typeof $( this ).find('input:checked').val() !== 'undefined'){
  217. answer = $( this ).find('input:checked').val();
  218. }
  219. $(this).removeClass('has-error');
  220. $(this).find('.error-msg').remove();
  221. if(typeof answer === 'undefined' || answer.length == 0){
  222. $(this).addClass('has-error');
  223. $(this).children('.col-md-9').prepend('<label class="control-label error-msg">This field is required.</label>')
  224. errors++;
  225. return;
  226. }
  227. fields[fieldid] = answer;
  228. });
  229. if (errors > 0) {
  230. return;
  231. };
  232. data['fields'] = fields;
  233. $.ajax({
  234. url:".",
  235. data: data,
  236. type: 'POST'
  237. }).done(function(data){
  238. window.location.replace('');
  239. });
  240.  
  241. });
  242.  
  243. $('#category-box').on('change', function(e){
  244. e.preventDefault();
  245. $('div[data-category]').hide();
  246. $("div[data-category='" + $(this).val() + "']").fadeIn('slow');
  247. });
  248. });
  249.  
  250. </script>
  251. <form method="post" action="support.php" role="form" id="ticket-form" class="ticket-form" style="margin-bottom:200px;">
  252. <div class="form-group category-box" style="max-width:40%;">
  253. <select class="form-control" id="category-box">
  254. <option selected="" disabled="" value="none">Select a Category</option>
  255. <option id="category_5" value="donation">Donation </option>
  256. <option id="category_13" value="general-support">General Support</option>
  257. </select>
  258. </div>
  259. <div class="row" data-category="donation" style="display:none;margin-left: 0px;margin-right: 0px;">
  260. <h4>Donation </h4>
  261. <div class="col-md-3">
  262. Title
  263. </div>
  264. <div class="col-md-9">
  265. <div class="form-group donation-title-form" style="max-width:40%">
  266. <input type="text" class="form-control donation-title" name="title2" autocomplete="off" placeholder="Title">
  267. <?php echo "<p class='text-danger'>$errTitle2</p>"; ?>
  268. </div>
  269. </div>
  270. <div class="col-md-3">
  271. Username
  272. </div>
  273. <div class="col-md-9">
  274. <div class="form-group donation-title-form" style="max-width:40%">
  275. <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $_SESSION["username"]; ?>" readonly>
  276. </div>
  277. </div>
  278. <div class="col-md-3">
  279. Email
  280. </div>
  281. <div class="col-md-9">
  282. <div class="form-group donation-title-form" style="max-width:40%">
  283. <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $emailValue; ?>" readonly>
  284. </div>
  285. </div>
  286. <div class="field-group">
  287. <div class="col-md-3">
  288. <div class="field-question" data-field-id="12">Question/Issue</div>
  289. </div>
  290. <div class="col-md-9">
  291. <div class="ticket-box" style="margin-bottom: 10px">
  292. <textarea name="issue" class="form-control field-text" rows="5" placeholder="Question/Issue"></textarea>
  293. <?php echo "<p class='text-danger'>$errIssue</p>"; ?>
  294. </div>
  295. </div>
  296. </div>
  297. <div class="field-group">
  298. <div class="col-md-3">
  299. <div class="field-question" data-field-id="46">Have you re-logged?</div>
  300. </div>
  301. <div class="col-md-9">
  302. <?php echo "<p class='text-danger'>$errChoice</p>"; ?>
  303. <div class="radio-inline form-group">
  304. <label>
  305. <input type="radio" name="choice" value="Yes">
  306. Yes
  307. </label>
  308.  
  309. </div>
  310. <div class="radio-inline form-group">
  311. <label>
  312. <input type="radio" name="choice" value="No">
  313. No
  314. </label>
  315. </div>
  316. </div>
  317. </div>
  318. <input class="btn btn-primary pull-right submit-ticket" name="submit" type="submit" value="Submit ticket">
  319. </div>
  320. <div class="row" data-category="general-support" style="display:none;margin-left: 0px;margin-right: 0px;">
  321. <h4>General Support</h4>
  322. <div class="col-md-3">
  323. Title
  324. </div>
  325. <div class="col-md-9">
  326. <div class="form-group general-support-title-form" style="max-width:40%">
  327. <input type="text" class="form-control general-support-title" name="title" autocomplete="off" placeholder="Title">
  328. <?php echo "<p class='text-danger'>$errTitle</p>"; ?>
  329. </div>
  330. </div>
  331. <div class="col-md-3">
  332. Username
  333. </div>
  334. <div class="col-md-9">
  335. <div class="form-group donation-title-form" style="max-width:40%">
  336. <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $_SESSION["username"]; ?>" readonly>
  337. </div>
  338. </div>
  339. <div class="col-md-3">
  340. Email
  341. </div>
  342. <div class="col-md-9">
  343. <div class="form-group donation-title-form" style="max-width:40%">
  344. <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $emailValue; ?>" readonly>
  345. </div>
  346. </div>
  347. <div class="field-group">
  348. <div class="col-md-3">
  349. <div class="field-question" data-field-id="45">What do you need help with?</div>
  350. </div>
  351. <div class="col-md-9">
  352. <div class="ticket-box" style="margin-bottom: 10px">
  353. <textarea name="help" class="form-control field-text" rows="5" placeholder="What do you need help with?"></textarea>
  354. <?php echo "<p class='text-danger'>$errHelp</p>"; ?>
  355. </div>
  356. </div>
  357. </div>
  358. <input class="btn btn-primary pull-right submit-ticket" name="submit2" type="submit" value="Submit ticket">
  359. </div>
  360. </form>
  361.  
  362. </div>
  363.  
  364. <hr>
  365.  
  366. <!-- Footer -->
  367. <footer>
  368. <div class="row">
  369. <div class="col-lg-12">
  370. <p>Copyright &copy; ShadowHCF 2016 - Developed by <a href="/u/SkyDZN"><b>SkyDZN</b></a></p>
  371. </div>
  372. </div>
  373. <!-- /.row -->
  374. </footer>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement