Ejemplo n.º 1
0
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
if (!check_permission('campaigns', $user_detail['user_id'])) {
    exit;
}
if (isset($_GET['action']) && $_GET['action'] == 1 && isset($_POST['select_campaign']) && is_array($_POST['select_campaign'])) {
    $selected_items = $_POST['select_campaign'];
    foreach ($selected_items as $item_id) {
        switch ($_POST['form_action']) {
            case 'Pause':
                pause_campaign($item_id);
                break;
            case 'Run':
                run_campaign($item_id);
                break;
            case 'Delete':
                delete_campaign($item_id);
                break;
        }
    }
    global $successmessage;
    $successmessage = 'Your campaigns have successfully been updated.';
}
?>
<script type="text/javascript" language="javascript">
function SetAction(x) {
var answer = confirm("Are you sure you want to "+x+" the selected campaigns?")
	if (answer){
document.listform.form_action.value = x;
document.listform.submit();	}
	else{
		return false;
Ejemplo n.º 2
0
function uninstall_network($networkid)
{
    if (!check_network_installed($networkid)) {
        global $errormessage;
        $errormessage = 'This network does not seem to be installed. Unable to remove network.';
        return false;
    }
    global $maindb;
    $network_numeric_id = get_network_id($networkid);
    mysql_query("DELETE from md_networks where network_identifier='{$networkid}'", $maindb);
    /* Delete Network Campaigns*/
    $campred = mysql_query("SELECT * FROM md_campaigns WHERE campaign_type='network' AND campaign_networkid='" . $network_numeric_id . "'", $maindb);
    while ($camp_det = mysql_fetch_array($campred)) {
        delete_campaign($camp_det['campaign_id']);
    }
    /*TODO: Delete Network Allocations*/
    mysql_query("UPDATE md_zones set backfill_alt_1='' where backfill_alt_1='" . $network_numeric_id . "'", $maindb);
    mysql_query("UPDATE md_zones set backfill_alt_2='' where backfill_alt_2='" . $network_numeric_id . "'", $maindb);
    mysql_query("UPDATE md_zones set backfill_alt_3='' where backfill_alt_3='" . $network_numeric_id . "'", $maindb);
    global $successmessage;
    $successmessage = 'Network successfully removed.';
    return true;
    return true;
}