app = $app;
if ($intern)
return;
$this->app->ActionHandlerInit($this);
$this->app->ActionHandler("list", "zolltarifnummer_list");
$this->app->ActionHandler("create", "zolltarifnummer_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "zolltarifnummer_edit");
$this->app->ActionHandler("delete", "zolltarifnummer_delete");
$this->app->DefaultActionHandler("list");
$this->app->ActionHandlerListen($app);
}
public function Install() {
/* Fill out manually later */
}
static function TableSearch(&$app, $name, $erlaubtevars) {
switch ($name) {
case "zolltarifnummer_list":
$allowed['zolltarifnummer_list'] = array('list');
$heading = array('','','Nummer', 'Beschreibung', 'Interne Bemerkung', 'Menü');
$width = array('1%','1%','30%','30%','30%','1%'); // Fill out manually later
// columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8);
$findcols = array('z.id','z.id','z.nummer', 'z.beschreibung', 'z.internebemerkung');
$searchsql = array('z.nummer', 'z.beschreibung', 'z.internebemerkung');
$defaultorder = 1;
$defaultorderdesc = 0;
$dropnbox = "'
' AS `open`, CONCAT('') AS `auswahl`";
$menu = "
| " . " |
' AS `open`, CONCAT('') AS `auswahl`";
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS z.id, $dropnbox, z.nummer, z.beschreibung, z.internebemerkung, z.id FROM zolltarifnummer z"." WHERE id=$id");
foreach ($result[0] as $key => $value) {
$this->app->Tpl->Set(strtoupper($key), $value);
}
/*
* Add displayed items later
*
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
$this->app->Tpl->Add('EMAIL', $email);
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
*/
// $this->SetInput($input);
$this->app->Tpl->Parse('PAGE', "zolltarifnummer_edit.tpl");
}
/**
* Get all paramters from html form and save into $input
*/
public function GetInput(): array {
$input = array();
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
$input['nummer'] = $this->app->Secure->GetPOST('nummer');
$input['beschreibung'] = $this->app->Secure->GetPOST('beschreibung');
$input['internebemerkung'] = $this->app->Secure->GetPOST('internebemerkung');
return $input;
}
/*
* Set all fields in the page corresponding to $input
*/
function SetInput($input) {
// $this->app->Tpl->Set('EMAIL', $input['email']);
$this->app->Tpl->Set('NUMMER', $input['nummer']);
$this->app->Tpl->Set('BESCHREIBUNG', $input['beschreibung']);
$this->app->Tpl->Set('INTERNEBEMERKUNG', $input['internebemerkung']);
}
}