Exemplo n.º 1
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php';
require_once DOC_ROOT . '/includes/classes/class.user.php';
require_once DOC_ROOT . '/includes/classes/class.city.php';
require_once DOC_ROOT . '/includes/classes/class.announcement_feedback.php';
$id = get_param('id');
$announcement = new Announcement($id);
$data = array('id' => $id, 'type' => ANNOUNCEMENT_TYPE, 'title' => $announcement->title(), 'description' => $announcement->text(), 'text' => $announcement->text(), 'category' => array('id' => $announcement->category['id'], 'name' => $announcement->category['name']), 'question' => $announcement->question(), 'location' => $announcement->location(), 'image' => $announcement->get_image_src(), 'status' => $announcement->status->status(), 'calendared' => $announcement->calendared(), 'vote' => $announcement->vote(), 'support' => $announcement->get_support(), 'oppose' => $announcement->get_oppose(), 'days_remaining' => $announcement->days_remaining(), 'sponsors' => $announcement->sponsors, 'comment_data' => $announcement->comment_data, 'user_feedback' => $announcement->feedback_submitted($user_id));
return_jsonp_data($data);
Exemplo n.º 2
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php';
require_once DOC_ROOT . '/includes/classes/class.html.php';
require_once DOC_ROOT . '/includes/classes/class.announcement.php';
require_once DOC_ROOT . '/includes/classes/class.office.php';
$region_id = 65517;
$region_type = REGION_CITY;
$id = get_param('id');
$announcement = new Announcement($id);
if (!empty($_POST)) {
    $announcement->region_id($region_id);
    $announcement->region_type($region_type);
    $announcement->title(get_param('title'));
    $announcement->description(get_param('description'));
    $announcement->text(get_param('text'));
    $announcement->question(get_param('question'));
    $announcement->location(get_param('location'));
    $date_beginning = set_date_parts(get_param('begin_month'), get_param('begin_day'), get_param('begin_year'));
    $date_ending = set_date_parts(get_param('end_month'), get_param('end_day'), get_param('end_year'));
    $calendared = set_date_parts(get_param('calendared_month'), get_param('calendared_day'), get_param('calendared_year'));
    $vote = set_date_parts(get_param('vote_month'), get_param('vote_day'), get_param('vote_year'));
    $announcement->date_beginning($date_beginning);
    $announcement->date_ending($date_ending);
    $announcement->calendared($calendared);
    $announcement->vote($vote);
    if ($id) {
        $announcement->update();
    } else {
        $id = $announcement->insert();
    }
Exemplo n.º 3
0
/*
$admin_id = get_param('admin_id');
if (!$admin_id) {
    redirect('/admin/login.php');
}
*/
$html = new HTML('admin');
$html->set_title('Dashboard');
$html->generate_header();
if (!empty($announcement_ids)) {
    $feedback_average = Announcement::get_average_announcement_feedback();
    foreach ($announcement_ids as $id) {
        $announcement = new Announcement($id);
        $announcement_id = $id;
        $src = $announcement->get_image_src();
        $shorttitle = my_truncate($announcement->title(), 10, "...");
        $shortdescription = my_truncate($announcement->description(), 20, "...");
        $chart_question = $announcement->question();
        $feedback_support = $announcement->get_support();
        $feedback_oppose = $announcement->get_oppose();
        $feedback_total = $feedback_support + $feedback_oppose;
        ?>
<div class="row_clickable row_thumb" onclick="document.location.href='announcement_edit?id=<?php 
        echo $id;
        ?>
'">
    <img src="<?php 
        echo $src;
        ?>
" class="thumbnail">
    <div class='row_icon'></div>
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php';
require_once DOC_ROOT . '/includes/classes/class.user.php';
require_once DOC_ROOT . '/includes/classes/class.announcement.php';
$type = get_param('type');
$id = get_param('id');
$announcement = new Announcement($id);
$data = array('title' => $announcement->title(), 'calendared' => $announcement->calendared(), 'vote' => $announcement->vote(), 'image' => $announcement->get_image_src(), 'question' => $announcement->question(), 'support' => $announcement->get_support(), 'oppose' => $announcement->get_oppose(), 'sponsors' => $announcement->sponsor);
return_jsonp_data($data);