| | |
| | | $this->id = intval($_REQUEST["id"]);
|
| | |
|
| | | if(count($_POST) > 1) {
|
| | | $this->dataRecord = $_POST;
|
| | | $this->onSubmit();
|
| | | } else {
|
| | | $this->onShow();
|
| | |
| | |
|
| | | function onSubmit() {
|
| | | global $app, $conf;
|
| | | |
| | | $this->dataRecord = $_POST;
|
| | |
|
| | | // Calling the action functions
|
| | | if($this->id > 0) {
|
| | |
| | | $sql = $app->tform->getSQL($this->dataRecord,$app->tform->getCurrentTab(),'UPDATE',$this->id,$ext_where);
|
| | | if($app->tform->errorMessage == '') {
|
| | | $app->db->query($sql);
|
| | | if($app->db->errorMessage != '') die($app->db->errorMessage);
|
| | |
|
| | | // Call plugin
|
| | | foreach($this->plugins as $plugin) {
|
| | |
| | | $sql = $app->tform->getSQL($this->dataRecord,$app->tform->getCurrentTab(),'INSERT',$this->id,$ext_where);
|
| | | if($app->tform->errorMessage == '') {
|
| | | $app->db->query($sql);
|
| | | if($app->db->errorMessage != '') die($app->db->errorMessage);
|
| | | $this->id = $app->db->insertID();
|
| | |
|
| | | // Call plugin
|