Example #1
0
 public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     isset($request['action']) ? $action = $request['action'] : ($action = '');
     isset($request['view']) ? $view = $request['view'] : ($view = 'form');
     isset($request['itemid']) ? $itemid = $request['itemid'] : ($itemid = '');
     if (isset($request['action'])) {
         switch ($action) {
             case "add":
                 cidlookup_add($request);
                 needreload();
                 redirect_standard();
                 break;
             case "delete":
                 cidlookup_del($itemid);
                 needreload();
                 redirect_standard();
                 break;
             case "edit":
                 cidlookup_edit($itemid, $request);
                 needreload();
                 redirect_standard('itemid');
                 break;
             case "getJSON":
                 switch ($request['jdata']) {
                     case "cid_modules":
                         header('Content-Type: application/json');
                         echo json_encode($this->cid_modules);
                         exit;
                         break;
                     default:
                         header('Content-Type: application/json');
                         echo json_encode(array('status' => 'ERROR', 'message' => 'Invalid Request'));
                         exit;
                         break;
                 }
                 break;
         }
     }
 }
Example #2
0
isset($_REQUEST['action']) ? $action = $_REQUEST['action'] : ($action = '');
//the item we are currently displaying
isset($_REQUEST['itemid']) ? $itemid = $_REQUEST['itemid'] : ($itemid = '');
$dispnum = "cidlookup";
//used for switch on config.php
$tabindex = 0;
//if submitting form, update database
if (isset($_POST['action'])) {
    switch ($action) {
        case "add":
            cidlookup_add($_POST);
            needreload();
            redirect_standard();
            break;
        case "delete":
            cidlookup_del($itemid);
            needreload();
            redirect_standard();
            break;
        case "edit":
            cidlookup_edit($itemid, $_POST);
            needreload();
            redirect_standard('itemid');
            break;
    }
}
//get list of callerid lookup sources
$cidsources = cidlookup_list();
?>

</div> <!-- end content div so we can display rnav properly-->