Beispiel #1
0
$smarty->assign('paging',$partner->pageMe());
$smarty->assign('listPartner',$listPartner);

// 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($partner->add_news()){
			$rec = mysql_fetch_array(mysql_query("select max(id) from tbl_partner"),MYSQL_NUM);
			if($_FILES['gambar']['size']>0){
				$nfile = $rec[0];
				if(!$partner->uploadFile(100000,$nfile)){
					$meta = $partner->pesan;
					$smarty->assign('kembali',true);
					$smarty->assign('id',$nfile);
					$smarty->assign('aksi2',$aksi2);
				}else{
					$sql = "update tbl_partner set logo='$partner->thumbName' where id=$rec[0]";
					$partner->exQ($sql);
				}
			}
			$smarty->assign('pesan',"Products added !<br>".$meta);
			$smarty->assign('dShowMe',true);
		}else{
			$kategori = eraseStrange($_POST['kategori']);
			$draw = $partner->drawKategori('$kategori');
			$smarty->assign("drawK",$draw);