include("../database/koneksi.php");
$tgl= date('Y-m-d H:i:s');
$sql="select nomor from foto_res where voucher='".$_REQUEST[voucher]."' order by length(nomor) desc, nomor desc"; //echo $sql; exit;
$hasil=mysql_query($sql);
$line=mysql_fetch_array($hasil);
$baris=(int)$line[0];$baris++;
if ($baris<10){
$nomor= "000".$baris;
}else if ($baris<100){
$nomor= "00".$baris;
}else if ($baris<1000){
$nomor= "0".$baris;
}else{
$nomor= $baris;
}
$info = pathinfo($_FILES['file1']['name']);
$file_name=$_POST['voucher'].$nomor.".".$info['extension'];//echo $file_name;// echo $info." ".$_POST['file1']['name']."
";
/*for ($i=0;$i