| Server IP : 104.21.21.239 / Your IP : 216.73.216.30 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/tgnewdev/admin/mod/ |
Upload File : |
<?php require('_mod_security.php'); ?>
<?php
$sql = '';
switch ($_GET['func']):
case 'grid' :
require_once('classes/lcs_db_grid.php');
$dbg = new lcs_db_grid;
$dbg->start_header_section();
$dbg->start_header();
$dbg->add_column(['label' => 'Show Name', 'dbcol' => 'os.name', 'width' => '175px']);
$dbg->add_column(['label' => 'Location', 'dbcol' => 'ol.name', 'width' => '175px']);
$dbg->add_column(['label' => 'Start Date', 'dbcol' => 'os.start_date', 'width' => '125px']);
$dbg->add_column(['label' => 'End Date', 'dbcol' => 'os.end_date', 'width' => '125px', 'filter' => true, 'filter_condition' => '> NOW()']);
$dbg->add_column(['label' => 'Address', 'dbcol' => 'ol.address', 'width' => '125px']);
if ($_GET['parm2'] ?? '' === 'no_status_filter') :
$dbg->add_column(['label' => 'Status', 'dbcol' => 'os.status', 'width' => '60px', 'filter'=>false]);
else :
$dbg->add_column(['label' => 'Status', 'dbcol' => 'os.status', 'width' => '60px', 'multi_filter' => APP_EVENT_STATUSES, 'multi_filter_col' => 'os.status', 'multi_filter_type' => 'int']);
endif;
$dbg->add_column(['label' => 'Inactivate', 'sortable' => false, 'searchable' => false, 'width' => '65px', 'align' => 'center', 'update' => true]);
$dbg->add_column(['label' => 'Delete', 'sortable' => false, 'searchable' => false, 'width' => '55px', 'align' => 'center', 'update' => true]);
$dbg->end_header();
$dbg->end_header_section();
$sql = "SELECT os.*, ol.name AS location_name, ol.address, ol.city, ol.state FROM obw_shows os " .
"LEFT JOIN obw_locations ol ON (ol.id = os.obw_location_id) " .
"WHERE ".$dbg->search_spec()." ".$_GET['parm1']." " .
"GROUP BY os.id " .
"ORDER BY ".$dbg->sort_spec();
//error_log(' === '.$sql.' === ');
$xls_sql = $sql;
$xls_sql_encoded = xls_sql_encrypt($xls_sql);
$result = $db->query($sql) or die('Database Error!');
$dbg->start_data_section();
if ($result->rowCount() > 0) :
while ($row = $result->fetch(PDO::FETCH_OBJ)) :
$dbg->start_row();
$dbg->add_cell('<a href="index.php?IX='.$_GET['ix_form'].'&id='.$row->id.'" >'.$row->name.'</a>');
$dbg->add_cell($row->location_name);
$dbg->add_cell(nzdate_display($row->start_date));
$dbg->add_cell(nzdate_display($row->end_date));
$dbg->add_cell($row->address);
$dbg->add_cell(APP_EVENT_STATUSES[$row->status]);
if ($row->status == 1) :
$dbg->add_cell('<a href="javascript:confirm_inactivate(\'Are you sure?\', \''.$row->id.'\', \''.$_GET['div'].'\');"><img src="img/inactivate_icon.png" style="border:none;" /></a>');
else :
$dbg->add_cell('');
endif;
$dbg->add_cell('<a href="javascript:confirm_delete(\'Are you sure? This action cannot be reversed.\', \''.$row->id.'\', \''.$_GET['div'].'\');"><img src="img/delete_icon.gif" style="border:none;" /></a>');
$dbg->end_row();
endwhile;
else :
$dbg->start_row();
$dbg->add_cell('No records found');
$dbg->end_row();
endif;
$dbg->end_data_section();
echo json_encode(['row_count' => $result->rowCount(), 'html' => $dbg->get_html(), 'xls_sql' => $xls_sql_encoded, 'extra_data'=> '']);
return;
break;
case 'delete' :
$sql = "DELETE FROM obw_shows WHERE id = ".nz(trim($_GET['id']), '0')." ";
$db->query($sql) or die(json_encode(['result' => 'Database Error!']));
$msg = 'Success';
echo json_encode(['result' => $msg]);
return;
break;
case 'inactivate' :
$sql = "UPDATE obw_shows SET status = 0 WHERE id = ".nz(trim($_GET['id']), '0')." ";
$db->query($sql) or die(json_encode(['result' => 'Database Error!']));
$msg = 'Success';
echo json_encode(['result' => $msg]);
return;
break;
endswitch;