select_db($dbname);

/* if (array_key_exists(‘submitremove’, $_POST))
{
$removeline = $_POST(“removeline”);
//$query = “DELETE FROM holdingcart WHERE cartrecordid = ‘$removeline’ AND SessionID = ‘$session_id'”;
$result = $db->query(“DELETE FROM holdingcart WHERE cartrecordid = ‘$removeline’ AND SessionID = ‘$session_id'”);
} */

if ($_POST[‘submitremove’] == “Remove”)
{
$removeline = $_POST[‘removeline’];

//$query=”DELETE FROM holdingcart WHERE cartrecordid = ‘$removeline’ AND SessionID = ‘$session_id'”;
$erase = $db->query(“DELETE FROM holdingcart WHERE holdingcart.cartrecordid = ‘$removeline'”);
} else { };

$returnlink = $_GET[‘merchant_return_link’];

if (isset($returnlink))
{
$clearcart = $db->query(“DELETE FROM holdingcart WHERE SessionID = ‘$session_id'”);
echo “

Your order has been successfully received. You will receive an email with the tickets and further information shortly. If you do not receive this email, check your spam filter or call us.

“;
}
?>
query(‘SELECT meta_value AS ShowID, post_title AS Name, posts.ID AS postid FROM wp_postmeta meta, wp_posts posts WHERE posts.ID = meta.post_id AND posts.ID IN (SELECT posts.ID FROM wp_postmeta meta, wp_posts posts WHERE posts.ID = meta.post_id AND meta_key = “enddate” AND meta_value > CURDATE()) AND posts.ID IN (SELECT posts.ID FROM wp_postmeta meta, wp_posts posts WHERE posts.ID = meta.post_id AND meta_key = “sellonline” AND meta_value = “Yes”) AND meta_key = “showid”‘);
$show_num_results = $shows->num_rows;

for ($s=0; $s < $show_num_results; $s++) { $srow = $shows->fetch_assoc();
$shownameupper = strtoupper($srow[‘Name’]);
$showname = ($srow[‘Name’]);
$showid = ($srow[‘ShowID’]);
$postid = ($srow[‘postid’]);

$query=”SELECT Time, PerfID FROM performances WHERE performances.Time > NOW() AND ShowID = ‘$showid’ ORDER BY performances.Time;”;
$result = $db->query($query);
$num_results = $result->num_rows;
echo ‘

‘;
echo $shownameupper;
echo ‘
‘;
$_SESSION[”.$showname.”];
?>

Performance:

‘;

$query=”SELECT TicketType, Price FROM prices WHERE Category = (SELECT meta_value FROM wp_postmeta WHERE meta_key = ‘category’ AND post_id = ‘$postid’) ORDER BY Price DESC;”;
$result = $db->query($query);
$num_results = $result->num_rows;
echo ‘

Ticket:

‘;
echo ‘

Quantity:

‘;

echo ‘

‘;

echo ‘

‘;
echo “Presented by “;
$presentedsql=”SELECT meta_value FROM wp_postmeta WHERE meta_key = ‘category’ AND post_id = ‘$postid’ ;”;
$presentedby = $db->query($presentedsql);
$pb = $presentedby->fetch_assoc();
$presented = ($pb[‘meta_value’]);
if ($presented==”Major”) { echo “the Arcadians Theatre Group.”; }
elseif ($presented ==”ACT”) { echo “Arcadians’ Children’s Theatre.”; }
elseif ($presented ==”Lamplighters”) { echo “the Lamplighters Male Choir.”; }
elseif ($presented ==”Minstrels”) { echo “the Minstrels.”; }
else { echo “the Arcadians Theatre Group.”; }
echo ‘
‘;
$notesquery = $db->query(“SELECT meta_value FROM wp_postmeta WHERE meta_key = ‘notes’ AND post_id = ‘$postid'”);
$notesarray = $notesquery->fetch_assoc();
$notes = ($notesarray[‘meta_value’]);
echo $notes;
echo ‘