Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'bancheck.php';
- session_start();
- $user_check=$_SESSION['username'];
- if(!isset($user_check))
- {
- header("Location: login/index.php");
- }
- ?>
- <?php
- $servername = "localhost";
- $username = "////";
- $password = "/////";
- $dbname = "/////";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql2 = "SELECT email FROM users WHERE username='$user_check'";
- $result5 = $conn->query($sql2);
- if ($result5->num_rows > 0) {
- // output data of each row
- while($row = $result5->fetch_assoc()) {
- $emailValue = $row['email'];
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- //Submit 2
- if (isset($_POST["submit2"])) {
- $name = $_SESSION['username'];
- $title = $_POST['title'];
- $help = $_POST['help'];
- $from = "$emailValue";
- $to = 'info@shadowhcf.com';
- $subject = "General Ticket - $name";
- $body = "";
- if (!isset($title)) {
- $errTitle = 'Please enter a title';
- } else if (!isset($help)) {
- $errHelp = 'Please enter this field';
- } else {
- if (@mail ($to,$subject,$body,$from)) {
- $result = '<div class="alert alert-danger">Your ticket has been sent! You"ll receive response on your email.</div>';
- mail ($to,$subject,$body,$from);
- } else {
- $result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later</div>';
- }
- }
- }
- //Submit 1
- if (isset($_POST["submit"])) {
- $name = $_SESSION['username'];
- $title2 = $_POST['title2'];
- $issue = $_POST['issue'];
- $from = "$emailValue";
- $to = 'info@shadowhcf.com';
- $subject = "Donation Ticket $name";
- $choice = $_POST['choice'];
- $body = 'From: $name\n Title: $title2\n Issue:\n $issue\nHas relogged: $choice_status';
- if (!$title2) {
- $errTitle2 = 'Please enter a title';
- } else if (!isset($issue)) {
- $errIssue = 'Please enter this field';
- } else if (!isset($choice)) {
- $errChoice = 'Please enter a choice';
- } else {
- if (@mail ($to, $subject, $body, $from)) {
- $result = '<div class="alert alert-danger">Your ticket has been sent! You"ll receive response on your email.</div>';
- mail ($to, $subject, $body, $from);
- } else {
- $result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later</div>';
- }
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>ShadowHCF :: Ticketsystem</title>
- <!-- Bootstrap Core CSS -->
- <script src="https://shadowhcf.com/bootstrap/jquery/jquery.js"></script>
- <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
- <!-- THIS LINE -->
- <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
- <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
- <script type="text/javascript" src='https://shadowhcf.com/js/bootstrap.min.js'></script>
- <link rel="stylesheet" href="https://shadowhcf.com/css/bootstrap.css" />
- <!-- Custom CSS -->
- <link href="https://shadowhcf.com/css/half-slider.css" rel="stylesheet">
- <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <?php include($_SERVER['DOCUMENT_ROOT']."/inc/navbar.php"); ?>
- </div>
- <style>
- .label-moderator {
- background-color: #00AAAA;
- }
- .label-admin {
- background-color: #d9534f;
- }
- .label-owner {
- background-color: #E6302B;
- }
- .label-defaultrank {
- background-color: #BDBDBD;
- }
- .label-country {
- background-color: #2A79DB;
- }
- .text-muted {
- color: #777;
- }
- </style>
- <div class="container">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
- <script>
- $(document).ready(function(){
- $('[data-toggle="tooltip"]').tooltip();
- });
- </script>
- <div style="margin-top: 80px;">
- <div class="jumbotron" style="margin-bottom: 0px;border-bottom-left-radius: 0px;border-bottom-right-radius: 0px;">
- <h1>ShadowHCF Ticketsystem</h1>
- <p>Welcome to the ShadowHCF ticket system.</p>
- <hr>
- <b>Send only ticket a time, otherwise you'll be banned from our ticketsystem.</b>
- </div>
- <h5 class="pull-right">
- Staff Applications Closed <i class="fa fa-times-circle-o" aria-hidden="true" style="color:#d9534f"></i>
- </h5>
- <h3>Select a Category to Get Started.</h3>
- <?php echo $result; ?>
- <?php echo "<h4 class='text-danger'><b>$error</b></h4>"; ?><br>
- <script type="text/javascript">
- $(function() {
- $('.submit-ticket').on('click', function(e){
- e.preventDefault();
- var category = $("#category-box").val();
- var errors = 0;
- var title = $("div[data-category='" + category + "']").find('.' + category + '-title').val();
- $("div[data-category='" + category + "']").find('.' + category + '-title-form').removeClass('has-error');
- $("div[data-category='" + category + "']").find('.' + category + '-title-form').find('.error-msg').remove();
- if(typeof title === 'undefined' || title.length == 0){
- errors++;
- $("div[data-category='" + category + "']").find('.' + category + '-title-form').addClass('has-error');
- $("div[data-category='" + category + "']").find('.' + category + '-title-form').prepend('<label class="control-label error-msg">This field is required.</label>')
- }
- data = {
- csrfmiddlewaretoken: 'rYmZ9ExMxVuOY34MydWuKcRb9nnt48OX',
- category: $(this).data('category'),
- title: title
- }
- var fields = {}
- $("div[data-category='" + category + "'] .field-group").each(function(index){
- var fieldid = $( this ).find('.field-question').data('field-id');
- var answer;
- if(typeof $( this ).find('.field-text').val() !== 'undefined'){
- answer = $( this ).find('.field-text').val();
- } else if (typeof $( this ).find('input:checked').val() !== 'undefined'){
- answer = $( this ).find('input:checked').val();
- }
- $(this).removeClass('has-error');
- $(this).find('.error-msg').remove();
- if(typeof answer === 'undefined' || answer.length == 0){
- $(this).addClass('has-error');
- $(this).children('.col-md-9').prepend('<label class="control-label error-msg">This field is required.</label>')
- errors++;
- return;
- }
- fields[fieldid] = answer;
- });
- if (errors > 0) {
- return;
- };
- data['fields'] = fields;
- $.ajax({
- url:".",
- data: data,
- type: 'POST'
- }).done(function(data){
- window.location.replace('');
- });
- });
- $('#category-box').on('change', function(e){
- e.preventDefault();
- $('div[data-category]').hide();
- $("div[data-category='" + $(this).val() + "']").fadeIn('slow');
- });
- });
- </script>
- <form method="post" action="support.php" role="form" id="ticket-form" class="ticket-form" style="margin-bottom:200px;">
- <div class="form-group category-box" style="max-width:40%;">
- <select class="form-control" id="category-box">
- <option selected="" disabled="" value="none">Select a Category</option>
- <option id="category_5" value="donation">Donation </option>
- <option id="category_13" value="general-support">General Support</option>
- </select>
- </div>
- <div class="row" data-category="donation" style="display:none;margin-left: 0px;margin-right: 0px;">
- <h4>Donation </h4>
- <div class="col-md-3">
- Title
- </div>
- <div class="col-md-9">
- <div class="form-group donation-title-form" style="max-width:40%">
- <input type="text" class="form-control donation-title" name="title2" autocomplete="off" placeholder="Title">
- <?php echo "<p class='text-danger'>$errTitle2</p>"; ?>
- </div>
- </div>
- <div class="col-md-3">
- Username
- </div>
- <div class="col-md-9">
- <div class="form-group donation-title-form" style="max-width:40%">
- <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $_SESSION["username"]; ?>" readonly>
- </div>
- </div>
- <div class="col-md-3">
- Email
- </div>
- <div class="col-md-9">
- <div class="form-group donation-title-form" style="max-width:40%">
- <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $emailValue; ?>" readonly>
- </div>
- </div>
- <div class="field-group">
- <div class="col-md-3">
- <div class="field-question" data-field-id="12">Question/Issue</div>
- </div>
- <div class="col-md-9">
- <div class="ticket-box" style="margin-bottom: 10px">
- <textarea name="issue" class="form-control field-text" rows="5" placeholder="Question/Issue"></textarea>
- <?php echo "<p class='text-danger'>$errIssue</p>"; ?>
- </div>
- </div>
- </div>
- <div class="field-group">
- <div class="col-md-3">
- <div class="field-question" data-field-id="46">Have you re-logged?</div>
- </div>
- <div class="col-md-9">
- <?php echo "<p class='text-danger'>$errChoice</p>"; ?>
- <div class="radio-inline form-group">
- <label>
- <input type="radio" name="choice" value="Yes">
- Yes
- </label>
- </div>
- <div class="radio-inline form-group">
- <label>
- <input type="radio" name="choice" value="No">
- No
- </label>
- </div>
- </div>
- </div>
- <input class="btn btn-primary pull-right submit-ticket" name="submit" type="submit" value="Submit ticket">
- </div>
- <div class="row" data-category="general-support" style="display:none;margin-left: 0px;margin-right: 0px;">
- <h4>General Support</h4>
- <div class="col-md-3">
- Title
- </div>
- <div class="col-md-9">
- <div class="form-group general-support-title-form" style="max-width:40%">
- <input type="text" class="form-control general-support-title" name="title" autocomplete="off" placeholder="Title">
- <?php echo "<p class='text-danger'>$errTitle</p>"; ?>
- </div>
- </div>
- <div class="col-md-3">
- Username
- </div>
- <div class="col-md-9">
- <div class="form-group donation-title-form" style="max-width:40%">
- <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $_SESSION["username"]; ?>" readonly>
- </div>
- </div>
- <div class="col-md-3">
- Email
- </div>
- <div class="col-md-9">
- <div class="form-group donation-title-form" style="max-width:40%">
- <input type="text" class="form-control donation-title" name="" autocomplete="off" value="<?php echo $emailValue; ?>" readonly>
- </div>
- </div>
- <div class="field-group">
- <div class="col-md-3">
- <div class="field-question" data-field-id="45">What do you need help with?</div>
- </div>
- <div class="col-md-9">
- <div class="ticket-box" style="margin-bottom: 10px">
- <textarea name="help" class="form-control field-text" rows="5" placeholder="What do you need help with?"></textarea>
- <?php echo "<p class='text-danger'>$errHelp</p>"; ?>
- </div>
- </div>
- </div>
- <input class="btn btn-primary pull-right submit-ticket" name="submit2" type="submit" value="Submit ticket">
- </div>
- </form>
- </div>
- <hr>
- <!-- Footer -->
- <footer>
- <div class="row">
- <div class="col-lg-12">
- <p>Copyright © ShadowHCF 2016 - Developed by <a href="/u/SkyDZN"><b>SkyDZN</b></a></p>
- </div>
- </div>
- <!-- /.row -->
- </footer>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement