<?php 



session_start();
require_once("../../includes/display_internal_user_dryout.inc.php");
require_once("../../includes/functions_internal_user_dryout.inc.php");
$obj = new data();
$connect = $obj->funConnect();
$display = new display();
$display->logout_iu();
$pagename = basename($_SERVER['PHP_SELF']);
if (isset($_REQUEST['selBType']) && $_REQUEST['selBType']!="")
{
	$selBType = $_REQUEST['selBType'];
}
else if(isset($_SESSION['selBType']))
{
	$selBType = $_SESSION['selBType'];
}
else
{
	$selBType = '';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php $display->title("Payment Actioned Report"); ?></title>
<?php $display->favicon(); ?>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<?php $display->css(); ?>
<!-- <link href="../../css/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" /> -->
<link href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<link href="https://cdn.datatables.net/buttons/2.2.2/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css" />
<!-- <link href="https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css" rel="stylesheet" /> -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="../js/html5shiv.js"></script>
  <script src="../js/respond.min.js"></script>
<![endif]-->
</head>
    <body class="skin-blue fixed">
        <!-- header logo: style can be found in header.less -->
        <?php $display->header_tag(); ?>
		<div class="wrapper row-offcanvas row-offcanvas-left">
            <?php $display->leftmenu(7,2); ?>
			<aside class="right-side">                
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        <i class="fa fa-leaf"></i>&nbsp;Reports&nbsp;&nbsp;&nbsp;&nbsp;<small><div class="headline text-center" id="time" style="color:#000; font-weight:bold; font-size:12px;"></div></small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="../"><i class="fa fa-home"></i> Home</a></li>
                        <li>Reports</li>
						<li>Operations</li>
						<li class="active">Payment Actioned Report </li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content download_pdf">
				<!--   content put here..................-->
				<div class="box box-primary">
				<h3 style=" text-align:center;">Payment Actioned Report </h3>
				<div style="height:10px;"></div>
					<div class="row invoice-info" style="margin-left:5px;margin-right:5px;">
						<div class="col-sm-2 invoice-col">
							Date From <span style="font-size:10px; font-style:italic;">  (Payment Date)</span>
							<address>
								<input type="text" name="txtFrom_Date" id="txtFrom_Date" class="form-control" autocomplete="off" placeholder="dd-mm-yyyy"> 
							</address>
						</div>
				
						<div class="col-sm-2 invoice-col">
							Date To <span style="font-size:10px; font-style:italic;">  (Payment Date)</span>
							<address>
								<input type="text" name="txtTo_Date" id="txtTo_Date" class="form-control" autocomplete="off" placeholder="dd-mm-yyyy"> 
							</address>
						</div>
						
                        <div class="col-xs-2">
                             Business Type
                             <select name="selBType" id="selBType" class="form-control" >
                               <?php echo $obj->getBusinessTypeList1($selBType);?>
                              </select>                  
                        </div><!-- /.col -->
						<div class="col-sm-2 invoice-col">
							&nbsp;
							<address>
								<button type="button" class="btn btn-primary btn-flat" onClick="getData();" >Search</button>
							</address>
						</div><!-- /.col -->
						<div class="col-sm-2 invoice-col">
							&nbsp;
							<address>
								&nbsp;
							</address>
						</div><!-- /.col -->
					</div>
					<div align="right">	
                        <!-- <a href="#" title="Pdf" onClick="getExcel();"><button class="btn btn-default" style="margin-right: 5px;" type="button"><i class="fa fa-download"></i>Generate Excel</button></a> -->
                        <a href="#" title="Pdf" onClick="javascript:exportPDF();"><button class="btn btn-default" style="margin-right: 5px;" type="button"><i class="fa fa-download"></i>Generate PDF</button></a>
					</div>
					<form name="frm1" id="frm1" enctype="multipart/form-data" action="<?php echo $pagename;?>">
						<div id="DivOwner" class="box-body table-responsive">
							<table id="df_list"  class="table table-bordered table-striped " >
								<thead>
								<tr>
								<th align="left" valign="top" width="9%">Sr. No</th>
			
								<th align="left" valign="top" width="9%">Voyage No.</th>
								<th align="left" valign="top" width="9%">Vessel  Name</th>
								
								<th align="left" valign="top" width="9%">Vendor Name</th>
								<th align="left" valign="top" width="9%">Payment Type</th>
								<th align="left" valign="top" width="9%">Payment Date</th>
								<th align="left" valign="top" width="9%">Amount</th>   	
                                   
								</tr>
								</thead>
								
								  

									
							</table>
						</div>
					</form>
				</div>
				<!--   content ends here..................-->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
			
        </div><!-- ./wrapper -->
<?php $display->footer(); ?>
<?php $display->js(); ?>
<!-- <script src="../../js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script> -->

<!-- ldj commented -->

<!-- 
	<script src="../../js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
	<script src="../../js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script> -->
	
	
	<!-- ldj commented -->
	<script>
jQuery.fn.load = function (callback) {
    var el = $(this);

    el.on('load', callback);

    return el;
};
		</script>
	<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js" type="text/javascript"></script>
	
	<!-- new scripts -->
	<script src="https://cdn.datatables.net/buttons/2.2.2/js/dataTables.buttons.min.js" type="text/javascript"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js" type="text/javascript"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js" type="text/javascript"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js" type="text/javascript"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js" type="text/javascript"></script>
	<script src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.html5.min.js" type="text/javascript"></script>
	<script src="https://cdn.datatables.net/buttons/2.2.2/js/buttons.print.min.js" type="text/javascript"></script>

<!-- new scripts -->



<script src="../../js/timer.js" type="text/javascript"></script>
<link href="../../css/jquery.alerts.css" rel="stylesheet" type="text/css" />
<link href="../../css/datepicker/datepicker.css" rel="stylesheet" type="text/css" />
<script src="../../js/bootstrap-datepicker.js" type="text/javascript"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.3/jspdf.min.js" type="text/javascript"></script> -->
<!-- <script src="https://rawgit.com/eKoopmans/html2pdf/master/dist/html2pdf.bundle.min.js" type="text/javascript"></script> -->






<!-- <script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
<script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
        
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>  -->



<script language="JavaScript" type="text/javascript" src="../../js/jquery.alerts.js"></script>



<script type="text/javascript">
$(document).ready(function(){
	
	$('#txtFrom_Date,#txtTo_Date').datepicker({
		format: 'dd-mm-yyyy',
		autoclose: true
	});
	



	// $('#df_list').DataTable( {
    //     dom: 'Bfrtip',
    //     buttons: [
    //         'copy', 'csv', 'excel', 'pdf', 'print'
    //     ]
    // } );

	$('#df_list').removeClass('table table-bordered table-striped');
	$('#df_list').addClass('display nowrap');
	$('#df_list').DataTable( {
		paging:true
	});


	
});

function getData()
{


	
	    // var table = $('#df_list').dataTable();
	 
	if($("#txtFrom_Date").val() != "" && $("#txtTo_Date").val() != "")
	{
		$('#DivOwner').html('<span style="text-align:center;display:block;"><img src="../../img/loading.gif" /></span>');
		var selBType = $('#selBType').val();

		$('#selBType').on('change', function(){
			selBType=$(this).val();
		});
	
		
		$.post("options.php?id=105",{txtFrom_Date:""+$("#txtFrom_Date").val()+"",txtTo_Date:""+$("#txtTo_Date").val()+"",selBType:selBType}, function(html) {
			$('#DivOwner').empty();
			$('#DivOwner').append(html);
			// $("#df_list").dataTable();

			$('#df_list').DataTable( {
				paging: true, 
       
       			 dom: 'Bfrtip',
				buttons: [
					{
						extend: 'excel',
						messageTop: "From Date :  "+$('#txtFrom_Date').val()+" -------- To Date : "+$('#txtTo_Date').val(),
					},
					{
						extend: 'pdf',
						messageTop: "From Date :  "+$('#txtFrom_Date').val()+" -------- To Date : "+$('#txtTo_Date').val(),
					},
						]
    		} );



	
		});
	}else{
		jAlert('Please select Date From & Date To', 'Alert Dialog');
	}
}

// function getPdf()
// {
// 	var chk;
// 	if($("#checkbox").attr('checked'))
// 	{
// 		chk = 1;
// 	}else{
// 		chk = 0;
// 	}
// 	location.href='allPdf.php?id=34&txtFrom_Date='+$("#txtFrom_Date").val()+'&txtTo_Date='+$("#txtTo_Date").val()+'&chk='+chk+'&selBType='+$("#selBType").val();
// }

// function getExcel()
// {
// 	var chk;
// 	if($("#checkbox").attr('checked'))
// 	{chk = 1;}else{chk = 0;}
// 	location.href='allExcel.php?id=14&txtFrom_Date='+$("#txtFrom_Date").val()+'&txtTo_Date='+$("#txtTo_Date").val()+'&chk='+chk+'&selBType='+$("#selBType").val();
// }

var specialElementHandlers = {
    // element with id of "bypass" - jQuery style selector
    '.no-export': function (element, renderer) {
        // true = "handled elsewhere, bypass text extraction"
        return true;
    }
};

// function exportPDF() {
//     var element = document.querySelector('.download_pdf');
// html2pdf(element);
// }

</script>
		
</body>
</html>