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.legislation.php'; $region_id = 65517; $region_type = REGION_CITY; $announcement_ids = Announcement::get_ids_by_region($region_id, $region_type); $legislation_ids = Legislation::get_ids_by_region($region_id, $region_type); /* $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
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php'; require_once DOC_ROOT . '/includes/classes/class.html.php'; require_once DOC_ROOT . '/includes/classes/class.admin.php'; $admin = new Admin(); if (!empty($_POST)) { $email = get_param('email'); $password = get_param('password'); if ($admin->login($email, $password)) { redirect('/admin/index.php'); } else { $error['login'] = true; } } $html = new HTML('admin'); $html->set_title('Meocracy Admin Login'); ?> <form method="post"> <label for="email">Admin Email</label><input type="text" id="email" name="email" value="<?php echo isset($email) ? $email : ''; ?> "/><br/> <label for="password">Password</label><input type="password" id="password" name="password"/><br/> <p id="submit-block"> <input type="submit" value="Login"/><br/> </p> </form> <script type="text/javascript"> $(document).ready(function() { $('#email').focus(); });
$sponsor->name_last(get_param('name_last')); $sponsor->name_middle(get_param('name_middle')); $sponsor->office(get_param('office')); $sponsor->phone(get_param('phone')); $sponsor->email(get_param('email')); $sponsor->bio(get_param('bio')); $sponsor->image(get_param('image')); if ($id) { $sponsor->update(); } else { $id = $sponsor->insert(); } redirect('sponsor'); } $html = new HTML('admin'); $html->set_title("Edit this person's directory information"); $html->generate_header(); ?> <style type="text/css"> .sponsor_type { display:none; } </style> <form method="post"> <div class="row"> <div class="input_border">Is this Sponsor an Individual or an Office?</div> <div class="input_border"> <?php $checked = $sponsor->sponsor_type() == 'I' ? 'checked' : '';
$tags = $issue->tags(); if (!empty($_POST)) { $alerts = get_param('alerts'); $new_alerts = get_param('new_alerts'); if (!empty($new_alerts)) { foreach ($new_alerts as $alert_tag) { $alert = new User_Alert(); $alert->user_id($user_id); $alert->tag_id($alert_tag); $alert->add(); } } redirect('/alert_manager.php?type=' . $type); } $html = new HTML(); $html->set_title('Related Issues'); $html->generate_header_mobile(); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li>Set A New Alert</li> <li>Stay on top of<br/><br/> <form method="post"> <input type="hidden" name="type" value="<?php echo $type; ?> "/> <?php if (!empty($tags)) { $alert = new User_Alert(); foreach ($tags as $tag_id => $tag) { if ($user_alert_id = User_Alert::is_set($user_id, $tag)) {
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php'; require_once DOC_ROOT . '/includes/classes/class.html.php'; $html = new HTML('admin'); $html->set_title(""); $html->generate_header(); include 'includes/functions.php'; $query = "select * from `old_user` order by `name_last`"; $data = db()->Get_Table($query); foreach ($data as $row) { $id = $row['id']; $mobile = "(" . $row['mobile_area'] . ") " . $row['mobile_prefix'] . "-" . $row['mobile_suffix']; $name_last = ucfirst($row['name_last']); $name_first = ucfirst($row['name_first']); ?> <div class='row_clickable' onclick="document.location.href='user_result?id=<?php echo $id; ?> '"> <?php echo "{$mobile} {$name_last}, {$name_first}"; ?> </div> <?php } $html->generate_footer(); ?>
$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 echo $legislation->status->status(); ?> <br/> <span class="label">Calendared</span> <?php echo $legislation->calendared();
$feedback = new Announcement_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->announcement_id($id); log_time('announcement_id'); $feedback->record_response(); log_time('record_response'); redirect('/announcement_feedback_response.php?id=' . $id); } $html = new HTML(); $html->set_title('Announcement'); $html->use_style('announcement.css'); $html->generate_header_mobile(); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li> <img src="<?php echo $announcement->get_image_src(); ?> "/> <?php echo $announcement->description(); ?> </li> <li> <span class="label">Status</span> <?php
require_once DOC_ROOT . '/includes/classes/class.tag.php'; require_once DOC_ROOT . '/includes/classes/class.announcement.php'; require_once DOC_ROOT . '/includes/classes/class.legislation.php'; $user_id = get_param('user_id'); if (!$user_id) { redirect('/login.php'); } $user = new User($user_id); if (!empty($_POST)) { $alerts = get_param('alerts'); User_Alert::keep_selected_alerts($user_id, $alerts); redirect('/alert_manager.php'); } $alerts = User_Alert::get_all($user_id); $html = new HTML(); $html->set_title('Alert Manager'); $html->generate_header_mobile(); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li>Current Alerts</li> <li> <form method="post"> <?php if (!empty($alerts)) { foreach ($alerts as $alert) { ?> <input type="checkbox" id="alerts" name="alerts[]" value="<?php echo $alert->tag_id(); ?> " checked/><?php echo $alert->tag->tag();
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php'; require_once DOC_ROOT . '/includes/classes/class.html.php'; $html = new HTML('admin'); $html->set_title('Manage the information you show to the public'); $html->generate_header(); ?> <div class='row_clickable' onclick="document.location.href='office'"> <div class='row_icon'></div> <h3>Offices and Departments</h3> <p>Add my offices, departments and agencies to the directory.</p> </div> <div class='row_clickable' onclick="document.location.href='sponsor'"> <div class='row_icon'></div> <h3>Sponsor Directory</h3> <p>Add or edit sponsor contact information.</p> </div> <div class='row_clickable' onclick="document.location.href='user'"> <div class='row_icon'></div> <h3>Users</h3> <p>Last updated 45 days ago.</p> </div> <div class='row_clickable' onclick="document.location.href='account'"> <div class='row_icon'></div> <h3>My Account</h3> <p>Last updated 45 days ago.</p> </div>
<?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 = 5; $region_type = REGION_STATE; $legislation_ids = Legislation::get_ids_by_region($region_id, $region_type); $html = new HTML('admin'); $html->set_title('Send and manage legislative announcements'); $html->generate_header(); ?> <div class='row_clickable' onClick="document.location.href='legislation_edit'"> <div class='row_icon'></div> <h3>Send a new legislative announcement</h3> <p>I last posted a legislative announcement 3 days ago.</p> </div> <?php if (!empty($legislation_ids)) { $feedback_average = Legislation::get_average_legislation_feedback(); foreach ($legislation_ids as $id) { $legislation = new Legislation($id); $legislation_id = $id; $shorttitle = my_truncate($legislation->title(), 10, "..."); $shortdescription = my_truncate($legislation->recommended_action(), 20, "..."); $chart_question = $legislation->question(); $feedback_support = $legislation->get_support(); $feedback_oppose = $legislation->get_oppose(); $feedback_total = $feedback_support + $feedback_oppose; ?> <div class='row_clickable' onclick="document.location.href='legislation_edit?id=<?php
if (!empty($_POST)) { $office->region_id($region_id); $office->region_type($region_type); $office->title(get_param('title')); $office->description(get_param('description')); $office->phone(get_param('phone')); $office->email(get_param('email')); if ($id) { $office->update(); } else { $id = $office->insert(); } redirect('office'); } $html = new HTML('admin'); $html->set_title("Edit this office's directory listing"); $html->generate_header(); ?> <form method="post"> <div class='row'> <div class='label' for='title'>Title:</div> <div class='input_border'> <input name='title' id='title' value='<?php echo $office->title(); ?> '> </div> </div> <div class='row'> <div class='label' for='description'>Description:</div>
<?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'; $region_id = 65517; $region_type = REGION_CITY; $region_id = 216; $region_type = REGION_COUNTY; $announcement_ids = Announcement::get_ids_by_region($region_id, $region_type); $html = new HTML('admin'); $html->set_title('Send and manage announcements'); $html->generate_header(); ?> <div class="row_clickable" onclick="document.location.href='announcement_edit'"> <div class="row_icon"></div> <h3>Send a new announcement</h3> <p>My last announcement was 3 days ago.</p> </div> <?php 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();
$sponsor_ids = get_param('sponsor_ids'); if (!empty($sponsor_ids)) { $legislation->associate_sponsors($sponsor_ids); } // tags next $tag_list = get_param('tag_list'); $tags = explode('|', $tag_list); if (!empty($tags)) { $legislation->associate_tags($tags); } else { $legislation->disassociate_tags(); } redirect('legislation'); } $html = new HTML('admin'); $html->set_title('Edit this legislative legislation'); $html->use_style('admin/tag.css'); $html->use_style('dp/themes/base/ui.all.css'); $html->use_style('dp/themes/base/ui.core.css'); $html->use_style('dp/themes/base/ui.datepicker.css'); $html->use_style('dp/themes/base/ui.theme.css'); $html->use_script('admin/stopwords.js'); $html->use_script('admin/tag_extraction.js'); $html->use_script('datepicker/ui/ui.core.js'); $html->use_script('datepicker/ui/ui.datepicker.js'); $html->use_script('datepicker/header.js'); $html->generate_header(); ?> <form method="post"> <div class='row'>
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/classes/class.user.php'; $user = new User(); if (!empty($_POST)) { $email_reminder = get_param('email_reminder'); $mobile_phone = get_param('mobile_phone'); $password = get_param('password'); if ($email_reminder) { $error['reminder_sent'] = true; } elseif ($user->login($mobile_phone, $password)) { redirect('/index.php'); } else { $error['login'] = true; } } $html = new HTML(); $html->set_title('Meocracy Login'); $html->generate_header_mobile(); ?> <form method="post"> <?php if (isset($error['reminder_sent'])) { ?> <p class="error">Reminder has been sent. Check your email.</p> <?php } if (isset($error['login'])) { ?> <p class="error"> Unrecognized login. <a href="/signup.php">Need an account</a>? </p> <?php
<?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.sponsor.php'; $region_id = 65517; $region_type = REGION_CITY; $sponsor_ids = Sponsor::get_ids_by_region($region_id, $region_type); $html = new HTML('admin'); $html->set_title('Edit personnel directory listings'); $html->generate_header(); ?> <div class='row_clickable' onclick="document.location.href='sponsor_edit'"> <h3>Add a new sponsor to the directory</h3> </div> <?php if (!empty($sponsor_ids)) { foreach ($sponsor_ids as $id) { $sponsor = new Sponsor($id); $sponsor_type = $sponsor->sponsor_type(); if ($sponsor_type == 'I') { $name_last = $sponsor->name_last(); $name_first = $sponsor->name_first(); $name_middle = $sponsor->name_middle(); $title = $sponsor->title(); $sponsor_name = $name_first . ' ' . $name_last . ', ' . $title; } elseif ($sponsor_type == 'O') { $office = $sponsor->office(); $sponsor_name = $office; } $src = '/images/photos/personnel/' . $sponsor->image();
} if (empty($firstname)) { $error['firstname'] = true; } if (empty($lastname)) { $error['lastname'] = true; } if (empty($error)) { if ($new_user->signup($mobile_phone, $password, $signup_data)) { redirect($new_signup); } } else { } } $html = new HTML(); $html->set_title('Sign Up'); $html->generate_header_mobile(); ?> <div id="signup" data-role="page" data-title='Meocracy' data-theme='a'> <!-- <div data-role='header' data-theme='a'> <div data-role='navbar'> <ul> <li><a href='index.php' data-icon='home' data-theme='a'>Home</a></li> <li><a href='search.php' data-icon='search' data-theme='a'>Search</a></li> <li><a href='alert_manager.php' data-icon='alert' data-theme='a'>Alerts</a></li> <li><a href='settings.php' data-icon='gear' data-theme='a'>Settings</a></li> </ul>
$sql = sprintf("SELECT lt.legislation_id FROM legislation_tag lt \n JOIN legislation_region lr ON lr.legislation_id=lt.legislation_id\n JOIN tag t ON lt.tag_id=t.tag_id \n WHERE t.tag='%s'\n AND\n (\n lr.region_id=%d AND lr.region_type=%d\n OR lr.region_id=%d AND lr.region_type=%d\n OR lr.region_id=%d AND lr.region_type=%d\n )", $search, $user->city_id, REGION_CITY, $user->county_id, REGION_COUNTY, $user->state_id, REGION_STATE); $data = db()->Get_Table($sql); } if ($search_fulltext) { if ($search_announcements) { $sql = "SELECT a.announcement_id FROM announcement a\n WHERE a.heading LIKE '%" . $search . "%'\n OR a.description LIKE '%" . $search . "%'\n OR a.text LIKE '%" . $search . "%'\n OR a.question LIKE '%" . $search . "%'\n "; $data = db()->Get_Table($sql); } if ($search_legislation) { $sql = "SELECT l.legislation_id FROM legislation l\n WHERE l.title LIKE '%" . $search . "%'\n OR l.recommended_action LIKE '%" . $search . "%'\n OR l.background LIKE '%" . $search . "%'\n OR l.discussion LIKE '%" . $search . "%'\n OR l.question LIKE '%" . $search . "%'\n "; $data = db()->Get_Table($sql); } } } $html = new HTML(); $html->set_title('Settings'); //$html->generate_header_mobile(); ?> <p>Enter search term</p> <form method="post"> <input type="text" id="search" name="search" value=""/><br/> <input type="checkbox" id="announcements" name="announcements" value=1" checked /> Announcements<br/> <input type="checkbox" id="legislation" name="legislation" value=1" checked /> Legislation<br/> <input type="checkbox" id="fulltext" name="fulltext" value=1" checked /> Search Full Text<br/> <input type="hidden" name="user_id" value="<?php echo $user_id; ?> "/> <input type="submit" value="Search"/> </form> <script type="text/javascript">
// finally, tags $tag_list = get_param('tag_list'); $tags = explode('|', $tag_list); if (!empty($tags)) { $announcement->associate_tags($tags); } else { $announcement->disassociate_tags(); } redirect('announcement'); } if ($id) { $sponsor_id = $announcement->sponsor_id(); $office_name = $announcement->office->office_name(); } $html = new HTML('admin'); $html->set_title('Edit this announcement'); $html->use_style('admin/tag.css'); $html->use_style('dp/themes/base/ui.all.css'); $html->use_style('dp/themes/base/ui.core.css'); $html->use_style('dp/themes/base/ui.datepicker.css'); $html->use_style('dp/themes/base/ui.theme.css'); $html->use_script('admin/stopwords.js'); $html->use_script('admin/tag_extraction.js'); $html->use_script('datepicker/ui/ui.core.js'); $html->use_script('datepicker/ui/ui.datepicker.js'); $html->use_script('datepicker/header.js'); $html->generate_header(); ?> <form method="post" data-ajax='false'> <div class='row'>
$friends = $user->get_friend_list(); $select_friends = true; if (!empty($_POST)) { $select_friends = false; $screen = get_param('screen'); if ($screen == 1) { $friend_ndx = get_param('friend_ndx'); $friend_ndx_list = implode('|', $friend_ndx); } elseif ($screen == 2) { $friend_ndx_list = get_param('friend_ndx_list'); $message = get_param('message'); $user->tell_friends($friend_ndx_list, $message); } } $html = new HTML(); $html->set_title('Tell Friends'); $html->generate_header_mobile(); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li><?php echo $announcement->heading(); ?> </li> <li>Let my friends know</li> <li> <form method="post"> <?php if ($select_friends) { ?> <input type="hidden" id="screen" name="screen" value="1"/> <?php
if (!$id) { redirect('/index.php'); } $legislation = new Legislation($id); log_time('new Legislation'); $support = $legislation->get_support(); $oppose = $legislation->get_oppose(); $total = $support + $oppose; $chart_question = $legislation->question(); log_time('gathering feedback'); $feedback_support = $legislation->get_support(); $feedback_oppose = $legislation->get_oppose(); $feedback_total = $feedback_support + $feedback_oppose; log_time('gathered data'); $html = new HTML(); $html->set_title('Feedback Response'); log_time('about to generate header'); $html->generate_header_mobile(); log_time('header generated'); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li> <img class="ui-li-thumb" src="<?php echo $legislation->get_image_src(); ?> "/> <?php echo $legislation->question(); ?> </li> <li>Results</li>
<?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.user.php'; require_once DOC_ROOT . '/includes/classes/class.city.php'; $user_id = get_param('user_id'); if (!$user_id) { redirect('/login.php'); } $user_region = new UserRegion(); $city = $user_region->get_region_for_user($user_id); $html = new HTML(); $html->set_title('City Home'); $html->generate_header_mobile(); ?> <ul data-role='listview' data-inset='false' data-theme='a' data-divider-theme='a'> <li> <a href="/issues.php?type=<?php echo REGION_CITY; ?> "><?php echo $city->image_tag(); echo $city->city_name(); ?> </a> (<?php echo $city->issue_count[REGION_CITY]; ?> ) </li>
<?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.office.php'; $region_id = 65517; $region_type = REGION_CITY; $region_logo = '/images/photos/logo/city_aliso_viejo.png'; $office_ids = Office::get_ids_by_region($region_id, $region_type); $html = new HTML('admin'); $html->set_title('Edit office directory listings'); $html->generate_header(); include 'includes/functions.php'; ?> <div class='row_clickable' onclick="document.location.href='office_edit'"> <h3>Add a new office to the directory</h3> </div> <?php if (!empty($office_ids)) { foreach ($office_ids as $id) { $office = new Office($id); $title = $office->title(); $description = $office->description(); ?> <div class='row_clickable row_thumb' onclick="document.location.href='office_edit?id=<?php echo $id; ?> '"> <div class='row_icon'></div> <img src='<?php echo $region_logo;