applicationTestModel.php
62 lines
| 2.0 KiB
| text/x-php
|
PhpLexer
|
r0 | <?php | ||
class applicationTestModel extends ModelBase{ | ||||
public $tableName = 'sis_appl_test'; | ||||
public $id = array('key'=>'idappl_test','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 getApplicationTest($number){ | ||||
$query = "SELECT spt.* FROM ".$this->tableName." AS spt" | ||||
." INNER JOIN sis_tests AS st ON spt.idtest = st.idtest" | ||||
." WHERE st.ordering = ".$number; | ||||
$result = $this->db->prepare($query); | ||||
$result->execute(); | ||||
return $result; | ||||
} | ||||
public function getApplicationTestbyID($id){ | ||||
$query = "SELECT * FROM ".$this->tableName | ||||
." WHERE idappl_test = ".$id; | ||||
$result = $this->db->prepare($query); | ||||
$result->execute(); | ||||
return $result; | ||||
} | ||||
public function getApplicationTestChecked($id, $idapplication){ | ||||
$query = "SELECT * FROM ".$this->tableName | ||||
." WHERE idtest = ".$id." AND idapplication = ".$idapplication; | ||||
$result = $this->db->prepare($query); | ||||
$result->execute(); | ||||
return $result; | ||||
} | ||||
public function info($id){ | ||||
$this->setQuery("Select * | ||||
From sis_appl_test | ||||
Where idappl_test =".$id); | ||||
$consulta = $this->loadObjectList(); | ||||
return $consulta; | ||||
} | ||||
public function Getappl_test($id, $form){ | ||||
$this->setQuery("Select * | ||||
From sis_appl_test | ||||
Where idappl_test =".$id." and idtest=".$form); | ||||
$consulta = $this->loadObjectList(); | ||||
return $consulta; | ||||
} | ||||
} | ||||
?> | ||||