include_once("logincheck.php");
include_once("myconnect.php");
$to_delete="";
$items_removed=0;
if ( count($_POST)<>0 )
{
/////////////////////////// A REQUEST TO DELETE SOME CONTACTS ///////////////
if(isset($_REQUEST["delete"]))
{
for($i=0;$i<=$_REQUEST["cnt"];$i++)
{
if ( isset($_REQUEST["checkbox" . $i]) ) //Is the checkbox ticked
{
if ($to_delete!="") { $to_delete.="," ; } //To insert comma??
$to_delete.= $_REQUEST["checkbox" . $i]; //Add another item to delete
$items_removed++;
}
} //End For
if ($to_delete=="")
{
$msg1="Please choose a group";
}
else
{
$del_str=" Delete from sbjbs_mailalert_set where sb_id IN (" . $to_delete .")";
//echo $del_str;
mysql_query($del_str);
$msg1= $items_removed;
$msg1.=($items_removed>1)?' Groups have':' Group has';
$msg1.=" been removed";
}
} //edn if delete
//=============insert
if(isset($_REQUEST["insert"]))
{
$sb_cid=str_replace(";",",",$_REQUEST["cid_list"]);
$sb_loc_id=str_replace(";",",",$_REQUEST["loc_id"]);
$sb_uid=$_SESSION["sbjbs_userid"];
if($sb_cid==""){ $sb_cid=-1;}
if($sb_loc_id==""){ $sb_loc_id=-1;}
mysql_query("insert into sbjbs_mailalert_set (sb_uid,sb_cid,sb_loc_id)
values ($sb_uid,'$sb_cid','$sb_loc_id') ");
if(mysql_affected_rows()>0)
{
$msg1="Requested group has been added to your alert list";
}
else
{
header("Location: gen_confirm_mem.php?err=manage_mail_alerts&errmsg=".urlencode("
Sorry, some error occurred and unable to add group to your alert list"));
die();
}
} //end if insert
header("Location: gen_confirm_mem.php?errmsg=".urlencode($msg1));
die();
/////////////////////////////
}
function main()
{
global $to_delete, $items_removed;
$cat_list="";
$cid_list="";
$loc_id_list="";
$loc_list="";
$sbrow_con=mysql_fetch_array(mysql_query("select * from sbjbs_config"));
$sb_cat_listing=$sbrow_con["sb_cat_listing"];
?>
| |
| Mail Alerts Groups
|
| To remove a category
just click the check box and click the remove button below. |
|
|
|
|
| |
| |
|
}
include_once("template.php");
?>