View file www/partner/ads/index_c.php

File size: 1.93Kb
<?
define("PARTNER_AUTHORIZATION",1);
include("../../../includes/common.php");

/*PAGE TITLE*/
$page_title = "Выносные коды";

$header = "Выносные коды";


$table_headers = Array(
	"name"=>Array("Название"),
	"code"=>Array("HTML код","align=center"),		
	"preview"=>Array("Предпросмотр","align=center")		
);


$table_items = Array();

$query = "select * from exchanger_codes where status=1";

$res = mysql_query($query);
echo mysql_error();
$itter =$pager['start_item'];
$i=0;

while ($row = mysql_fetch_object($res)){
	$code = str_replace("SITE_URL", $SETTINGS['site_url'], stripslashes($row->html_code));
	$code = str_replace("QUERY_STR", "pid=".$PARTNER_ID, $code);
	$code = str_replace("PARTNER_ID", $PARTNER_ID, $code);
//PARTNER_ID
	
	$table_items[$itter] = Array(
		"itter"=>array($itter,"align=center"),
		"id"=>Array($row->id,"align=center"),
		"name"=>Array(stripslashes($row->name)),
		"code"=>Array("<textarea cols=30 rows=5 onClick='this.select();'>".htmlspecialchars($code)."</textarea>","align=center"),
		"preview"=>Array($code,"align=center")
	);
	$itter++;
}

$smarty->assign('page_title',"Partners");

$smarty->assign('error',$error);

/* table template */
$smarty->assign('pager',$pager);
$smarty->assign('table_headers',$table_headers);
$smarty->assign('table_items',$table_items);
$smarty->assign('table_width',"90%");

$smarty->assign('page_title',$page_title);
$smarty->assign('error',$error);

/* table template */
$smarty->assign('top_menu_tpl',"partner_ads_menu.tpl");
$smarty->assign('main_tpl',"partner_codes.tpl");

$smarty->assign('browser_title',$browser_title);
$smarty->assign('page_title',$page_title);
$smarty->assign('page_meta',$page_meta);
$smarty->assign('errors',$err_arr);

$smarty->assign('PARTNER_ID',$PARTNER_ID);
$smarty->assign('partner_comission',round($PARTNER_DATA['comission_perc']*100,2));

/* display content */
$smarty->display('partner_index.tpl');
?>