Page 1 sur 1

Tracer lignes et colonnes pour imprssion

Posté : 15 juin 2014, 23:34
par Dexter.o
Voilà je voudrais imprimer un tableau de planning et j'ai mis ce script:

echo" <td><a href=tableau_garde.php?month=$month&year=$year&person=$person&section=$section&equipe=$equipe&print=YES target=_blank><img src=images/printer.gif width=22 border=0 alt='imprimer le tableau'></a></td>
<tr></table>";

Mis les lignes et colonnes n'apparaissent pas.

Re: Tracer lignes et colonnes pour imprssion

Posté : 16 juin 2014, 09:59
par Elie
Bah faut voir ce que retourne tableau_garde.php

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 18:42
par Dexter.o
En fait c'est un tableau sans lignes ni colonnes qui s'imprime.
Y a t il une ligne de commande spécifique pour ça?

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 18:50
par Elie
<table border="1">

Mais bon on comprend ni ton problème ni ce que tu vois a l'ecran

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 20:40
par Dexter.o
Voilà ce que j'ai...
Image

et voilà ce que je voudrais mais pour le tableau précédent...

Image

merci pour votre patience... :oops:

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 20:43
par Elie
Donne le
Code
De
Tableau garde.php

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 22:31
par Dexter.o

Code : Tout sélectionner

<?php include_once ("config.php"); check_all(0); if (isset($_GET["person"])) $person=$_GET["person"]; else $person=0; if (isset($_GET["section"])) $section=$_GET["section"]; else $section=0; if (isset($_GET["equipe"])) $equipe=$_GET["equipe"]; else $equipe=1; if (isset($_GET["print"])) $print=$_GET["print"]; else $print='NO'; if (isset($_GET["month"])) { $month=$_GET["month"]; $year=$_GET["year"]; } else { $day=date("d"); $month=date("n"); $year=date("Y"); if ( $day >= 24 ) { // afficher le mois suivant if ( $month == 12 ) { $month = 1; $year= $year +1; } else $month = $month +1 ; } } $moislettres=moislettres($month); writehead(); echo "<script type=\"text/javascript\" src=\"js/tableau_garde.js\"></script>"; //===================================================================== // formulaire //===================================================================== $yearnext=date("Y") +1; $yearcurrent=date("Y"); $yearprevious = date("Y") - 1; echo "<form>"; if ( $print == 'NO' ) { echo "<p><table border=0><tr><td>"; echo "année<select name='menu1' onchange=\"fillmenu(this.form,this.form.menu1,this.form.menu2,'".$person."','".$section."','".$equipe."')\">"; if ($year > $yearprevious) echo "<option value='$yearprevious'>".$yearprevious."</option>"; else echo "<option value='$yearprevious' selected>".$yearprevious."</option>"; if ($year <> $yearcurrent) echo "<option value='$yearcurrent' >".$yearcurrent."</option>"; else echo "<option value='$yearcurrent' selected>".$yearcurrent."</option>"; if ($year < $yearnext) echo "<option value='$yearnext' >".$yearnext."</option>"; else echo "<option value='$yearnext' selected>".$yearnext."</option>"; echo "</select></td>"; echo "<td>mois<select name='menu2' onchange=\"fillmenu(this.form,this.form.menu1,this.form.menu2,'".$person."','".$section."','".$equipe."')\">"; $m=1; while ($m <=12) { $monmois = $mois[$m - 1 ]; if ( $m == $month ) echo "<option value='$m' selected >".$monmois."</option>\n"; else echo "<option value= $m >".$monmois."</option>\n"; $m=$m+1; } echo "</select>"; echo "</td></tr></table>"; echo "</form>"; } function intercase() { global $print, $mydarkcolor; if ( $print == "NO" ) { echo "<td bgcolor=$mydarkcolor width=0></td>"; } } $mycolor=$textcolor; //nb de jours du mois $d=nbjoursdumois($month, $year); $queryg="select EQ_NOM, EQ_JOUR, EQ_NUIT, S_ID from equipe where EQ_ID=".$equipe; $resultg=mysql_query($queryg); $rowg=@mysql_fetch_array($resultg); $EQ_NOM=$rowg["EQ_NOM"]; $EQ_JOUR=$rowg["EQ_JOUR"]; $EQ_NUIT=$rowg["EQ_NUIT"]; $EQS_ID=$rowg["S_ID"]; //===================================================================== // le tableau est il terminé ? sinon seuls certains peuvent le voir //===================================================================== $query="select PGS_STATUS from planning_garde_status where PGS_YEAR=$year and PGS_MONTH=$month and EQ_ID=$equipe"; $result=mysql_query($query); $row=@mysql_fetch_array($result); $PGS_STATUS=$row["PGS_STATUS"]; if (( $PGS_STATUS <> "OK" ) and (! check_rights($_SESSION['id'], 6)) and ($print == "NO")){ echo "<body background=$background text=$textcolor>"; write_msgbox("Attention",$error_pic,"Le tableau de $EQ_NOM pour $moislettres $year n'est pas disponible. Vous devez attendre qu'il soit créé par le bureau opérations.",30,30); } else { //===================================================================== // affiche le tableau //===================================================================== $query="select P_ID, P_PRENOM, P_NOM from pompier order by P_NOM"; $result=mysql_query($query); if ( $print == "YES" ) { echo "<body onload='javascript:window.print()'>"; } else { echo "<body>"; } echo "<div align=center><font size=4><b>Tableau de ".$EQ_NOM." pour $moislettres $year"; if ( $section <> 0 ) echo " (section $section)"; echo "<br></b></font>"; if ( check_rights($_SESSION['id'], 7)) { if ( $PGS_STATUS <> "OK" ) { echo "<table width=700 cellspacing=0 border=0 ><TR> <td width=10%>".$warning_pic."<td> <td width=90%>Le tableau n'est pas accessible par le personnel. <input type='button' value='Montrer' name='montrer' onclick=\"bouton_redirect('tableau_garde_status.php?month=$month&year=$year&section=$section&equipe=$equipe&action=montrer','montrer', '".$EQ_NOM."')\"></td> </tr></table>"; } } if ( $print == "NO" ) { echo "<p>"; if ( check_rights($_SESSION['id'], 5)) { echo " <input type='button' value='Vider' name='vider' onclick=\"bouton_redirect('tableau_garde_delete.php?month=$month&year=$year&equipe=$equipe','vider', '".$EQ_NOM."')\">"; } if ( check_rights($_SESSION['id'], 7)) { echo " <input type='button' value='Remplir' name='remplir' onclick=\"bouton_redirect('processing.php?month=$month&year=$year&day=1&equipe=$equipe','remplir', '".$EQ_NOM."');\">"; } if ( check_rights($_SESSION['id'], 7)) { if ( $PGS_STATUS == "OK" ) { echo " <input type='button' value='Masquer' name='masquer' onclick=\"bouton_redirect('tableau_garde_status.php?month=$month&year=$year&section=$section&equipe=$equipe&action=masquer','masquer', '".$EQ_NOM."')\">"; } } if ($nbsections == 3 ) echo "<table width=500 cellspacing=0 border=0 >"; else echo "<table width=380 cellspacing=0 border=0 >"; echo "<tr height=60>"; // filtre personnes echo " <td> filtre du personnel<br> <select id='filtre' name='filtre' onchange='redirect(".$month.",".$year.",document.getElementById(\"filtre\").value,".$section.",".$equipe.")'> <option value='0'>Tout le monde</option>"; while ($row=@mysql_fetch_array($result)) { $P_NOM=$row["P_NOM"]; $P_PRENOM=$row["P_PRENOM"]; $P_ID=$row["P_ID"]; echo "<option value='".$P_ID."'"; if ($P_ID == $person ) echo " selected "; echo ">".strtoupper($P_NOM)." ".ucfirst($P_PRENOM)."</option>\n"; } // filtre section if ($nbsections == 3 ) { if ( $regime_travail == 3 ) $g="1,2,3"; else $g="1,2,3,4"; $query="select S_ID from section where S_ID in (".$g.")"; echo "</select></td>"; echo " <td>filtre des jours<br> <select id='section' name='section' onchange='redirect(".$month.",".$year.",".$person.",document.getElementById(\"section\").value,".$equipe.")'> <option value='0'>Tous les jours</option>"; $result=mysql_query($query); while ($row=@mysql_fetch_array($result)) { $S_ID=$row["S_ID"]; echo "<option value='".$S_ID."'"; if ($S_ID == $section ) echo " selected "; echo ">jours section ".$S_ID."</option>\n"; } echo "</select></td>"; } //choix type de garde $query="select distinct e.EQ_ID, e.EQ_NOM from equipe e, poste p where e.EQ_ID=p.EQ_ID and e.EQ_TYPE='GARDE'"; echo " <td>type de garde<br> <select id='equipe' name='equipe' onchange='redirect(".$month.",".$year.",".$person.",".$section.",document.getElementById(\"equipe\").value)'>"; $result=mysql_query($query); while ($row=@mysql_fetch_array($result)) { $EQ_ID=$row["EQ_ID"]; $EQ_NOM=$row["EQ_NOM"]; echo "<option value='".$EQ_ID."'"; if ($EQ_ID == $equipe ) echo " selected "; echo ">".$EQ_NOM."</option>\n"; } echo "</select></td>"; echo" <td><a href=tableau_garde.php?month=$month&year=$year&person=$person&section=$section&equipe=$equipe&print=YES target=_blank><img src=images/printer.gif width=22 border=0 alt='imprimer le tableau'></a></td> <tr></table>"; } // =============================================== // liste des postes devant être affichés // =============================================== $queryp="select PS_ID, TYPE, DESCRIPTION from poste, equipe where poste.EQ_ID=equipe.EQ_ID and equipe.EQ_ID=".$equipe." order by PS_ID"; $resultp=mysql_query($queryp); if ( $print == 'NO') echo "<p><table> <tr> <td class='FondMenu'>"; if ( $print == "NO" ) { echo "<table border=0 cellspacing=0 >"; } else { echo "<table border=1 cellspacing=0 cellpadding=0 bordercolor=$mydarkcolor>"; } // =============================================== // premiere ligne du tableau // =============================================== echo "<tr height=15 class=TabHeader>"; echo "<td width=90><font size=1>Jour</font></td> <td width=10><font size=1>S.</font></td> <td width=10><font size=1>A/G</font></td>"; intercase(); while ($rowp=@mysql_fetch_array($resultp)) { $TYPE=$rowp["TYPE"]; $DESCRIPTION=$rowp["DESCRIPTION"]; echo "<td bgcolor=$mydarkcolor width=100 align=center><font size=1>$DESCRIPTION</font></td>"; } echo "</tr>"; // =============================================== // 2 lignes par jour (j / N) // =============================================== $day=1; while ( $day <= $d ) { if ( $EQS_ID <> 0 ) $sectionjour=get_section_pro_jour($equipe,$year, $month, $day); else $sectionjour=0; if (( $section == 0 ) or ( $section == $sectionjour )) { $_dt= mktime(0,0,0,$month,$day,$year); if ( dateCheckFree($_dt)) { $daycolor="#FFFF99"; $nightcolor="#FFCC33"; } else { $daycolor="#FFFFFF"; $nightcolor="$mylightcolor"; } // jour if ( $EQ_JOUR == 1 ) { // si la garde est active le jour if (( check_rights($_SESSION['id'], 6)) && ( $print == "NO")) { echo "<tr height=9 bgcolor=$daycolor onMouseover=\"this.bgColor='yellow'\" onMouseout=\"this.bgColor='$daycolor'\" onclick=\"this.bgColor='#33FF00'; displaymanager('manual.php?month=$month&year=$year&section=$section&day=$day&equipe=$equipe&origine=tableau')\">"; } else echo "<tr height=9 bgcolor=$daycolor>"; echo "<td width=90><font color=#0000CC size=1>"; echo date_fran($month, $day, $year); echo "</font></td>"; if (($nbsections == 3 ) and ( $sectionjour <> 0 )) $img="<img src=images/".$sectionjour.".gif>"; else $img='-'; echo "<td width=10 align=center>$img</td>"; echo "<td width=10 align=center><font color=#0000CC size=1>A</font></td>"; intercase(); $resultp=mysql_query($queryp); while ($rowp=@mysql_fetch_array($resultp)) { $PS_ID=$rowp["PS_ID"]; $query="select pg.P_ID, p.P_NOM, p.P_STATUT, pg.PG_STATUT, p.P_SECTION, pg.TYPE from planning_garde pg, pompier p where pg.TYPE ='J' and pg.PS_ID=".$PS_ID." and pg.P_ID=p.P_ID and pg.PG_DATE='".$year."-".$month."-".$day."' order by pg.TYPE"; $result=mysql_query($query); if ( mysql_num_rows($result) == 0 ) { $PG_STATUT='SPV'; $P_STATUT='SPV'; $P_NOM='-'; $mycolor='#A0A0A0'; echo "<td width=100 align=center><font size=1>-</font></td>"; } else { // cas général 1 personne $row=@mysql_fetch_array($result); $P_NOM=$row["P_NOM"]; $P_ID=$row["P_ID"]; $P_SECTION=$row["P_SECTION"]; $PG_STATUT=$row["PG_STATUT"]; $P_STATUT=$row["P_STATUT"]; $PG_TYPE=$row["TYPE"]; $boldtag1="<b>";$boldtag2="</b>"; if ( $P_STATUT == 'SPP' ) $mycolor='#FF0000'; else $mycolor=$textcolor; if ( $P_STATUT <> $PG_STATUT ) { // cas garde SPPV $boldtag1=$boldtag1."<u>"; $boldtag2=$boldtag2."</u>"; } if (( $person <> 0 ) and ( $person <> $P_ID )) { $mycolor='#A0A0A0'; $boldtag1="<i>"; $boldtag2="</i>"; } if ( $PG_TYPE=="J" ) echo "<td width=100 align=center><font size=1><font color=$mycolor>".$boldtag1.strtoupper($P_NOM).$boldtag2."</font></td>"; } } echo "</tr>"; } //jour // nuit if ( $EQ_NUIT == 1 ) { // si la garde est active la nuit if (( check_rights($_SESSION['id'], 6)) && ( $print == "NO")) { echo "<tr height=9 bgcolor=$nightcolor onMouseover=\"this.bgColor='yellow'\" onMouseout=\"this.bgColor='$nightcolor'\" onclick=\"this.bgColor='#33FF00'; displaymanager('manual.php?month=$month&year=$year&section=$section&day=$day&equipe=$equipe&origine=tableau')\">"; } else echo "<tr height=9 bgcolor=$nightcolor>"; if ( $EQ_JOUR == 0 ) { echo "<td width=90><font color=#0000CC size=1>"; echo date_fran($month, $day, $year); echo "</font></td>"; if ($nbsections == 3 ) echo "<td width=10 align=center><img src=images/".$sectionjour.".gif></td>"; else echo "<td width=10 align=center></td>"; echo "<td width=10 align=center><font color=#0000CC size=1>G</font></td>"; } else { echo "<td width=90 align=center><font color=#0000CC size=1>''</font></td>"; echo "<td width=10 align=center><font color=#0000CC size=1></font></td>"; echo "<td width=10 align=center><font color=#0000CC size=1>N</font></td>"; } intercase(); $resultp=mysql_query($queryp); while ($rowp=@mysql_fetch_array($resultp)) { $PS_ID=$rowp["PS_ID"]; $query="select pg.P_ID, p.P_NOM,p.P_STATUT, p.P_SECTION, pg.PG_STATUT from planning_garde pg, pompier p where pg.TYPE='N' and pg.PS_ID=".$PS_ID." and pg.P_ID=p.P_ID and pg.PG_DATE='".$year."-".$month."-".$day."'"; $result=mysql_query($query); $row=@mysql_fetch_array($result); $sectioninfo=""; if ( mysql_num_rows($result) == 0 ) { $PG_STATUT='SPV'; $P_STATUT='SPV'; $P_NOM='-'; } else { $P_NOM=$row["P_NOM"]; $P_ID=$row["P_ID"]; $P_SECTION=$row["P_SECTION"]; $PG_STATUT=$row["PG_STATUT"]; $P_STATUT=$row["P_STATUT"]; } $boldtag1="<b>";$boldtag2="</b>"; if ( $P_STATUT == 'SPP' ) $mycolor='#FF0000'; else $mycolor=$textcolor; if ( $P_STATUT <> $PG_STATUT ) { // cas garde SPPV $boldtag1=$boldtag1."<u>"; $boldtag2=$boldtag2."</u>"; } if (( $person <> 0 ) and ( $person <> $P_ID )) { $mycolor='#A0A0A0'; $boldtag1="<i>"; $boldtag2="</i>"; } echo "<td width=100 align=center ><font size=1><font color=$mycolor>".$boldtag1.strtoupper($P_NOM).$boldtag2."</font></td>"; } echo "</tr>"; } // if $EQ_NUIT == 1 } // if section $day=$day+1; } //end loop of days echo "</table>"; if ( $print == 'NO') echo "</td></tr></table>"; } // tableau termine ?>

Re: Tracer lignes et colonnes pour imprssion

Posté : 17 juin 2014, 23:53
par Elie
Je ne suis pas la pour critiquer ce code HTML des années 2000 avec des <table> et des <font> et sans aucun " ...

La réponse est la : http://css.mammouthland.net/tableaux-bo ... er-css.php

Re: Tracer lignes et colonnes pour imprssion

Posté : 18 juin 2014, 20:54
par Dexter.o
Pour info j'y suis arrivé en mettant ça:

Code : Tout sélectionner

$queryp="select PS_ID, TYPE, DESCRIPTION from poste, equipe where poste.EQ_ID=equipe.EQ_ID and equipe.EQ_ID=".$equipe." order by PS_ID"; $resultp=mysql_query($queryp); if ( $print == 'NO') echo "<p><table> <tr> <td class='FondMenu'>"; if ( $print == "NO" ) { echo "<table border=0 cellspacing=0 >"; } else { echo "<table border=1 cellspacing=0 cellpadding=0 bordercolor=$mydarkcolor>"; }
mais les traits sont un peu gros...je ne vois pas ou je pourrais modifier ça .. 8-|

Re: Tracer lignes et colonnes pour imprssion

Posté : 18 juin 2014, 21:00
par Elie
<table style="border: 1px solid $mydarkcolor">
Si 1px c'est trop gros, autant abandonner tout de suite

Re: Tracer lignes et colonnes pour imprssion

Posté : 19 juin 2014, 17:53
par Dexter.o
Merci Elie pour ton aide.