Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
114 righe
3.5 KiB
114 righe
3.5 KiB
<?php |
|
|
|
require_once "IDataClass.php"; |
|
/* |
|
* To change this license header, choose License Headers in Project Properties. |
|
* To change this template file, choose Tools | Templates |
|
* and open the template in the editor. |
|
*/ |
|
|
|
/** |
|
* Description of UTENTI |
|
* |
|
* @author Stefano |
|
*/ |
|
class Domanda_Adesione extends DataClass { |
|
|
|
const TABLE_NAME = "DOMANDA_ADESIONE"; |
|
//const SEQ_NAME = "DOMANDA_ADESIONEID_SEQ"; |
|
const SP_ = "SPDOMANDAADESIONESAVE"; |
|
|
|
public $ID = 0; // FA RIFERIMENTO ALL'ID DELLA DOMANDA |
|
public $ISTITUTO_DI_CREDITO; |
|
public $FILIALE_DI = ""; |
|
public $IBAN = ""; |
|
public $INFO_PEC = ""; |
|
public $REGOLARITA_CONTRIBUTIVA = -999; |
|
public $MOTIVAZIONE = ""; |
|
public $HASH_FILE = ""; |
|
public $FILEPATH = null; |
|
public $DATA_INSERIMENTO = ""; |
|
public $DATA_COMPLETAMENTO = ""; |
|
public $FILESIZE = ""; |
|
public $HASH_FILE_P7M= ""; |
|
public $NOMEFILEORIGINALE= ""; |
|
|
|
public function __construct($src = null) { |
|
global $con; |
|
if ($src == null) |
|
return; |
|
if (is_array($src)) { |
|
if (isset($src['ID']) && $src['ID'] > 0) { |
|
$this->_loadAndFillObject($src['ID'], self::TABLE_NAME, $src); |
|
} else { |
|
$this->_loadByRow($src, $stripSlashes); |
|
} |
|
} elseif (intval($src)) { |
|
$sql = "SELECT * FROM " . self::TABLE_NAME . " WHERE ID = :id"; |
|
$query = $con->prepare($sql); |
|
$query->bindParam(":id", $src); |
|
try { |
|
$query->execute(); |
|
$it = $query->fetchAll(PDO::FETCH_ASSOC); |
|
Utils::FillObjectFromRow($this, $it[0]); |
|
} catch (Exception $exc) { |
|
$exc->getMessage(); |
|
} |
|
} |
|
} |
|
|
|
public function Save() { |
|
global $con; |
|
$vars = get_object_vars($this); |
|
$sql = "CALL " . self::SP_ . " (?,?,?,?,?,?,?,?,?,?,?,?)"; |
|
$query = $con->prepare($sql); |
|
$query->bindParam(1, $this->ID); |
|
$query->bindParam(2, $this->ISTITUTO_DI_CREDITO); |
|
$query->bindParam(3, $this->FILIALE_DI); |
|
$query->bindParam(4, $this->IBAN); |
|
$query->bindParam(5, $this->INFO_PEC); |
|
$query->bindParam(6, $this->REGOLARITA_CONTRIBUTIVA); |
|
$query->bindParam(7, $this->MOTIVAZIONE); |
|
$query->bindParam(8, $this->HASH_FILE); |
|
$query->bindParam(9, $this->FILEPATH); |
|
$query->bindParam(10, $this->FILESIZE); |
|
$query->bindParam(11, $this->HASH_FILE_P7M); |
|
$query->bindParam(12, $this->NOMEFILEORIGINALE); |
|
try { |
|
$it = parent::_Save($query); |
|
} catch (Exception $exc) { |
|
|
|
$it['descrizioneErrore'] = $exc->getMessage(); |
|
} |
|
return $it; |
|
} |
|
|
|
public function Delete() { |
|
return parent::_Delete(self::TABLE_NAME, "ID = " . $this->ID); |
|
} |
|
|
|
/** |
|
* Elimina l'oggetto corrente dal database e restituisce TRUE se ha successo |
|
* |
|
* @return bool Risultato booleano dell'operazione |
|
*/ |
|
public function LogicalDelete() { |
|
return parent::_LogicalDelete(self::TABLE_NAME, "id = " . $this->id); |
|
} |
|
|
|
/** |
|
* Funzione per la visualizzazione dei logs |
|
* @param type $record |
|
* @param type $campo |
|
*/ |
|
public function Parse(&$record, $campo = "") { |
|
$props = get_class_vars(get_class($this)); |
|
switch ($campo) { |
|
|
|
default: |
|
array_push($record, array("Campo" => $campo, "Valore" => $this->$campo)); |
|
break; |
|
} |
|
} |
|
|
|
}
|
|
|