<?php
define('_FEXEC', 1);
require('includes/application_top.php');

define('HEADING_TITLE', 'Concert Details');
define('TABLE_HEADING_ACCOUNT', 'My Account');
define('DELETE', '<b>Delete</b>');
define('IMAGE_DELETE', 'Delete');
define('IMAGE_EXPORT', 'Export');
define('CATEGORIES_ID', 'Concert ID');
define('CATEGORIES_NAME', '<b>Concert Name: ');
define('HEADING_TITLE_4', 'This is a list of all your "LOADED" events mixed with your seat plans. Your new seat plan will be added to end of your data. Please be careful not to DELETE existing seat plans. Always back up.');

$sql = "SELECT c.categories_id, cd.categories_name 
        FROM " . TABLE_CATEGORIES . " c 
        JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd 
        ON c.categories_id = cd.categories_id 
        WHERE c.parent_id = '0' 
        ORDER BY c.sort_order";
$result = tep_db_query($sql);



$output = '';
$output = '<h4>' . HEADING_TITLE_4 . '</h4>';
$output .= '<table class="dataTableContent" border="0" width="100%">';
$output .= '<tr class="dataTableContent">';
$output .= '<td><strong>' . CATEGORIES_NAME . '</strong></td>';
$output .= '<td><strong>Export</strong></td>';
$output .= '<td><strong>' . DELETE . '</strong></td>';
$output .= '</tr>';

while ($myConcert = tep_db_fetch_array($result)) {
    $output .= '<tr bgcolor="#efefef">';
    $output .= '<td><h5>' . $myConcert['categories_id'] . ' : ' . htmlspecialchars($myConcert['categories_name']) . '</h5></td>';
    // Export button: passes the concert id (or section_id) via GET
    $output .= '<td><a href="export_sp.php?section_id=' . $myConcert['categories_id'] . '">' . tep_image_button_sm("", IMAGE_EXPORT) . '</a></td>';
    $output .= '<td><a href="#" onclick="return confirmDeletion(' . $myConcert['categories_id'] . ');">' . tep_image_button_sm("", IMAGE_DELETE) . '</a></td>';
    $output .= '</tr>';
}

$output .= '</table>';
echo $output;

?>


