<?php
require('top.php');

InitGP(array('action','ad_id','ad_name','ad_title','ad_height','ad_width','ad_e_times',),'GP',false);
// 频道管理
/***************************************************************************************/


if ($action == 'ad') {
	$sql = "SELECT * FROM ".$db_tablepre."ad ";
	$query = sql_return($sql);

}
elseif ($action == 'm'){
	
	strtotime($ad_e_times) ? $ad_e_times = strtotime($ad_e_times) : $ad_e_times = $timestamp ;
	$ad_title = addslashes(serialize($ad_title));
	
	
	$sql = "UPDATE ".$db_tablepre."ad  SET ad_name='".$ad_name."',ad_title='".$ad_title."',ad_height='".$ad_height."',ad_width='".$ad_width."',ad_up_times='".$timestamp."',ad_e_times='".$ad_e_times."' WHERE ad_id=".$ad_id;
//

	$showad_path = '../data/cache/ad/cache_ad_'.$ad_id.'.htm';
	$showad_path_url = '../data/cache/ad/cache_ad_'.$ad_id.'_url.htm';
    unlink($showad_path);
    unlink($showad_path_url);
	sql_return($sql)  && Showmsg('post_Success');

}


require PrintEot($self_template,'A');
?>