Example #1
0
        if (IsAdmin() || $_SESSION["AccessLevel"] == ACCESS_LEVEL_ADMINGROUP) {
            $rb = $pageObject->lockingObj->GetLockInfo($strTableName, $keys, true, $id);
            if ($rb != "") {
                $system_message = $rb;
            }
        }
    }
}
if ($pageObject->lockingObj && $inlineedit != EDIT_INLINE) {
    $pageObject->body["begin"] .= '<div class="runner-locking" ' . $system_attrs . '>' . $system_message . '</div>';
}
if ($message) {
    $message = "<div class='message " . $mesClass . "'>" . $message . "</div>";
}
// PRG rule, to avoid POSTDATA resend
if ($IsSaved && no_output_done() && $inlineedit == EDIT_SIMPLE) {
    // saving message
    $_SESSION["message_edit"] = $message ? $message : "";
    // key get query
    $keyGetQ = "";
    $keyGetQ .= "editid1=" . rawurldecode($keys["id"]) . "&";
    // cut last &
    $keyGetQ = substr($keyGetQ, 0, strlen($keyGetQ) - 1);
    // redirect
    header("Location: app_modules_" . $pageObject->getPageType() . ".php?" . $keyGetQ);
    // turned on output buffering, so we need to stop script
    exit;
}
// for PRG rule, to avoid POSTDATA resend. Saving mess in session
if ($inlineedit == EDIT_SIMPLE && isset($_SESSION["message_edit"])) {
    $message = $_SESSION["message_edit"];
                $mesClass = "mes_ok";
            }
        } elseif ($inlineadd != ADD_INLINE) {
            $mesClass = "mes_not";
        }
    } else {
        $message = $usermessage;
        $status = "DECLINED";
        $readavalues = true;
    }
}
if ($message) {
    $message = "<div class='message " . $mesClass . "'>" . $message . "</div>";
}
// PRG rule, to avoid POSTDATA resend
if (no_output_done() && $inlineadd == ADD_SIMPLE && $IsSaved) {
    // saving message
    $_SESSION["message_add"] = $message ? $message : "";
    // redirect
    header("Location: pad_pad_customer_" . $pageObject->getPageType() . ".php");
    // turned on output buffering, so we need to stop script
    exit;
}
if ($inlineadd == ADD_MASTER && $IsSaved) {
    $_SESSION["message_add"] = $message ? $message : "";
}
// for PRG rule, to avoid POSTDATA resend. Saving mess in session
if ($inlineadd == ADD_SIMPLE && isset($_SESSION["message_add"])) {
    $message = $_SESSION["message_add"];
    unset($_SESSION["message_add"]);
}
Example #3
0
 /**
  *	POST-REDIRECT-GET 
  *	Redirect after saving the data to avoid saving again on refresh.
  */
 protected function prgRedirect()
 {
     if (!$this->insertedSuccessfully || $this->mode != ADD_SIMPLE || !no_output_done()) {
         return false;
     }
     // saving message
     $_SESSION["message_add"] = $this->message ? $this->message : "";
     // redirect
     HeaderRedirect($this->pSet->getShortTableName(), $this->pageType);
     // turned on output buffering, so we need to stop script
     return true;
 }
Example #4
0
 /**
  * PRG rule, to avoid POSTDATA resend
  *
  */
 function rulePRG()
 {
     if (no_output_done() && count($this->selectedRecs) && !strlen($this->deleteMessage)) {
         // redirect, add a=return param for saving SESSION
         header("Location: " . $this->shortTableName . "_" . $this->getPageType() . ".php?a=return");
         // turned on output buffering, so we need to stop script
         exit;
     }
 }
Example #5
0
 /**
  * PRG rule, to avoid POSTDATA resend
  * call after save
  *
  */
 function rulePRG()
 {
     if (no_output_done() && postvalue("a") == "save") {
         $getParams = '';
         if (postvalue('group')) {
             $getParams = '?group=' . postvalue('group');
         }
         // redirect, add a=return param for saving SESSION
         header("Location: " . $this->shortTableName . "_" . $this->getPageType() . ".php" . $getParams);
         // turned on output buffering, so we need to stop script
         exit;
     }
 }
Example #6
0
 /**
  * PRG rule, to avoid POSTDATA resend
  * call after save
  */
 function rulePRG()
 {
     if (no_output_done() && postvalue("a") == "save") {
         // redirect, add a=return param for saving SESSION
         HeaderRedirect($this->shortTableName, $this->getPageType(), "a=return");
         // turned on output buffering, so we need to stop script
         exit;
     }
 }
Example #7
0
 /**
  *	POST-REDIRECT-GET 
  *	Redirect after saving the data to avoid saving again on refresh.
  */
 protected function prgRedirect()
 {
     if (!$this->updatedSuccessfully || $this->mode != EDIT_SIMPLE || !no_output_done()) {
         return false;
     }
     $_SESSION["message_edit"] = $this->message . "";
     $keyParams = array();
     foreach ($this->keyFields as $i => $k) {
         $keyParams[] = "editid" . ($i + 1) . "=" . rawurldecode($this->keys[$k]);
     }
     HeaderRedirect($this->pSet->getShortTableName(), $this->getPageType(), implode("&", $keyParams));
     exit;
     return true;
 }