-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathcivimobile.event_search.html
40 lines (37 loc) · 1.46 KB
/
civimobile.event_search.html
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
<div data-role="header">
<h3>Search Events</h3>
<a href="<?php echo CRM_Utils_System::url('civicrm/mobile/'); ?>" data-ajax="false" id="home-main" data-transition="slide" data-direction="reverse" data-role="button" data-icon="home" data-iconpos="notext" class="ui-btn-left jqm-home">Home</a>
</div>
<div data-role="content" id="event-content">
<div class="ui-listview-filter ui-bar-c">
<input type="search" name="event_name" id="event_name" value=""/>
</div>
<ul id="events" data-role="listview" data-inset="false" data-filter="false"></ul>
</div>
<script type="text/javascript">
function eventSearch (q) {
setTimeout(function(){
$.mobile.loading('show');
},1);
CRM.api('Event','get',
{'version' :'3', 'title': {'LIKE': '%' + q + '%'}, 'return' : 'event_title,id' }, {
success:function (data){
if (data.count == 0) {
cmd = null;
}
else {
cmd = "refresh";
$('#events').show();
$('#events').empty();
}
$.each(data.values, function(key, value) {
$('#events').append('<li role="option" tabindex="-1" data-theme="c" id="event-'+value.id+'" ><a href="<?php echo CRM_Utils_System::url('civicrm/mobile/participant/checkin', 'eid='); ?>'+ value.id +'" data-transition="slideup">'+value.title+'</a></li>');
});
setTimeout(function(){
$.mobile.loading('hide');
},1);
$('#events').listview(cmd);
}
});
}
</script>