%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/jalalj2hb/public_html/ftm-admin/
Upload File :
Create Path :
Current File : /home/jalalj2hb/public_html/ftm-admin/ecoles.php

<!doctype html>
<!--[if lte IE 9]> <html class="lte-ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->

<head>
<?php 

/* 
    <div style="width: 100%;border: 2px dashed grey;margin-top: 2px;"></div>
*/
$ecole_id="";
include("include/head.php");

if($_SESSION['user']->privilege!="admin"){ 
red_vers("dashboard.php");
}


$add ="";
$add_abd="";
$page_name="ecoles";

$ecole_id=getValue("ecole_id");

if($ecole_id!=""){
$sql_infi_c="SELECT nom_ecole FROM `ecoles` WHERE id_ecole=$ecole_id limit 1";
$clients=$db->executeQuery($sql_infi_c);
$nom_ecole=$clients[0]->nom_ecole;
}
$etat=getValue("etat");


$ajouter_bool=false;


$id_ecole= getValue("id_ecole");


if(isSubmit('ajouterAbn')){
	


  
    $nom_ecole= getValue("nom_ecole");
    $N_agr= getValue("N_agr");
	$ville_id= getValue("ville_id");
	$adresse= getValue("adresse");
	$fix= getValue("fix");
	$tel= getValue("tel");
	$email= getValue("email");
	$password= getValue("password");
	$propriétaire= getValue("propriétaire");
     $target_dir = "assets/img/";
$target_file = $target_dir . basename($_FILES["logo"]["name"]);
move_uploaded_file($_FILES["logo"]["tmp_name"], $target_file);
     $logo=$target_file;
	 $date_creation=getDateFormat(date("Y-m-d"));
	// die();

	$ch=array(
		'id_ecole',
		'nom_ecole',
		'N_agr',
		'ville_id',
		'adresse' ,
		'fix',
		'tel',
		'password',
		'date_creation',
		'propriétaire',
		'logo',
		'email');
		$val=array(NULL,
		$nom_ecole,
		$N_agr,
		$ville_id,
		$adresse ,
		$fix ,
		$tel,
		$password,
		$date_creation,
		$propriétaire,
		$logo,
		$email);
	
	echo $id_ecole = $db->Ajouter_('ecoles',$ch,$val);
	// echo $date_creation;
	// die();
	$ajouter_bool=true;



  
    $date_debut= getDateFormat(getValue("date_debut"));
	$date_fin= getDateFormat(getValue("date_fin"));	
    $prix= getValue("prix");
	$ch=array('id_abonnement','ecole_id','date_debut','date_fin' ,'prix','date_creation');
	$val=array(NULL,$id_ecole,$date_debut,$date_fin , $prix,$date_creation);
	
	 $db->Ajouter_('abonnement',$ch,$val);
	 $ajouter_bool=true;


	 
 }


if(isSubmit('renouvelerAbn')){
	
	$id_ecole= getValue("id_ecole");
    $date_debut= getDateFormat(getValue("date_debut_m"));
	$date_fin= getDateFormat(getValue("date_fin_m"));	
    $prix= getValue("prix_m");	
	$date_creation=date("Y-m-d");
	$ch=array('id_abonnement','ecole_id','date_debut','date_fin' ,'prix','date_creation');
	$val=array(NULL,$id_ecole,$date_debut,$date_fin , $prix,$date_creation);
	 $db->Ajouter_('abonnement',$ch,$val);
	 


	 
 } 
 
 
 if(isSubmit('modifierAbn')){
	$id_ecole=getValue("id_ecole_m");

	
    $nom_ecole= getValue("nom_ecole");
	$ville_id= getValue("ville_id");
	$adresse= getValue("adresse");
	$fix= getValue("fix");
	$tel= getValue("tel");
	$email= getValue("email");
  
	$ch=array('id_ecole','nom_ecole','ville_id','adresse' ,'fix','tel','email');
	$val=array($id_ecole,$nom_ecole,$ville_id,$adresse ,$fix , $tel,$email);
	
	
	 $db->Update_('ecoles',$ch,$val);
	 $ajouter_bool=true;
	
	


 } 
 
if(isSubmit('supprimerAbn')){

$id_ecole=getValue("id_ecole");
$id_ecole_supp=getValue("id_ecole_supp");
$sql="delete from ecoles where id_ecole='$id_ecole_supp'";
$supp_abn=$db->executeQuery($sql);
$ajouter_bool=true;



}

 ?>

    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Remove Tap Highlight on Windows Phone IE -->
    <meta name="msapplication-tap-highlight" content="no"/>

       <link rel="icon" type="image/png" href="assets/img/favicon-32x32.png" sizes="32x32">

    <title>FTM</title>


    <!-- uikit -->
    <link rel="stylesheet" href="bower_components/uikit/css/uikit.almost-flat.min.css" media="all">

    <!-- flag icons -->
    <link rel="stylesheet" href="assets/icons/flags/flags.min.css" media="all">

    <!-- style switcher -->
    <link rel="stylesheet" href="assets/css/style_switcher.min.css" media="all">
    
    <!-- altair admin -->
    <link rel="stylesheet" href="assets/css/main.min.css" media="all">

    <!-- themes -->
    <link rel="stylesheet" href="assets/css/themes/themes_combined.min.css" media="all">
	<link rel="stylesheet" href="assets/css/select2.css" media="all">
    <!-- matchMedia polyfill for testing media queries in JS -->
    <!--[if lte IE 9]>
        <script type="text/javascript" src="bower_components/matchMedia/matchMedia.js"></script>
        <script type="text/javascript" src="bower_components/matchMedia/matchMedia.addListener.js"></script>
        <link rel="stylesheet" href="assets/css/ie.css" media="all">
    <![endif]-->

</head>
<body class=" sidebar_main_open sidebar_main_swipe">
    <!-- main header -->
	<?php include("include/header.php");?>
    <!-- main sidebar -->
	<?php include("include/sidebar.php");?>
<div class="uk-width-medium-1-1">
 <button class="md-btn message_success" data-message="<a href='#' class='notify-action'>Fermer</a> Mise à  jour réussi avec succès" data-status="success" data-pos="bottom-center">Success</button>
</div>
    <div id="page_content">
        <div id="page_content_inner">

            <div class="md-card uk-margin-medium-bottom">
                <div class="md-card-content">
                    <div class="uk-overflow-container"> 
						<h3 class="title_p"><a href="ecoles.php"><i class="material-icons">&#xE853;</i>  Auto-écoles</a></h3>
						
				<div class="uk-grid" data-uk-grid-margin>
                <div class="uk-width-medium-1-1">
                    <div class="md-card">
                        <div class="md-card-content">
                          <form method="GET">
                            <div class="uk-grid">
							<div class="uk-width-large-2-5 uk-width-1-1">
                               <div class="uk-input-group">
							    <label for="uk_dp_1">Ecole</label>
								<input required type="text" name="ecole_id"  class="select2_rech" placeholder="Nom  " id="nom_ecole_rech" value="<?php if($ecole_id!=""){echo $ecole_id;}?>" />
								<input type="hidden" name="etat" value="<?php echo $etat?>" />
								</div>
							</div>
                                <div class="uk-width-large-1-5 uk-width-1-1">
                                  
                                </div>
								  <div class="uk-width-large-1-5 uk-width-1-1">
                                  
                                </div>
								<div class="uk-width-large-1-5 uk-width-1-1">
								<div class="uk-input-group">
								<label for="uk_dp_1">&nbsp;</label>
								<button  type="submit"class="md-btn md-btn-danger md-btn-wave-light waves-effect waves-button waves-light" name="rechercher" >Rechercher</button>
								   </div>
                                </div>
                            </div>
							</form>
                        </div>
                    </div>
                </div>
				</div>
				
                <table class="uk-table" id="ecole">
				<thead>
				<tr>
				<th class="uk-text-nowrap">N°</th>
				<th class="uk-text-nowrap">Ecole</th>
				<th class="uk-text-nowrap">numero d'agrement</th>
				<th class="uk-text-nowrap">Abonnement </th>
				<th class="uk-text-nowrap uk-text-right">Ville</th>
				<th class="uk-text-nowrap uk-text-right">Tel</th>
				<th class="uk-text-nowrap uk-text-right">Fixe</th>
				<th class="uk-text-nowrap uk-text-right">Email</th>
				<th class="uk-text-nowrap uk-text-right">Actions</th>
				</tr>
				</thead>
                <tbody>
<?php
				$sql="SELECT * FROM ecoles,villes WHERE id_ville=ville_id and ecoles.privilege !='admin' ";
				
				if($ecole_id!=""){
				$sql.=" and id_ecole='$ecole_id'";
				}
				
			
				
				$sql.=" ORDER BY id_ecole DESC";
				
				$ecoles=$db->executeQuery($sql);
				foreach($ecoles as $ecole){
				$sql_abn="select datediff(date_fin, NOW()) as diff ,datediff(date_fin, date_debut) as duree ,abonnement.date_creation as date_creation_abn FROM abonnement WHERE ecole_id=".$ecole->id_ecole." order by id_abonnement DESC LIMIT 1";

				$abn=$db->executeQuery($sql_abn);
					
				$duree=@$abn[0]->duree;
				if($duree<=0){$duree=1;}
				$pourc=((@$abn[0]->diff*100)/$duree);
				if($pourc<0){$pourc=0; } if($pourc>100){$pourc=100; }
				$pourc=number_format($pourc, 2, '.', '');
				
?>
                                        <tr class="uk-table-middle">
							<td class="uk-width-1-10 uk-text-nowrap"><?php echo $ecole->id_ecole?></td>
							<td class="uk-width-1-10 uk-text-nowrap"><a href="abonnements.php?ecole_id=<?php echo $ecole->id_ecole?>"><?php echo $ecole->nom_ecole?></a></td>

								<td class="uk-width-1-10 uk-text-nowrap"><?php echo $ecole->N_agr?></td>
							
							
							<?php  if(@$abn[0]->diff<=0){ ?>
							<td class="uk-width-1-10 uk-text-nowrap "><span class="uk-badge uk-badge-danger">Expiré</span>
							<?php 	}else{ ?>
							
							<td class="uk-width-1-10 uk-text-nowrap"><span class="uk-badge  uk-badge-success">Encours</span>

							<?php } ?>
						   
						   
								<div class="uk-progress uk-progress-mini uk-progress-dander uk-margin-remove">
									<div class="uk-progress-bar" style="width: <?php echo $pourc;?>%;"></div>
									
								</div>
								<b><?php echo $pourc;?>%</b>
							</td>
											
											
											<td class="uk-width-1-10 uk-text-right"><?php echo $ecole->ville?></td>
											<td class="uk-width-1-10 uk-text-right"><?php echo $ecole->tel?></td>
											<td class="uk-width-1-10 uk-text-right"><?php echo $ecole->fix?> </td>
											<td class="uk-width-1-10 uk-text-right"><?php echo $ecole->email?> </td>
											

<td class="uk-width-2-10 uk-text-right">
<a href="#"  data-uk-modal="{target:'#modal_header_footer_<?php echo $ecole->id_ecole?>'}"><i class="md-icon material-icons">&#xE254;</i></a>
<!------------------------------------------------------------------------>
	<div class="uk-modal" id="modal_header_footer_<?php echo $ecole->id_ecole?>">
	<form method="POST" action="ecoles.php">
	<div class="uk-modal-dialog">
	<div class="uk-modal-header">
	<h3 class="uk-modal-title"><i class="material-icons">&#xE85D;</i> Modifier ecole </h3>
	</div>
	<div class="uk-modal-container">
		<input type="hidden"  class="md-input" name="id_ecole_m" value="<?php echo $ecole->id_ecole?>"  />
	<div class="uk-grid">
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">

	<label for="uk_dp_1">Nom de l'Auto-école </label>
	
	<input type="text"  class="md-input" name="nom_ecole" value="<?php echo $ecole->nom_ecole?>"  />
	
	</div>
	</div>
	
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Adresse </label>
	
	<input type="text"  class="md-input" name="adresse" value="<?php echo $ecole->adresse?>"  />
	
	</div>
	</div>
	
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Ville </label>
	
	<select  class="md-input" name="ville_id">
	<?php
	$villes=$db->executeQuery("select * from villes ");
	foreach($villes as $ville){
	?>
	<option  <?php if($ville->id_ville==$ecole->ville_id){echo "selected";} ?> value="<?php echo $ville->id_ville?>"> <?php echo $ville->ville?></option>
	
	<?php } ?>
	</select>
	
	</div>
	</div>
	
	</div>
	<div class="uk-grid">

	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Tel </label>

	<input type="text"  class="md-input" name="tel" value="<?php echo $ecole->tel?>"  />

	</div>
	</div>
	
	
		
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Fixe </label>

	<input type="text"  class="md-input" name="fix" value="<?php echo $ecole->fix?>"  />

	</div>
	</div>
		
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Email </label>

	<input type="text"  class="md-input" name="email" value="<?php echo $ecole->email?>"  />

	</div>
	</div>
	
	
	</div>
	
	</div>
	<div class="uk-modal-footer uk-text-right">
	<button type="button" class="md-btn md-btn-flat uk-modal-close">Annuler</button>
	<button  type="submit" class="md-btn md-btn-flat md-btn-flat-danger" name="modifierAbn" id="modifierAbn"><i class="material-icons">&#xE254;</i> Modifier</button>
	</div>
	</div>
	
	</form>
	</div>
<!------------------------------------------------------------------------>
	<a href="#"  data-uk-modal="{target:'#modal_supprimer_<?php echo $ecole->id_ecole?>'}"><i class="md-icon material-icons">&#xE92B;</i></a>
										
												
	<div class="uk-modal" id="modal_supprimer_<?php echo $ecole->id_ecole?>">
	<div class="uk-modal-dialog">
	<span class="uk-text-right" style="float: left;">Vous voulez vraiment supprimer ?</span>
	<div class="uk-modal-footer uk-text-right">
	<form method="post" action="ecoles.php">
	<input type="hidden" name="id_ecole" value="<?php echo $ecole->id_ecole ?>"  />
	<input type="hidden" name="id_ecole_supp" value="<?php echo $ecole->id_ecole?>"/>
	<button type="button" class="md-btn md-btn-flat uk-modal-close">Annuler</button>
	<button  type="submit" class="md-btn md-btn-flat md-btn-flat-danger" name="supprimerAbn" id="supprimerAbn">Supprimer</button>
	</form>
	</div>
	</div>
	</div>



	<!------------------------------------------------------------------------>
	<a href="#"  data-uk-modal="{target:'#modal_renouveler_<?php echo $ecole->id_ecole?>'}"><i class='md-icon material-icons'>&#xe419</i></a>
<a href="chat_ecole.php?ecole_id=<?php echo $ecole->id_ecole?>"><i class='md-icon material-icons'>message</i></a>

										
												
	<div class="uk-modal" id="modal_renouveler_<?php echo $ecole->id_ecole?>">
		<div class="uk-modal-dialog">
	<form action="./ecoles.php" method="POST">
	<div class="uk-modal-header">
	<h3 class="uk-modal-title"><i class="material-icons">&#xE85D;</i> renouveler abonnement </h3>
	</div>
	<div class="uk-modal-container">
	
	<div class="uk-grid">
	<div class="uk-width-large-1-2">
	<div class="uk-input-group">
	<label for="uk_dp_1">Ecole : <?php  echo $ecole->nom_ecole?></label>
	
	<input type="hidden" name="id_ecole" value="<?php echo $ecole->id_ecole?>"  />
	
	
	</div>
	</div>
	
	<div class="uk-width-large-1-2">
		<div class="uk-input-group">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date creation</label>
		<input class="md-input" type="text" value="<?php  echo date("Y/m/d") ?>" required  name="date_creation_m" id="date_creation_<?php echo $ecole->id_ecole?>" data-uk-datepicker="{format:'DD/MM/YYYY'}">
		</div>
	</div>
	</div>
	<div class="uk-grid">
		<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date début</label>
		<input class="md-input" type="text" value="<?php echo date("Y/m/d")  ?>" required  name="date_debut_m"  data-uk-datepicker="{format:'DD/MM/YYYY'}">
		</div>
		</div>
	
	
		
		<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group md-input-filled">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date fin</label>
		<input class="md-input" type="text" value="<?php  
		 $now = date_create(date("Y/m/d") );
		 $now->add(new DateInterval('P1Y'));
		echo $now->format('Y/m/d');
		 ?>"   name="date_fin_m"  data-uk-datepicker="{format:'DD/MM/YYYY'}" >
		</div>
		</div>
		
	

	
	<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group md-input-filled">
		<label for="uk_dp_1">Prix </label>
		<input class="md-input" type="number" name="prix_m" id="prix_m" value="<?php echo $ecole->prix?>" required >
	</div>
	</div>
	
	
	

	
	</div>
	
	</div>
	<div class="uk-modal-footer uk-text-right">
	<button type="button" class="md-btn md-btn-flat uk-modal-close">Annuler</button>
	<button  type="submit" class="md-btn md-btn-flat md-btn-flat-danger" name="renouvelerAbn" id="renouvelerAbn"><i class='material-icons'>&#xe419</i> renouveler abonnement
</button>

	</div>
		</form>
		</div>
		</div>
	</div>



	
											</td>
                                        </tr>
									<?php } ?>
                                       
                                    </tbody>
                                </table>
                    </div>
                  
                </div>
            </div>


        </div>
    </div>

	
	<div class="uk-modal" id="modal_header_footer">

		<form method="POST" enctype="multipart/form-data"  action="ecoles.php">
	<div class="uk-modal-dialog">
	<div class="uk-modal-header">
	<h3 class="uk-modal-title">
		<i class="material-icons">&#xE85D;</i> Ajouter ecole </h3>
	</div>
	<div class="uk-modal-container">
	
	<div class="uk-grid">
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Non de l'Auto-école </label>
	
	<input required type="text"  class="md-input" name="nom_ecole" value=""  />
	
	</div>
	</div>

	
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Adresse </label>
	
	<input required type="text"  class="md-input" name="adresse" value=""  />
	
	</div>
	</div>
	
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Ville </label>
	
	<select  class="md-input" name="ville_id">
	    		<option  selected="selecter">selecter</option>

	<?php
	$villes=$db->executeQuery("select * from villes ");

	foreach($villes as $ville){
	?>
	<option  value="<?php echo $ville->id_ville?>"> <?php echo $ville->ville?></option>
	
	<?php } ?>
	</select>
	
	</div>
	</div>
	
	</div>
	<div class="uk-grid">

	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Tel </label>

	<input required type="text"  class="md-input" name="tel" value=""  />

	</div>
	</div>
	
	
		
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Fixe </label>

	<input required type="text"  class="md-input" name="fix" value=""  />

	</div>
	</div>
		
	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">Email </label>

	<input required type="text"  class="md-input" name="email" value=""  />

	</div>
	</div>
	
	
	</div>
	<div class="uk-grid">
		<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">nom du propriétaire </label>

	<input required type="text"  class="md-input" name="propriétaire" value=""  />

	</div>
	</div>

	<div class="uk-width-large-1-3">
	<div class="uk-input-group">
	<label for="uk_dp_1">mot de passe</label>

	<input required type="text"  class="md-input" name="password" value=""  />

	</div>
	</div>

	<div class="uk-width-large-1-3">
	<label for="uk_dp_1">logo </label>
	<div class="uk-input-group">

	<input required type="file" class="md-input" name="logo" />
	</div>
	</div>

	
	</div>
	<div class="uk-grid">
		<div class="uk-input-group">
		<label for="uk_dp_1">numéro d'agrément</label>
		<input required type="text"  class="md-input" name="N_agr" value=""  />
		</div>
	</div>
	<!-- Ajouter abonnement  -->
<br>	
<div class="uk-modal-header">
	<h5 class="uk-modal-title">  <i class="material-icons">&#xE85D;</i>Ajouter abonnement </h5>
	</div>

	<div class="uk-grid">
	
	<div class="uk-width-large-1-2">
		<div class="uk-input-group">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date creation</label>
		<input  required class="md-input" type="text" value="<?php  echo date("d/m/Y");?>" required  name="date_creationhref="abonnements.php?ecole_idata-uk-datepicker="{format:'DD/MM/YYYY'}">
		</div>
	</div>
	</div>

	<div class="uk-grid">
		<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date début</label>
		<input class="md-input" type="text"  required  name="date_debut" id="date_debut" data-uk-datepicker="{format:'DD/MM/YYYY'}">
		</div>
		</div>
	

		<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group md-input-filled">
		<span class="uk-input-group-addon"><i class="uk-input-group-icon uk-icon-calendar"></i></span>
		<label for="uk_dp_1">Date fin</label>
		<input required class="md-input" type="text"  required  name="date_fin" id="date_fin" data-uk-datepicker="{format:'DD/MM/YYYY'}">
		</div>
		</div>
		

	<div class="uk-width-large-1-3 uk-width-1-1">
		<div class="uk-input-group md-input-filled">
		<label for="uk_dp_1">Prix </label>
		<input required class="md-input" type="number" name="prix" id="prix" value="0" required >
	</div>
	</div>
	

	
	</div>

	</div><!-- end content -->
<div class="uk-modal-footer uk-text-right">
	<button type="button" class="md-btn md-btn-flat uk-modal-close">Annuler</button>
	<button  type="submit" class="md-btn md-btn-flat md-btn-flat-danger" name="ajouterAbn" id="ajouterAbn"><i class="material-icons">&#xE145;</i> Ajouter</button>
	</div>

	</div>
	
	</form>
	</div>
	
	 <div class="md-fab-wrapper">
            <span>ajouter</span>
	 	
        <a class="md-fab md-fab-accent" id="add_abd"  data-uk-modal="{target:'#modal_header_footer'}">
            <i class="material-icons">&#xE145;</i>
        </a>
    </div>
	
	

    <!-- common functions -->
    <script src="assets/js/common.min.js"></script>
    <!-- uikit functions -->
    <script src="assets/js/uikit_custom.min.js"></script>
    <!-- altair common functions/helpers -->
    <script src="assets/js/altair_admin_common.min.js"></script>
	<script src="assets/js/select2.js"></script>
	  <!--  notifications functions -->
    <script src="assets/js/pages/components_notifications.min.js"></script>
    
	
		    <!-- datatables -->
    <script src="bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
    <!-- datatables buttons-->
    <script src="bower_components/datatables-buttons/js/dataTables.buttons.js"></script>
    <script src="assets/js/custom/datatables/buttons.uikit.js"></script>
   
    <script src="bower_components/datatables-buttons/js/buttons.colVis.js"></script>
    <script src="bower_components/datatables-buttons/js/buttons.html5.js"></script>
    <script src="bower_components/datatables-buttons/js/buttons.print.js"></script>
    
    <!-- datatables custom integration -->
    <script src="assets/js/custom/datatables/datatables.uikit.min.js"></script>

    <!--  datatables functions -->
    <script src="assets/js/pages/plugins_datatables.min.js"></script>
	
	
  <script>
        $(function() {
			
			
	$("#ecole").dataTable({
      	/* dataTable language FR */ 
	"iDisplayLength": 10,
	"language": {
	"sProcessing":     "Traitement en cours...",
	"sSearch":         "Rechercher&nbsp;:",
	"sLengthMenu":     "Afficher _MENU_ &eacute;l&eacute;ments",
	"sInfo":           "Affichage de l'&eacute;l&eacute;ment _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
	"sInfoEmpty":      "Affichage de l'&eacute;l&eacute;ment 0 &agrave; 0 sur 0 &eacute;l&eacute;ment",
	"sInfoFiltered":   "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
	"sInfoPostFix":    "",
	"sLoadingRecords": "Chargement en cours...",
	"sZeroRecords":    "Aucun &eacute;l&eacute;ment &agrave; afficher",
	"sEmptyTable":     "Aucune donn&eacute;e disponible dans le tableau",
	"oPaginate": {
	"sFirst":      "Premier",
	"sPrevious":   "Pr&eacute;c&eacute;dent",
	"sNext":       "Suivant",
	"sLast":       "Dernier"
	},
	"oAria": {
	"sSortAscending":  ": activer pour trier la colonne par ordre croissant",
	"sSortDescending": ": activer pour trier la colonne par ordre d&eacute;croissant"
	}

	}
	/* */
    });
	
		});
 </script>
    <script>
        $(function() {
            if(isHighDensity) {
                // enable hires images
                altair_helpers.retina_images();
            }
            if(Modernizr.touch) {
                // fastClick (touch devices)
                FastClick.attach(document.body);
            }
        });
        $window.load(function() {
            // ie fixes
            altair_helpers.ie_fix();
        });
    </script>
<?php if( $ajouter_bool==true){?>
 <script>
  $(function() {
$(".message_success").trigger("click");
	 });
 </script>
 <?php } ?>
 
<?php if($add=="true"){?>
<script>
$(function() {
   var modal = UIkit.modal("#modal_header_footer");
    modal.show(); 
});
</script>
 <?php } ?>
<?php if($add_abd!=""){?>
<script>
$(function() {
$("#add_abd").trigger("click");
   var modal = UIkit.modal("#modal_header_footer");
    modal.show(); 
	
// test 
var add_abd="<?php echo $add_abd?>";
var pack="<?php echo $pack?>";

var prix_p1="<?php echo $_SESSION['salle']->pack1?>";
var prix_p2="<?php echo $_SESSION['salle']->pack2?>";
var prix_p3="<?php echo $_SESSION['salle']->pack3?>";
var prix_p4="<?php echo $_SESSION['salle']->pack4?>";

if(add_abd!=""){
if(pack=="pack1"){$("#type_ecole option[value='mensuel']").attr("selected","selected");$("#prix").val(prix_p1);$("#prix_recu").val(prix_p1);$("#reste").val("0");}

if(pack=="pack2"){$("#type_ecole option[value='trimestrielle']").attr("selected","selected");$("#prix").val(prix_p2);$("#prix_recu").val(prix_p2);$("#reste").val("0");}

if(pack=="pack3"){$("#type_ecole option[value='semestriel']").attr("selected","selected");$("#prix").val(prix_p3);$("#prix_recu").val(prix_p3);$("#reste").val("0");}

if(pack=="pack4"){$("#type_ecole option[value='annuel']").attr("selected","selected");$("#prix").val(prix_p4);$("#prix_recu").val(prix_p4);$("#reste").val("0");}

}
});
</script>
<?php } ?>


<style>
img {
    width: auto\9;
    height: auto;
    max-width: 100%;
    vertical-align: middle;
    border: 0;
    -ms-interpolation-mode: bicubic;
}
</style> 

   <script>
   $(function() {
	   
var prix_p1="";
var prix_p2="";
var prix_p3="";
var prix_p4="";
$('#prix_recu').on('keyup ', function() {
	
var prix=parseInt($("#prix").val());
var prix_recu=parseInt($("#prix_recu").val());

var reste=parseInt(prix-prix_recu);

$("#reste").val(reste);
});
$('#type_ecole').on('change', function() {
	var month_add=0;var date_fin="";
	  var type_ecole=$(this).val();
if(type_ecole=="mensuel"){month_add=1;$("#prix").val(prix_p1);$("#prix_recu").val(prix_p1);$("#reste").val("0");}
if(type_ecole=="trimestrielle"){month_add=3; $("#prix").val(prix_p2);$("#prix_recu").val(prix_p2);$("#reste").val("0");}	
if(type_ecole=="semestriel"){month_add=6;$("#prix").val(prix_p3);$("#prix_recu").val(prix_p3);$("#reste").val("0");}
if(type_ecole=="annuel"){month_add=12;$("#prix").val(prix_p4);$("#prix_recu").val(prix_p4);$("#reste").val("0");}
 var date_debut=$("#date_debut").val();

 var set_start = date_debut.split('/');  

var day = set_start[0];  
var month = (set_start[1] - 1);  // January is 0 so August (8th month) is 7
var year = set_start[2];
var date_debut = new Date(year, month, day);
	  var x = 12; //or whatever offset
var result1 = new Date(date_debut);
result1.setMonth(result1.getMonth() + month_add);

var dd = result1.getDate();
var mm = result1.getMonth()+1; //January is 0!

var yyyy = result1.getFullYear();
if(dd<10){
    dd='0'+dd
} 
if(mm<10){
    mm='0'+mm
} 
date_fin = dd+'/'+mm+'/'+yyyy;
$("#date_fin").val("");
$("#date_fin").val(date_fin);
   });
   
   
 //-----

$('.type_ecole_m').on('change', function() {
	var id=$(this).attr("id-ligne");
	var month_add=0;var date_fin="";
	  var type_ecole=$(this).val();
	  if(type_ecole=="mensuel"){month_add=1;}	  if(type_ecole=="trimestrielle"){month_add=3;} 	
	  if(type_ecole=="semestriel"){month_add=6;} 	  if(type_ecole=="annuel"){month_add=12;}
 var date_debut=$("#date_debut_"+id).val();

 var set_start = date_debut.split('/');  

var day = set_start[0];  
var month = (set_start[1] - 1);  // January is 0 so August (8th month) is 7
var year = set_start[2];
var date_debut = new Date(year, month, day);
	  var x = 12; //or whatever offset
var result1 = new Date(date_debut);
result1.setMonth(result1.getMonth() + month_add);

var dd = result1.getDate();
var mm = result1.getMonth()+1; //January is 0!

var yyyy = result1.getFullYear();
if(dd<10){
    dd='0'+dd
} 
if(mm<10){
    mm='0'+mm
} 
date_fin = dd+'/'+mm+'/'+yyyy;
$("#date_fin_"+id).val("");
$("#date_fin_"+id).val(date_fin);
   });
   
 //-----
 
	$("#nom_ecole_rech").select2({
    minimumInputLength: 2,
    ajax: {
        url: "rech_client.php",
        dataType: 'json',
        type: "GET",
        quietMillis: 50,
        data: function (term) {
            return {
                term: term
            };
        },
        results: function (data) {
            return {
                results: $.map(data.data, function (item) {
                    return {
                        text: item.nom_ecole,
                        slug: item.id_ecole,
                        id: item.id_ecole
                    }
                })
            };
        }
    }
	
	<?php if($ecole_id!=""){?>
	,  initSelection : function (element, callback) {
        var data = {id: "<?php echo $ecole_id;?>", text: "<?php echo $nom_ecole;?>"};
        callback(data);
    }
	<?php } ?>
});


	$("#nom_ecole").select2({
		 placeholder: "Chercher par nom ",
    minimumInputLength: 2,
    ajax: {
        url: "rech_client.php",
        dataType: 'json',
        type: "GET",
        quietMillis: 50,
        data: function (term) {
            return {
                term: term
            };
        },
        results: function (data) {
            return {
                results: $.map(data.data, function (item) {
                    return {
                        text: item.nom_ecole,
                        slug: item.id_ecole,
                        id: item.id_ecole
                    }
                })
            };
        }
    }
	<?php if($ecole_id!=""){?>
	,  initSelection : function (element, callback) {
        var data = {id: "<?php echo $ecole_id;?>", text: "<?php echo $nom_ecole;?>"};
        callback(data);
    }
	<?php } ?>
});
	});
	</script>
    <script>
        $(function() {
            var $switcher = $('#style_switcher'),
                $switcher_toggle = $('#style_switcher_toggle'),
                $theme_switcher = $('#theme_switcher'),
                $mini_sidebar_toggle = $('#style_sidebar_mini'),
                $slim_sidebar_toggle = $('#style_sidebar_slim'),
                $boxed_layout_toggle = $('#style_layout_boxed'),
                $accordion_mode_toggle = $('#accordion_mode_main_menu'),
                $html = $('html'),
                $body = $('body');


            $switcher_toggle.click(function(e) {
                e.preventDefault();
                $switcher.toggleClass('switcher_active');
            });

            $theme_switcher.children('li').click(function(e) {
                e.preventDefault();
                var $this = $(this),
                    this_theme = $this.attr('data-app-theme');

                $theme_switcher.children('li').removeClass('active_theme');
                $(this).addClass('active_theme');
                $html
                    .removeClass('app_theme_a app_theme_b app_theme_c app_theme_d app_theme_e app_theme_f app_theme_g app_theme_h app_theme_i app_theme_dark')
                    .addClass(this_theme);

                if(this_theme == '') {
                    localStorage.removeItem('altair_theme');
                    $('#kendoCSS').attr('href','bower_components/kendo-ui/styles/kendo.material.min.css');
                } else {
                    localStorage.setItem("altair_theme", this_theme);
                    if(this_theme == 'app_theme_dark') {
                        $('#kendoCSS').attr('href','bower_components/kendo-ui/styles/kendo.materialblack.min.css')
                    } else {
                        $('#kendoCSS').attr('href','bower_components/kendo-ui/styles/kendo.material.min.css');
                    }
                }

            });

            // hide style switcher
            $document.on('click keyup', function(e) {
                if( $switcher.hasClass('switcher_active') ) {
                    if (
                        ( !$(e.target).closest($switcher).length )
                        || ( e.keyCode == 27 )
                    ) {
                        $switcher.removeClass('switcher_active');
                    }
                }
            });

            // get theme from local storage
            if(localStorage.getItem("altair_theme") !== null) {
                $theme_switcher.children('li[data-app-theme='+localStorage.getItem("altair_theme")+']').click();
            }


        // toggle mini sidebar

            // change input's state to checked if mini sidebar is active
            if((localStorage.getItem("altair_sidebar_mini") !== null && localStorage.getItem("altair_sidebar_mini") == '1') || $body.hasClass('sidebar_mini')) {
                $mini_sidebar_toggle.iCheck('check');
            }

            $mini_sidebar_toggle
                .on('ifChecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.setItem("altair_sidebar_mini", '1');
                    localStorage.removeItem('altair_sidebar_slim');
                    location.reload(true);
                })
                .on('ifUnchecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.removeItem('altair_sidebar_mini');
                    location.reload(true);
                });

        // toggle slim sidebar

            // change input's state to checked if mini sidebar is active
            if((localStorage.getItem("altair_sidebar_slim") !== null && localStorage.getItem("altair_sidebar_slim") == '1') || $body.hasClass('sidebar_slim')) {
                $slim_sidebar_toggle.iCheck('check');
            }

            $slim_sidebar_toggle
                .on('ifChecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.setItem("altair_sidebar_slim", '1');
                    localStorage.removeItem('altair_sidebar_mini');
                    location.reload(true);
                })
                .on('ifUnchecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.removeItem('altair_sidebar_slim');
                    location.reload(true);
                });

        // toggle boxed layout

            if((localStorage.getItem("altair_layout") !== null && localStorage.getItem("altair_layout") == 'boxed') || $body.hasClass('boxed_layout')) {
                $boxed_layout_toggle.iCheck('check');
                $body.addClass('boxed_layout');
                $(window).resize();
            }

            $boxed_layout_toggle
                .on('ifChecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.setItem("altair_layout", 'boxed');
                    location.reload(true);
                })
                .on('ifUnchecked', function(event){
                    $switcher.removeClass('switcher_active');
                    localStorage.removeItem('altair_layout');
                    location.reload(true);
                });

        // main menu accordion mode
            if($sidebar_main.hasClass('accordion_mode')) {
                $accordion_mode_toggle.iCheck('check');
            }

            $accordion_mode_toggle
                .on('ifChecked', function(){
                    $sidebar_main.addClass('accordion_mode');
                })
                .on('ifUnchecked', function(){
                    $sidebar_main.removeClass('accordion_mode');
                });


        });
    </script>

    <?php include 'include/footer.php'; ?> 

</body>
</html>

Zerion Mini Shell 1.0