<?php

// Set flag that this is a parent file

	define( '_FEXEC', 1 );
	require('includes/application_top.php');
	
	//cartzone my concert details colors configured
	$color1 = '' . COLOR_1 . '';
	$color2 = '' . COLOR_2 . '';
	$color3 = '' . COLOR_3 . '';
	$color4 = '' . COLOR_4 . '';
	$color5 = '' . COLOR_5 . '';
	
define('HEADING_TITLE', 'Concert Details');

define('TABLE_HEADING_ACCOUNT', 'My Account');

define('EDIT_CONCERT', '<b>Edit Concert</b>');

define('EDIT', '<b>Edit</b>');
define('DELETE', '<b>Delete</b>');
define('ADD_NEW', 'Add New');

define('IMAGE_EDIT_CHANGES', 'Edit Entry');
define('IMAGE_DELETE', 'Delete Entry');

//define('CONCERT_NAME', '<b>Concert Name: </b>');
define('CATEGORIES_ID', 'Concert ID');
define('SORT_ORDER', 'Sort Order');
define('CATEGORIES_NAME', '<b>Concert Name: ');
define('CONCERT_VENUE', 'Concert Venue: ');
define('CATEGORIES_DESCRIPTION', 'Concert Description');
define('CATEGORIES_HEADING', 'Concert Heading Title');
define('CONCERT_DATE', 'Concert Date');
define('EDIT_DATE_ID', 'Edit Date ID');
define('DATE_ID', 'Date ID');
define('CONCERT_PRICE1', '<div style=\'color:' . $color1 . ';\'><b>Concert Price 1: </b>');
define('CONCERT_PRICE2', '<div style=\'color:' . $color2 . ';\'><b>Concert Price 2: </b>');
define('CONCERT_PRICE3', '<div style=\'color:' . $color3 . ';\'><b>Concert Price 3: </b>');
define('CONCERT_PRICE4', '<div style=\'color:' . $color4 . ';\'><b>Concert Price 4: </b>');
define('CONCERT_PRICE5', '<div style=\'color:' . $color5 . ';\'><b>Concert Price 5: </b>');
define('CONCERT_TIME', '<b>Concert Time: </b>');

define('RESET', 'Reset');
define('HIDE', 'Hide');
define('UNHIDE', 'Enable');
define('EDIT_PRICES', '<b>Edit Prices</b>');

$last_parent = '' .COUNT_PLANS . ''; //last category parent id that shows a seat plan

	//comment out below if we have no sub categories
	//$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c where c.parent_id = '0'");
//	$categories = tep_db_fetch_array($categories_query);
//	$last_parent = $categories['total'];
	
	$action = $FREQUEST->getvalue('action','string','0');	
	$id = $FREQUEST->getvalue('id','int','0');		
	 if($action=='get_details')
    { 
	echo 'get_details^';
  $sql = tep_db_query ("select * from " . TABLE_CATEGORIES_DESCRIPTION . "  where categories_id= " . (int)$id . "");
  $myConcert = tep_db_fetch_array($sql);
  }	
  
	if ($action == "delete") {	

		$sort_query = tep_db_query("select * from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$id . "' order by categories_id desc limit 1");
		$sort = tep_db_fetch_array($sort_query);
		$sort_order = $sort['sort_order']+1;
		
		$id_query=tep_db_query("SELECT products_id from " . TABLE_PRODUCTS . " where parent_id='" . (int)$id . "'");
		$pid_ids='';
		while($id_result=tep_db_fetch_array($id_query)){
			if ($pid_ids!='') $pid_ids .= ',';
			$pid_ids .= "'" . $id_result['products_id'] . "'";
		}
		
		tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id in(" . $pid_ids . ")");
    	tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in(" . $pid_ids . ")");
		tep_db_query("delete from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$id . "'");
		tep_db_query("delete from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$id . "'");
		tep_db_query("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id >= '" . (int)$id . "' AND categories_id<'" . (int)$sort_order . "'");
		tep_db_query("delete from " . TABLE_PRODUCTS . " where parent_id = '" . (int)$id . "'");
	
		//tep_db_query($sql);		
		header("Location: " . FILENAME_ADMIN_CONCERT . "");
	}
	if ($action == "reset") 
	{	
		$sql = sprintf("update " . TABLE_PRODUCTS . " set products_quantity = '1', products_status = '1' where parent_id = " . (int)$id . " and products_sku = '1'");
		tep_db_query($sql);	
		//echo "RESET";	
		header("Location: " . FILENAME_ADMIN_CONCERT . "");
	}
	if ($action == "hide") {	
		$sql = sprintf("update " . TABLE_CATEGORIES . " set categories_status = '0' where categories_id = " . (int)$id . "");
		tep_db_query($sql);		
		header("Location: " . FILENAME_ADMIN_CONCERT . "");
	}
	if ($action == "unhide") {	
		$sql = sprintf("update " . TABLE_CATEGORIES . " set categories_status = '1' where categories_id = " . (int)$id . "");
		tep_db_query($sql);		
		header("Location: " . FILENAME_ADMIN_CONCERT . "");
	}
	if ($action == "lock") {
		$sql = sprintf("update " . TABLE_CATEGORIES . " set categories_products_lock = '".$_GET['lk']."' where categories_id = '" . (int)$id . "'");
		tep_db_query($sql);		
		header("Location: " . FILENAME_ADMIN_CONCERT . "");
	}
	if ($FPOST) {
	
	
		if ($FPOST['function'] == "editconcert") {
			
			foreach ($FPOST as $k => $v) {
				if ($k != "Submit" && $k != "function" && $k != "categories_id") {
					$l .= sprintf("`%s` = '%s',",$k,addslashes($v));	
				}
			}
			
			$l = substr($l,0,strlen($l)-1);
			
			$sql = sprintf("update " . TABLE_CATEGORIES_DESCRIPTION . " set %s where `categories_id` = '%s'",$l,addslashes($FPOST['categories_id']));
			
			tep_db_query($sql);
			
			header("Location: " . FILENAME_ADMIN_CONCERT . "");
		}
		//update date id
		if ($FPOST['function'] == "date_id") {
			$date_id =$_POST['products_model'];
			$sql = sprintf("update " . TABLE_PRODUCTS . " set products_model = '" . $date_id . "'  where products_status = '1' and parent_id = " . (int)$id . "");
			tep_db_query($sql);
			//cartzone update categories table too
			tep_db_query("update " . TABLE_CATEGORIES . " set date_id ='" . $date_id . "' where categories_id = " . (int)$id . "");
			echo "UPDATED";
			//header("Location:" . FILENAME_ADMIN_CONCERT . "");
		}


		if ($FPOST['batch_update'] == "batch_update") {
			for($i=0; $i<sizeof($_POST['color']); $i++){
				$sql = sprintf("update " . TABLE_PRODUCTS . " set products_price = '" . $_POST['products_price'][$i] . "'  where color_code = '" . $_POST['color'][$i] . "' and parent_id = " . (int)$id . "");
				tep_db_query($sql);
			}
			echo "UPDATED";
		}
	}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style type="text/css">
	#pup {position:absolute; visibility:hidden; z-index:200; width:130; }
</style>
    <link href="../js/jqModal.css" media="all" rel="stylesheet" type="text/css">
    <link href="base.css" media="all" rel="stylesheet" type="text/css"/>
    <script language="javascript" type="text/javascript" src="../js/jquery.js"></script>
    
    <!--<script language="javascript" type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>-->
    <script language="javascript" type="text/javascript" src="../js/jqDnR.js"></script>
    <script language="javascript" type="text/javascript" src="../js/jqModal.js"></script>
    <script language="javascript" type="text/javascript" src="../js/base.js"></script>
<script src="../js/jquery-1.2.1.min.js" type="text/javascript"></script>

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">  
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td valign="top">
<?php	
	 if($action=='edit')
    { 
	?>
    <?php $sql = sprintf("select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c where cd.categories_id= " . (int)$id . " and c.categories_id= " . (int)$id . "");
		  $result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);  ?>
		 <?php echo EDIT_CONCERT;?><br />   
        <form name="addnew" method="post"> 
        <input type="hidden" name="function" value="editconcert" />
        <input type="hidden" name="categories_id" value="<?php echo $myConcert['categories_id']; ?>" />
<table border="0" class="dataTableContent">
    <tr class="dataTableContent">
        <td class="dataTableContent"><?php echo CATEGORIES_ID . tep_draw_separator('pixel_trans.gif','54','10');?></td>
        <td class="dataTableContent"><?php echo $myConcert['categories_id'];?></td>
    </tr>
    <tr class="dataTableContent">
        <td class="dataTableContent"><?php echo CATEGORIES_NAME . tep_draw_separator('pixel_trans.gif','54','10');?></td>
        <td class="dataTableContent"><?php echo tep_draw_input_field('categories_name',$myConcert['categories_name'],'maxlength=150 size=75');?></td>
    </tr>
    <tr>
        <td class="dataTableContent"><?php echo CATEGORIES_HEADING . tep_draw_separator('pixel_trans.gif','52','10');?></td>
        <td class="dataTableContent"><?php echo tep_draw_input_field('categories_heading_title',$myConcert['categories_heading_title']);?></td>
    </tr>
    <tr class="dataTableContent">
        <td class="dataTableContent"><?php echo CATEGORIES_DESCRIPTION . tep_draw_separator('pixel_trans.gif','18','10');?></td>
        <td class="dataTableContent"><?php  echo tep_draw_input_field('categories_description',$myConcert['categories_description'],'maxlength=200 size=75');?></td>
    </tr> 
    <tr>
        <td class="dataTableContent"><?php echo CONCERT_VENUE . tep_draw_separator('pixel_trans.gif','52','10');?></td>
        <td class="dataTableContent"><?php echo tep_draw_input_field('concert_venue',$myConcert['concert_venue']); ?></td>
    </tr>
    <tr class="dataTableContent">
        <td class="dataTableContent" valign="top"><?php echo CONCERT_DATE . tep_draw_separator('pixel_trans.gif','62','10');?></td>
        <td class="dataTableContent" valign="top"><?php  echo tep_draw_input_field('concert_date',$myConcert['concert_date']);?></td>
    </tr>
    <tr class="dataTableContent">
        <td class="dataTableContent"><?php echo CONCERT_TIME . tep_draw_separator('pixel_trans.gif','60','10');?></td>
        <td class="dataTableContent"><?php  echo tep_draw_input_field('concert_time',$myConcert['concert_time']);?></td>
    </tr>  
    <tr>
        <td>&nbsp;</td>
        <td><input value="Confirm" type="submit" name="Submit" /><?php //echo '&nbsp' . tep_image_submit('button_confirm.gif',IMAGE_CONFIRM); ?></td>
    </tr>  
</table>
        </form>
        <FORM METHOD="LINK" ACTION="myconcert_update.php">
            <INPUT TYPE="submit" VALUE="Back to Concert Update">
            </FORM>
    <?php }?>
     
    <?php	
	 if($action=='date_id')
    { 
	?>
     <?php echo DATE_ID;?><br />
    <?php 
			$sql = sprintf("select products_model from " . TABLE_PRODUCTS . "  where products_status = '1' and parent_id = " . (int)$id . "");
			$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);  ?>
			
			<form name="dete_id" method="post"> 
			<input type="hidden" name="function" value="date_id" />
			<input type="hidden" name="products_model" value="<?php echo $myConcert['products_model']; ?>" />
			<table border="0" class="dataTableContent">
			<tr class="dataTableContent">
			  <td class="dataTableContent"><?php echo DATE_ID . tep_draw_separator('pixel_trans.gif','46','10');?></td>
			<td class="dataTableContent"><?php  echo tep_draw_input_field('products_model',$myConcert['products_model']);?></td>
			</tr>
			<tr>
			  <td>&nbsp;</td>
			<td><input value="Confirm" type="submit" name="Submit" /></td>
			</tr>  
			</table>
			</form>
            <FORM METHOD="LINK" ACTION="myconcert_update.php">
            <INPUT TYPE="submit" VALUE="Back to Concert Update">
            </FORM>
    <?php }?>

    
    <?php	
	 if($action=='editprices')
    { 
	?>
     <?php echo EDIT_PRICES;?><br />
   
			
<form name="prices" method="post"> 
			
			<table border="0" class="dataTableContent">
			<tr>
				<td><?php echo tep_draw_hidden_field('batch_update','batch_update');?></td>
			</tr>
			<tr class="dataTableContent">
				<td class="dataTableContent">
					<input type="hidden" name="color[]" value="<?php echo $color1; ?>" /> 
					<?php echo CONCERT_PRICE1 . tep_draw_separator('pixel_trans.gif','46','10');?>
				</td>
				<td>
					<?php 
					$sql = sprintf("select products_price from " . TABLE_PRODUCTS . "  where color_code = '" . $color1 ."' and parent_id = " . (int)$id . "");
					$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);  
					echo tep_draw_input_field('products_price[]',$myConcert['products_price']);?>	
				</td>
			</tr>

			<tr class="dataTableContent">
			  <td class="dataTableContent">
			  	<input type="hidden" name="color[]" value="<?php echo $color2; ?>" />
				<?php echo CONCERT_PRICE2 . tep_draw_separator('pixel_trans.gif','46','10');?></td>
			  <td class="dataTableContent">
				<?php 
					//
		 		$sql = sprintf("select products_price from " . TABLE_PRODUCTS . "  where color_code = '" . $color2 ."' and parent_id = " . (int)$id . "");
				$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);
				echo tep_draw_input_field('products_price[]',$myConcert['products_price']);?>	
				</td>
			</tr>

			<tr class="dataTableContent">
			  <td class="dataTableContent">
				<input type="hidden" name="color[]" value="<?php echo $color3; ?>" />
				<?php echo CONCERT_PRICE3 . tep_draw_separator('pixel_trans.gif','46','10');?></td>
			  <td class="dataTableContent">
				<?php 
		 		$sql = sprintf("select products_price from " . TABLE_PRODUCTS . "  where color_code = '" . $color3 ."' and parent_id = " . (int)$id . "");
				$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);
				echo tep_draw_input_field('products_price[]',$myConcert['products_price']);?>	
				</td>
			</tr>

			<tr class="dataTableContent">
			  <td class="dataTableContent">
				<input type="hidden" name="color[]" value="<?php echo $color4; ?>" /> 
				<?php echo CONCERT_PRICE4 . tep_draw_separator('pixel_trans.gif','46','10');?></td>
			  <td class="dataTableContent">
				<?php 
		 		$sql = sprintf("select products_price from " . TABLE_PRODUCTS . "  where color_code = '" . $color4 ."' and parent_id = " . (int)$id . "");
				$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);
				echo tep_draw_input_field('products_price[]',$myConcert['products_price']);?>	
				</td>
			</tr>
			
			<tr class="dataTableContent">
			  <td class="dataTableContent">
				<input type="hidden" name="color[]" value="<?php echo $color5; ?>" />
				<?php echo CONCERT_PRICE5 . tep_draw_separator('pixel_trans.gif','46','10');?></td>
			  <td class="dataTableContent">
				<?php 
		 		$sql = sprintf("select products_price from " . TABLE_PRODUCTS . "  where color_code = '" . $color5 ."' and parent_id = " . (int)$id . "");
				$result = tep_db_query($sql); $myConcert = tep_db_fetch_array($result);
				echo tep_draw_input_field('products_price[]',$myConcert['products_price']);?>	
				</td>
			</tr>
			
			<tr>
			  <td>&nbsp;</td>
			<td><input value="Confirm" type="submit" name="Submit" /></td>
			</tr>  
			</table>
			</form>

           <br>
            <FORM METHOD="LINK" ACTION="myconcert_update.php">
            <INPUT TYPE="submit" VALUE="Back to Concert Update">
            </FORM>
    <?php }?>

	<?php
	if ($action == "add") { ?>
         <?php //echo ADD_NEW;?><br />
        <form name="addnew" method="post">   
        <input type="hidden" name="function" value="addconcert" />
            <table border="0" class="dataTableContent">
            <tr class="dataTableContent">
              <td class="dataTableContent"><?php echo CATEGORIES_NAME . tep_draw_separator('pixel_trans.gif','54','10');?></td>
                     <td class="dataTableContent"><?php echo tep_draw_input_field('categories_name',$myConcert['categories_name'],'maxlength=150 size=75'); ?></td>
		    </tr>
              <tr>
                <td class="dataTableContent"><?php echo CATEGORIES_HEADING . tep_draw_separator('pixel_trans.gif','52','10');?></td>
                      <td class="dataTableContent"><?php echo tep_draw_input_field('categories_heading_title',$myConcert['categories_heading_title']); ?></td>
             </tr>
			 <tr class="dataTableContent">
			   <td class="dataTableContent"><?php echo CATEGORIES_DESCRIPTION . tep_draw_separator('pixel_trans.gif','18','10');?></td>
                     <td class="dataTableContent"><?php  echo tep_draw_input_field('categories_description',$myConcert['categories_description'],'maxlength=200 size=75');?></td>
		    </tr> 
              <tr>
                <td class="dataTableContent"><?php echo CONCERT_VENUE . tep_draw_separator('pixel_trans.gif','52','10');?></td>
                      <td class="dataTableContent"><?php echo tep_draw_input_field('concert_venue',$myConcert['concert_venue']); ?></td>
             </tr>
			<tr class="dataTableContent">
			  <td class="dataTableContent"><?php echo CONCERT_DATE . tep_draw_separator('pixel_trans.gif','62','10');?></td>
                     <td class="dataTableContent"><?php  echo tep_draw_input_field('concert_date',$myConcert['concert_date']);?></td>
			 </tr>
            <tr class="dataTableContent">
              <td class="dataTableContent"><?php echo CONCERT_TIME . tep_draw_separator('pixel_trans.gif','60','10');?></td>
                     <td class="dataTableContent"><?php  echo tep_draw_input_field('concert_time',$myConcert['concert_time']);?></td>
		    </tr>
                <tr>
                  <td>&nbsp;</td>
                	<td><input value="Confirm" type="submit" name="Submit" /></td>
                </tr>
            </table>
        </form> 
		<?php
        }
		
		if (!$action) {
		?>
	
        <a class="main" href="?action=add"><?php //echo ADD_NEW;?></a>
	<table width="100%" border="0" cellspacing="1" cellpadding="5">
  <tr>
    <td colspan="2" align="center"><h2>CREATE YOUR SEAT PLAN</h2></td>
    </tr>
  <tr>
    <td width="15%" align="center" <?php 
	$sql = tep_db_query("SELECT * FROM seat_plan ");
	$rows=tep_db_num_rows($sql);
	if(tep_db_num_rows($sql)>0){
	echo "class=\"loaded\"";
	} ?>><strong>TEMPLATE</strong> <span class="style1">(loaded)</span></td>
    <td width="16%" align="center" <?php 
	$sql = tep_db_query("SELECT * FROM products ");
	$rows=tep_db_num_rows($sql);
	if(tep_db_num_rows($sql)>0){
	echo "class=\"loaded\"";
	} ?>><strong>ACTIVE</strong> <span class="style1">(loaded)</span></td>
    </tr>
</table>
    
    <table class="dataTableContent" border="0" width="100%">
    
    	<tr class="dataTableContent">
        	<td><strong><?php echo LOCK;?></strong></td>
            <td><strong><?php echo HIDE;?></strong></td>
        	<td><strong><?php echo CATEGORIES_NAME;?></strong></td>
            <td><strong><?php echo CATEGORIES_HEADING;?></strong></td>
            <td><strong><?php echo CONCERT_VENUE;?></strong></td>
            <td><strong><?php echo CONCERT_DATE;?></strong></td>
            <td><strong><?php echo EDIT_DATE_ID;?></strong></td>
            <td><strong><?php echo DATE_ID;?></strong></td>
            <td><strong><?php echo EDIT;?></strong></td>
            <td><strong><?php echo EDIT_PRICES;?></strong></td>
            <td><strong><?php echo DELETE;?></strong></td>
            <td><strong><?php echo RESET;?></strong></td>
        </tr>
       
	<?php // set the limit of plans here

	$sql = "select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c where cd.categories_id = c.categories_id and c.parent_id ='0' order by c.sort_order ";//limit " . $last_parent . "
	$result = tep_db_query($sql);
	
	while ($myConcert = tep_db_fetch_array($result)) {

			if ($myConcert['parent_id'] == '0')
			//echo '<tr class="cpdata">';
			//elseif($myConcert['parent_id'] > '0')
			echo '<tr bgcolor="#efefef">';
			//echo '<td><a href="?action=lock&id=' . $myConcert['categories_id'] . '" onclick="var x=confirm(\'Sorry, Locking is for MULTI version only\'); if (x==false) { return false; }">' . tep_image_button("locked.gif",LOCK) . '</a></td>';
			if($myConcert['categories_products_lock'] == '1'){
				echo '<td><a href="?action=lock&lk=0&id=' . $myConcert['categories_id'] . '">' . tep_image_button("unlocked.gif",LOCK) . '</a></td>';
			}else{
				echo '<td><a href="?action=lock&lk=1&id=' . $myConcert['categories_id'] . '">' . tep_image_button("locked.gif",UNLOCK) . '</a></td>';
			}
			if ($myConcert['categories_status'] == '1')
			echo '<td><a href="?action=hide&id=' . $myConcert['categories_id'] . '">' . tep_image_button("icon_active.gif",HIDE) . '</a></td>';
			elseif($myConcert['categories_status'] == '0')
			echo '<td><a href="?action=unhide&id=' . $myConcert['categories_id'] . '">' . tep_image_button("icon_inactive.gif",UNHIDE) . '</a></td>';
			echo '<td>' . $myConcert['categories_name'] . '</td>';
			echo '<td>' . $myConcert['categories_heading_title'] . '</td>';
			echo '<td>' . $myConcert['concert_venue'] . '</td>';
			echo '<td>' . $myConcert['concert_date'] . '</td>';
			if($myConcert['parent_id'] == '0'){
				//echo '<td></td>';
			//}elseif($myConcert['parent_id'] > '0'){
				if($myConcert['categories_products_lock'] == '0'){
					echo '<td><a href="javascript:void(0);" onclick="alert(&quot;Concert is Locked&quot;);">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
				}else{
					echo '<td><a href="?action=date_id&id=' . $myConcert['categories_id'] . '">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
				}
			}
			echo '<td>' . $myConcert['date_id'] . '</td>';
			if($myConcert['categories_products_lock'] == '0'){
				echo '<td><a href="javascript:void(0);" onclick="alert(&quot;Concert is Locked&quot;);">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
			}else{
				echo '<td><a href="?action=edit&id=' . $myConcert['categories_id'] . '">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
			}
			if($myConcert['parent_id'] == '0'){
				//echo '<td></td>';
			//}elseif($myConcert['parent_id'] > '0'){
				if($myConcert['categories_products_lock'] == '0'){
					echo '<td><a href="javascript:void(0);" onclick="alert(&quot;Concert is Locked&quot;);">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
				}else{
					echo '<td><a href="?action=editprices&id=' . $myConcert['categories_id'] . '">' . tep_image_button("pencil.png",IMAGE_EDIT_CHANGES) . '</a></td>';
				}
			}
			echo '<td><a href="?action=delete&id=' . $myConcert['categories_id'] . '">' . tep_image_button("delete.png",IMAGE_DELETE) . '</a></td>';
			if($myConcert['parent_id'] == '0'){
				//echo '<td></td>';
			//}elseif($myConcert['parent_id'] > '0'){
				if($myConcert['categories_products_lock'] == '0'){
					echo '<td><a href="javascript:void(0);" onclick="alert(&quot;Concert is Locked&quot;);">' . tep_image_button("reset.gif",RESET) . '</a></td>';
				}else{
					echo '<td><a href="?action=reset&id=' . $myConcert['categories_id'] . '" onclick="var x=confirm(\'are you sure you want to reset the seat plan?\'); if (x==false) { return false; }">' . tep_image_button("reset.gif",RESET) . '</a></td>';
				}
			}
			echo '</tr>';
		}
?>
    </table>
     <?php } ?>
	</td>  
<!-- body_text_eof //-->
  </tr>
</table>
<?php include(DIR_WS_INCLUDES . 'osconcert.php'); ?>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>