

<?php
error_reporting(0);
include_once("../class/class.MySQL.php");
require '../class/resizeImage.php';

session_start();

$db	=new MySQL();

$data1="";
$data3="";

if(isset($_REQUEST['upd_id']))
{
	$idd=$_REQUEST['upd_id'];
	//echo $idd;	
			
$data3=array();

$j=0;




foreach($_FILES['idproof']['name'] as $image){


 
if(isset($_FILES['idproof']['name'][$j]) && $_FILES['idproof']['name'][$j]!=''){
		$randnum		=rand(1200,9999);
		$data3['filetype']=$_POST['ptype'][$j];
	 	$image			=$randnum.$_FILES['idproof']['name'][$j];
		$data3['file']		=$image;
		$paththumb= "upload/thumb/".$randnum.$_FILES['idproof']['name'][$j];
		$pathimg= "upload/image/".$randnum.$_FILES['idproof']['name'][$j];
		try {
	
				$image = new ImageResize($_FILES['idproof']['tmp_name'][$j]);
				
				//// Save thumb
				$image->resize(230,110);
				$image->save($paththumb);
				
				/// Save Image
				$image1 = new ImageResize($_FILES['idproof']['tmp_name'][$j]);
				$image1->resizeToWidth(500);
				$image1->save($pathimg);

		} catch (Exception $e) {

		}
		}
	
		
		//echo '{"employ1":'.json_encode($employ1).'}';($data,$where,$table
		$j++;
}
$where['idid']			= $idd;
		$employ1=$db->Update('idproof',$data3,$where);
}


?>