searchrecordings.blade.php
3.42 KB
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
<?php
use App\Models\CRMCallArchive;
use App\Models\CRMCall;
use App\Models\User;
use App\Jobs\KHRMSLib;
$wakka = new KHRMSLib();
$dashboarduser=Auth::user();
$clmnlst = array("lan","number");
if(Input::get("getCallRec")=="1")
{
$calllog=CRMCallArchive::find(Input::get("calllog"));
$tdata=json_decode($calllog->data,true);
echo '<audio controls src="dialer/playrecfile?calllog='.$calllog->id.'" />';
return;
}
if(Input::has("submit"))
{
if(isset($_GET['key']))$key=$_GET['key'];
if(isset($_GET['value']))$value=$_GET['value'];
$alist=CRMCallArchive::where($key,'=', $value);
$alist=$alist->get();
$userarr=array();
$i=sizeof($alist);$i=1;
$totaltime=0;$ttlovr10=0;$ttlovr5=0;$ttlovr1=0;$ttlovr0=0;$outstr="";$usrcnt=0;
$totaltimeIn=0;$ttlovr10In=0;$ttlovr5In=0;$ttlovr1In=0;$ttlovr0In=0;$usrcntIn=0;
$actionarr=array();$actionarrIn=array();
foreach($alist as $aline)
{
$tpostdata=json_decode($aline->data,true);
$created=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60));
if(isset($tpostdata['recFolder']))
{
$recstr='';
if($dashboarduser->moduleACL("Dialer",false,false,true))
{
if(isset($tpostdata['recFolder']))$recstr.="<a href=# onclick='getCallRec(".$aline->id.");return false;' title='Size : ".round($aline->recsize/1024,0)." KB'><i class='fa fa-play-circle'></i> </a>";
$recstr.="<a href='dialer/playrecfile?calllog=$aline->id&out=wav' title='' target='_blank'><i class='fa fa-download'></i> </a><span id='recspan_".$aline->id."'</span>";
}
$outstr.="<tr><td>".$i."</td>
<td>$created</td>
<td>$recstr</td>
</tr>";
$i++;
}
}
}
?>
<div class=innerAll>
<style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style>
<script>
$(document).ready(function()
{
if(!$('#dialoglog').hasClass('ui-dialog-content'))
{
$('#dialoglog').dialog({
autoOpen: false,
width: '70%',
buttons: {
"Ok": function() {
$(this).dialog("close");
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
}
});
</script>
<div style="float:left;width:50%">
<select id="key">
<?php foreach($clmnlst as $c){$s="";if($c==$key)$s='selected';echo "<option value='$c' $s>$c</option>";} ?>
</select>
<input id=val name="val" type="text" value='<?php echo $value; ?>'>
<button class="btn btn-sm btn-default" onclick='showRecordingList();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-search'></i> Search</button>
</div>
<div style="clear:both"></div>
<hr>
<script>
function showRecordingList()
{
var key = $("#key").val();
var val = $("#val").val();
if(key == "" || val == "")
{
simpleNotification('Alert','topRight','<span class="fa fa-exclamation-triangle"></span> Oops..Something is not right!');
return;
}
doAjax('dialer/searchrecordings?submit=1&key='+key+'&value='+val,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function getCallRec(id)
{
doAjax("dialer/searchrecordings","getCallRec=1&calllog="+id,'recspan_'+id,'rec_ajax','singlefail','GET');
}
</script>
<br/>
<div style='clear:both'></div>
<div style='overflow:auto'>
<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'>
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Recording</th>
</tr>
</thead>
<?php echo $outstr; ?>
</table>
</div>
</div>