chemistryModel.php
34 lines
| 1.2 KiB
| text/x-php
|
PhpLexer
|
r0 | <?php | |
class chemistryModel extends ModelBase{ | |||
public $tableName = 'sis_chemistry'; | |||
public $id = array('key'=>'idchemistry','value'=>''); | |||
public function addItem($datos){ | |||
$this->setFieldArray($datos); | |||
list($resultado,$id,$mensaje) = $this->insert(); | |||
return array ($resultado,$id,$mensaje); | |||
} | |||
public function DeleteItem(){ | |||
list($resultado,$mensaje) = $this->delete(); | |||
return array ($resultado,$mensaje); | |||
} | |||
public function UpdateItem($datos){ | |||
$this->setFieldArray($datos); | |||
list($resultado,$mensaje) = $this->update(); | |||
return array ($resultado,$mensaje); | |||
} | |||
public function getChemistry($idappl_test){ | |||
$query = "SELECT sc.results, sc.clinically_significant, sc.repeated, sdm.name_field, sc.description" | |||
." FROM ".$this->tableName." AS sc" | |||
." INNER JOIN sis_data_medical AS sdm" | |||
." ON sdm.iddm = sc.iddm" | |||
." WHERE sc.idappl_test = ".$idappl_test; | |||
$result = $this->db->prepare($query); | |||
$result->execute(); | |||
$num_rows = $result->rowCount(); | |||
return array($result, $num_rows); | |||
} | |||
} | |||
?> |