Example #1
0
include_once 'lang/pso_staticpage.lang.inc';
include_once CLASS_PATH . 'pso_staticpage.class.php';
/**
 * 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 = 'pso_staticpage.form.php';
globalizeGet();
globalizePost();
$obj = new pso_staticpage();
$title = getTitleFromMenuCaption('Static Page');
//  Update number values
//  Remove the thousands seperator
$_REQUEST['sp_id'] = str_replace(".", "", $_REQUEST['sp_id']);
$_REQUEST['sp_id'] = str_replace(",", ".", $_REQUEST['sp_id']);
$_REQUEST['sp_published'] = str_replace(".", "", $_REQUEST['sp_published']);
$_REQUEST['sp_published'] = str_replace(",", ".", $_REQUEST['sp_published']);
//  Set value of checkbox = 0 if not passed in the request
$_REQUEST['sp_published'] = isset($_REQUEST['sp_published']) && $_REQUEST['sp_published'] == "on" ? 1 : 0;
switch ($in2Action) {
    case 'add':
        $_REQUEST['sp_cruser'] = $_SESSION['us_id'];
        $_REQUEST['sp_crdate'] = $_SESSION['us_id'];
        $lastId = $obj->InsertRequest(false);
        foreach ($_FILES as $uploadedFile) {
Example #2
0
<?php

include_once 'conf/config.php';
include_once 'lang/pso_staticpage.lang.inc';
include_once CLASS_PATH . 'pso_staticpage.class.php';
globalizePost();
$obj = new pso_staticpage();
$rows = MAX_PAGE_RECORDS;
/**
 * Get query data
 */
$obj->Select(array('sp_type', 'sp_title', 'sp_img', 'IF(sp_published = 1, "' . $yesNo[$_SESSION['lang']][1] . '", "' . $yesNo[$_SESSION['lang']][0] . '") sp_published', 'sp_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->sp_id . '" value="' . $row->sp_id . '"/>
				</td>';
    print '    <td><img src="' . PROJECT_UPLOAD_BO_URL . $row->sp_img . '" class="img-responsive img-circle"/></td>';
    print '    <td>' . $arrLang[$_SESSION['lang']]['sp_type_' . $row->sp_type] . '</td>';
    print '    <td>' . $row->sp_title . '</td>';
    print '    <td>' . $row->sp_published . '</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(\'pso_staticpage.form.php?recordId=' . $row->sp_id . '&in2Action=editRecord\');"><i class="fa fa-edit"></i>&nbsp;Edit</button>
					<button type="button" class="btn btn-default" onclick="javascript:deleteRecord(\'sp_id\', ' . $row->sp_id . ');"><i class="fa fa-trash-o"></i>&nbsp;Delete</button>
				</div>
			  </td>';
    print '</tr>';
}
Example #3
0
<?php

include_once 'conf/config.php';
include_once 'lang/pso_staticpage.lang.inc';
include_once CLASS_PATH . 'pso_staticpage.class.php';
$actScript = 'pso_staticpage.php';
globalizePost();
$obj = new pso_staticpage();
$title = getTitleFromMenuCaption('Static Page');
/**
 * Delete Record
 */
if (!$_SESSION['REDO']) {
    if ($sp_id) {
        $sp_ids = split('__', $sp_id);
        foreach ($sp_ids as $sp_id) {
            $_REQUEST['sp_id'] = $sp_id;
            $obj->DeleteRequest(false);
        }
    }
}
unset($_SESSION['REDO']);
?>
<!DOCTYPE html>
				<html lang="en">
				<head><title>PSO | Dashboard</title>
				    <meta charset="utf-8">
				    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
				    <meta name="viewport" content="width=device-width, initial-scale=1.0">
				    <link rel="shortcut icon" href="images/icons/favicon.ico">
				    <link rel="apple-touch-icon" href="images/icons/favicon.png">