Example #1
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$fb = new feedbacks();
if (isset($_POST['cid'])) {
    $n = count($_POST['cid']);
    for ($i = 0; $i < $n; $i++) {
        foreach ($_POST['cid'] as $key => $value) {
            $fb->delete_feedback($value);
            $_SESSION['task'] = 'delete';
        }
    }
}
switch ($_SESSION['commenttype']) {
    case 'feedback':
        header('location: feedback_manager.php');
        break;
    case 'sources':
        header('location: other_sources.php');
        break;
}
Example #2
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$feedbackID = $_GET['feedbackID'];
$feedback_detail = array();
$fb = new feedbacks();
$fb->set_read_feedback($feedbackID);
$feedback_detail = $fb->read_feedback($feedbackID);
$_SESSION['quoteID'] = $quoteID;
$_SESSION['quote_message'] = $quote_message;
$_SESSION['quote_author'] = $quote_author;
switch ($_SESSION['commenttype']) {
    case 'feedback':
        $heading = "Feedback/Comments";
        $feedback = "Feedback";
        break;
    case 'sources':
        $heading = "External Sources";
        $feedback = "Message";
        break;
}
Example #3
0
<?php

include 'admin/coreclass.php';
session_start();
$db = new database();
if (isset($_POST['submit'])) {
    $fb = new feedbacks();
    $feedbackDate = time();
    #the date when the feedback was posted.
    $username = $_POST['username'];
    #the name of the person who posted a feedback.
    $emailAddress = $_POST['emailAddress'];
    #the email address of the person who posted the feedback.
    $feedback = $_POST['feedback'];
    #the feedback of the person.
    $category = 1;
    $fb->send_feedbacks($username, $emailAddress, $feedback, $category);
}
/**
 * obtain list of the category 
 */
$sql = "select * from category";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$categories = array();
while ($categories[] = $db->fetcharray()) {
}
$totalcategories = count($categories);
$categorylist = '';
for ($i = 0; $i < $totalcategories - 1; $i++) {
Example #4
0
if (isset($_SESSION['task']) && $_SESSION['task'] != '') {
    switch ($_SESSION['task']) {
        case 'edit':
            $message = 'Successfully saved the changes of profile: ' . $_SESSION['title'];
            break;
        case 'add':
            $message = 'Successfully saved the profile: ' . $_SESSION['title'];
            break;
        case 'delete':
            $message = 'Successfully delete the feedbacks';
            break;
    }
    unset($_SESSION['task']);
}
$_SESSION['commenttype'] = 'feedback';
$fb = new feedbacks();
$feedback = $fb->view_all_feedbacks(1);
$totalrows = count($feedback);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 1;
$scrollnumber = 5;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = 1;
}
$start = $page * $limit - $limit;
$pagelink = new paging($page, $totalrows, $limit, $paging, $scroll, $scrollnumber);
$j = $start + 1;
for ($i = $start; $i < $start + $limit; $i++) {
Example #5
0
//retrieve the users workflow he had been assign ...
$db = new database();
$sql = "select * from user_stage us,\r\n\t\tstages s\r\n\t\twhere us.userID = {$userID}\r\n\t\tand\ts.stageID = us.stageID ";
// print $sql;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$user_stage = array();
while ($row = $db->fetcharray()) {
    $user_stage[] = $row;
}
$db->freeresult();
$msg = new messages();
$messages = $msg->view_unread_messages($userID);
$total_unread_messages = count($messages) - 1;
$fb = new feedbacks();
$feedbacks = $fb->view_unread_feedbacks(1);
$total_unread_feedbacks = count($feedbacks) - 1;
$feedbacks = $fb->view_unread_feedbacks(2);
$total_unread_sources = count($feedbacks) - 1;
// get all articles belong in da specific category and edit by this editor assigned on dat category
if ($editor_on_category) {
    $sql = "select * from article_versions av, article_category ac where \r\n\t\t\t((av.stageID = 2 and av.status != 'revise') or (av.stageID = 3 and av.status = 'revise' )) \r\n\t\t\tand (( av.isarchive = '0' and ( ac.articleID = av.articleID ) and ( ac.categoryID = '{$assigned_category}' ))) order by av.created DESC \r\n\t";
} else {
    // wil display all articles regardless of category so that this user can edit them..
    $sql = "select * from article_versions av where \r\n\t\t\t(av.stageID = 2 and av.status != 'revise') or (av.stageID = 3 and av.status = 'revise' ) \r\n\t\t\tand av.isarchive = '0' order by av.created DESC \r\n\t";
}
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$writing = array();
Example #6
0
<?php

include 'admin/coreclass.php';
session_start();
$db = new database();
if (isset($_POST['submit'])) {
    $fb = new feedbacks();
    $feedbackDate = time();
    #the date when the feedback was posted.
    $username = $_POST['username'];
    #the name of the person who posted a feedback.
    $emailAddress = $_POST['emailAddress'];
    #the email address of the person who posted the feedback.
    $feedback = $_POST['feedback'];
    #the feedback of the f*****g person.
    $externalreport = $_POST['externalreport'];
    $category = 2;
    $fb->send_feedbacks($username, $emailAddress, $externalreport, $category);
}
/**
 * obtain list of the category 
 */
$sql = "select * from category";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$categories = array();
while ($categories[] = $db->fetcharray()) {
}
$totalcategories = count($categories);
$categorylist = '';