<?php

ini_set('display_errors', 1);
define("ADMIN", true);
require_once("../../../common/lib.php");
require_once("../../../common/define.php");
define("TITLE_ELEMENT", 'doc_achat');
if(!isset($_SESSION['user'])){
    header("Location: /admin/login.php");
    exit();
}
require_once("../../includes/fn_module.php"); ?>
<!DOCTYPE html>
<head>
    <?php include("../../includes/inc_header_common.php"); ?>

</head>
<body>
    <div id="wrapper">
        <?php include("../../includes/inc_top.php"); ?>
        <div id="page-wrapper">
            <div class="page-header">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-8">
                            <h1><i class="fa fa-balance-scale"></i> Balance des comptes</h1>
                        </div>
                    </div>
                </div>
            </div>
            <div class="container-fluid">
                <div class="alert-container">
                    <div class="alert alert-success alert-dismissable"></div>
                    <div class="alert alert-warning alert-dismissable"></div>
                    <div class="alert alert-danger alert-dismissable"></div>
                </div>
                <div class="row" style="width:50%;float:left;">				
				
	<form method="GET" action="rapport.php">				

	<div class="panel panel-default">
		<div class="panel-body">
			   <label class="col-lg-3 control-label text-right">Année exercice &nbsp;<span class="red">*</span></label>
			   <div class="col-lg-6">
				  <div class=" form-inline">
					 <select id="annee" name="annee" class="form-control">					

						<option value="">Tous</option>	
						<?php
						for ($x = 2018; $x <= date("Y"); $x++) {
						  echo "<option value='$x' selected >$x </option>";
						}
						?>	
						
											

					 </select>
				  </div>
			   </div>
		 </div>
	</div>

	<div class="panel panel-default">
		<div class="panel-body">
			   <label class="col-lg-3 control-label text-right">Class &nbsp;<span class="red">*</span></label>
			   <div class="col-lg-6">
				  <div class=" form-inline">
					 <select id="class" name="class" class="form-control">					
						<option value="">Tous</option>						
						<?php
						if($db !== false){
							$query = "SELECT * FROM `pm_classe_compte` order by id ASC";
							$result = @$db->query($query);
                            if($result !== false){
								foreach($result as $row){
									echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
								}	
							}	
							
						} ?>
					 </select>
				  </div>
			   </div>
		 </div>
	</div> 	
	
	<div class="panel panel-default">
		<div class="panel-body">
			<label class="col-lg-2 control-label  text-right">Du&nbsp;<span class="red">*</span></label>
			<div class="col-lg-6">
				<div class=" form-inline">  
                                                                          
					<div class="input-group">
						<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
						<input type="text" class="form-control datepicker" name="date_from" value="01-01-<? echo date("Y"); ?>" >
					</div>
				</div>
			</div>
		 </div>
	</div> 

	<div class="panel panel-default">
		<div class="panel-body">
			<label class="col-lg-2 control-label  text-right">Au&nbsp;<span class="red">*</span></label>
			<div class="col-lg-6">
				<div class=" form-inline">  
                                                                          
					<div class="input-group">
						<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
						<input type="text" class="form-control datepicker" name="date_to" value="31-12-<? echo date("Y"); ?>" >
					</div>
				</div>
			</div>
		 </div>
	</div> 



	
	
	




	<div class="panel panel-default">
		<div class="panel-body">
			   <label class="col-lg-4 control-label text-right">Etat du réglement &nbsp;<span class="red">*</span></label>
			   <div class="col-lg-6">
				  <div class=" form-inline">
					 <select id="etat" name="etat" class="form-control">					
						<option value="">Tous</option>						
						<option value="non_paye">Non payé</option>						
						<option value="paye">Payé</option>						
						
					 </select>
				  </div>
			   </div>
		 </div>
	</div> 
	





	
	
	<div class="panel panel-default">
		<div class="panel-body">
			   <label class="col-lg-4 control-label " ></label>
			   <div class="col-lg-6">
				  <div class=" form-inline">
						<button type="submit" class="btn btn-default mt15" data-toggle="tooltip" data-placement="bottom" title="Rchercher">
							<i class="fa fa-search"></i><span class="hidden-sm hidden-xs"> Rchercher</span>
						</button>
				  </div>
			   </div>
		 </div>
	</div> 


</form>	
									
                    <?php
                    if($db !== false){
                        
                    } ?>
					
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<?php
$_SESSION['msg_error'] = "";
$_SESSION['msg_success'] = "";
$_SESSION['msg_notice'] = ""; ?>
