<!DOCTYPE html>
<html lang="en">
<head>
	<!-- Main navbar -->
		<?php $this->load->view('admin/common_header'); ?>
	<!-- /main navbar -->
	

	<!-- date picker JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/interactions.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/widgets.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/effects.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/extensions/mousewheel.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/libraries/jquery_ui/globalize/globalize.js"></script>

	
	<!-- Bootsrap form validation JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/formValidation.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/bootstrap.js"></script>
	
	<!-- select box theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/selects/bootstrap_select.min.js"></script>

	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/styling/uniform.min.js"></script>
	<!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/pnotify.min.js"></script>-->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/selects/bootstrap_multiselect.js"></script>
	<!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/ui/moment/moment.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/pickers/daterangepicker.js"></script>-->

	<!-- Theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/app.js"></script>
	<!-- /theme JS files -->
	
	<!-- bootsrap switch checkbox JS files 
    <script src="<?php echo base_url();?>/assets/boots/js/bootstrap-switch.js"></script>-->

    <!-- notify JS files -->
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/jgrowl.min.js"></script>
	
	<!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/form_multiselect.js"></script>
	 /theme JS files -->
	
	<style>    
		.btn-group {
			display: block;
		}
	    div.checker {
	    	top: 18px !important;
	    }
	    .multiselect-container {
	    	width:100% !important;
	    }
	    div.form-group  div.btn-group ul.multiselect-container.dropdown-menu {
	    	padding: 0px !important;
	    }
	</style>
</head>

<body class="navbar-top-md-md">
	<!-- <div class="pre_loader"></div> -->
	<!-- Fixed navbars wrapper -->
	<div class="navbar-fixed-top">

		<!-- Main navbar -->
		<?php $this->load->view('admin/mainnav'); ?>
		<!-- /main navbar -->


		<!-- Second navbar -->
		<?php $this->load->view('admin/secondnav'); ?>
		<!-- /second navbar -->

	</div>
	<!-- /fixed navbars wrapper -->


	<!-- Page header -->
	<?php $this->load->view('admin/'.$module_name.'_header'); ?>
	<!-- /page header -->


	<!-- Page container -->
	<div class="page-container">

		<!-- Page content -->
		<div class="page-content">

			<!-- Main content -->
			<div class="content-wrapper">
			<div class="col-lg-12">
				<div class="col-lg-12">
					<!-- Horizontal form -->
					<div class="panel panel-flat">
						<div class="panel-heading">
							<h5 class="panel-title"><?php echo $page_title; ?></h5>
							<div class="heading-elements">
								<ul class="icons-list">
									<!-- <li><a href="<?php echo base_url();?>admin/users/add" class="glyphicon-plus"></a></li> -->
			                		<li><a data-action="collapse"></a></li>
			                		<li><a data-action="reload"></a></li>
			                		<li><a data-action="close"></a></li>
			                	</ul>
		                	</div>
						</div>
						<?php $currency_info = defaultcurrency();?>
	                	
						<div class="panel-body">
							<form class="form-horizontal export validateDontSubmit" name="frmexport" id="frmexport" action="<?php echo $action;?>" method="post">

								<!-- <div class="form-group ">
									<label class="control-label col-lg-2 text-semibold"><?php echo $this->lang->line('lbl_select_user_type'); ?> </label>
									<div class="col-lg-4">
										<select name="user_type" class="form-control bootstrap-select" id="user-type">
		                                    <option value=""><?php echo ucfirst($this->lang->line('lbl_select_user_type'));?></option>
		                                    <option value="all"><?php echo ucfirst($this->lang->line('lbl_all_user'));?></option>
		                                    <option value="1"><?php echo ucfirst($this->lang->line('lbl_active_user'));?></option>
		                                    <option value="0"><?php echo ucfirst($this->lang->line('lbl_suspend_user'));?></option>
										</select>
									</div>
								</div>

								<div class="form-group ">
									<label class="control-label col-lg-2 text-semibold"><?php echo $this->lang->line('lbl_select_users'); ?> </label>
									<div class="col-lg-4">
										<select name="user_list[]" class="form-control multiselect-full-featured1" multiple="multiple" id="user_list">
										</select>
									</div>
								</div> -->
								
								<div class="form-group ">
									<label class="control-label col-lg-2 text-semibold"><?php echo $this->lang->line('lbl_payment_gateway'); ?> </label>
									<div class="col-lg-4">
										<select name="payment_id[]" id="payment_name" class="form-control input-group multiselect-full-featured" multiple="multiple">
		                                    <?php foreach ($payment_list as $pay_list) {?>
		                                    	<option value="<?php echo $pay_list->payment_id; ?>"><?php echo ucfirst($pay_list->payment_name);?></option>
											<?php } ?>
										</select>
									</div>
								</div>

								<div class="form-group ">
									<label class="control-label col-lg-2 text-semibold"><?php echo $this->lang->line('lbl_date_range'); ?> </label>
									<div class="col-lg-2">
										<label class="control-label text-semibold"><?php echo $this->lang->line('lbl_date_from'); ?> </label>
										<div class="input-group">
											<span class="input-group-addon"><i class="icon-calendar22"></i></span>
											<input type="text" class="form-control start_date" placeholder="<?php echo $this->lang->line('place_start_date'); ?>" name="start_date" value="">
										</div>
									</div>
									<div class="col-lg-2">
										<label class="control-label text-semibold"><?php echo $this->lang->line('lbl_date_to'); ?> </label>
										<div class="input-group">
											<span class="input-group-addon"><i class="icon-calendar22"></i></span>
											<input type="text" class="form-control end_date" placeholder="<?php echo $this->lang->line('place_end_date'); ?>" name="end_date" value="">
										</div>
									</div>
								</div>

								<!-- <div class="form-group ">
									<label class="control-label col-lg-2 text-semibold"><?php echo $this->lang->line('lbl_amount_range'); ?> </label>
									<div class="col-lg-2">
										<label class="control-label text-semibold"><?php echo $this->lang->line('lbl_amount_min'); ?> </label>
										<div class="input-group">
											<span class="input-group-addon" style="font-size: 18px;"><strong><?php echo $currency_info->currency_symbol;?></strong></span>
											<input type="text" class="form-control" placeholder="<?php echo $this->lang->line('place_min_amount'); ?>" name="min_amount" value="">
											<span class="input-group-addon"><?php echo strtoupper($currency_info->currency_unit);?></span>
										</div>
									</div>
									<div class="col-lg-2">
										<label class="control-label text-semibold"><?php echo $this->lang->line('lbl_amount_max'); ?> </label>
										<div class="input-group">
											<span class="input-group-addon" style="font-size: 18px;"><strong><?php echo $currency_info->currency_symbol;?></strong></span>
											<input type="text" class="form-control" placeholder="<?php echo $this->lang->line('place_max_amount'); ?>" name="max_amount" value="">
											<span class="input-group-addon"><?php echo strtoupper($currency_info->currency_unit);?></span>
										</div>
									</div>
								</div> -->
								
								<div class="text-right col-lg-6">
									<input name="button" value="<?php echo $this->lang->line('lbl_submit'); ?>" type="submit" class="btn btn-primary"/>
								</div>

								
							</form>
						</div>
					</div>
					<!-- /horizotal form -->
				</div>
			</div>
			

			</div>
			<!-- /main content -->

		</div>
		<!-- /page content -->
		

		<!-- Footer -->
		<div class="footer text-muted">
			<?php echo site_footer();?>
		</div>
		<!-- /footer -->

	</div>
	<!-- /page container -->

	<script type="text/javascript">
		jQuery.noConflict();
		(function( $ ) {
		$(function() {

			$('.multiselect-full-featured').multiselect({
		        includeSelectAllOption: true,
		        enableFiltering: true,
		        enableCaseInsensitiveFiltering: true,
		        templates: {
		            filter: '<li class="multiselect-item multiselect-filter"><i class="icon-search4"></i> <input class="form-control" type="text"></li>'
		        },
		        onSelectAll: function() {
		            $.uniform.update();
		        }
		    });

		    $('.multiselect-full-featured1').multiselect({
		    	
		        includeSelectAllOption: true,
		        enableFiltering: true,
		        enableCaseInsensitiveFiltering: true,
		        templates: {
		            filter: '<li class="multiselect-item multiselect-filter"><i class="icon-search4"></i> <input class="form-control" type="text"></li>'
		        },
		        onSelectAll: function() {
		            $.uniform.update();
		        }
		    });

		    $(".styled, .multiselect-container input").uniform({ radioClass: 'choice'});

			$(document).ready(function() {

				$('.bootstrap-select').selectpicker();

				$.jGrowl.defaults.closer = false;

				<?php if(isset($form_err_data)) { ?>
					$.jGrowl('<?php echo trim($form_err_data);?>', {
			            header: '<?php echo $this->lang->line("error");?>',
			            theme: 'bg-danger'
			        });
				<?php } ?>


				<?php if($this->session->flashdata('error_message')) { ?>
					$.jGrowl("<?php echo $this->session->flashdata('error_message');?>", {
			            header: '<?php echo $this->lang->line("error");?>',
			            theme: 'bg-danger'
			        });
	            <?php } ?>
	                    
	            <?php if($this->session->flashdata('success_message')) { ?>
	                $.jGrowl("<?php echo $this->session->flashdata('success_message');?>", {
			            header: '<?php echo $this->lang->line("success");?>',
			            theme: 'bg-success'
			        });
	            <?php } ?>

	            $(".end_date").datepicker({
	            	format: 'mm-dd-yyyy',
	            	maxDate: 0
	            }).on('change', function(e) {
	            	$('.export').formValidation('revalidateField','end_date');
	            })

	            $(".start_date").datepicker({
	            	format: 'mm-dd-yyyy',
	            	maxDate: 0
	            }).on('change', function(e) {
	            	$('.export').formValidation('revalidateField','start_date');
	            })
	            

			});
		    // $('[name="page_content"]').ckeditor();
		 	$('#icon-bck').on('click',function() {
				window.history.back();
			});


			// $('ul.multiselect-container').find('.checker').children().addClass('checked');
			$('.exportbtn').on('click', function() {
				// document.forms["frmexport"].submit();
				$('#frmexport').submit();
				alert('test');
			});

	    	$('.export').formValidation({
		    	framework: 'bootstrap',
		    	excluded: [':disabled'],
		        icon: {
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        row: {
				    valid: 'has-success1',
				    invalid: 'has-error'
				},
		        fields: {
		        	
		        	'payment_name[]': {
		        		message: '<?php echo $this->lang->line("reports_payment_required"); ?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("reports_payment_required"); ?>'
		                    }
		                }
		        	},
		        	start_date: {
		        		message: '<?php echo $this->lang->line("reports_from_date_required"); ?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("reports_from_date_required"); ?>'
		                    },
		                    date: {
	                            format: 'MM/DD/YYYY',
	                            max: 'end_date',
	                            message: 'The start date is not a valid'
	                        }
		                }
		        	},
		        	end_date: {
		        		message: '<?php echo $this->lang->line("reports_to_date_required"); ?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo $this->lang->line("reports_to_date_required"); ?>'
		                    },
		                    date: {
	                            format: 'MM/DD/YYYY',
	                            min: 'start_date',
	                            message: 'The end date is not a valid'
	                        }
		                }
		        	}
		        }
		    })
				

		});
		})(jQuery);
	
	</script>

</body>
</html>
