Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Created February 12, 2013 17:47
Show Gist options
  • Save anthonycvella/4771682 to your computer and use it in GitHub Desktop.
Save anthonycvella/4771682 to your computer and use it in GitHub Desktop.
<?php
session_start();
if(!isset($_SESSION['loggedIn']) || $_SESSION['loggedIn']!=1)
{
header("Location: login.php");
exit();
}
$included = 'true';
include ("BarcodeQR.php");
require ("classes/database.php");
$dbinfo = array(
"host" => "127.0.0.1",
"user" => "root",
"pass" => "",
"name" => "hiskor"
);
// Creates the PDO Object for queries
$db = new Database ( $dbinfo );
$qr = new BarcodeQR();
$ticketCode = $_SESSION['ticketCode'];
$qr->text("text")
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
<?php require_once ("templates/head.tpl.php"); ?>
<body>
<div class="wrap">
<?php require_once ("templates/header.tpl.php"); ?>
<div id="content">
<?php require_once ("templates/sidebar.tpl.php"); ?>
<div id="main">
<div class="clear"></div>
<div class="full_w">
<div align="center" class="h_title">Add Ticket</div>
<!-- Creates the error message returned from doAddUser script -->
<?php if(isset($_SESSION['message'])) : ?>
<div class="<?php echo $_SESSION['error_bar']; unset($_SESSION['error_bar']); ?>"><p><?php echo $_SESSION['message']; unset($_SESSION['message']); ?></p></div>
<?php endif; ?>
<form action="classes/doAddTicket.php" method="post">
<label for="username">Quantity:</label>
<input id="login" name="username" class="addUserText" />
<div class="sep"></div>
<button type="submit" class="addUserButtonOk">Create Ticket</button>
</form>
<?php if(isset($_SESSION['ticketCode'])) : ?>
<p><?php echo $_SESSION['ticketCode']; ?></p>
<p><?php $qr->draw(); unset($_SESSION['ticketCode']); ?></p>
<?php endif; ?>
</div>
</div>
<div class="clear"></div>
</div>
<?php require_once ("templates/footer.tpl.php"); ?>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment