function image_upload($js){
global $ar,$db;
$dt=array();
//$dt['param']=$js;
$p['id']=$js['id'];
$p['title']="";
$p['caption']="";
//$dt['p']=$p;
UploadImageData($p,$js['img_data'],$js['tbl']);
$sql="SELECT * from `files` where modul='".$js['tbl']."' and item_id=".$js['id']." order by id desc";
$res=mysqli_query($db,$sql);
$c=0;
while($r1=mysqli_fetch_assoc($res)) {
$dt['data'][$c]['id']=$r1['id'];
$dt['data'][$c]['url']['small']=$ar['img_url']."".$r1['modul']."/".$r1['path']."/".$r1['seq']."/image/small/".$r1['url'];
$dt['data'][$c]['url']['medium']=$ar['img_url']."".$r1['modul']."/".$r1['path']."/".$r1['seq']."/image/medium/".$r1['url'];
$dt['data'][$c]['url']['big']=$ar['img_url']."".$r1['modul']."/".$r1['path']."/".$r1['seq']."/image/big/".$r1['url'];
$c++;
}
$dt['count']=$c;
$dt['success']=true;
return $dt;
}