📄 manage_group_settings.php
字号:
<?php
include "logincheck.php";
include_once "myconnect.php";
$rs0=mysql_query("select * from sbbleads_levels order by sb_id");
$row0=mysql_fetch_array($rs0);
$sbtop=$row0["sb_levelname"];
$row0=mysql_fetch_array($rs0);
$sbmiddle=$row0["sb_levelname"];
$row0=mysql_fetch_array($rs0);
$sblowest=$row0["sb_levelname"];
$errcnt=0;
if(count($_POST)>0)
{
$sb_sell_cnt=$_REQUEST["sb_sell_cnt"];
$sb_buy_cnt=$_REQUEST["sb_buy_cnt"];
$sb_product_cnt=$_REQUEST["sb_product_cnt"];
$sb_profile=$_REQUEST["sb_profile"];
$sb_img_cnt=$_REQUEST["sb_img_cnt"];
$sb_cat_cnt=$_REQUEST["sb_cat_cnt"];
$sb_profilecat_cnt=$_REQUEST["sb_profilecat_cnt"];
$sb_posturl=$_REQUEST["sb_posturl"];
$sb_keyword_cnt=$_REQUEST["sb_keyword_cnt"];
$sb_sell_cnt1=$_REQUEST["sb_sell_cnt1"];
$sb_buy_cnt1=$_REQUEST["sb_buy_cnt1"];
$sb_product_cnt1=$_REQUEST["sb_product_cnt1"];
$sb_profile1=$_REQUEST["sb_profile1"];
$sb_img_cnt1=$_REQUEST["sb_img_cnt1"];
$sb_cat_cnt1=$_REQUEST["sb_cat_cnt1"];
$sb_profilecat_cnt1=$_REQUEST["sb_profilecat_cnt1"];
$sb_posturl1=$_REQUEST["sb_posturl1"];
$sb_keyword_cnt1=$_REQUEST["sb_keyword_cnt1"];
$sb_sell_cnt2=$_REQUEST["sb_sell_cnt2"];
$sb_buy_cnt2=$_REQUEST["sb_buy_cnt2"];
$sb_product_cnt2=$_REQUEST["sb_product_cnt2"];
$sb_profile2=$_REQUEST["sb_profile2"];
$sb_img_cnt2=$_REQUEST["sb_img_cnt2"];
$sb_cat_cnt2=$_REQUEST["sb_cat_cnt2"];
$sb_profilecat_cnt2=$_REQUEST["sb_profilecat_cnt2"];
$sb_posturl2=$_REQUEST["sb_posturl2"];
$sb_keyword_cnt2=$_REQUEST["sb_keyword_cnt2"];
if( !is_numeric($sb_sell_cnt) || ($sb_sell_cnt < 0) || !is_numeric($sb_sell_cnt1) || ($sb_sell_cnt1 < 0) || !is_numeric($sb_sell_cnt2) || ($sb_sell_cnt2 < 0) )
{
$errs[$errcnt]="Maximum sell offers allowed must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_buy_cnt) || ($sb_buy_cnt < 0) || !is_numeric($sb_buy_cnt1) || ($sb_buy_cnt1 < 0) || !is_numeric($sb_buy_cnt2) || ($sb_buy_cnt2 < 0) )
{
$errs[$errcnt]="Maximum buy offers allowed must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_product_cnt) || ($sb_product_cnt < 0) || !is_numeric($sb_product_cnt1) || ($sb_product_cnt1 < 0) || !is_numeric($sb_product_cnt2) || ($sb_product_cnt2 < 0) )
{
$errs[$errcnt]="Maximum product catalogs allowed must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_keyword_cnt) || ($sb_keyword_cnt < 0) || !is_numeric($sb_keyword_cnt1) || ($sb_keyword_cnt1 < 0) || !is_numeric($sb_keyword_cnt2) || ($sb_keyword_cnt2 < 0))
{
$errs[$errcnt]="Maximum keywords allowed must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_img_cnt) || ($sb_img_cnt < 0) || !is_numeric($sb_img_cnt1) || ($sb_img_cnt1 < 0) || !is_numeric($sb_img_cnt2) || ($sb_img_cnt2 < 0) )
{
$errs[$errcnt]="Maximum images allowed must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_profilecat_cnt) || ($sb_profilecat_cnt < 0) || !is_numeric($sb_profilecat_cnt1) || ($sb_profilecat_cnt1 < 0) || !is_numeric($sb_profilecat_cnt2) || ($sb_profilecat_cnt2 < 0) )
{
$errs[$errcnt]="Maximum categories allowed to post profiles must be a positive integer";
$errcnt++;
}
if( !is_numeric($sb_cat_cnt) || ($sb_cat_cnt < 0) || !is_numeric($sb_cat_cnt1) || ($sb_cat_cnt1 < 0) || !is_numeric($sb_cat_cnt2) || ($sb_cat_cnt2 < 0) )
{
$errs[$errcnt]="Maximum categories allowed to post sell/buy offers must be a positive integer";
$errcnt++;
}
if($errcnt == 0)
{
$sb_sell_cnt=(int)$sb_sell_cnt;
$sb_buy_cnt=(int)$sb_buy_cnt;
$sb_product_cnt=(int)$sb_product_cnt;
$sb_keyword_cnt=$sb_keyword_cnt;
$sb_img_cnt=(int)$sb_img_cnt;
$sb_cat_cnt=(int)$sb_cat_cnt;
$sb_profilecat_cnt=(int)$sb_profilecat_cnt;
$sb_sell_cnt1=(int)$sb_sell_cnt1;
$sb_buy_cnt1=(int)$sb_buy_cnt1;
$sb_product_cnt1=(int)$sb_product_cnt1;
$sb_keyword_cnt1=(int)$sb_keyword_cnt1;
$sb_img_cnt1=(int)$sb_img_cnt1;
$sb_cat_cnt1=(int)$sb_cat_cnt1;
$sb_profilecat_cnt1=(int)$sb_profilecat_cnt1;
$sb_sell_cnt2=(int)$sb_sell_cnt2;
$sb_buy_cnt2=(int)$sb_buy_cnt2;
$sb_product_cnt2=(int)$sb_product_cnt2;
$sb_keyword_cnt2=(int)$sb_keyword_cnt2;
$sb_img_cnt2=(int)$sb_img_cnt2;
$sb_cat_cnt2=(int)$sb_cat_cnt2;
$sb_profilecat_cnt2=(int)$sb_profilecat_cnt2;
if(!get_magic_quotes_gpc())
{
$sb_posturl=str_replace("$","\$",addslashes($sb_posturl));
$sb_profile=str_replace("$","\$",addslashes($sb_profile));
$sb_posturl1=str_replace("$","\$",addslashes($sb_posturl1));
$sb_profile1=str_replace("$","\$",addslashes($sb_profile1));
$sb_posturl2=str_replace("$","\$",addslashes($sb_posturl2));
$sb_profile2=str_replace("$","\$",addslashes($sb_profile2));
}
else
{
$sb_posturl=str_replace("$","\$",$sb_posturl);
$sb_profile=str_replace("$","\$",$sb_profile);
$sb_posturl1=str_replace("$","\$",$sb_posturl1);
$sb_profile1=str_replace("$","\$",$sb_profile1);
$sb_posturl2=str_replace("$","\$",$sb_posturl2);
$sb_profile2=str_replace("$","\$",$sb_profile2);
}
$sbqu_gro="update sbbleads_groups set sb_sell_cnt=$sb_sell_cnt, sb_buy_cnt=$sb_buy_cnt, sb_product_cnt=$sb_product_cnt, sb_keyword_cnt=$sb_keyword_cnt, sb_img_cnt=$sb_img_cnt, sb_cat_cnt=$sb_cat_cnt, sb_profilecat_cnt=$sb_profilecat_cnt, sb_posturl='$sb_posturl', sb_profile='$sb_profile' where sb_memtype=1";
// die($sbqu_gro);
mysql_query($sbqu_gro);
$sbqu_gro="update sbbleads_groups set sb_sell_cnt=$sb_sell_cnt1, sb_buy_cnt=$sb_buy_cnt1, sb_product_cnt=$sb_product_cnt1, sb_keyword_cnt=$sb_keyword_cnt1, sb_img_cnt=$sb_img_cnt1, sb_cat_cnt=$sb_cat_cnt1, sb_profilecat_cnt=$sb_profilecat_cnt1, sb_posturl='$sb_posturl1', sb_profile='$sb_profile1' where sb_memtype=2";
mysql_query($sbqu_gro);
$sbqu_gro="update sbbleads_groups set sb_sell_cnt=$sb_sell_cnt2, sb_buy_cnt=$sb_buy_cnt2, sb_product_cnt=$sb_product_cnt2, sb_keyword_cnt=$sb_keyword_cnt2, sb_img_cnt=$sb_img_cnt2, sb_cat_cnt=$sb_cat_cnt2, sb_profilecat_cnt=$sb_profilecat_cnt2, sb_posturl='$sb_posturl2', sb_profile='$sb_profile2' where sb_memtype=3";
mysql_query($sbqu_gro);
// if( mysql_affected_rows() >= 1 )
{
header("Location: manage_group_settings.php?msg=".urlencode("Member options have been configured"));
die();
}
/* else
{
header("Location: manage_group_settings.php?msg=".urlencode("Unable to update member options, please try again"));
die();
}
*/ } //end if errcnt == 0
}// end if form posted
else
{ //first time rendering
$sbrow1_gro=mysql_fetch_array(mysql_query("select * from sbbleads_groups where sb_memtype=1"));
$sb_sell_cnt=$sbrow1_gro["sb_sell_cnt"];
$sb_buy_cnt=$sbrow1_gro["sb_buy_cnt"];
$sb_product_cnt=$sbrow1_gro["sb_product_cnt"];
$sb_profile=$sbrow1_gro["sb_profile"];
$sb_img_cnt=$sbrow1_gro["sb_img_cnt"];
$sb_cat_cnt=$sbrow1_gro["sb_cat_cnt"];
$sb_profilecat_cnt=$sbrow1_gro["sb_profilecat_cnt"];
$sb_posturl=$sbrow1_gro["sb_posturl"];
$sb_keyword_cnt=$sbrow1_gro["sb_keyword_cnt"];
$sbrow1_gro=mysql_fetch_array(mysql_query("select * from sbbleads_groups where sb_memtype=2"));
$sb_sell_cnt1=$sbrow1_gro["sb_sell_cnt"];
$sb_buy_cnt1=$sbrow1_gro["sb_buy_cnt"];
$sb_product_cnt1=$sbrow1_gro["sb_product_cnt"];
$sb_profile1=$sbrow1_gro["sb_profile"];
$sb_img_cnt1=$sbrow1_gro["sb_img_cnt"];
$sb_cat_cnt1=$sbrow1_gro["sb_cat_cnt"];
$sb_profilecat_cnt1=$sbrow1_gro["sb_profilecat_cnt"];
$sb_posturl1=$sbrow1_gro["sb_posturl"];
$sb_keyword_cnt1=$sbrow1_gro["sb_keyword_cnt"];
$sbrow1_gro=mysql_fetch_array(mysql_query("select * from sbbleads_groups where sb_memtype=3"));
$sb_sell_cnt2=$sbrow1_gro["sb_sell_cnt"];
$sb_buy_cnt2=$sbrow1_gro["sb_buy_cnt"];
$sb_product_cnt2=$sbrow1_gro["sb_product_cnt"];
$sb_profile2=$sbrow1_gro["sb_profile"];
$sb_img_cnt2=$sbrow1_gro["sb_img_cnt"];
$sb_cat_cnt2=$sbrow1_gro["sb_cat_cnt"];
$sb_profilecat_cnt2=$sbrow1_gro["sb_profilecat_cnt"];
$sb_posturl2=$sbrow1_gro["sb_posturl"];
$sb_keyword_cnt2=$sbrow1_gro["sb_keyword_cnt"];
}
function main()
{
global $sblowest, $sbmiddle, $sbtop, $errs, $errcnt, $sb_sell_cnt, $sb_buy_cnt, $sb_product_cnt, $sb_profile, $sb_img_cnt, $sb_cat_cnt, $sb_profilecat_cnt, $sb_posturl, $sb_keyword_cnt, $sb_sell_cnt1, $sb_buy_cnt1, $sb_product_cnt1, $sb_profile1, $sb_img_cnt1, $sb_cat_cnt1, $sb_profilecat_cnt1, $sb_posturl1, $sb_keyword_cnt1, $sb_sell_cnt2, $sb_buy_cnt2, $sb_product_cnt2, $sb_profile2, $sb_img_cnt2, $sb_cat_cnt2, $sb_profilecat_cnt2, $sb_posturl2, $sb_keyword_cnt2;
if(count($_POST)<>0) //IF SOME FORM WAS POSTED DO VALIDATION
{
if( $errcnt != 0 )
{
// ob_end_flush();
?>
<table width="558" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif"><strong>Your Request cannot be processed due to following Reasons</strong></font></td>
</tr>
<?
for ($i=0;$i<$errcnt;$i++)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -