299d7b19a8cd08e63e03fcf3a53dbe5b50311dfa.php
6.87 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<style>
#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}
.select2-container-multi{height: 90px; overflow-y: auto;border: 1px solid #efefef;border-radius: 3px !important;}
.select2-container-active{height: 90px; overflow-y: auto;border: 1px solid #5897fb;border-radius: 3px !important;}
.select2-container-multi.select2-container-active.select2-choices{border:none !important; box-shadow: none !important;}
.select2-choices{border:none !important; box-shadow: none !important;}
.select2-drop,.select2-drop-active{border-color: #5897fb;margin-top: -9px;}
</style>
<div class=innerAll>
<h4 style="float:left;width:50%;margin:10px 0;"><?php echo e($reportTitle); ?></h4>
<div style="float:right;width:50%" id="download_btn">
<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button>
</div>
<div style="clear:both"></div>
<hr style="margin-bottom: 5px;">
<div>
Search <input id=filter name="filter" type="text" style="border:1px solid #efefef; padding: 2px 10px;">
Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' />
<select id="modtime" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'>
<?php
foreach (range(0,23) as $hour) {
$selected = ($hour == $logtime) ? "selected" : "";
echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>";
}
?></select>
To <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logdateto); ?>' onchange='statusLogReloadFun("");' />
<select id="modtimeto" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'>
<?php
foreach (range(0,23) as $hour) {
$selected = ($hour == $logtimeto) ? "selected" : "";
echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>";
}
?></select>
<button class="pull-right btn btn-sm btn-default" onclick='$("#advance").toggle();' title='Advance Search'><i class='fa fa-search'></i> Advance Search</button>
<div style="clear:both"></div>
<div style="margin-top: 5px; display:<?php echo e($displayAdv); ?>;" id="advance">
<div style="width: 25%;" class="pull-left">
Campaign<br />
<select id="campaignbox" multiple="multiple" style="width:96%" class=select2multi>
<?php foreach($clientlist as $c)
{ $s="";
if(in_array($c, $campaign))$s='selected';
echo "<option value='$c' $s>$c</option>";
}?>
</select>
</div>
<div style="width: 25%;" class="pull-left">
State<br />
<select id="statebox" multiple="multiple" style="width:96%" class=select2multi>
<?php foreach($statelist as $c)
{ $s="";
if(in_array($c, $state))$s='selected';
echo "<option value='$c' $s>$c</option>";
} ?>
</select>
</div>
<div style="width: 25%;" class="pull-left">
Product<br />
<select id="productbox" multiple="multiple" style="width:96%" class=select2multi>
<?php foreach($productlist as $c)
{ $s="";
if(in_array($c, $product))$s='selected';
echo "<option value='$c' $s>$c</option>";
}?>
</select>
</div>
<div style="width: 25%;" class="pull-left">
Bucket<br />
<select id="bucketbox" multiple="multiple" style="width:96%" class=select2multi>
<?php foreach($bucketlist as $c)
{ $s="";
if(in_array($c, $bucket))$s='selected';
echo "<option value='$c' $s>$c</option>";
} ?>
</select>
</div>
<div style="margin-top: 5px;" class="pull-left">
<button class="pull-right btn btn-sm btn-default" onclick='statusLogReloadFun("");' title='Search'><i class='fa fa-search'></i> Search</button>
</div>
</div>
</div>
<div style="clear:both"></div>
<hr style="margin:5px;">
<script>
$(document).ready(function() {
waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000");
$('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'});
$('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'});
});
function dataString()
{
var campaignStr = '';
$('#campaignbox :selected') .each(function(i, sel){
if(campaignStr != '') campaignStr = campaignStr + '||' + $(sel).val();
else campaignStr = $(sel).val();
});
var stateStr = '';
$('#statebox :selected') .each(function(i, sel){
if(stateStr != '') stateStr = stateStr + '||' + $(sel).val();
else stateStr = $(sel).val();
});
var productStr = '';
$('#productbox :selected') .each(function(i, sel){
if(productStr != '') productStr = productStr + '||' + $(sel).val();
else productStr = $(sel).val();
});
var bucketStr = '';
$('#bucketbox :selected') .each(function(i, sel){
if(bucketStr != '') bucketStr = bucketStr + '||' + $(sel).val();
else bucketStr = $(sel).val();
});
return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+campaignStr+'&state='+stateStr+'&product='+productStr+'&bucket='+bucketStr;
}
function statusLogReloadFun(sortby)
{
var sortstr='';if(sortby!="")sortstr="&sort="+sortby
var searchStr = dataString();
doAjax('dialer/<?php echo e($returnblade); ?>?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function dlAgentlogXls()
{
var searchStr = dataString();
window.open('dialer/<?php echo e($returnblade); ?>?dllogxls=1&'+searchStr);
return false;
}
function breakupXls(report,userId,column)
{
var searchStr = dataString();
window.open('dialer/breakupxls?report='+report+'&userId='+userId+'&column='+column+'&'+searchStr);
return false;
}
function displayMode(mode) {
if(mode == 'percent') {
$(".summation").hide();
$(".percent").show();
}
else {
$(".percent").hide();
$(".summation").show();
}
}
</script>