Example #1
0
<?php

include_once "administration/conf/config.server.php";
include_once CLASS_PATH . 'pso_portfolio_cat.class.php';
include_once CLASS_PATH . 'pso_portfolio.class.php';
/* Portfolio Cat*/
$objPorCat = new pso_portfolio_cat();
$whereClausePorCat = 'WHERE pocat_published=1 ORDER BY pocat_order ASC';
$objPorCat->Select(array('pocat_title', 'pocat_id', 'pocat_order', 'pocat_published'), '', $whereClausePorCat, '', false);
$printPorCat = '';
$printPortfolio = '';
while (!$objPorCat->EOF()) {
    $rowPorCat = $objPorCat->Row();
    $printPorCat .= '<button class="btn btn-portfolio-filter btn-white btn-active-primary" data-filter=".cat-' . $rowPorCat->pocat_id . '">' . $rowPorCat->pocat_title . '</button>';
    /* // Portfolio Cat */
    /* Portfolio*/
    $objPortfolio = new pso_portfolio();
    $whereClausePortfolio = 'WHERE po_published=1 AND po_pocat_id=' . $rowPorCat->pocat_id;
    $objPortfolio->Select(array('po_pocat_id', 'po_id', 'po_title', 'po_link', 'po_desc', 'po_img', 'po_published'), '', $whereClausePortfolio, '', false);
    while (!$objPortfolio->EOF()) {
        $rowPortfolio = $objPortfolio->Row();
        $PortfolioDesc = strip_tags($rowPortfolio->po_desc);
        if (strlen($rowPortfolio->po_desc) > 100) {
            $PortfolioDesc = substr($PortfolioDesc, 0, 100);
            $PortfolioDesc = explode(' ', $PortfolioDesc);
            array_pop($PortfolioDesc);
            $PortfolioDesc = implode(' ', $PortfolioDesc);
            $PortfolioDesc .= "...";
        }
        $printPortfolio .= '<div class="portfolio-grid-item extended cat-' . $rowPorCat->pocat_id . '">
						<div class="portfolio-info">
<?php

include_once 'conf/config.php';
include_once 'lang/pso_portfolio_cat.lang.inc';
include_once CLASS_PATH . 'pso_portfolio_cat.class.php';
globalizePost();
$obj = new pso_portfolio_cat();
$rows = MAX_PAGE_RECORDS;
/**
 * Get query data
 */
$obj->Select(array('pocat_title', 'pocat_order', 'IF(pocat_published = 1, "' . $yesNo[$_SESSION['lang']][1] . '", "' . $yesNo[$_SESSION['lang']][0] . '") pocat_published', 'pocat_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->pocat_id . '" value="' . $row->pocat_id . '"/>
				</td>';
    print '    <td>' . $row->pocat_title . '</td>';
    print '    <td>' . $row->pocat_order . '</td>';
    print '    <td>' . $row->pocat_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_portfolio_cat.form.php?recordId=' . $row->pocat_id . '&in2Action=editRecord\');"><i class="fa fa-edit"></i>&nbsp;Edit</button>
<button type="button" class="btn btn-default" onclick="javascript:deleteRecord(\'pocat_id\', ' . $row->pocat_id . ');"><i class="fa fa-trash-o"></i>&nbsp;Delete</button>
</div>
</td>';
    print '</tr>';
}
include_once 'lang/pso_portfolio_cat.lang.inc';
include_once CLASS_PATH . 'pso_portfolio_cat.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_portfolio_cat.form.php';
globalizeGet();
globalizePost();
$obj = new pso_portfolio_cat();
$title = getTitleFromMenuCaption('Portfolio Category');
//  Update number values
//  Remove the thousands seperator
$_REQUEST['pocat_id'] = str_replace(".", "", $_REQUEST['pocat_id']);
$_REQUEST['pocat_id'] = str_replace(",", ".", $_REQUEST['pocat_id']);
$_REQUEST['pocat_order'] = str_replace(".", "", $_REQUEST['pocat_order']);
$_REQUEST['pocat_order'] = str_replace(",", ".", $_REQUEST['pocat_order']);
$_REQUEST['pocat_published'] = str_replace(".", "", $_REQUEST['pocat_published']);
$_REQUEST['pocat_published'] = str_replace(",", ".", $_REQUEST['pocat_published']);
//  Set value of checkbox = 0 if not passed in the request
$_REQUEST['pocat_published'] = isset($_REQUEST['pocat_published']) && $_REQUEST['pocat_published'] == "on" ? 1 : 0;
switch ($in2Action) {
    case 'add':
        $_REQUEST['pocat_cruser'] = $_SESSION['us_id'];
        $_REQUEST['pocat_crdate'] = date('Y-m-d H:i:s');
Example #4
0
<?php

include_once 'conf/config.php';
include_once 'lang/pso_portfolio_cat.lang.inc';
include_once CLASS_PATH . 'pso_portfolio_cat.class.php';
$actScript = 'pso_portfolio_cat.php';
globalizePost();
$obj = new pso_portfolio_cat();
$title = getTitleFromMenuCaption('Portfolio Category');
/**
 * Delete Record
 */
if (!$_SESSION['REDO']) {
    if ($pocat_id) {
        $pocat_ids = split('__', $pocat_id);
        foreach ($pocat_ids as $pocat_id) {
            $_REQUEST['pocat_id'] = $pocat_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">