Page 1 sur 2

pb lors de la création d'un état

Posté : 21 juin 2006, 17:18
par sokrates
j'ai réalisé un programme qui affiche une liste de personnel(php/mysql), d'une spécialité donnée par l'utilisateur, sous forme de tableau en vue de l'imprimer à la suitesous format A3, mais le pb qui me géne c'est l'impression marche correctement pour des spécialités mais je trouve 4 colonnes et demi manquantes pour d'autres spécialités, et ça a le mme résultat si je change d'imprimante.
y a t il une explication pour ça!!
et merci d'avance

Posté : 21 juin 2006, 18:08
par mere-teresa
Quelles colonnes ? Celles du milieu ? Celles de la fin ?
Que donne un Aperçu avant impression ?
Avec quel logiciel tu imprimes ?

Posté : 22 juin 2006, 09:04
par sokrates
merci de m'avoir répondu;
ce sont des colonnes du coté droite,l'apperçu aussi est tjrs tronqué, j'imprime avec (fichier,imprimer)

Posté : 22 juin 2006, 11:40
par mere-teresa
Que donne l'aperçu ?

Posté : 22 juin 2006, 11:43
par sokrates
ça donne 3 colonnes manquantes à droite, et ça mme si je change l'imprimante par défault

Posté : 22 juin 2006, 14:15
par goeb
salut,
il semble que ta page HTML soit trop large pour être imprimée sur 29.7 cm ou 42 cm (je sais pas si t'es en mode portrait ou paysage).

essaye de diminuer le grossissement de l'impression (essaye 50% par exemple).


une autre possibilité est de faire des pages HTML moins larges (des colonnes de tableau moins larges par exemple).

Posté : 22 juin 2006, 15:14
par sokrates
ce qui me gène c'est que mon programme donne satisfaction pour des spécialités (l'untilisateur choisie une spécialité, et mon programme donne la listes des personnes qui ont cette spécialité, les données affichées sont les mmme) mais pour d'autre spécialités 3 colonnes (sur la droite du tableau affichés) disparaissent !!!!!

Posté : 23 juin 2006, 11:03
par goeb
et dans le cas où les colonnes disparaissent, c'est pas à cause d'une valeur très très longue (qui élargit exagérément sa colonne) ?

Posté : 23 juin 2006, 11:32
par sokrates
ça je ne peut pas le savoir, moi je suis un débutant en php, mais pqoi les largeurs des colonnes ne sont pas fixes!!!

Posté : 23 juin 2006, 11:37
par Ben-J
pour connaitre la valeur d'une variable php, fais un var_dump( mavariable );
tu peux définir la largeur de tes colonnes avec les attibuts width et heignt dans tes balises html;

Posté : 23 juin 2006, 11:52
par rakizm
tu peux nous montrer le code de l'affichage???

Posté : 23 juin 2006, 12:12
par sokrates
<?

	  if (isset($_POST['specialite']))
     {
       $specialite=$_POST['specialite'];
     }
   else
     {
  		   if (isset($_GET['specialite']))
     		{
       			$specialite=$_GET['specialite'];
	     }     
		 else
		 {
		 	$specialite="0";
  			}
      }
//    $link = mysql_connect("localhost", "root", "") or die("Impossible de se connecter");
//    mysql_select_db("assistant") or die("Could not select database");
//      $link = mysql_connect("mysql.rnu.tn", "uc", "usousse&06") or die("Impossible de se connecter");
//      mysql_select_db("uc") or die("Could not select database");
	  include("base_loc.php");
//	  include("base.php");
      $query = "SELECT * FROM assistant where specialite='$specialite' order by num_ordre";
      $result = mysql_query($query) or die("1 query failed");
	  
?>		
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Untitled Document</title>
</head>

<body>
   <? $t=file("./textes.txt");  ?>
   <? $e=file("./textes2.txt");  ?>
   <? $tt=file("./entete.txt");  ?>
	<?  $line["specialite"]=$specialite ;?>

<center><table border="0" width=80% bgcolor='#FFFFFF'>
<tr>
<th> <p align="center" p><b2><?  echo trim($tt[1]) ?></b2></th>
<th> <p align="center" p><b><?  echo trim($tt[0]) ?></b></th>
</tr>
</table></center>

<center><table border="0" width=100% bgcolor='#aaaaaa'>
<tr>
<th> <p align="center" p><h1><b><?  echo trim($e[0]) ?></b></h1></th>
</tr>
<tr>
<th> <p align="center" p><h1><b><?  echo trim($e[1]) ?></b></h1></th>
</tr>

</table></center>
<? $sp=file("./spec.txt");  ?>

   <form method="post" action="edition.php" name="consultation">
	  
   <h1 align="right" >
	<select name="specialite" >
	<option <? if (trim($line["specialite"]) == trim("$sp[0]")) {echo " selected ";} ?>><? echo $sp[0]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[1]")) {echo " selected ";} ?>><? echo $sp[1]; ?>
  	<option <? if (trim($line["specialite"]) == trim("$sp[2]")) {echo " selected ";} ?>><? echo $sp[2]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[3]")) {echo " selected ";} ?>><? echo $sp[3]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[4]")) {echo " selected ";} ?>><? echo $sp[4]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[5]")) {echo " selected ";} ?>><? echo $sp[5]; ?>
    <option <? if (trim($line["specialite"]) == trim("$sp[6]")) {echo " selected ";} ?>><? echo $sp[6]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[7]")) {echo " selected ";} ?>><? echo $sp[7]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[8]")) {echo " selected ";} ?>><? echo $sp[8]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[9]")) {echo " selected ";} ?>><? echo $sp[9]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[10]")) {echo " selected ";} ?>><? echo $sp[10]; ?>
  	<option <? if (trim($line["specialite"]) == trim("$sp[11]")) {echo " selected ";} ?>><? echo $sp[11]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[12]")) {echo " selected ";} ?>><? echo $sp[12]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[13]")) {echo " selected ";} ?>><? echo $sp[13]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[14]")) {echo " selected ";} ?>><? echo $sp[14]; ?>
  	<option <? if (trim($line["specialite"]) == trim("$sp[15]")) {echo " selected ";} ?>><? echo $sp[15]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[16]")) {echo " selected ";} ?>><? echo $sp[16]; ?>
	<option <? if (trim($line["specialite"]) == trim("$sp[17]")) {echo " selected ";} ?>><? echo $sp[17]; ?>
	</select>
	<?  echo $e[2] ?>  </h1>
  <P align="right">
  <p align="right">
      Cliquez sur <input type="submit" value="Chercher specialité"> 
  </p>
  </form>
  
<div align="right">
  <table width="100%" border="1" cellspacing=0 cellpadding=0 >
  	<tr>
    	 <th rowspan="2" align="center"><?  echo $e[24] ?></th>
		 <th rowspan="2" align="center"><?  echo $e[23] ?></th>
    	 <th rowspan="2" align="center"><?  echo $e[22] ?></th>
    	 <th rowspan="2" align="center"><?  echo $e[21] ?></th>
    	 <th colspan="2" align="center"><?  echo $e[27] ?></th>
    	 <th colspan="6" align="center"><?  echo $e[25] ?></th>
    	 <th colspan="6" align="center"><?  echo $e[5] ?></th>
    	 <th rowspan="2" align="center"><?  echo $e[4] ?></th>
    	 <th rowspan="2" align="center"><?  echo $e[3] ?></th>
    	 <th rowspan="2" align="center"><?  echo $e[30] ?></th>
  	</tr>
  	<tr>
    	 <th align="center"><?  echo $e[20] ?></th>
    	 <th align="center">&nbsp;</th>
    	 <th align="center"><?  echo $e[13] ?></th>
    	 <th align="center"><?  echo $e[19] ?></th>
    	 <th align="center"><?  echo $e[18] ?></th>
    	 <th align="center"><?  echo $e[17] ?></th>
    	 <th align="center"><?  echo $e[12] ?></th>
    	 <th align="center"><?  echo $e[11] ?></th>
    	 <th align="center"><?  echo $e[16] ?></th>
    	 <th align="center"><?  echo $e[9] ?></th>
    	 <th align="center"><?  echo $e[15] ?></th>
    	 <th align="center"><?  echo $e[8] ?></th>
    	 <th align="center"><?  echo $e[7] ?></th>
    	 <th align="center"><?  echo $e[6] ?></th>
   	</tr>
	
<?

    $color=" bgcolor='#cccccc' ";

	while ($line = mysql_fetch_array($result))
	{
   	 if (!($line["specialite"]=="")) { $specialite=$line["specialite"];}
	if ($color == " bgcolor='#cccccc' ")
	{
		$color=" bgcolor='#ffffff' ";
	}
	else
	{
		$color=" bgcolor='#cccccc' ";
	}
?>
   <tr <? echo $color ?>>
      <td width="2.5%" rowspan="6">&nbsp;</td>
      <td width="2.5%" rowspan="6">&nbsp; </td>
      <td width="2%" rowspan="6">&nbsp;</td>
      <td width="2%" rowspan="6">&nbsp;</td>
      <td width="2%" rowspan="6">&nbsp;</td>
      <td width="14%"  align="right" rowspan="6">
  	    <p> : <? echo $t[18]; ?></p>  <p>&nbsp; <?  echo $line["encadreur"];  ?></p>  
	    <p> : <? echo $t[19]; ?></p>  <p> <?  echo $line["sujet"];      ?></p> 
		<p> : <? echo $t[20]; ?></p> <p> <?  echo $line["etab_master"];?></p> </td>
      <td width="10%"  align="right" >&nbsp; <? echo $line["etab_actsc_1"]; ?></td>      
      <td width="2%" align="right" >&nbsp;</td>
      <td width="2%" align="right" >&nbsp;</td>
      <td width="2%" align="right" >&nbsp;</td>
      <td width="10%"  align="right" >&nbsp;<? echo $line["nat_actsc_1"]; ?></td>      
      <td width="5%"  align="right" >&nbsp;<? echo $line["an_actsc_1"]; ?></td>      
      <td width="2%"  align="right">&nbsp;</td>
      <td width="6%"  align="right" >&nbsp;<? echo $line["obs_bac"]; ?></td>      
      <td width="2%"  align="right">&nbsp;</td>
     <td width="3%"  align="right">&nbsp;<? echo $line["date_bac"]; ?></td>      
     <td width="5%"  align="right" >&nbsp; <? echo $line["spec_bac"]; ?></td>      
     <td width="2.5%"  align="right" ><? echo $t[25];  ?></td>      
      <td width="8.5%"  align="right" rowspan="6"><? echo $line["nom"] ;  ?>&nbsp;<? echo $line["prenom"] ;  ?></td>
      <td width="3%"  align="right" rowspan="6">&nbsp;<? echo $line["num_cin"] ; ?></td>
      <td width="2%"  align="right" rowspan="6">&nbsp;<? echo $line["num_ordre"] ; ?></td>
	</tr>
	<tr <? echo $color ?>>
		<td align="right">&nbsp;<? echo $line["etab_actsc_2"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["nat_actsc_2"]; ?></td>
		<td align="right">&nbsp;<? echo $line["an_actsc_2"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right"> &nbsp;<? echo $line["obs_maitr"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["date_maitr"]; ?></td>
		<td align="right">&nbsp;<? echo $line["spec_maitr"]; ?></td>
		<td align="right">&nbsp;<? echo $t[26];  ?></td>
	</tr>
	<tr <? echo $color ?>>
		<td align="right">&nbsp;<? echo $line["etab_actsc_3"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right"> &nbsp;<? echo $line["nat_actsc_3"]; ?></td>
		<td align="right">&nbsp;<? echo $line["an_actsc_3"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["obs_mast"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["date_mast"]; ?></td>
		<td align="right">&nbsp;<? echo $line["spec_mast"]; ?></td>
		<td align="right">&nbsp;<? echo $t[27];  ?></td>
	</tr>
	<tr <? echo $color ?>>
		<td align="right">&nbsp;<? echo $line["etab_actpf_1"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["nat_actpf_1"]; ?></td>
		<td align="right">&nbsp;<? echo $line["an_actpf_1"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["obs_doc"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["date_doc"]; ?></td>
		<td align="right">&nbsp;<? echo $line["spec_doc"]; ?></td>
		<td align="right">&nbsp;<? echo $t[28];  ?></td>
	</tr>
	<tr <? echo $color ?>>
		<td align="right">&nbsp;<? echo $line["etab_actpf_2"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["nat_actpf_2"]; ?></td>
		<td align="right">&nbsp;<? echo $line["an_actpf_2"]; ?></td>
		<td rowspan="2" align="right">&nbsp;</td>
		<td rowspan="2" align="right">&nbsp;<? echo $line["obs_autr"]; ?></td>
		<td rowspan="2" align="right">&nbsp;</td>
		<td rowspan="2" align="right">&nbsp;<? echo $line["date_autr"]; ?></td>
		<td rowspan="2" align="right">&nbsp;<? echo $line["spec_autr"]; ?></td>
		<td rowspan="2" align="right">&nbsp;<? echo $t[29];  ?></td>
	</tr>
		<tr <? echo $color ?>>
		<td align="right">&nbsp;<? echo $line["etab_actpf_3"]; ?></td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="right">&nbsp;<? echo $line["nat_actpf_3"]; ?></td>
		<td align="right">&nbsp;<? echo $line["an_actpf_3"]; ?></td>
	</tr>
	<!--  fin personne --> 
	
	
	
	
<?
	}
	if (trim($line["specialite"])=="") {$line["specialite"]=$specialite ;}
//	  echo("specialité xx = ") ;echo("$specialite");
//	  echo("linespecialité xx = ") ;echo($line["specialite"]);
	  
?>		  
</table>

</div> 

</body>
</html>

Posté : 23 juin 2006, 14:36
par Ben-J
édite ton message et met le entre balise php ce sera plus lisible ^^

Posté : 24 juin 2006, 08:34
par sokrates
de quel message vous parlez!!! explique s v p, je suis débutant

Posté : 24 juin 2006, 09:24
par Ben-J
ton message précédent, Posté le: 23 Juin 2006, 12:12, avec ton code
tu as le bouton éditer sur la droite en haut, puis tu rajoutes
 avant ton code et 
après.
et sinon que te donne tes tests ?