Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
 
3
/***************************************************************************
4
 *   Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in)  	   *
5
 *   sendtogeo@gmail.com   												   *
6
 *                                                                         *
7
 *   This program is free software; you can redistribute it and/or modify  *
8
 *   it under the terms of the GNU General Public License as published by  *
9
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 *   (at your option) any later version.                                   *
11
 *                                                                         *
12
 *   This program is distributed in the hope that it will be useful,       *
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
15
 *   GNU General Public License for more details.                          *
16
 *                                                                         *
17
 *   You should have received a copy of the GNU General Public License     *
18
 *   along with this program; if not, write to the                         *
19
 *   Free Software Foundation, Inc.,                                       *
20
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
21
 ***************************************************************************/
22
 
23
include_once("includes/sp-load.php");
24
include_once(SP_CTRLPATH . "/alerts.ctrl.php");
25
 
26
checkLoggedIn();
27
$controller = New AlertController();
28
$controller->view->menu = 'alerts';
29
$controller->layout = 'ajax';
30
$controller->spTextPanel = $controller->getLanguageTexts('panel', $_SESSION['lang_code']);
31
$controller->set('spTextPanel', $controller->spTextPanel);
32
$controller->spTextMyAccount = $controller->getLanguageTexts('myaccount', $_SESSION['lang_code']);
33
$controller->set('spTextMyAccount', $controller->spTextMyAccount);
34
 
35
if($_SERVER['REQUEST_METHOD'] == 'POST'){
36
 
37
    switch($_POST['sec']) {
38
 
39
        case "fetch_alerts":
40
            $controller->fetchAlerts($_POST);
41
            break;
42
 
43
        case "delete_all_alerts":
44
            if (!empty($_POST['ids'])) {
45
                foreach($_POST['ids'] as $id) {
46
                    $controller->deleteAlert($id);
47
                }
48
            }
49
 
50
            $controller->listAlerts($_POST);
51
            break;
52
 
53
		default:
54
		    $controller->listAlerts($_POST);
55
			break;
56
 
57
	}
58
 
59
} else {
60
 
61
    switch($_GET['sec']) {
62
 
63
        case "alert_info":
64
            $controller->showAlertInfo($_GET['id']);
65
            break;
66
 
67
        case "delete_alert":
68
            $controller->deleteAlert($_GET['id']);
69
            $controller->listAlerts($_GET);
70
            break;
71
 
72
		default:
73
			$controller->listAlerts($_GET);
74
			break;
75
	}
76
}
77
?>