This repository has been archived by the owner on May 19, 2020. It is now read-only.
forked from kurund/CiviMobile-Prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
civimobile.home.tpl.php
54 lines (47 loc) · 2.14 KB
/
civimobile.home.tpl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php require_once('civimobile.header.php'); ?>
<div data-role="page" data-theme="c" id="jqm-home">
<div id="jqm-homeheader" data-role="header">
<h3><?php print $civimobile_page_settings['title'] ?></h3>
</div>
<div data-role="content">
<ul id="main-events-list" data-role="listview" data-inset="true" >
<li data-role="list-divider">Upcoming Events</li>
<?php
$params = array ('version' =>'3');
$results = civicrm_api("Event","get",$params);
$events = $results['values'];
foreach($events as $key => $event) { ?>
<li role="option" tabindex="-1" data-theme="c" id="event-<?php print $event['id']; ?>" >
<a href="/civimobile/participants&event_id=<?php print $event['id']; ?>" data-role="participants-<?php print $event['id']; ?>">
<?php print $event['title']; ?></a>
</li>
<?php } ?>
</ul>
<ul id="activities-list" data-role="listview" data-inset="true">
<li data-role="list-divider">Your Activities</li>
<?php
global $user;
// get current user's contact ID
$params = array ('version' =>'3', 'uf_id' => $user->uid );
$results = civicrm_api("UF_match","get",$params);
$contactID = $results['values'][$user->uid]['contact_id'];
$params = array ('version' =>'3', 'contact_id' =>$contactID, 'rowCount' => '5');
$results = civicrm_api("Activity","get",$params);
$activities = $results['values'];
foreach($activities as $key => $activity) { ?>
<li tabindex="-1" data-theme="c" >
<?php print $activity['subject']; ?>
</li>
<?php } ?>
</ul>
</div>
<div data-role="footer" data-id="global-footer" data-position="fixed" data-theme="c">
<div data-role="navbar" data-theme="c">
<ul>
<li><a href="/civimobile/contact" data-icon="search" data-ajax="false">Contacts</a></li>
<li><a href="/civimobile/events" data-icon="grid" data-ajax="false">Events</a></li>
</ul>
</div><!-- /navbar -->
</div><!-- /footer -->
</div>
<?php require('civimobile.footer.php'); ?>