Page 1 sur 1

IMPRESSION DES CARTE SUR PETITE DIMENSION

Posté : 11 oct. 2012, 15:48
par adebo
bonjour a tous, j suis nouveau sur ce forum,je veux faire des impressions des cartes, avec mon code, j'arrive a imprimer 5 cartes sur une page de format A4, mais mois je veux imprimer un seule carte par page de petit format avec les dimensions 8,65cm sur 5,45cm car j'ai nue imprimante pour imprimer les cartes. alors comment faire ? merci

Re: IMPRESSION DES CARTE SUR PETITE DIMENSION

Posté : 11 oct. 2012, 15:58
par piotrowski-s
et si tu nous montrais ton code pour commencer?

Re: IMPRESSION DES CARTE SUR PETITE DIMENSION

Posté : 11 oct. 2012, 16:22
par adebo
mon code est:
<form method='POST' action='imprimautrecarte.php'>
			 <?php 
  $req=mysql_query('select * from catre');
		 $cont= 0;
		  while($sql=mysql_fetch_array($req))
		{
			if((count($sql) > 1))
			{
			  $cont= $cont+1;
			    print"<table border='1px' width='690' height='100' align='center'style='-moz-border-radius:12 12 12 12;'>";
						print"<tr>";
								print"<td width='50%'>";
										print"<table>";
												
											print"<tr id='tete'><td align='center' colspan='3'><font color='red'size='3'>VALIDITE:".$sql['8']."</font></td></tr>";
											 print"<tr id='corp'><td colspan='3'><i><font color='blue'<u>N° CAB</u></font>: ".$sql['6']."<span id='nom'></font></i></td> </tr>";
											 print"<tr id='corp'><td><u><b>NOM:</b></u>       ".  $sql['1']. "</td><td rowspan='3' align='right' colspan='2'><img src=".$sql['7']." alt='votre photo' width=80 height=80/></td> </tr>";
										     print"<tr id='corp'><td><u><b>PRENOMS:</b></u>    ".$sql['2']."</td> </tr>";
										     print"<tr id='corp'><td width='75%'><u><b>Né(e) le  :</b></u>   " .$sql['3'] .  "  à  " . $sql['4'] . "</td></tr>";
											 print"<tr id='corp'><td><u><b>SPECIALITE:</b> </u>" .$sql['5']."</td></tr>";
											 print"<tr id='text'><td colspan='2'align='right' colspan='2'><font color='white'></font></i></td></tr>";
							     		     print"<tr><td  align='center' widht='75%' > Le D/COUS:</td><td align='right' colspan='2'>Le titulaire</td></tr>";
											 print'</table>';
											 
								print"</td>";
							
								
								print"<td width='50%'>";
								
								     print"<table>";  
											 print"<tr rowspan='2'><td align='left'><img src='images/drapo1.png'/></td><td align='center'><font color='green'>REPUBLIQUE</font><font color='yellow'> DU</font><font color='red'>BENIN</font></td>";
											 print"<td align='right'><font color='red' size='2'><img src='images/drapo2.png'/></font></td></tr>";
											 print"<tr><td colspan='3' align='center' size='4'><b>CENTRE DES OEUVRES UNIVERSITAIRES ET SOCIALES DE PARAKOU</b></td> </tr>";
											 print"<tr><td colspan='3' align='center'><b><img src='images/carte.jpg' width='75%'></b></td> </tr>";
											 print"<tr ><td colspan='3' align='center' rospan='2'>N°:B00".$cont."/COUS-PARAKOU</td> </tr>";
										     print"<tr id='text'><td colspan='3' align='center'><font color='green'>Cette carte est strictement personnelle.<br/>Elle est indispensable pour beneficier des oeuvres universitaires</font></td></tr>";
										     print"<tr><td><br/></td></tr>";
									 print'</table>';
									     
			   				  print"</td>";
						print"</tr>";
				print"</table>";
				//print"<br/>";
			
			   // $req3=mysql_query('delete from resident WHERE num="'.$sql['0'].'"') or die ('Erreur <br/>'.mysql_error());

			  }
       else
            {
			 echo"<script type=\"text/javascript\">" ;
					echo "alert('CARTE VIDES , VOUS N'AVIEZ PAS ENTRE LES DONNEES!!');"; 
					echo "window.history.back();"; 	
					echo "</script>";	
			
			}	   
	}
			
			
			    //$req2=mysql_query('delete from catre WHERE nom="'.$sql['0'].'"') or die ('Erreur <br/>'.mysql_error());
			

				?>
			<script type="text/javascript">
				window.print() ;
			   </script>