Пример #1
0
<?php 
if (!empty($announcement->sponsor)) {
    foreach ($announcement->sponsor as $sponsor) {
        echo $sponsor->sponsor_name() . '<br/>';
    }
}
?>
<br/>
        <span class="label">Vote</span> <?php 
echo $announcement->vote();
?>
<br/>
        <div class="clear"></div>
        <br/><br/>
        <p>I have <?php 
echo $announcement->days_remaining();
?>
 left to:</p>
        <div id="btn_support" data-val="1" class="button">Support</div>
        <div id="btn_oppose" data-val="-1" class="button">Oppose</div>
        <div class="clear"></div>
        <form id="response_form" method="post">
        <input type="hidden" name="id" id="id" value="<?php 
echo $id;
?>
"/>
        <input type="hidden" name="response" id="response" value=""/>
        <ul>
            <li><img src="<?php 
echo $announcement->sponsor[0]->get_image_src();
?>
Пример #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.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);