Exemplo n.º 1
0
         }
         $valuelist .= "`{$key}` = {$val}, ";
         $this->setLog(" add:`{$key}` = {$val}, ");
     }
     $valuelist = ereg_replace(', $', '', $valuelist);
     $query = "UPDATE `{$table}` SET {$valuelist} WHERE {$primarykey}";
 }
 $this->setLog("\n Running query:\n" . $query);
 $sql_query = $query;
 $qSaveData = new sqlQuery($dbc);
 $result = $qSaveData->query($query);
 //  $uniqid = $qSaveData->getInsertId() ; PL 20030516 not used
 if (!$result) {
     $error = $qSaveData->getError();
     $this->addParam("recordupdated", "no");
     $disp->setPage($urlerror);
     $disp->addParam("message", $strInsertError . $error);
     $this->setDisplayNext($disp);
 } else {
     $disp->setPage(urldecode($goto));
     if (strlen($setmessage) > 0) {
         $strUpdateOk = $setmessage;
     }
     $this->addParam("recordupdated", "yes");
     $disp->addParam("message", $strUpdateOk);
     //    $disp->addParam("updateid", $uniqid) ; ; PL 20030516 not used could be replace with value of primary key
     $disp->addParam("update", "yes");
     $this->setDisplayNext($disp);
 }
 if (!empty($_SERVER['PHP_SELF'])) {
     $disp->save("displayUpdateRecord", $_SERVER['PHP_SELF']);
Exemplo n.º 2
0
         }
         $fieldlist = ereg_replace(', $', '', $fieldlist);
         $valuelist = ereg_replace(', $', '', $valuelist);
         $query = "INSERT INTO `{$table}` ({$fieldlist}) VALUES ({$valuelist})";
     }
     $this->setLog("\n Running query:\n" . $query);
     $message = urlencode($strInsertOk);
     $sql_query = $query;
     $qSaveData = new sqlQuery($this->dbc);
     $result = $qSaveData->query($query);
     $uniqid = $qSaveData->getInsertId($table, "id" . $table);
     $this->addParam("insertid", $uniqid);
     if (!$result) {
         $error = $qSaveData->getError();
         $this->addParam("recordinserted", "no");
         $disp->setPage($urlerror);
         $disp->addParam("message", $strInsertError . $error);
     } else {
         $disp->setPage($goto);
         if (strlen($setmessage) > 0) {
             $strInsertOk = $setmessage;
         }
         $this->addParam("recordinserted", "yes");
         $disp->addParam("message", $strInsertOk);
         $disp->addParam("insertid", $uniqid);
         $disp->addParam("updage", "no");
     }
     $this->setDisplayNext($disp);
 }
 if (!empty($_SERVER['PHP_SELF'])) {
     $disp->save("displayAddRecord", $_SERVER['PHP_SELF']);
Exemplo n.º 3
0
session_unregister("manageData");
$globalevents[displayTableOrder] = 0;
$globalevents[manageData] = 0;
session_register("globalevents");
if ($doSave != "no") {
    $infoDisplay = new Display();
    $infoDisplay->addParam("mydb_num", $mydb_num);
    if ($displaytype == "form") {
        $infoDisplay->addParam("goto", $gotonext);
        // $infoDisplay->addParam("toto", "toto") ;
        if (strlen($empty) > 0) {
            $infoDisplay->addParam("empty", $empty);
        } else {
            if (strlen($table) > 0) {
                $infoDisplay->addParam("table", $table);
                $infoDisplay->addParam("id" . $table, ${"id" . $table});
            }
        }
        $goto = "displayform.php";
    }
    if (strlen($goto) > 0) {
        $infoDisplay->setPage($goto);
        $this->setDisplayNext($infoDisplay);
        $infoDisplay->save("infoDisplay", basename($goto));
    } else {
        $infoDisplay->setPage("displayreport.php");
        $this->setDisplayNext($infoDisplay);
        $infoDisplay->save("infoDisplay", "displayreport.php");
    }
}
//echo $this->getUrlNext() ;