 <div id="container_Reportpengantar" style="height:100%; margin:0px; padding:0px;overflow:'hidden'; border: 0px solid #cd0a0a">
	<div class="pane-header ui-state-active" id="Reportpengantar_bar" >   
			<label style="margin-right:10px;">SOURCE</label>
				<select id="cb_datadok_bwpengantar" style="margin-right:10px;width:80px" >
				  <option value="all" selected>ALL</option>
				  <option value="aw">AW</option>
				  <option value="wh">WH</option>
			</select>
			<label style="margin-right:10px;">PERIODE:</label>
			
			<select id="periode_pengantar" name="periode_pengantar">
			<?php
				$year = date("Y");
				$month = date("m");
				
				$bulan = array('1'=> 'Januari'
								, '2' => 'Febuari'
								, '3' => 'Maret'
								, '4' => 'April'
								, '5' => 'Mei'
								, '6' => 'Juni'
								, '7' => 'Juli'
								, '8' => 'Agustus'
								, '9' => 'September'
								, '10' => 'Oktober'
								, '11' => 'November'
								, '12' => 'Desember'
							);
							
				for($i=$year;$i>=($year-3);$i--){
					if($year != $i) {
						$month = 12;
					}
					
					for($x=$month;$x>=1;$x--){
						echo "<option value='".$i."_".$x."'>".$bulan[$x]." ".$i."</option>";
					}
				}
			?>
			</select>
			
			 <button id="btnPrintReportpengantarPDF"  >PRINT PDF</button> 
			 <button id="btnPrintReportpengantarXLX"  >PRINT XLS</button> 
			 <button id="btnPrintReportpengantarXLXS" >PRINT XLSX</button>  
	</div>
</div> 

<script> 
  $(document).ready(function(){ 
		
	$("#btnPrintReportpengantarPDF").button();
	$("#btnPrintReportpengantarXLX").button(); 
	$("#btnPrintReportpengantarXLXS").button(); 
 
	function reportPrint(format){
 		var source	=	$("#cb_datadok_bwpengantar").val();
		var periode_pengantar	=	$("#periode_pengantar").val();
  	
		var dialog = jQuery('<div />')
					 .html('<div class="ui-layout-content ui-widget-content-panel">\
									<p >Are u want to print report?</p>\
								   </div>\
									<div class="pane-footer ui-state-default"></div>\
									<form hidden id="frmPrintReportpengantar" method="POST" action="<?php echo base_url().'reports/ct_monthlyreport/print_pengantar'; ?>"/>');  
		dialog.dialog({
				modal:true,
				width : 300,
				height : 150,
				title :'Report Pengantar',
				buttons: { 
					"CLOSE": function(){
						dialog.dialog("close");  
					},
					"PRINT": function() { 
					
 					$("#frmPrintReportpengantar").append($("<input>").attr({"value":periode_pengantar , "name":'periode_pengantar'})); 
					$("#frmPrintReportpengantar").append($("<input>").attr({"value":source , "name":'source'}));
					$("#frmPrintReportpengantar").append($("<input>").attr({"value":format , "name":'format'}));  
					$("#frmPrintReportpengantar").submit();  
					
					dialog.dialog("close");  
					}
				},
				close : function(){
					dialog.dialog('destroy').remove(); 
				},
				open: function(){
					$("body").unblock(); 
				}
			}); 
	
	} 

	$("#btnPrintReportpengantarPDF").button().click(function(){	
		reportPrint('pdf');
 	})	
 	$("#btnPrintReportpengantarXLX").button().click(function(){	
		reportPrint('xls');
 	})	
 	$("#btnPrintReportpengantarXLXS").button().click(function(){	
		reportPrint('xlsx');
 	})	
  	
});

</script> 

  