[ create a new paste ] login | about

Link: http://codepad.org/kVwk7LUb    [ raw code | output | fork ]

PHP, pasted on Sep 17:
<?php
require_once('model/session.php');
require_once('model/db_conn.php');
require_once('model/functions.php');
require_once('view/header.php');
if(!$session->is_logged_in()){
	redirect_to("https://www.foxvm.com/login");
}
$head_me->title = 'Foxvm.com - Your support tickets.';
$head_me->page_header();
$head_me->page_start();
$head_me->page_menu();
?>
    <div class="container support summery">

	<div class="row home ">
	<div class="col-sm-10 ">
	<h2>Your support tickets</h2>
	</div>
	<div class="col-sm-2">
	<a class="btn btn-default btn-md" href="/new-ticket"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Open a new ticket</a>
	</div>
	</div>
<div class="row edgey">

<div class="col-sm-12">
<table class="table table-striped table-hover custom">
  <thead>
    <tr>
      <th>Ticket Number</th>
      <th>Service</th>
      <th>Type</th>
	  <th>Subject</th>
	  <th>Last person to intervene</th>
	  <th>Creation date</th>
	  <th>Date of update</th>
	  <th>Status</th>
    </tr>
  </thead>
  <tbody>
<?php
$info = $db->prepare("SELECT * FROM tickets WHERE user_id=:id ORDER BY ticket_id DESC");
$user_id = $_SESSION['user_id'];
$info->bindValue(":id",$user_id,PDO::PARAM_INT);
$info->execute();
$ticket_info = $info->fetchAll(PDO::FETCH_ASSOC);
foreach($ticket_info as $ticketfo){
	$subject = $ticketfo['ticket_subject'];
	$message = $ticketfo['ticket_message'];
	$ticket_date = strtotime($ticketfo['ticket_date']);
	$ticket_date = date("jS \of F Y h:i:s A", $ticket_date);
	$ticket_id = $ticketfo['ticket_id'];
	$ticket_status = $ticketfo['ticket_status'];
	$service_attch = $ticketfo['service_attch'];
	$reply = $db->prepare("SELECT * FROM reply WHERE ticket_id=:id ORDER BY reply_id DESC LIMIT 1");
	$reply->bindValue(":id",$ticket_id,PDO::PARAM_INT);
	$reply->execute();
	$reply_fo = $reply->fetchAll(PDO::FETCH_ASSOC);
	$update_date = strtotime($reply_fo[0]['reply_date']);
	$last_person = $reply_fo[0]['reply_person'];
	if(empty($last_person)){
		$last_person = $_SESSION['user_name'];
	}
	if(empty($update_date)){
	$update_date=$ticket_date;
	}else{
	
	$update_date = date("jS \of F Y h:i:s A", $update_date);
	}
	echo "
	  <tr class=\"active\">
      <td>$ticket_id</td>
      <td>$service_attch</td>
      <td>Customer Support</td>
	  <td><a href=\"/viewticket.php?id=$ticket_id\">$subject</a></td>
	  <td>$last_person</td>
	  <td>$ticket_date</td>
	  <td>$update_date</td>
	  <td>$ticket_status</td>
    </tr>";
}
?>

    
  </tbody>
</table>
</div>
	</div>
	</div>
	<?php
	
echo '
<script>
$(\'tr\').click( function() {
 window.location = $(this).find(\'a\').attr(\'href\');
}).hover( function() {
    $(this).toggleClass(\'hover\');
	
});
</script>
';

$head_me->page_footer();

?>


Output:
1
2
3
4

Warning: require_once(model/session.php): failed to open stream: No such file or directory on line 2

Fatal error: require_once(): Failed opening required 'model/session.php' (include_path='.:/usr/lib/php') on line 2


Create a new paste based on this one


Comments: