Пример #1
0
    redirect('/index.php');
}
$legislation = new Legislation($id);
if (!empty($_POST)) {
    log_time('Preparing to process feedback.');
    $feedback = new Legislation_Feedback();
    log_time('new Feedback');
    $feedback->response(get_param('response'));
    log_time('response');
    $feedback->comments(get_param('response_comments'));
    log_time('comments');
    $feedback->user_id($user_id);
    log_time('user_id');
    $feedback->legislation_id($id);
    log_time('legislation_id');
    $feedback->record_response();
    log_time('record_response');
    redirect('/legislation_feedback_response.php?id=' . $id);
}
$html = new HTML();
$html->set_title('Legislation');
$html->generate_header_mobile();
?>
<ul data-role='listview' data-inset='false' data-theme='a'  data-divider-theme='a'>
    <li>
        <?php 
echo $legislation->question();
?>
    </li>
    <li>
        <span class="label">Status</span> <?php 
Пример #2
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';
$user = new User($user_id);
$id = get_param('id');
$feedback_id = get_param('fid');
$legislation = new Legislation($id);
$data = array('status' => '-1');
if (!empty($legislation)) {
    $feedback = new Legislation_Feedback($feedback_id);
    $feedback->user_id($user_id);
    $response = get_param('response');
    if (abs(1 * $response) == 1) {
        $feedback->response($response);
        $feedback_id = $feedback->record_response($id);
        $data = array('legislation_id' => $id, 'response_type' => "opinion: {$response}", 'feedback_id' => $feedback_id, 'comment_data' => $legislation->comment_data);
    } else {
        $feedback->comments(get_param('comments'));
        $feedback->update();
        $data = array('legislation_id' => $id, 'response_type' => 'comments', 'comment_data' => $legislation->get_comment_data());
    }
}
return_jsonp_data($data);