%PDF- %PDF-
Direktori : /home/jalalj2hb/www/ftm-admin/ |
Current File : /home/jalalj2hb/www/ftm-admin/inbox.php |
<!doctype html> <!--[if lte IE 9]> <html class="lte-ie9" lang="en"> <![endif]--> <!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]--> <head> <?php include("include/head.php"); $page_name="inbox"; $ecole_id=$_SESSION['user']->id_ecole; if(isSubmit('ajouterAbn')){ $id_message= getValue("id_message"); $candidat_id= getValue("candidat_id"); $date=date("Y-m-d"); $titre= getValue("titre"); $message= getValue("message"); //UPLOADER $file= $_FILES["file"]["tmp_name"]; if($file) { $target_dir = "uploads/"; $target_file = $target_dir.rand(1,1000).basename($_FILES["file"]["name"]); move_uploaded_file($_FILES["file"]["tmp_name"], $target_file); $file=$target_file; }else{ $file=''; } // $ch=array('id_message','ecole_id','candidat_id','message','date','titre','file'); $val=array(NULL,$ecole_id,$candidat_id,$message,$date,$titre,$file); $db->Ajouter_('messages',$ch,$val); $ajouter_bool=true; red_vers("envoyer_msg.php"); } if(isSubmit('modifierAbn')){ $id_message=getValue("id_message_m"); $titre= getValue("titre"); $message= getValue("message"); $ch=array('id_message','message','titre'); $val=array($id_message,$message ,$titre); $db->Update_('messages',$ch,$val); $ajouter_bool=true; } if(isSubmit('supprimerAbn')){ $id_message=getValue("id_message"); $id_message_supp=getValue("id_message_supp"); $sql="delete from messages where id_message='$id_message_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="envoyer_msg.php"><i class="material-icons"></i> Messages</a></h3> <table class="uk-table" id="abonnement"> <thead> <tr> <th class="uk-text-nowrap">N°</th> <th class="uk-text-nowrap">destinataires</th> <th class="uk-text-nowrap">Titre </th> <th class="uk-text-nowrap">Message </th> <th class="uk-text-nowrap">date</th> <th class="uk-text-nowrap">fichier</th> <th class="uk-text-nowrap">Actions</th> </tr> </thead> <tbody> <?php if ($_SESSION['user']->privilege=="admin") { $sql="SELECT * FROM messages m,candidats c WHERE (m.candidat_id=c.id_user AND m.ecole_id=".$_SESSION['user']->id_ecole.") OR (m.candidat_id=9999999) OR (m.candidat_id=0) GROUP BY m.id_message ORDER BY m.ecole_id DESC "; }else{ $sql=@"SELECT * FROM messages m,candidats c WHERE (m.candidat_id=9999999) GROUP BY m.id_message ORDER BY m.ecole_id DESC "; } $messages=$db->executeQuery($sql); // print_r($messages); foreach($messages as $m){ ?> <tr class="uk-table-middle"> <td class="uk-width-1-10 uk-text-nowrap"><?php echo $m->id_message?></td> <td class="uk-width-1-10 uk-text-nowrap"> <?php if($m->candidat_id==0) {echo "Tout les candidats ";} else if($m->candidat_id==9999999) { echo "touls les auto ecoles "; } else {echo $m->nom." ".$m->nom_famille;}?> </td> <td class="uk-width-1-10 uk-text-nowrap"><?php echo $m->titre?></td> <td class="uk-width-1-10 uk-text-nowrap"><?php echo $m->message?></td> <td class="uk-width-1-10 uk-text-center"><?php echo ew_FormatDateTime($m->date,7)?></td> <td class="uk-width-1-10 uk-text-center"><?php if ($m->file) { ?> <a href="<?php echo $m->file?>" class="uk-icon-button uk-icon-download"> </a> <?php } else{ echo "aucun"; } ?> </td> <td class="uk-width-2-10 uk-text-center"> <?php if ( $_SESSION['user']->privilege == "admin" or $m->candidat_id!=9999999 and $_SESSION['user']->privilege == "user"): ?> <a href="#" data-uk-modal="{target:'#modal_header_footer_<?php echo $m->id_message?>'}"><i class="md-icon material-icons"></i></a> <?php endif ?> <div class="uk-modal" id="modal_header_footer_<?php echo $m->id_message?>"> <form method="POST" action="envoyer_msg.php"> <div class="uk-modal-dialog"> <div class="uk-modal-header"> <h3 class="uk-modal-title"><i class="material-icons"></i> Modifier Message </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">Candidat : <?php echo $m->nom." ".$m->nom_famille?></label> <input type="hidden" name="id_message_m" value="<?php echo $m->id_message?>" /> </div> </div> <div class="uk-width-large-1-2 uk-width-1-1"> <div class="uk-input-group md-input-filled"> <label for="uk_dp_1">Titre </label> <input class="md-input" type="text" name="titre" id="titre" required value="<?php echo $m->titre?>" /> </div> </div> </div> <div class="uk-grid"> <div class="uk-width-large-1-1 uk-width-1-1"> <div class="uk-input-group md-input-filled"> <label for="uk_dp_1">Message </label> <textarea class="md-input" name="message" id="message" rows="5" cols="90" required><?php echo $m->message?></textarea> </div> </div> </div> </div> <div class="uk-modal-footer uk-text-center"> <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> <?php if ( $_SESSION['user']->privilege == "admin" or $m->candidat_id!=9999999 and $_SESSION['user']->privilege == "user"): ?> <a href="#" data-uk-modal="{target:'#modal_supprimer_<?php echo $m->id_message?>'}"><i class="md-icon material-icons"></i></a> <?php endif ?> <div class="uk-modal" id="modal_supprimer_<?php echo $m->id_message?>"> <div class="uk-modal-dialog"> <span class="uk-text-center" style="float: left;">Vous voulez vraiment supprimer ?</span> <div class="uk-modal-footer uk-text-center"> <form method="post" action="envoyer_msg.php"> <input type="hidden" name="id_message_supp" value="<?php echo $m->id_message?>"/> <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> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> <div class="uk-modal" id="modal_header_footer"> <form method="POST" action="envoyer_msg.php" enctype="multipart/form-data"> <div class="uk-modal-dialog"> <div class="uk-modal-header"> <h3 class="uk-modal-title"> <i class="material-icons"></i>Ajouter message </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"> Candidat </label> <select required name="candidat_id" class="md-input"> <option value="0">Tout les candidats</option> <?php if ($_SESSION['user']->privilege=="admin"): ?> <option value="9999999">Tout les ecoles</option> <?php endif ?> <?php if ($_SESSION['user']->privilege=="user") : ?> <?php $sql="SELECT * FROM `candidats` WHERE ecole_id=".$_SESSION['user']->id_ecole; $candidats=$db->executeQuery($sql); foreach($candidats as $c){ ?> <option value="<?php echo $c->id_user ?>"><?php echo $c->nom." ".$c->nom_famille;?></option> <?php } ?> <?php endif ?> </select> <input type="hidden" name="ecole_id" value="<?php echo $ecole_id?>" /> </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">Titre </label> <input class="md-input" type="text" name="titre" id="titre" required value="" /> </div> </div> <div class="uk-width-large-1-3 uk-width-1-1"> <label for="uk_dp_1">attacher un fichier: </label> <div class="uk-input-group md-input-filled"> <input class="md-input" type="file" name="file" id="titre" value="" /> </div> </div> </div> <div class="uk-grid"> <div class="uk-width-large-1-1 uk-width-1-1"> <div class="uk-input-group md-input-filled"> <label for="uk_dp_1">Message </label> <textarea class="md-input" name="message" id="message" rows="5" cols="90" required ></textarea> </div> </div> </div> </div> <div class="uk-modal-footer uk-text-center"> <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"></i> Ajouter</button> </div> </div> </form> </div> <div class="md-fab-wrapper"> <a class="md-fab md-fab-accent" id="add_abd" data-uk-modal="{target:'#modal_header_footer'}"> <i class="material-icons"></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() { $("#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(); }); </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 $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>