%PDF- %PDF-
Direktori : /home/jalalj2hb/www/ftm-admin/ |
Current File : /home/jalalj2hb/www/ftm-admin/abonnements.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"); $date_debut_rech=@$_GET['date_debut_rech']; $date_fin_rech=@$_GET['date_fin_rech']; $ecole_id_rech=@$_GET['ecole_id']; if($date_debut_rech==""){ $date_debut_rech="01"."/".date("m")."/".date("Y"); } if($date_fin_rech==""){ $date_fin_rech=ew_FormatDateTime(date("Y-m-t", strtotime(date("Y-m-d"))),7); } $page_name="abonnements"; $add=getValue("add"); $add_abd=getValue("add_abd"); $pack=getValue("pack"); $date_debut_abn=getValue("date_debut_abn"); if($date_debut_abn==""){ $date_debut_abn="01"."/".date("m")."/".date("Y"); } $date_fin_abn=getValue("date_fin_abn"); if($date_fin_abn==""){ $date_fin_abn=""; } $ecole_id=getValue("ecole_id"); $id_ecole=getValue("id_ecole"); $nom_ecole=""; 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"); $date_debut_abn=ew_FormatDateTime($date_debut_abn,7); $date_fin_abn=ew_FormatDateTime($date_fin_abn,7); $date_debut_sql=getDateFormat($date_debut_rech); $date_fin_sql=getDateFormat($date_fin_rech); $ajouter_bool=false; $id_abonnement= getValue("id_abonnement"); if(isSubmit('ajouterAbn')){ $id_ecole= getValue("id_ecole"); $date_debut= getDateFormat(getValue("date_debut")); $date_fin= getDateFormat(getValue("date_fin")); $prix= getValue("prix"); $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); $ajouter_bool=true; } if(isSubmit('modifierAbn')){ $id_abonnement=getValue("id_abonnement_m"); $id_ecole= getValue("id_ecole"); $date_debut= getDateFormat(getValue("date_debut_m")); $date_fin= getDateFormat(getValue("date_fin_m")); $date_creation=getDateFormat(getValue("date_debut_m")); $prix= getValue("prix_m"); $ch=array('id_abonnement','date_debut','date_fin','prix','date_creation'); $val=array($id_abonnement,$date_debut,$date_fin,$prix,$date_creation ); $db->Update_('abonnement',$ch,$val); $ajouter_bool=true; red_vers("abonnements.php"); } if(isSubmit('supprimerAbn')){ $id_ecole=getValue("id_ecole"); $id_abonnement_supp=getValue("id_abonnement_supp"); $sql="delete from abonnement where id_abonnement='$id_abonnement_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="abonnements.php"><i class="material-icons"></i> Abonnements</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"> <?php if($_SESSION['user']->privilege=="admin"){?> <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">nom d'école </label> <input type="text" name="ecole_id" class="select2_rech" placeholder="nom d'école " 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 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 required="required" class="md-input uk-datepicker" type="text" value="<?php echo @$date_debut_rech?>" name="date_debut_rech" id="uk_dp_1" data-uk-datepicker="{format:'DD/MM/YYYY'}"> </div> </div> <div class="uk-width-large-1-5 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 fin</label> <input class="md-input uk-datepicker" type="text" value="<?php echo @$date_fin_rech?>" name="date_fin_rech" id="uk_dp_1" data-uk-datepicker="{format:'DD/MM/YYYY'}"> </div> </div> <div class="uk-width-large-1-5 uk-width-1-1"> <div class="uk-input-group"> <label for="uk_dp_1"> </label> <button type="submit"class="md-btn md-btn-danger md-btn-wave-light waves-effect waves-button waves-light" name="rechercher" value="rechercher" >Rechercher</button> </div> </div> </div> </form> <?php } ?> </div> </div> </div> </div> <table class="uk-table" id="abonnement"> <thead> <tr> <th class="uk-text-nowrap">N°</th> <th class="uk-text-nowrap">Ecole</th> <th class="uk-text-nowrap">État </th> <th class="uk-text-nowrap uk-text-right">Date début</th> <th class="uk-text-nowrap uk-text-right">Date fin</th> <th class="uk-text-nowrap uk-text-right">Prix</th> <th class="uk-text-nowrap uk-text-right">Actions</th> </tr> </thead> <tbody> <?php $sql="SELECT *, datediff(date_fin, NOW()) as diff ,datediff(date_fin, date_debut) as duree ,abonnement.date_creation as date_creation_abn FROM `abonnement`,ecoles WHERE id_ecole=ecole_id"; if($_SESSION['user']->privilege=="user"){ $sql.=" and ecole_id='".$_SESSION['user']->id_ecole."'"; } if($id_abonnement!=""){ $sql.=" and id_abonnement='$id_abonnement'"; } if($etat=="expire"){ $sql.=" and datediff(date_fin, NOW())<=31"; } if($id_abonnement=="" and $ecole_id=="" and $etat==""){ if($date_debut_rech!="" and $date_fin_rech!=""){ if(isset($_GET['rechercher'])){ $sql.=" and abonnement.date_creation BETWEEN '$date_debut_sql' and '$date_fin_sql'"; } } } if(isset($_GET['rechercher']) and $ecole_id_rech){ $sql.=" and ecole_id='$ecole_id_rech'"; } $sql.=" ORDER BY id_abonnement DESC"; $ecoles=$db->executeQuery($sql); foreach($ecoles as $ecole){ $duree=$ecole->duree; if($duree<=0){$duree=1;} $pourc=(($ecole->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_abonnement?></td> <td class="uk-width-1-10 uk-text-nowrap"><a href="ecoles.php?id_ecole=<?php echo $ecole->id_ecole?>"><?php echo $ecole->nom_ecole?></a></td> <?php if($ecole->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 ew_FormatDateTime($ecole->date_debut,7)?></td> <td class="uk-width-1-10 uk-text-right"><?php echo ew_FormatDateTime($ecole->date_fin,7)?></td> <td class="uk-width-1-10 uk-text-right"><?php echo $ecole->prix?> DH</td> <td class="uk-width-2-10 uk-text-right"> <?php if($_SESSION['user']->privilege=="admin"){?> <a href="#" data-uk-modal="{target:'#modal_header_footer_<?php echo $ecole->id_abonnement?>'}"><i class="md-icon material-icons"></i></a> <!------------------------------------------------------------------------> <div class="uk-modal" id="modal_header_footer_<?php echo $ecole->id_abonnement?>"> <form method="POST" action="abonnements.php"> <div class="uk-modal-dialog"> <div class="uk-modal-header"> <h3 class="uk-modal-title"><i class="material-icons"></i> Modifier 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->ecole_id?>" /> <input type="hidden" name="id_abonnement_m" value="<?php echo $ecole->id_abonnement?>" /> </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 ew_FormatDateTime($ecole->date_creation_abn,7)?>" required name="date_creation_m" id="date_creation_<?php echo $ecole->id_abonnement?>" 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 ew_FormatDateTime($ecole->date_debut,7)?>" required name="date_debut_m" id="date_debut_<?php echo $ecole->id_abonnement?>" 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 echo ew_FormatDateTime($ecole->date_fin,7)?>" required name="date_fin_m" id="date_fin_<?php echo $ecole->id_abonnement?>" 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="modifierAbn" id="modifierAbn"><i class="material-icons"></i> Modifier</button> </div> </div> </form> </div> <!------------------------------------------------------------------------> <a href="#" data-uk-modal="{target:'#modal_supprimer_<?php echo $ecole->id_abonnement?>'}"><i class="md-icon material-icons"></i></a> <div class="uk-modal" id="modal_supprimer_<?php echo $ecole->id_abonnement?>"> <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="abonnements.php"> <input type="hidden" name="id_ecole" value="<?php echo $ecole->ecole_id?>" /> <input type="hidden" name="id_abonnement_supp" value="<?php echo $ecole->id_abonnement?>"/> <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> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </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() { $("#abonnement").dataTable({ /* dataTable language FR */ "iDisplayLength": 10, "language": { "sProcessing": "Traitement en cours...", "sSearch": "Rechercher :", "sLengthMenu": "Afficher _MENU_ éléments", "sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments", "sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément", "sInfoFiltered": "(filtré de _MAX_ éléments au total)", "sInfoPostFix": "", "sLoadingRecords": "Chargement en cours...", "sZeroRecords": "Aucun élément à afficher", "sEmptyTable": "Aucune donnée disponible dans le tableau", "oPaginate": { "sFirst": "Premier", "sPrevious": "Précédent", "sNext": "Suivant", "sLast": "Dernier" }, "oAria": { "sSortAscending": ": activer pour trier la colonne par ordre croissant", "sSortDescending": ": activer pour trier la colonne par ordre dé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_abonnement option[value='mensuel']").attr("selected","selected");$("#prix").val(prix_p1);$("#prix_recu").val(prix_p1);$("#reste").val("0");} if(pack=="pack2"){$("#type_abonnement option[value='trimestrielle']").attr("selected","selected");$("#prix").val(prix_p2);$("#prix_recu").val(prix_p2);$("#reste").val("0");} if(pack=="pack3"){$("#type_abonnement option[value='semestriel']").attr("selected","selected");$("#prix").val(prix_p3);$("#prix_recu").val(prix_p3);$("#reste").val("0");} if(pack=="pack4"){$("#type_abonnement 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_abonnement').on('change', function() { var month_add=0;var date_fin=""; var type_abonnement=$(this).val(); if(type_abonnement=="mensuel"){month_add=1;$("#prix").val(prix_p1);$("#prix_recu").val(prix_p1);$("#reste").val("0");} if(type_abonnement=="trimestrielle"){month_add=3; $("#prix").val(prix_p2);$("#prix_recu").val(prix_p2);$("#reste").val("0");} if(type_abonnement=="semestriel"){month_add=6;$("#prix").val(prix_p3);$("#prix_recu").val(prix_p3);$("#reste").val("0");} if(type_abonnement=="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_abonnement_m').on('change', function() { var id=$(this).attr("id-ligne"); var month_add=0;var date_fin=""; var type_abonnement=$(this).val(); if(type_abonnement=="mensuel"){month_add=1;} if(type_abonnement=="trimestrielle"){month_add=3;} if(type_abonnement=="semestriel"){month_add=6;} if(type_abonnement=="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>