Example #1
0
 public function delete()
 {
     $url = Registry::getUrl();
     $id = $_REQUEST["id"] ? $_REQUEST["id"] : $url->vars[0];
     $mosca = new Mosca($id);
     if ($mosca->id) {
         if ($mosca->delete()) {
             Registry::addMessage("Mosca eliminada satisfactoriamente", "success");
             //Log
             Log::add(LOG_DELETE_MOSCA, $mosca);
         }
     }
     Url::redirect(Url::site("moscas"));
 }
Example #2
0
 public function index()
 {
     $this->setData("moscas2", Mosca::select(array("tipoId" => 2)));
     $html = $this->view("views.parrilla");
     $this->render($html);
     //Log
     Log::add(LOG_LISTAR_PARRILLA);
 }
Example #3
0
 public function edit()
 {
     $url = Registry::getUrl();
     $this->setData("entrada", new Entrada($url->vars[0]));
     $this->setData("moscas1", Mosca::select(array("tipoId" => 1)));
     $this->setData("moscas2", Mosca::select(array("tipoId" => 2)));
     $this->setData("tipos", Tipo::select());
     $this->setData("entradasED", Entrada::select(array("tipo" => "ED")));
     $this->setData("entradasFIN", Entrada::select(array("tipo" => "FIN")));
     $html = $this->view("views.edit");
     $this->render($html);
 }
Example #4
0
 public function telson($firstLine = false)
 {
     $entrada = new Entrada($this->entradaId);
     $mosca = new Mosca($entrada->moscaId);
     $mosca2 = Mosca::getBy('codigo', $entrada->logo2);
     $tipo = new Tipo($this->tipo);
     if ($firstLine) {
         $tf = "TF";
     } else {
         $tf = "  ";
     }
     $segmento = " ";
     if ($entrada->segmento > 0) {
         $segmento = "X";
     }
     if ($tipo->codigo == "P") {
         $type_material = "S";
     } elseif ($tipo->codigo == "C") {
         $type_material = "C";
     } else {
         $type_material = "I";
     }
     $output = str_replace("-", "", $this->getFecha()) . $this->getHora() . $tf . substr($this->duracion, 1, 11) . $segmento . "CP2-10" . " " . " " . "          " . "          " . "      " . str_pad($type_material, 3, " ", STR_PAD_RIGHT) . "      " . str_pad($entrada->tcIn, 11, " ", STR_PAD_RIGHT) . str_pad($this->houseNumber, 16, " ", STR_PAD_RIGHT) . str_pad(substr(utf8_decode($this->titulo), 0, 16), 16, " ", STR_PAD_RIGHT) . str_pad(substr(utf8_decode($this->titulo), 0, 32), 32, " ", STR_PAD_RIGHT) . " " . "   " . "                " . str_pad($mosca2->identificador, 6, " ", STR_PAD_RIGHT) . str_pad($mosca2->codigo, 16, " ", STR_PAD_RIGHT) . str_pad(substr($this->delay, 1), 10, " ", STR_PAD_RIGHT) . str_pad(substr($mosca2->duracion, 1), 10, " ", STR_PAD_RIGHT) . "      " . "                " . "          " . "          " . " " . " " . " " . " " . "                                      " . "                " . "                          " . str_pad($mosca->identificador, 6, " ", STR_PAD_RIGHT) . str_pad($mosca->codigo, 16, " ", STR_PAD_RIGHT) . "           " . "      " . "                " . "          " . "          " . "      " . "                                           " . "        " . "                " . "           " . "          " . "  " . "          ";
     return $output;
 }