<commit_before><?php
session_start();

$sesID = session_id();
// init
include_once "../include/settings.php";
include_once "../include/mysql.php";

include $GLOBAL['path']."/class/tickets.class.php";
$tickets = new Tickets($linkID);

// check login TBD


$sql = "INSERT INTO `tickets` (`eventID`,`userID`,`name`,`qty`,`price`,`more_info`) VALUES ('$_GET[id]','$_SESSION[id]','$_GET[name]','$_GET[qty]','$_GET[price]','$_GET[more_info]')";
$result = $tickets->new_mysql($sql);

$sql = "SELECT * FROM `tickets` WHERE `eventID` = '$_GET[id]' AND `userID` = '$_SESSION[id]' ORDER BY `name` ASC";
$result = $tickets->new_mysql($sql);

$device = $tickets->device_type();

if ($device == "0") {
print "
                <table class=\"table\">
                <tr><td><b>Name</b></td><td><b>Quantity</b></td><td><b>Price</b></td><td>&nbsp;</td></tr>
";
} else {
print "
                <table class=\"table\">
                <tr><td><b>Name</b></td><td><b>Quantity</b></td><td><b>Price</b></td></tr>
";	
}
while ($row = $result->fetch_assoc()) {
	print "<tr><td>$row[name]</td><td>$row[qty]</td><td>$row[price]</td>";
	if ($device == "0") {
		print "
		<td>
        <input type=\"button\" class=\"btn btn-primary\" value=\"Edit\" onclick=\"document.location.href='index.php?section=dashboard&center=edit_tickets&id=$_GET[id]&item=$row[id]'\">
        <input type=\"button\" class=\"btn btn-danger\" value=\"Delete\" onclick=\"if(confirm('WARNING: You are about to delete $row[name]')){document.location.href='index.php?section=dashboard&center=manage_tickets&id=$_GET[id]&delete=y&item=$row[id]'};\">

		</td></tr>";
	} else {
		print "
		</tr><tr><td colspan=3>
        <input type=\"button\" class=\"btn btn-primary\" value=\"Edit\" onclick=\"document.location.href='index.php?section=dashboard&center=edit_tickets&id=$_GET[id]&item=$row[id]'\">
        <input type=\"button\" class=\"btn btn-danger\" value=\"Delete\" onclick=\"if(confirm('WARNING: You are about to delete $row[name]')){document.location.href='index.php?section=dashboard&center=manage_tickets&id=$_GET[id]&delete=y&item=$row[id]'};\">

		</td></tr>";	
	}<commit_msg>mobile development<commit_after><?php
session_start();

$sesID = session_id();
// init
include_once "../include/settings.php";
include_once "../include/mysql.php";

include $GLOBAL['path']."/class/tickets.class.php";
$tickets = new Tickets($linkID);

// check login TBD


$sql = "INSERT INTO `tickets` (`eventID`,`userID`,`name`,`qty`,`price`,`more_info`) VALUES ('$_GET[id]','$_SESSION[id]','$_GET[name]','$_GET[qty]','$_GET[price]','$_GET[more_info]')";
$result = $tickets->new_mysql($sql);

$sql = "SELECT * FROM `tickets` WHERE `eventID` = '$_GET[id]' AND `userID` = '$_SESSION[id]' ORDER BY `name` ASC";
$result = $tickets->new_mysql($sql);

$device = $tickets->device_type();

if ($device == "0") {
print "
                <table class=\"table\">
                <tr><td><b>Name</b></td><td><b>Quantity</b></td><td><b>Price</b></td><td>&nbsp;</td></tr>
";
} else {
print "
                <table class=\"table\">
                <tr><td><b>Name</b></td><td><b>Quantity</b></td><td><b>Price</b></td></tr>
";	
}
while ($row = $result->fetch_assoc()) {
	if (strlen($row['name']) > 30) {
		$row['name'] = substr($row['name'], 0,30);
		$row['name'] .= " ...";
	}
	print "<tr><td>$row[name]</td><td>$row[qty]</td><td>$row[price]</td>";
	if ($device == "0") {
		print "
		<td>
        <input type=\"button\" class=\"btn btn-primary\" value=\"Edit\" onclick=\"document.location.href='index.php?section=dashboard&center=edit_tickets&id=$_GET[id]&item=$row[id]'\">
        <input type=\"button\" class=\"btn btn-danger\" value=\"Delete\" onclick=\"if(confirm('WARNING: You are about to delete $row[name]')){document.location.href='index.php?section=dashboard&center=manage_tickets&id=$_GET[id]&delete=y&item=$row[id]'};\">

		</td></tr>";
	} else {
		print "
		</tr><tr><td colspan=3>
        <input type=\"button\" class=\"btn btn-primary\" value=\"Edit\" onclick=\"document.location.href='index.php?section=dashboard&center=edit_tickets&id=$_GET[id]&item=$row[id]'\">
        <input type=\"button\" class=\"btn btn-danger\" value=\"Delete\" onclick=\"if(confirm('WARNING: You are about to delete $row[name]')){document.location.href='index.php?section=dashboard&center=manage_tickets&id=$_GET[id]&delete=y&item=$row[id]'};\">

		</td></tr>";	
	}
{'fraction_non_alphanumeric': 0.2632060370455065, 'fraction_numerical': 0.002515435627715527, 'mean_word_length': 4.879032258064516, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 114, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6773223', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1571, 'n_words': 224}