function __construct($modello, $pratica) { $this->db = appUtils::getDb(); $db = $this->db; $this->modello = $modello; $this->pratica = $pratica; $sql = "SELECT * FROM stp.e_modelli WHERE id=?"; $ris = $db->fetchAssoc($sql, array($modello)); $this->modello = $ris["nome"]; $this->viste = explode(',', $ris["views"]); $this->funzioni = explode(',', $ris["functions"]); $this->modelliDir = DATA_DIR . DIRECTORY_SEPARATOR . "praticaweb" . DIRECTORY_SEPARATOR . "modelli" . DIRECTORY_SEPARATOR; $info = pathinfo($this->modello); $this->basename = $info["filename"]; $this->extension = $info["extension"]; $this->docName = str_pad(rand(0, 999999), 6, '0', STR_PAD_LEFT) . "-" . $this->modello; $this->actions = $ris["action"]; }