searchform.blade.php 5.14 KB
<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>

<?php
if($param) {
	$clientlist = array_filter($clientlist, function($var) use ($param) { return (strpos(trim($var), $param) !== 0) ? false : true; });
}
?>

<div class=innerAll>

<h4 style="float:left;width:50%;margin:10px 0;">{{ $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;">&nbsp;&nbsp; 
    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>&nbsp;&nbsp;
    <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:{{ $displayAdv }};" id="advance">
        <div style="width: 80%;" class="pull-left">
            Campaign
            <select id="campaignbox" multiple="multiple" style="width:25%" class=select2multi>
                <?php foreach($clientlist as $c)
                    {   $s="";
	                    if($param) {
	                    	$s='selected';
	                    	echo "<option value='$c' $s>$c</option>";
	                    } else {
	                        if(in_array($c, $campaign))$s='selected';
	                        echo "<option value='$c' $s>$c</option>";
	                    }
                    }?>
            </select>
        </div>
        <div style="margin-top: 5px;" class="pull-right">
            <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();
    });
    return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+campaignStr;
}
function statusLogReloadFun(sortby)
{
    var sortstr='';if(sortby!="")sortstr="&sort="+sortby
    var searchStr = dataString();
    doAjax('dialer/{{ $returnblade }}?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function dlAgentlogXls()
{
    var searchStr = dataString();
    window.open('dialer/{{ $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>