Location: PHPKode > projects > GECO > Admin_testimmg.php
<?php

include("dblib.inc");

include("clublib.inc");

checkAdmin();

$message = "";



include("Header.php"); 


$image_dir = "images";
$image_url = "images";
$upload_dir = "uploads/";
$upload_url = "uploads/";
include ("random.php");
  

if ( isset( $fupload ))
	{
	
	// controllo se ha inserito qualcosa
	if  ( $fupload_name == "" ) 
		{
		$message .= " Attenzione! Il campo File non può essere vuoto.";
		}	

	// controllo se e' un' imago	
	if (!($fupload_type == "image/jpeg" || $fupload_type == "image/pjpeg") )
			{
			$message = "Il file deve essere nel formato jpg, quello che hai inviato &egrave; un file $fupload_type";
			}
	// sovrascrivo il file
	if ($message == "")
		{
	    $random_password42 = makeRandomPassword();
		copy ( $fupload, "$image_dir/Pac$random_password42.jpg") or die ("Impossibile copiare il file");
	//	$message = "Il file &egrave; stato aggiornato con successo. <br>(Potrebbe essere necessario aggiornare la pagina per vedere la nuova fotografia)";
            
		
		}

	
	}
	
	

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">



<html>

<head>

	<title>Inserimento Articoli</title>

	<link rel="stylesheet" type="text/css" href="stylesheet.css">

    <style type="text/css">
<!--
.style3 {color: #FF0000}
-->
    </style>
</head>



<body bgcolor="#FFFFFF" link="#504C43" alink="#000000" vlink="#504C43" text="#000000">





<form method="post" action="<?php print $PHP_SELF;?>" name="cv_upload" enctype="multipart/form-data">
<!-- flag di invio del modulo -->

  <input type="Hidden" name="actionflag" value="ins_exp">
    <input type="Hidden" name="catalog" value="<? echo "$catalog"; ?>">
  
</p>
<div align="center"><font class="style4">Eseguire <span class="style3">PRIMA</span> l'upload delle immagini dei Vs Articoli <span class="style3">POI</span>, quando le due immagini appariranno sotto,<br> 
compilare i campi rimanenti del form ed inviare i dati. Il codice a barre &egrave; creato automaticamente.</font></div>
<div align="center"><font class="FacetFieldCaptionTD"></font></div><br>
<table border="0" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="center">
  <!-- BEGIN Error -->
  <tr>
    <td colspan="2" class="FacetDataTD">
	<?php
	if (! $message == "")
	{
	print "$message";
	}
	?>
	</td>
  </tr>
  <!-- END Error -->
    <tr>
<td class="style2">Immagine .jpg :</td> 
<td class="FacetDataTD"><input type="file" name="fupload"  class="FacetButton" class="FacetDataTD"></td></tr>
 <tr>
 
<td colspan="3" align="right" nowrap class="FacetFooterTD">
      <!-- BEGIN Button Insert --><input name="Insert" type="submit" value="UPLOAD" class="FacetButton"><!-- END Button Insert -->
</td></tr>
</table>
</form>


<?

echo "<p align=center><a href=\"/#\" onclick=\"window.open('barcode.php?code=$random_password42&encoding=EAN&scale=2&mode=png','clock','scrollbars=yes,width=300,height=300,left='+(screen.availWidth/2-150)+',top='+(screen.availHeight/2-150)+'');return false;\"><img src=\"barcode.php?code=$random_password42&encoding=EAN&scale=1&mode=png\"  border=0 /></a></p> <p align=center class=style4>INSERISCI NUOVO ARTICOLO </p>
  <form action=Admin_artins.php method=post>
<table width=520 border=0 cellspacing=0 cellpadding=0 align=center>

    
   
 <input name=imgpicc type=hidden value=\"$image_dir/Pac$random_password42.jpg\"> 
 
 <input name=catalog type=hidden value= \"$catalog\" >

<input name=imggra type=hidden value=\"$image_dir/Pac$random_password42.jpg\">
<tr>
<td><div align=right class=style2>Cod. Barre </div></td>
 <td><input name=idart type=text value=\"$random_password42\" size=13 maxlength=13 ></td>
 </tr>
  <tr>
    
    <td><div align=right class=style2>QuantitĂ  in magazzino </div></td>
    <td><input name=quant type=text size=6 maxlength=6></td>
  </tr>
  <tr>
    
    <td><div align=right class=style2>Nome Articolo (usare 1..2 per nomi uguali) </div></td>
    <td><input name=oggnom type=text maxlength=30></td>
  </tr>
  <tr>
    
    <td><div align=right class=style2>Prezzo Unitario iva esclusa. </div></td>
    <td><input name=prezog type=text size=6 maxlength=6></td>
  </tr>
  <tr>

    <td> <div align=right class=style2>IVA senza %  </div></td>
    <td><input name=periva type=text size=3 maxlength=2></td>
  </tr>
   <tr>
    
    <td><div align=right class=style2>Descrizione Articolo</div></td>
    <td><textarea name=descrogg></textarea></td>
  </tr>
  
</table>

    <div align=center>
      <input name=Submit type=submit value=Invia>
    </div>
  </form>";
  print "<tr><td class=\"FacetDataTD\" align=\"center\">";
		print "<img src=\"$image_dir/Pac$random_password42.jpg\" border=0>";
		
		print "</td></tr>";
	
		
		


	
		
	?>
	
</body>
</html>
Return current item: GECO