| Server IP : 104.21.21.239 / Your IP : 216.73.216.11 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/connectionsdev/mod/ |
Upload File : |
<?php include('_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' => 'First Name', 'dbcol' => 'c.first_name', 'width' => '90px']);
$dbg->add_column(['label' => 'Last Name', 'dbcol' => 'c.last_name', 'width' => '90px']);
$dbg->add_column(['label' => 'Type', 'dbcol' => 'c.contact_type', 'width' => '100px']);
$dbg->add_column(['label' => 'Venue', 'dbcol' => 'v.name', 'width' => '200px']);
$dbg->add_column(['label' => 'Email', 'dbcol' => 'c.email', 'width' => '160px']);
$dbg->add_column(['label' => 'Office Phone', 'dbcol' => 'c.office_phone', 'width' => '100px']);
$dbg->add_column(['label' => 'Cell Phone', 'dbcol' => 'c.cell_phone', 'width' => '100px']);
$dbg->add_column(['label' => 'SMS', 'dbcol' => 'c.accepts_texts', 'width' => '40px', 'align' => 'center']);
$dbg->add_column(['label' => 'Status', 'dbcol' => 'c.status', 'width' => '60px', 'align' => 'center', 'filter' => true]);
$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 c.*, v.name AS venue_name FROM contacts c ".
"LEFT JOIN venues v ON (v.id = c.venue_id) ".
"WHERE ".$dbg->search_spec()." ".$_GET['parm1']." ".$_GET['parm2']." ".$_GET['parm3']." ".
"ORDER BY ".$dbg->sort_spec();
//echo ' === '.$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->first_name.'</a>');
$dbg->add_cell('<a href="index.php?IX='.$_GET['ix_form'].'&id='.$row->id.'" >'.$row->last_name.'</a>');
$dbg->add_cell(APP_CONTACT_TYPES[$row->contact_type]);
$dbg->add_cell('<a href="index.php?IX=venue_form&id='.$row->venue_id.'" >'.$row->venue_name.'</a>');
$dbg->add_cell($row->email);
$dbg->add_cell($row->office_phone);
$dbg->add_cell($row->cell_phone);
$dbg->add_cell(bool_to_yesno($row->accepts_texts));
$dbg->add_cell(APP_CONTACT_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 contacts 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 contacts 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;
?>