campaignwise.blade.php 4 KB
	<style>#logtable.td{vertical-align:top;padding:20px;}#logtable.tr{height:28px;overflow-y:hidden;}
/*#logtable.table thead tr{
	display:block;
}

#logtable.table tbody{
	display:block;
	height:500px;
	overflow:auto;//set tbody to auto
	}*/
</style>

<div class=innerAll>
	<h4 style="float:left;width:50%;margin:10px 0;">Campaign Report </small></h4>
	<div style="float:right;width:50%">
	@if(Auth::user()->username=='admin')
		<button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button>  
	@endif
	</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); ?>' /> 
		<select id="modtime" style="border:1px solid #efefef;">
			<?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); ?>'/>
		<select id="modtimeto" style="border:1px solid #efefef;">
			<?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;
		<input type="button" value='Submit' class="btn btn-xs btn-info">
	</div>

	<div style="clear:both"></div>
	<hr style="margin:5px;">

	<div style="overflow: auto; margin-top: 10px;">
		<table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px; margin:0; border:1px solid #BBB;'>
		<thead>
        <th>Campaign</th>
        <th>Dials</th>
        <th>Connects</th>
		<th>Contacts</th>
        <th>Callbacks</th>
        <th>Sales</th>
        <th>No Answer</th>
        <th>Busy</th>
        <th>Sit Tones</th>
        <th>Abandoned</th>
        <th>Connect %</th>
        <th>No Answer %</th>
        <th>Busy %</th>
        <th>Sit Tones %</th>
        <th>Abandoned %</th>
        </thead>

        <tbody>
        <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        </tr>
        </tbody>
		</table>
	</div>

	<div id=dialoglog></div>
</div>

<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"); 
				} 
			}
		});
	}
	waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logTableData') },"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()
{
	return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+$("#campaign").val();
}
function statusLogReloadFun(sortby)
{
	var sortstr='';if(sortby!="")sortstr="&sort="+sortby
	var searchStr = dataString();
	doAjax('dialer/campaignwise?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');
}
function dlAgentlogXls()
{
	var searchStr = dataString();
	//window.open('dialer/agenttime?dllogxls=1&'+searchStr);
	return false;
}
</script>