PageRenderTime 58ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/application/views/main.php

https://github.com/mrmatthewgriffiths/ushahidi_swift
PHP | 315 lines | 264 code | 35 blank | 16 comment | 19 complexity | ad18a285f4ff011dd674fedf1aaa7fcb MD5 | raw file
  1. <?php
  2. /**
  3. * Main view page.
  4. *
  5. * PHP version 5
  6. * LICENSE: This source file is subject to LGPL license
  7. * that is available through the world-wide-web at the following URI:
  8. * http://www.gnu.org/copyleft/lesser.html
  9. * @author Ushahidi Team <team@ushahidi.com>
  10. * @package Ushahidi - http://source.ushahididev.com
  11. * @module Admin Dashboard Controller
  12. * @copyright Ushahidi - http://www.ushahidi.com
  13. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General
  14. * Public License (LGPL)
  15. */
  16. ?>
  17. <!-- main body -->
  18. <div id="main" class="clearingfix">
  19. <div id="mainmiddle" class="floatbox withright">
  20. <!-- right column -->
  21. <div id="right" class="clearingfix">
  22. <!-- category filters -->
  23. <div class="cat-filters clearingfix">
  24. <strong><?php echo Kohana::lang('ui_main.category_filter');?></strong>
  25. </div>
  26. <ul class="category-filters">
  27. <li><a <?php if ($selected_category == 0 )echo" class='active' " ; ?> id="cat_0" href="/main/index/category/0/page/1"><div class="swatch" style="background-color:#<?php echo $default_map_all;?>"></div><div class="category-title">ALL SOURCES</div></a></li>
  28. <?php
  29. foreach ($categories as $category => $category_info)
  30. {
  31. $setactive = $selected_category == $category? " class='active' " :"" ;
  32. $category_title = $category_info[0];
  33. $category_color = $category_info[1];
  34. echo '<li><a '.$setactive.' href="/main/index/category/'.$category.'/page/1/" id="cat_'. $category .'"><div class="swatch" style="background-color:#'.$category_color.'"></div><div class="category-title">'.$category_title.'</div></a></li>';
  35. // Get Children
  36. echo '<div class="hide" id="child_'. $category .'">';
  37. foreach ($category_info[2] as $child => $child_info)
  38. {
  39. $child_title = $child_info[0];
  40. $child_color = $child_info[1];
  41. echo '<li style="padding-left:20px;"><a href="#" id="cat_'. $child .'"><div class="swatch" style="background-color:#'.$child_color.'"></div><div class="category-title">'.$child_title.'</div></a></li>';
  42. }
  43. echo '</div>';
  44. }
  45. ?>
  46. </ul>
  47. <!-- / category filters -->
  48. <?php
  49. if ($layers)
  50. {
  51. ?>
  52. <!-- Layers (KML/KMZ) -->
  53. <div class="cat-filters clearingfix" style="margin-top:20px;">
  54. <strong><?php echo Kohana::lang('ui_main.layers_filter');?></strong>
  55. </div>
  56. <ul class="category-filters" >
  57. <?php
  58. foreach ($layers as $layer => $layer_info)
  59. {
  60. $layer_name = $layer_info[0];
  61. $layer_color = $layer_info[1];
  62. $layer_url = $layer_info[2];
  63. $layer_file = $layer_info[3];
  64. $layer_link = (!$layer_url) ?
  65. url::base().'media/uploads/'.$layer_file :
  66. $layer_url;
  67. echo '<li><a href="#" id="layer_'. $layer .'"
  68. onclick="switchLayer(\''.$layer.'\',\''.$layer_link.'\',\''.$layer_color.'\'); return false;"><div class="swatch" style="background-color:#'.$layer_color.'"></div>
  69. <div>'.$layer_name.'</div></a></li>';
  70. }
  71. ?>
  72. </ul>
  73. <!-- /Layers -->
  74. <?php
  75. }
  76. ?>
  77. <div class="cat-filters clearingfix" style="Text-align:center;padding:20px;background: #CCCCCC;" >
  78. <form method="POST" name="verocityfrm" id="verocityfrm" action="<?php echo url::base().'main/verocity/'.$selected_category ; ?>" >
  79. <H5 >VERACITY SLIDER</H5>
  80. <br/>
  81. <div id="slider-range" ></div><br/><span style="color:#f6931f; font-weight:bold;">
  82. <input type="text" name="verocity_min" id="verocity_min" style="text-align:right; background-color:#CCCCCC;width:30px;border:0; color:#f6931f; font-weight:bold;" />%&nbsp;&nbsp;&nbsp;&nbsp; - &nbsp;&nbsp;&nbsp;&nbsp;
  83. <input type="text" name="verocity_max" id="verocity_max" style="text-align:right; background-color:#CCCCCC;width:30px;border:0; color:#f6931f; font-weight:bold;" />%</span><br/><br/>
  84. <input class="" type="submit" name="verocitysubmit" id="verocitysubmit" value=" Filter "/>
  85. </form>
  86. </div>
  87. <br />
  88. <!-- additional content -->
  89. <div class="additional-content">
  90. <h5><?php echo Kohana::lang('ui_main.how_to_report'); ?></h5>
  91. Help Ushahidi to seperate signal from noice.<br/><br/>
  92. <ol>
  93. <?php if (!empty($phone_array))
  94. { ?><li>Add or Click on tags to report accuracy<!-- <?php foreach ($phone_array as $phone) {
  95. echo "<strong>". $phone ."</strong>";
  96. if ($phone != end($phone_array)) {
  97. echo " or ";
  98. }
  99. } ?>-->
  100. </li><?php } ?>
  101. <li>Dispute Inaccuracies</li>
  102. <li>Mark irrelevant content as 'chatter'</li>
  103. <?php if (!empty($report_email))
  104. { ?><li>Email reports to <a href="mailto:<?php echo $report_email?>"><?php echo $report_email?></a></li><?php } ?>
  105. <li>What to do more? <strong>Register</strong></li> to become a sweeper.
  106. <!--
  107. <?php if (!empty($twitter_hashtag_array))
  108. { ?><li>By sending a tweet with the hashtag/s <?php foreach ($twitter_hashtag_array as $twitter_hashtag) {
  109. echo "<strong>". $twitter_hashtag ."</strong>";
  110. if ($twitter_hashtag != end($twitter_hashtag_array)) {
  111. echo " or ";
  112. }
  113. } ?></li><?php } ?>
  114. <li>By <a href="<?php echo url::base() . 'reports/submit/'; ?>">filling a form</a> at the website</li>
  115. -->
  116. </ol>
  117. </div>
  118. <!-- / additional content -->
  119. </div>
  120. <!-- / right column -->
  121. <!-- content column -->
  122. <div id="content" class="clearingfix">
  123. <div class="floatbox">
  124. <!-- filters -->
  125. </div>
  126. <!-- / filters -->
  127. <div>
  128. <table class="table-list">
  129. <!--<thead>
  130. <tr>
  131. <th scope="col"><?php echo Kohana::lang('ui_main.title'); ?></th>
  132. <th scope="col"><?php echo Kohana::lang('ui_main.source'); ?></th>
  133. <th scope="col"><?php echo Kohana::lang('ui_main.date'); ?></th>
  134. </tr>
  135. </thead> -->
  136. <tbody>
  137. <?php
  138. foreach ($feeds as $feed)
  139. {
  140. $feed_id = $feed->id;
  141. $feed_title = text::limit_chars($feed->item_title, 40, '...', True);
  142. $feed_link = $feed->item_link;
  143. $feed_date = date('M j Y h:m', strtotime($feed->item_date));
  144. //$feed_source = text::limit_chars($feed->feed->item_name, 15, "...");
  145. ?>
  146. <tr>
  147. <td id="feed_row_<?php echo $feed_id ;?>" >
  148. <?php if(isset($_SESSION['auth_user'])){ ?>
  149. <a href="javascript:submitfeed_to_ushahidi('<?php echo $feed_id ;?>','<?php echo $feed->category_id ; ?>')" >
  150. <?php } ?>
  151. <div style="padding:5px;width:35px;height:45px;border:1px solid #660033;Text-align:center; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
  152. <img src="<?php echo url::base(); ?>/media/img/rssdark.png" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  153. <br/>
  154. <span style="font-weight:bold;color:#660033">
  155. <label id="weight_<?php echo $feed_id; ?>" name="weight_<?php echo $feed_id; ?>" >
  156. <?php if ($feed->weight == 0.00){ echo "_" ;}else{ echo round($feed->weight,0 )."%"; } ?>
  157. </label>
  158. </span>
  159. </div>
  160. <?php if(isset($_SESSION['auth_user'])){ ?>
  161. </a>
  162. <?php } ?>
  163. </td>
  164. <td style="border-bottom:2px solid #AAAAAA;" id="feed_row_<?php echo $feed_id ;?>" >
  165. <?php echo $feed->item_description ;?> ...
  166. <br/>
  167. <strong>Delivered: </strong> <?php echo $feed->item_date ; /*$testDate;*/ ?>&nbsp;&nbsp;&nbsp;
  168. <strong>Source: </strong><?php echo $feed->item_source; ?> <br/>
  169. <!-- to displace status of sumitted feed to ushahidi -->
  170. <label id="lblreport_<?php echo $feed_id; ?>" name="lblreport_<?php echo $feed_id; ?>" >
  171. </label>
  172. <form id="formtag<?php echo $feed_id ;?>" name="formtag<?php echo $feed_id ;?>" method="POST" action="/main/tagging/feed/<?php echo $feed_id ; ?>/category/<?php echo $selected_category ;?>/page/<?php echo $current_page ; ?>" >
  173. <?php if(isset($_SESSION['auth_user'])){ ?>
  174. <a href="javascript:submit_tags('<?php echo $feed_id ;?>')" >
  175. <img src="<?php echo url::base(); ?>/media/img/Tagbtn.png" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  176. </a>
  177. <input type=text id="tag_<?php echo $feed_id; ?>" name="tag_<?php echo $feed_id; ?>" value="" />&nbsp;&nbsp;
  178. <?php }else{ ?>
  179. <img src="<?php echo url::base(); ?>/media/img/Tagbtn.png" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  180. <?php } ?>
  181. <label id="lbltags_<?php echo $feed_id; ?>" name="lbltags_<?php echo $feed_id; ?>" >
  182. <?php echo util::showtags($feed->id);?>
  183. </label>
  184. <div style="float:right">
  185. <a href="<?php echo $feed->item_link; ?>" target="_blank">
  186. <img src="<?php echo url::base(); ?>/media/img/page_icon.jpg" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  187. </a>
  188. <?php if(isset($_SESSION['auth_user'])){ ?>
  189. <a href="javascript:increment_feed_rating('<?php echo $feed_id ;?>','<?php echo $feed->category_id ; ?>')" >
  190. <img src="<?php echo url::base(); ?>/media/img/swift_page_icon.jpg" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  191. </a>
  192. <a href="javascript:decrement_feed_rating('<?php echo $feed_id ;?>','<?php echo $feed->category_id ; ?>')" >
  193. <img src="<?php echo url::base(); ?>/media/img/no_entry_icon.jpg" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  194. </a>
  195. <!-- <a href="javascript:mark_irrelevant('<?php echo $feed_id ;?>','<?php echo $feed->category_id ; ?>')" >
  196. <img src="<?php echo url::base(); ?>/media/img/qtnmark.jpg" alt="<?php echo $feed_title ?>" align="absmiddle" style="border:0" />
  197. </a> -->
  198. <?php } ?>
  199. </div>
  200. </form>
  201. </td>
  202. </tr>
  203. <?php
  204. }
  205. ?>
  206. </tbody>
  207. </table>
  208. <div style="align:bottom;">
  209. <?php echo $pagination; ?>
  210. </div>
  211. <!--<a class="more" href="<?php echo url::base() . 'feeds' ?>">View More...</a> -->
  212. </div>
  213. <!-- <div id="graph" class="graph-holder"></div> -->
  214. </div>
  215. </div>
  216. <!-- / content column -->
  217. </div>
  218. </div>
  219. <!-- / main body -->
  220. <!-- content -->
  221. <div class="content-container">
  222. <!-- content blocks -->
  223. <div class="content-blocks clearingfix">
  224. <!-- left content block -->
  225. <div class="content-block-left">
  226. <h5><?php echo Kohana::lang('ui_main.incidents_listed'); ?></h5>
  227. <table class="table-list">
  228. <thead>
  229. <!-- <tr>
  230. <th scope="col" class="title"><?php echo Kohana::lang('ui_main.title'); ?></th>
  231. <th scope="col" class="location"><?php echo Kohana::lang('ui_main.location'); ?></th>
  232. <th scope="col" class="date"><?php echo Kohana::lang('ui_main.date'); ?></th>
  233. </tr> -->
  234. </thead>
  235. <tbody>
  236. <?php
  237. if ($feedcounts == 0)
  238. {
  239. ?>
  240. <tr><td colspan="3">No Feeds In The System</td></tr>
  241. <?php
  242. }
  243. foreach ($feedsummary as $feedsum)
  244. {
  245. ?>
  246. <tr>
  247. <td><a href="<?php echo $feedsum->feed_url; ?>" target="_BLANK"> <?php echo $feedsum->feed_name; ?></a></td>
  248. <td><?php echo $feedsum->total; ?></td>
  249. </tr>
  250. <?php
  251. }
  252. ?>
  253. </tbody>
  254. </table>
  255. </div>
  256. <!-- / left content block -->
  257. <!-- right content block -->
  258. <div class="content-block-right">
  259. <h5>ANALYTIC SUITE</h5>
  260. <table class="table-list">
  261. <?php
  262. foreach ($analyticSummary as $feedsum)
  263. {
  264. ?>
  265. <tr>
  266. <td><h2> <?php echo $feedsum->count." of ".$feedsum->total." ".$feedsum->title; ?> </h2></td>
  267. </tr>
  268. <?php
  269. } ?>
  270. </table>
  271. </div>
  272. <!-- / right content block -->
  273. </div>
  274. </div>
  275. <!-- content -->
  276. </div>
  277. </div>
  278. <!-- / main body -->
  279. </div>
  280. <!-- / wrapper -->