Inheritance: extends BaseController
Beispiel #1
0
<?php

/**
 * Created by Yogesh on 12/2/2015.
 *
 */
session_start();
require_once "../config/Route.php";
require_once "../model/UsersController.php";
require_once "../model/FeedbackController.php";
if (array_key_exists('userId', $_SESSION)) {
    $feedbackController = new FeedbackController();
    $userController = new UsersController();
    $userId = $_SESSION['userId'];
    $user = $userController->find($userId);
    if ($user) {
        if (array_key_exists('post', $_GET)) {
            $id = test_input($_GET['post']);
            $poi = $feedbackController->find($id);
            if ($poi) {
                $feedbackController->delete($id);
                Route::getBackend("feedbacks/");
            } else {
                Route::get404Error();
            }
        } else {
            Route::get404Error();
        }
    } else {
        Route::get404Error();
    }
Beispiel #2
0
<?php

include "../header.php";
require_once "../model/FeedbackController.php";
require_once "../model/objects/Feedback.php";
if (array_key_exists('post', $_REQUEST)) {
    $postId = $_REQUEST['post'];
    if (is_numeric($postId)) {
        $feedbackController = new FeedbackController();
        $feedback = $feedbackController->find($postId);
        ?>

    <div class="content-wrapper">

        <section class="content-header">
            <h1>
                Read Feedback
            </h1>
        </section>

        <?php 
        if ($feedback) {
            $feedback->setStatus("R");
            $feedbackController->update($feedback);
            ?>
        <section class="content">
            <div class="row">
                <div class="col-md-9">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">Read Feedback</h3>
Beispiel #3
0
<?php

include "header.php";
require_once "model/ContributionController.php";
require_once "model/objects/Contribution.php";
require_once "model/FeedbackController.php";
require_once "model/objects/Feedback.php";
$contributionController = new ContributionController();
$feedbackController = new FeedbackController();
?>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Dashboard
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      <!-- Info boxes -->
      <div class="row">
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <a href="<?php 
echo Route::getAdminDirectory();
?>
locations/add.php">
              <span class="info-box-icon bg-aqua">
              <i class="ion ion-android-add-circle"></i></span>
Beispiel #4
0
<?php

include "../header.php";
require_once "../model/FeedbackController.php";
require_once "../model/objects/Feedback.php";
$feedbackController = new FeedbackController();
$searchKey = "";
if (array_key_exists("search", $_REQUEST)) {
    $searchKey = decodeInput($_REQUEST['search']);
}
?>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Feedbacks
      </h1>
    </section>
      <?php 
if ($searchKey != "") {
    $dataList = $feedbackController->search($searchKey, $offset, $rowsPerPage);
} else {
    $dataList = $feedbackController->getAll($offset, $rowsPerPage);
}
if ($dataList) {
    ?>
      <!-- Main content -->
      <section class="content">
          <div class="row">
              <div class="col-xs-12">
 * Error will re returned by the file
 */
require_once "../model/FeedbackController.php";
require_once "../model/objects/Feedback.php";
if ($_SERVER['REQUEST_METHOD'] == "post" || $_SERVER['REQUEST_METHOD'] == "POST") {
    if (array_key_exists("name", $_POST) && array_key_exists("email", $_POST) && array_key_exists("title", $_POST) && array_key_exists("message", $_POST) && array_key_exists("rate", $_POST) && array_key_exists("du", $_POST) && array_key_exists("dn", $_POST) && array_key_exists("dv", $_POST)) {
        //only if all data is available
        $name = decodeInput($_REQUEST['name']);
        $email = decodeInput($_REQUEST['email']);
        $subject = decodeInput($_REQUEST['title']);
        $message = decodeInput($_REQUEST['message']);
        $rating = decodeInput($_REQUEST['rate']);
        $deviceUser = decodeInput($_REQUEST['du']);
        $deviceName = decodeInput($_REQUEST['dn']);
        $deviceVersion = decodeInput($_REQUEST['dv']);
        $feedbackController = new FeedbackController();
        $feedback = new Feedback();
        $feedback->init($name, $email, $subject, $message, $rating, $deviceUser, $deviceName, $deviceVersion);
        if ($feedbackController->add($feedback)) {
            sendThankyouMail($name, $email, $subject);
            echo "success";
            exit;
        } else {
            echo "error";
            exit;
        }
    } else {
        echo "error";
        exit;
    }
} else {
Beispiel #6
0
 }
 if (preg_match('/^faq\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'QaController.php';
     $controller = new QaController();
     echo $controller->actions();
     die;
 }
 if (preg_match('/^about\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'StaticController.php';
     $controller = new StaticController('about');
     echo $controller->actions();
     die;
 }
 if (preg_match('/^feedback\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'FeedbackController.php';
     $controller = new FeedbackController();
     echo $controller->actions();
     die;
 }
 if (preg_match('/^(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'IndexController.php';
     $controller = new IndexController();
     echo $controller->actions();
     die;
 }
 if (preg_match('/^news\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'NewsController.php';
     $controller = new NewsController();
     echo $controller->actions();
     die;
 }