示例#1
0
 * 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();
    }
} else {
    Route::get404Error();
}
示例#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>