0x1998 - MANAGER
Edit File: suivi_campagne.php
<?php session_cache_limiter('private'); include "config/garde.php"; $id=isset($_GET['id'])? $_GET['id']:""; $sql="select nom, list_statut_denom from sms inner join user_type on user_type.id=sms_destid left join list_statut on sms_statut=list_statut_id where sms_campagne='".$id."'"; $result=mysqli_query($link,$sql); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Suivi d'une campagne de SMS</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <meta http-equiv="refresh" content="20" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="SHORTCUT ICON" href="../config/logo.jpg" /> <?php entete(); ?> <script type="text/javascript"> $(document).ready(function() { etat_suivi=sessionStorage.getItem('etat_suivi') || 1; etat_reponse=sessionStorage.getItem('etat_reponse') || 1; document.ouverture[0].value=etat_suivi; document.ouverture[1].value=etat_reponse; if (etat_suivi==1) {action('suivi','plus');} else if (etat_suivi==-1) action('suivi','moins'); if (etat_reponse==1) action('reponse','plus'); else if (etat_reponse==-1) action('reponse','moins'); }); function action(zone,etat) { var target="#"+zone; var bouton="#"+zone+"_"+etat; var bouton_oppose= (etat=='plus') ? "#"+zone+"_moins": "#"+zone+"_plus"; var champ_formulaire="etat_"+zone; if (etat=='moins') {$(target).hide(); $(bouton).hide(); $(bouton_oppose).show(); document.ouverture[champ_formulaire].value=-1; sessionStorage.setItem(champ_formulaire, "-1"); } else if (etat=='plus') {$(target).show();; $(bouton).hide(); $(bouton_oppose).show(); document.ouverture[champ_formulaire].value=1; sessionStorage.setItem(champ_formulaire, "1");} } </script> </head> <body> <form id="ouverture" name="ouverture"> <input type="hidden" id="etat_suivi" name="etat_suivi" /> <input type="hidden" id="etat_reponse" name="etat_reponse" /> </form> <div class="col-md-10 col-md-offset-1 "> <div class="panel panel-primary"> <div class="panel-heading"> <h3><center> Suivi d'une campagne SMS </center></h3> </div> <div class="panel-body"> <div id="content"> <div class="row"> <div class="col-md-1"> <h4><span class="label label-info">Suivi</span></h4> </div> <div class="col-md-1"> <span id="suivi_moins" class="glyphicon glyphicon-minus" style="padding-top: 20%" onclick="action('suivi','moins')"></span> <span id="suivi_plus" class="glyphicon glyphicon-plus" style="padding-top: 20%" onclick="action('suivi','plus')"></span> </div> </div> <div id="suivi"> <table class="table table-bordered"> <tr> <td class="info text-center" >Nom</td> <td class="info text-center" >Etat</td> </tr> <?php while ($a_row=mysqli_fetch_array($result)) { echo "<tr> <td width=15% >".$a_row['nom']."</td> <td width=30% >".$a_row['list_statut_denom']."</td> </tr>"; } ?> </tr> </table> </div> <div class="row"> <div class="col-md-1"> <h4><span class="label label-info">Réponse</span></h4> </div> <div class="col-md-1"> <div id="reponse_moins"><span class="glyphicon glyphicon-minus" style="padding-top: 20%" onclick="action('reponse','moins')"></span></div> <div id="reponse_plus"><span class="glyphicon glyphicon-plus" style="padding-top: 20%" onclick="action('reponse','plus')"></span></div> </div> </div> <div id="reponse"> <?php $reponse=mysqli_query($link,"select sms_reponse from sms where sms_campagne='".$id."' limit 1"); $b_row=mysqli_fetch_array($reponse); if ($b_row['sms_reponse']=='answer') { echo " <table class=\"table table-bordered\"> <tr> <td class=\"info text-center\" >Nom</td> <td class=\"info text-center\" >Date</td> <td class=\"info text-center\" >Reponse</td> </tr>"; $sql="select nom, message, DATE_FORMAT(date,\"%d/%m/%Y %H:%i:%s\") as date from received inner join sms on sms_id=ret_id inner join user_type on user_type.id=sms_destid where sms_campagne='".$id."'"; $result=mysqli_query($link,$sql); while ($a_row=mysqli_fetch_array($result)) { echo "<tr> <td width=15% >".$a_row['nom']."</td> <td width=15% >".$a_row['date']."</td> <td width=30% >".$a_row['message']."</td> </tr>"; } echo"</table>"; } ?> </div> </div> </div> <div class="panel-footer"> <center>Cette page se rafraichit automatiquement toutes les 20 secondes</center> </div> </div> </div> </body> </html>