Пример #1
0
$smarty->assign('refresh',$_SERVER['REQUEST_URI']);
$meta = '<meta http-equiv="refresh" content="3;url=\''.$_SERVER['SCRIPT_NAME'].'?aksi=partnerk" />';
if($_SERVER['HTTP_REFERER']){
	$smarty->assign('referer',$_SERVER['HTTP_REFERER']);
}else{
	$smarty->assign('referer',$_SERVER['SCRIPT_NAME']."?aksi=partner");
}
$smarty->assign('path_editor',PATH_EDITOR);

// fetch data
$x = 0;
$partner->sql = "select id,name,substr(description,1,100) as isi,logo,link,type_partner, if(status=1,'aktif', 'non aktif') as status from tbl_partner order by id Desc";
$partner->perPage = REC_PER_PAGE;
$partner->gul = 10;
$sql = $partner->genSql();
$result = $partner->exQ($sql);
while($data = mysql_fetch_array ($result,MYSQL_ASSOC)){
	foreach($data as $k=>$i){
		$listPartner[$x][$k]=$i;
		if($k=="logo"){
			if($i == ""){
				$listPartner[$x][$k] = IMAGE_PARTNER."/noPict.jpg";
			} else {
				$listPartner[$x][$k] = IMAGE_PARTNER."/".$i;
			}
		} 
		if($k=="type_partner"){
			//kategoriPrduct
			$listkategori = $partner->Kategori($i);
			$listPartner[$x][$k] = $listkategori['description'];
		}