示例#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.legislation_feedback.php';
$id = get_param('id');
$legislation = new Legislation($id);
$data = array('id' => $id, 'type' => LEGISLATION_TYPE, 'bill_id' => $legislation->bill, 'bill_latest_id' => $legislation->bill_latest_id(), 'title' => $legislation->title(), 'image' => $legislation->image, 'location' => $legislation->bill_location, 'category' => array('id' => $legislation->category['id'], 'name' => $legislation->category['name']), 'question' => $legislation->question(), 'support' => $legislation->get_support(), 'oppose' => $legislation->get_oppose(), 'current_location' => $legislation->current_location(), 'location_description' => $legislation->location_description, 'current_chamber' => $legislation->current_chamber(), 'raw_category' => $legislation->raw_category(), 'status' => $legislation->status(), 'sponsors' => $legislation->sponsors, 'summary' => iconv('ISO-8859-1', 'UTF8//TRANSLIT', $legislation->summary()), 'text' => iconv('ISO-8859-1', 'UTF8//TRANSLIT', $legislation->summary()), 'comment_data' => $legislation->comment_data, 'user_feedback' => $legislation->feedback_submitted($user_id));
return_jsonp_data($data);
示例#2
0
文件: issue.php 项目: rtoews/meocracy
<?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';
require_once DOC_ROOT . '/includes/classes/class.legislation.php';
$type = get_param('t');
$id = get_param('id');
if ($type == ANNOUNCEMENT_TYPE) {
    $issue = new Announcement($id);
} elseif ($type == LEGISLATION_TYPE) {
    $issue = new Legislation($id);
}
$data = array('title' => $issue->title(), 'summary' => $issue->summary(), 'question' => $issue->question(), 'current_chamber' => $issue->current_chamber(), 'location' => $issue->location(), 'description' => $issue->description(), 'image' => $issue->get_image_src(), 'status' => $issue->status(), 'calendared' => $issue->calendared(), 'vote' => $issue->vote(), 'days_remaining' => $issue->days_remaining());
return_jsonp_data($data);
示例#3
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.legislation.php';
$region_id = 65517;
$region_type = REGION_CITY;
$id = get_param('id');
$legislation = new Legislation($id);
if (!empty($_POST)) {
    $legislation->region_id($region_id);
    $legislation->region_type($region_type);
    $legislation->title(get_param('title'));
    $legislation->status(get_param('status'));
    $legislation->recommended_action(get_param('recommended_action'));
    $legislation->summary(get_param('summary'));
    $legislation->discussion(get_param('discussion'));
    $legislation->question(get_param('question'));
    $date_introduced = set_date_parts(get_param('intro_month'), get_param('intro_day'), get_param('intro_year'));
    $date_heard = set_date_parts(get_param('heard_month'), get_param('heard_day'), get_param('heard_year'));
    $legislation->date_introduced($date_introduced);
    $legislation->date_heard($date_heard);
    if ($id) {
        $legislation->update();
    } else {
        $id = $legislation->insert();
    }
    // sponsor IDs next
    $sponsor_ids = get_param('sponsor_ids');
    if (!empty($sponsor_ids)) {
        $legislation->associate_sponsors($sponsor_ids);