Example #1
0
 public function variables()
 {
     $tipoEnsayo = new TipoEnsayo();
     $this->tiposEnsayo = $tipoEnsayo->find();
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $tags2 = array_keys($_POST);
         // obtiene los nombres de las varibles
         $valores2 = array_values($_POST);
         // obtiene los valores de las varibles
         foreach ($tags2 as $index => $constId) {
             $id = explode("_", $constId);
             $id = $id[1];
             $constante = Load::model('constantetipoensayo')->find_first("id={$id}");
             if (isset($constante) && $constante->valor != $valores2[$index]) {
                 $constante->valor = $valores2[$index];
                 $constante->save();
             }
         }
     }
 }
Example #2
0
 function constantes($id)
 {
     $tipoEnsayo = new TipoEnsayo();
     $this->tipoEnsayo = $tipoEnsayo->find_first("id={$id}");
     $this->constantes = $tipoEnsayo->getConstantetipoensayo();
 }