Пример #1
0
     $window->filename = $_POST['filename'];
     $window->table_name = $_POST['table_name'];
     $window->windowsetting = $_POST['windowsetting'];
     $window->mid = $_POST['mid'];
     $window->seqno = $_POST['seqno'];
     $window->parentwindows_id = $_POST['parentwindows_id'];
     $window->description = $_POST['description'];
     $window->helpurl = str_replace("%26", "&", $_POST['helpurl']);
     $window->windowsetting = $_POST['windowsetting'];
     $window->jrxml = $_POST['jrxml'];
     if (get_magic_quotes_gpc()) {
         $window->windowsetting = stripslashes($window->windowsetting);
         $window->jrxml = stripslashes($window->jrxml);
     }
     if ($window->window_id > 0) {
         $window->updateWindow();
     } else {
         $window->insertWindow();
     }
     break;
 case "ajaxselectwindows":
     $window->mid = $_GET['mid'];
     $window->window_id = $_GET['window_id'];
     if ($window->window_id == "") {
         $window->window_id = 0;
     }
     echo $window->getSelectWindows($window->window_id, $window->mid, "Y");
     break;
 default:
     if (file_exists("../simantz/")) {
         include "menu.php";
Пример #2
0
         //create a new token for editing a form
         $token = $s->createToken($tokenlife, "CREATE_WDW");
         $o->getInputForm("edit", $o->window, $token);
         $o->showWindowTable("WHERE window_id>0", "ORDER BY functiontype,seqno,window_name");
     } else {
         //if can't find particular organization from database, return error message
         redirect_header("window.php", 3, "Some error on viewing your window data, probably database corrupted");
     }
     break;
     //when user press save for change existing organization data
 //when user press save for change existing organization data
 case "update":
     if ($s->check(false, $token, "CREATE_WDW")) {
         $o->updatedby = $xoopsUser->getVar('uid');
         //get current uid
         if ($o->updateWindow()) {
             //if data save successfully
             redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Your data is saved.");
         } else {
             redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
         }
     } else {
         redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
     }
     break;
 case "delete":
     if ($s->check(false, $token, "CREATE_WDW")) {
         if ($o->deleteWindow($o->window_id)) {
             redirect_header("window.php", $pausetime, "Data removed successfully.");
         } else {
             redirect_header("window.php?action=edit&window_id={$o->window_id}", $pausetime, "Warning! Can't delete data from database.");