This repository has been archived by the owner on Sep 23, 2020. It is now read-only.
/
view-threads-list.php
134 lines (134 loc) · 7.04 KB
/
view-threads-list.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<div class="vbx-content-menu vbx-content-menu-top">
<!-- <ul class="inbox-menu vbx-menu-items-left">
<li class="menu-item">
<a href="" class="dropdown-select-button link-button"><span>Select</span></a>
<ul class="hide">
<li><a class="select select-all" href="">Select All</a></li>
<li><a class="select select-none" href="">Select None</a></li>
<li><a class="select select-read" href="">Select Read</a></li>
<li><a class="select select-unread" href="">Select Unread</a></li>
</ul>
</li>
<li class="menu-item">
<a href="" class="delete-button link-button"><span>Delete</span></a>
</li>
</ul>--><!-- .vbx-menu-items -->
<div class="pagination">
<?php if (sizeof($allthreads) > $threads_per_page): ?>
<?php foreach(range(0, sizeof($allthreads), $threads_per_page) as $offset): ?>
<?php if ($offset == $threads_offset): ?>
<span class="current"><?php echo ($offset / $threads_per_page + 1);?></span>
<?php else: ?>
<span class="num"><a href="<?php echo site_url("p/messages?offset=" . $offset) ?>"><?php echo ($offset / $threads_per_page + 1);?></a></span>
<?php endif ?>
<?php endforeach; ?>
<span class="next"><a href="<?php echo site_url("p/messages?offset=" . ($threads_offset + $threads_per_page)) ?>">Next</a></span>
<span class="last"><a href="<?php echo site_url("p/messages?offset=" . (sizeof($allthreads) - $threads_per_page)) ?>">»</a></span>
<?php else: ?>
<span class="current">1</span>
<span class="next"><a href="<?php echo site_url("p/messages?offset=0") ?>">Next</a></span>
<span class="last"><a href="<?php echo site_url("p/messages?offset=0") ?>">»</a></span>
<?php endif ?>
</div>
</div><!-- .vbx-content-menu -->
<table border="0" class="vbx-items-grid">
<tbody>
<?php foreach($threads as $message): ?>
<tr rel="<?php echo $message[0]['id'] ?>" class="message-row sms-type <?php echo ($message[0]['status'])? 'unread' : 'read'?>">
<td class="message-caller">
<a href="<?php echo site_url("messages/details/{$message[0]['id']}")?>" class="quick-call-button">
<span class="replace"><?php echo $message[0]['contact'] ?></span>
</a>
<a href="<?php echo site_url("messages/details/{$message[0]['id']}")?>" class="quick-sms-button">
<span class="replace"><?php echo $message[0]['contact'] ?></span>
</a>
<div id="quick-call-popup-<?php echo $message[0]['id'] ?>" class="quick-call-popup hide">
<a href="" class="close action toggler"><span class="replace">close</span></a>
<p class="call-to-phone"><?php echo $message[0]['contact'] ?></p>
<ul class="caller-id-phone">
<li>
<a href="<?php echo site_url("messages/details/{$message[0]['id']}/callback") ?>" class="call">
Call
<span class="to hide"><?php echo $message[0]['contact'] ?></span>
<span class="callerid hide"><?php echo $phoneNumbers[0] ?></span>
<span class="from hide"><?php echo isset($user_numbers[0])? $user_numbers[0]->value : '' ?></span>
</a>
</li>
</ul>
</div>
<div id="quick-sms-popup-<?php echo $message[0]['id'] ?>" class="quick-sms-popup hide">
<a href="" class="close action sms-toggler"><span class="replace">close</span></a>
<input class="sms-message" type="text" name="content" />
<span class="count">160</span>
<button class="send-button" rel="<?php echo $message[0]['id'] ?>"><span>Send</span></button>
<img class="sending-sms-loader hide" src="<?php echo asset_url('assets/i/ajax-loader.gif')?>" alt="..." />
<p class="sms-to-phone hide"><?php echo $message[0]['contact'] ?></p>
<p class="from-phone hide"><?php echo $phoneNumbers[0] ?></p>
</div>
<span class="phone-number">
<a href="<?php echo site_url("p/messages/?to=" . urlencode($message[0]['contact']))?>" style="text-decoration:none" >
<?php
if ($address_book) {
echo lookupNumber($message[0]['contact']);
} else {
echo $message[0]['contact'];
}
?>
</a>
</span>
</td>
<td class="message-content">
<span class="transcript"><?php echo $message[0]['body'] ?></span>
</td>
<td>
<?php
if ($message[0]['num_media'] > 0) {
foreach($message[0]['media'] as $media) {
echo "<a href='https://api.twilio.com" . $media->uri . "' style='text-decoration:none' data-lightbox='" . $message[0]['id'] . "'>📷</a>";
//echo " \ " . $media->content_type . " \ ";
}
}
?>
</td>
<td class="message-timestamp">
<div class="unformatted-absolute-timestamp hide">
<?php echo strtotime($message[0]['created']) ?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table><!-- .vbx-items-grid -->
<div class="vbx-content-menu vbx-content-menu-bottom">
<!-- <ul class="inbox-menu vbx-menu-items">
<li class="menu-item">
<a href="" class="dropdown-select-button link-button"><span>Select</span></a>
<ul class="hide">
<li><a class="select select-all" href="">Select All</a></li>
<li><a class="select select-none" href="">Select None</a></li>
<li><a class="select select-read" href="">Select Read</a></li>
<li><a class="select select-unread" href="">Select Unread</a></li>
</ul>
</li>
<li class="menu-item">
<a href="" class="delete-button link-button"><span>Delete</span></a>
</li>
</ul>--><!-- .vbx-menu-items -->
<div class="pagination">
<?php if (sizeof($allthreads) > $threads_per_page): ?>
<?php foreach(range(0, sizeof($allthreads), $threads_per_page) as $offset): ?>
<?php if ($offset == $threads_offset): ?>
<span class="current"><?php echo ($offset / $threads_per_page + 1);?></span>
<?php else: ?>
<span class="num"><a href="<?php echo site_url("p/messages?offset=" . $offset) ?>"><?php echo ($offset / $threads_per_page + 1);?></a></span>
<?php endif ?>
<?php endforeach; ?>
<span class="next"><a href="<?php echo site_url("p/messages?offset=" . ($threads_offset + $threads_per_page)) ?>">Next</a></span>
<span class="last"><a href="<?php echo site_url("p/messages?offset=" . (sizeof($allthreads) - $threads_per_page)) ?>">»</a></span>
<?php else: ?>
<span class="current">1</span>
<span class="next"><a href="<?php echo site_url("p/messages?offset=0") ?>">Next</a></span>
<span class="last"><a href="<?php echo site_url("p/messages?offset=0") ?>">»</a></span>
<?php endif ?>
</div>
</div><!-- .vbx-content-menu -->