<?php include_once 'conf/config.php'; include_once 'lang/grp.lang.inc'; include_once CLASS_PATH . 'grp.class.php'; $actScript = 'grp.php'; globalizePost(); $obj = new grp(); $title = getTitleFromMenuCaption('Group'); /** * Built Search Criteria (if any) */ $gr_title = trim($gr_title); $gr_brief = trim($gr_brief); $whereClause = " WHERE UPPER(IFNULL(gr_title, '')) LIKE UPPER(CONCAT('%', IFNULL(" . $obj->getSqlColValue('gr_title', $gr_title) . ", ''), '%'))\nAND UPPER(IFNULL(gr_brief, '')) LIKE UPPER(CONCAT('%', IFNULL(" . $obj->getSqlColValue('gr_brief', $gr_brief) . ", ''), '%'))\n"; /** * Delete Record */ if (!$_SESSION['REDO']) { if ($gr_id) { $gr_ids = split('__', $gr_id); foreach ($gr_ids as $gr_id) { $_REQUEST['gr_id'] = $gr_id; $obj->DeleteRequest(false); } } } unset($_SESSION['REDO']); ?> <!DOCTYPE html>
<?php include_once 'conf/config.php'; include_once CLASS_PATH . 'grp.class.php'; globalizePost(); $obj = new grp(); $rows = MAX_PAGE_RECORDS; /** * WHERE clause building */ $gr_title = trim($gr_title); $gr_brief = trim($gr_brief); $whereClause = " WHERE UPPER(IFNULL(gr_title, '')) LIKE UPPER(CONCAT('%', IFNULL(" . $obj->getSqlColValue('gr_title', $gr_title) . ", ''), '%'))\n AND UPPER(IFNULL(gr_brief, '')) LIKE UPPER(CONCAT('%', IFNULL(" . $obj->getSqlColValue('gr_brief', $gr_brief) . ", ''), '%'))\n"; /** * Get query data */ $obj->Select(array('gr_title', 'gr_brief', 'gr_id'), '', $whereClause . ' ORDER BY ' . ($_POST['sort'] - 2) . ' ' . $_POST['dir'], $_POST['page'], $rows, false); while (!$obj->EOF()) { $row = $obj->Row(); print ' <td><input type="checkbox" name="chkRecord" id="chkRecord_' . $row->gr_id . '" value="' . $row->gr_id . '"/></td>'; print ' <td>' . $row->gr_title . '</td>'; print ' <td>' . $row->gr_brief . '</td>'; print ' <td> <div class="action-group btn-group pull-right mtm mbm"> <button type="button" class="btn btn-default" onclick="javascript:window.location.assign(\'grp.form.php?recordId=' . $row->gr_id . '&in2Action=editRecord\');"><i class="fa fa-edit"></i></button> <button type="button" class="btn btn-default" onclick="javascript:deleteRecord(\'gr_id\', ' . $row->gr_id . ');"><i class="fa fa-trash-o"></i></button> </div> </td>'; print '</tr>'; }
$password2 = ""; $dbname2 = "pso_db"; /** * Add SESSION variable to prevent main form to REDO the delete action */ $_SESSION['REDO'] = true; /** * Errors Management */ if ($_GET['error'] == 1) { $notification = formatFormErrors($_SESSION['errorMsgs']); } $actScript = 'grp.form.php'; globalizeGet(); globalizePost(); $obj = new grp(); $title = getTitleFromMenuCaption('Grp'); // Update number values // Remove the thousands seperator $_REQUEST['gr_id'] = str_replace(".", "", $_REQUEST['gr_id']); $_REQUEST['gr_id'] = str_replace(",", ".", $_REQUEST['gr_id']); // Set value of checkbox = 0 if not passed in the request switch ($in2Action) { case 'add': $_REQUEST['gr_cruser'] = $_SESSION['us_id']; $_REQUEST['gr_crdate'] = date('Y-m-d H:i:s'); $lastId = $obj->InsertRequest(false); /*foreach ($_FILES as $uploadedFile) { $Extention = explode('.', $uploadedFile['name']); $uploadedFile['filename'] = 'sl_img_' . $lastId . '.' . $Extention[1]; $fileObj = new file2($uploadedFile);