1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| <?php
include ("include/config.php");
$msg = $_GET[msg];
if(isset($_GET['no_www']))
$msg = "Vous avez pas de sites web pour faire de pub. Enregistrer un premièrement.";
if(isset($_POST[delete_pid])){
$chk_ads = mysql_result(mysql_query("select count(*) from advertisersinfo where ( end_date > curdate() or ppc_balance > 0 ) and pid = '$_POST[del_pid]' "),0,0);
if($chk_ads == 0){
mysql_query("delete from publishersinfo where pid='$_POST[del_pid]'");
mysql_query("delete from advertisersinfo where pid='$_POST[del_pid]'");
mysql_query("delete from advertisersinfo_edit where pid='$_POST[del_pid]'");
mysql_query("delete from publishers_adspaces where pid='$_POST[del_pid]'");
mysql_query("delete from pub_ad_code where pid='$_POST[del_pid]'");
mysql_query("delete from pub_geo where pid='$_POST[del_pid]'");
$msg = "site supprimé avec succès.";
header("location: seller_mywebsites.php?msg=$msg");
exit();
}
else
$msg = "Vous ne pouvez pas supprimé ce site tant que vous avez une annonce sur ce site.";
}
if($_SESSION[utype] != 'pub+adv'){
header("location: account.php?smw&red_url=".urlencode(basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING']));
exit();
}
if($_SERVER['REQUEST_METHOD']=='POST' && !isset($_POST[update_pid])){
$status = register_new_publisher($_POST);
if($status[0] == 'rank_error'){
$msg = "Désolé, votre site GPR is $status[1] et alexa rank is $status[2] ce qui est pas suffisant pour notre système. Nous acceptons le minimum GPR ".$_config[min_gpr]." et le maximum alexa rank ".$_config[max_alexa];
}
elseif($status[0] == 'success'){
if($_config[approve_new_site] == 'yes')
header("location: account.php?warning_msg_www");
else header("location: account.php");
exit();
}
else $msg = "Il y a une erreur sur le serveur maintenant. Réssaiyez ultérièrement...";
}
else if(isset($_POST[update_pid]) && $_POST[update_pid] != '' && $_SERVER['REQUEST_METHOD']=='POST'){
$status = update_publisher($_POST);
if($status[0] == 'rank_error'){
$msg = "Désolé, votre site GPR is $status[1] et alexa rank is $status[2] ce qui est pas suffisant pour notre système. Nous acceptons le minimum GPR ".$_config[min_gpr]." et le maximum alexa rank ".$_config[max_alexa];
}
elseif($status[0] == 'success'){
//header("location: seller_mywebsites.php?pid=$_POST[update_pid]");
//exit();
}
else $msg = "Il y a une erreur sur le serveur maintenant. Réssaiyez ultérièrement...";
}
$smarty->assign('msg',$msg);
$res = mysql_query("select * from publishersinfo where uid = '$_SESSION[uid]' order by pid desc");
while($r = @mysql_fetch_assoc($res)) {
$rr[] = array('pid'=>$r[pid], 'web'=>$r[websitename]);
}
$smarty->assign('www',$rr);
if(isset($_GET[pid])){
$res2 = mysql_query("select * from publishersinfo where uid='$_SESSION[uid]' and pid='$_GET[pid]'");
while($info = @mysql_fetch_assoc($res2)){
$_POST['wname'] = stripslashes($info['websitename']);
$_POST['url'] = stripslashes($info['url']);
$_POST['wdes'] = stripslashes($info['description']);
$_POST['cats'] = stripslashes($info['catid']);
$_POST['subcats'] = stripslashes($info['subcatid']);
$_POST['keywords'] = stripslashes($info['keywords']);
$_POST['tad'] = stripslashes($info['targetedad']);
$_POST['clickrate'] = stripslashes($info['clickrate']);
$_POST['isadult'] = stripslashes($info['isadult']);
$_POST['lang'] = stripslashes($info['langid']);
$_POST['adposition'] = stripslashes($info['adposition']);
$_POST['isrestricted'] = stripslashes($info['isrestricted']);
$_POST['restriction'] = stripslashes($info['restriction']);
$g = mysql_query("select gid from pub_geo where pid=$info[pid]");
for($i=0; $i< mysql_num_rows($g); $i++)
$_POST[dest][$i] = mysql_result($g,$i,0);
}
}
$geo_list = get_list('pub_geolist','location');
for ($i=0;$i<count($geo_list['gid']);$i++)
{
if(@in_array($geo_list['gid'][$i], $_POST['dest'])){
$right_list['location'][] = $geo_list['location'][$i];
$right_list['gid'][] = $geo_list['gid'][$i];
}
else{
$left_list['location'][] = $geo_list['location'][$i];
$left_list['gid'][] = $geo_list['gid'][$i];
}
}
$smarty->assign('geo',$left_list['location']);
$smarty->assign('g_id',$left_list['gid']);
$smarty->assign('r_geo',$right_list['location']);
$smarty->assign('r_g_id',$right_list['gid']);
$cat_list = get_list('category','category');
$smarty->assign('cats',$cat_list['category']);
$smarty->assign('cat_ids',$cat_list['cid']);
if(isset($_POST[subcats]) && isset($_POST[cats])){
$scat_list = get_sub_cat_list($_POST[cats]);
}
else $scat_list = get_sub_cat_list($cat_list['cid'][0]);
$smarty->assign('scats',$scat_list['subcategory']);
$smarty->assign('scat_ids',$scat_list['sid']);
$lang_list = get_list('language','language');
$smarty->assign('langs',$lang_list['language']);
$smarty->assign('lang_ids',$lang_list['lid']);
$smarty->assign('right_panel','off');
$content = $smarty->fetch('seller_mywebsites.tpl');
$smarty->assign('content',$content);
$smarty->display('master_page.tpl');
?> |
Partager