Exemplo n.º 1
0
	}
	$x++;
}

$smarty->assign('paging',$links->pageMe());
$smarty->assign('listLinks',$listLinks);

// pilih aksi2
$aksi2 = @preg_replace("@[^0-9a-z]@i","",$_GET['aksi2']);
if($_POST['smbDelete'] && $aksi2==""){
	$aksi2 = "delete";
}
$smarty->assign('aksi2',$aksi2);
switch($aksi2){
	case "add":
		if($links->add_news()){
			$rec = mysql_fetch_array(mysql_query("select max(id) from tbl_links"),MYSQL_NUM);
			if($_FILES['gambar']['size']>0){
				$nfile = $rec[0];
				if(!$tips->uploadFile(100000,$nfile)){
					$meta = $links->pesan;
					$smarty->assign('kembali',true);
					$smarty->assign('id',$nfile);
					$smarty->assign('aksi2',$aksi2);
				}else{
					$sql = "update tbl_links set gambar='$links->thumbName' where id=$rec[0]";
					$tips->exQ($sql);
				}
			}
			$smarty->assign('pesan',"Links added !<br>".$meta);
			$smarty->assign('dShowMe',true);