Exemplo n.º 1
0
Arquivo: delete.php Projeto: rjha/sc
<?php

//sc/monitor/feedback/delete.php
include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
include APP_WEB_DIR . '/inc/role/admin.inc';
use com\indigloo\Util;
use com\indigloo\Url;
use com\indigloo\Configuration as Config;
try {
    $gWeb = \com\indigloo\core\Web::getInstance();
    $qparams = Url::getRequestQueryParams();
    //base64 decode to use in redirect
    $qUrl = base64_decode($qparams["q"]);
    $id = $qparams["id"];
    $feedbackDao = new \com\indigloo\sc\dao\Feedback();
    $feedbackDao->delete($id);
    header("Location: " . $qUrl);
    exit;
} catch (\Exception $ex) {
    $gWeb->store("global.overlay.message", $ex->getMessage());
    header("Location: " . $qUrl);
    exit(1);
}
Exemplo n.º 2
0
Arquivo: view.php Projeto: rjha/sc
<?php

//sc/monitor/feedback.php
include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
include APP_WEB_DIR . '/inc/role/admin.inc';
use com\indigloo\Util;
use com\indigloo\Url;
use com\indigloo\Configuration as Config;
$qparams = Url::getRequestQueryParams();
$feedbackDao = new \com\indigloo\sc\dao\Feedback();
$pageSize = 20;
$paginator = new \com\indigloo\ui\Pagination($qparams, $pageSize);
$feedbackDBRows = $feedbackDao->getPaged($paginator);
$baseURI = "/monitor/feedback/view.php";
?>


<!DOCTYPE html>
<html>

    <head>
        <title> 3mik.com - feedback by users  </title>
        <?php 
include APP_WEB_DIR . '/inc/meta.inc';
?>

        <?php 
echo \com\indigloo\sc\util\Asset::version("/css/bundle.css");
?>
        
Exemplo n.º 3
0
Arquivo: contact.php Projeto: rjha/sc
use com\indigloo\ui\form as Form;
use com\indigloo\Constants;
use com\indigloo\Util;
use com\indigloo\exception\UIException;
if (isset($_POST['save']) && $_POST['save'] == 'Save') {
    $gWeb = \com\indigloo\core\Web::getInstance();
    $fvalues = array();
    $fUrl = \com\indigloo\Url::tryFormUrl("fUrl");
    try {
        $fhandler = new Form\Handler('web-form-1', $_POST);
        $fhandler->addRule('comment', 'Comment', array('required' => 1, 'maxlength' => 512));
        $fhandler->addRule('name', 'Name', array('required' => 1, 'maxlength' => 64));
        $fhandler->addRule('email', 'Email', array('required' => 1, 'maxlength' => 64));
        //check security token
        $fhandler->checkToken("token", $gWeb->find("form.token", true));
        $fvalues = $fhandler->getValues();
        if ($fhandler->hasErrors()) {
            throw new UIException($fhandler->getErrors());
        }
        $feedbackDao = new com\indigloo\sc\dao\Feedback();
        $feedbackDao->add($fvalues['name'], $fvalues['email'], $fvalues['phone'], $fvalues['comment']);
        //success - always go back to feedback form
        $gWeb->store(Constants::FORM_MESSAGES, array('Thanks for your input.'));
        header("Location: " . $fUrl);
    } catch (UIException $ex) {
        $gWeb->store(Constants::STICKY_MAP, $fvalues);
        $gWeb->store(Constants::FORM_ERRORS, $ex->getMessages());
        header("Location: " . $fUrl);
        exit(1);
    }
}