model->get();
$this->view->resoluciones=$resoluciones;
$this->view->render('resolucion/index');
}
function Registrar(){
$autoridades=$this->model->getAutoridad();
$this->view->autoridades=$autoridades;
$actas=$this->model->getActa();
$this->view->actas=$actas;
$municipales=$this->model->getEjeMunicipal();
$this->view->municipales=$municipales;
$regionales=$this->model->getEjeRegional();
$this->view->regionales=$regionales;
$descriptores=$this->model->getDescriptor();
$this->view->descriptores=$descriptores;
$this->view->render('resolucion/registrar');
}
function RegistrarResolucion(){
$numero=$_POST['numero'];
$observacion=$_POST['observacion'];
$id_acta=$_POST['id_acta'];
$id_descriptor=$_POST['id_descriptor'];
$id_autoridad=$_POST['id_autoridad'];
$id_regional=11;
$id_municipal=$_POST['id_municipal'];
$desicion=$_POST['desicion'];
$fecha=$_POST['fecha'];
$identificacion=$_POST['identificacion'];
$nombre=$_POST['nombre'];
$apellido=$_POST['apellido'];
$d=date("d-m-Y");
$ruta2="asdas";
$time = time();
$file2=date("Y-m-d (H:i:s)", $time).$_FILES['file2']['name'];
$ruta2= $_FILES['file2']['tmp_name'];
$destino2 = "src/resolucion/". $file2;
if($fecha > $d)
{
$mensaje='
La fecha de la Resolución no puede ser mayor que la vigente. Verifique la fecha.
';
$this->view->mensaje=$mensaje;
$this->render();
exit();
}
if($var=$this->model->existe($numero)){
$mensaje='
Esta Acta ya fue Registrada ' . $var . '
Verifique Nuevamente.
';
$this->view->mensaje=$mensaje;
$this->render();
exit();
}
if($this->model->insert(['numero'=>$numero, 'observacion'=>$observacion, 'file2'=>$file2, 'fecha'=>$fecha, 'id_acta'=>$id_acta, 'id_descriptor'=>$id_descriptor, 'id_autoridad'=>$id_autoridad, 'id_regional'=>$id_regional, 'id_municipal'=>$id_municipal, 'desicion'=>$desicion, 'destino2'=>$destino2,'ruta2'=>$ruta2, 'identificacion'=>$identificacion, 'nombre'=>$nombre, 'apellido'=>$apellido ])){
$mensaje='
Exitoso! Resolucion Nro. '.$numero.' Registrado
Correctamente.
';
}else{
$mensaje='
Error Al Intentar Registrar la Resolucion
'.$numero.'
Por Favor, Intentalo de Nuevo.
';
}
$this->view->mensaje=$mensaje;
$this->render();
}
function ViewEdit($param=null){
$id_resolucion=$param[0];
$id_asociado=$param[0];
$edicion=$this->model->getID($id_resolucion);
$this->view->edicion=$edicion;
$edicion1=$this->model->getIDAsociado($id_asociado);
$this->view->edicion1=$edicion1;
$autoridades=$this->model->getAutoridad();
$this->view->autoridades=$autoridades;
$actas=$this->model->getActa();
$this->view->actas=$actas;
$municipales=$this->model->getEjeMunicipal();
$this->view->municipales=$municipales;
$regionales=$this->model->getEjeRegional();
$this->view->regionales=$regionales;
$descriptores=$this->model->getDescriptor();
$this->view->descriptores=$descriptores;
$this->view->render('resolucion/ViewEdit');
}
public function EditarResolucion(){
$numero=$_POST['numero'];
$observacion=$_POST['observacion'];
$id_acta=$_POST['id_acta'];
$id_descriptor=$_POST['id_descriptor'];
$id_autoridad=$_POST['id_autoridad'];
$id_regional=$_POST['id_regional'];
$id_municipal=$_POST['id_municipal'];
$desicion=$_POST['desicion'];
$fecha=$_POST['fecha'];
$identificacion=$_POST['identificacion'];
$nombre=$_POST['nombre'];
$apellido=$_POST['apellido'];
$id_resolucion=$_POST['id_resolucion'];
$id_asociado=$_POST['id_asociado'];
$d=date("d-m-Y");
$ruta2="asdas";
$time = time();
$file2=date("Y-m-d (H:i:s)", $time).$_FILES['file2']['name'];
$ruta2= $_FILES['file2']['tmp_name'];
$destino2 = "src/resolucion/". $file2;
if($fecha > $d)
{
$mensaje='
La fecha de la Resolución no puede ser mayor que la vigente. Verifique la fecha.
';
$this->view->mensaje=$mensaje;
$this->render();
exit();
}
if($this->model->update(['numero'=>$numero, 'observacion'=>$observacion, 'file2'=>$file2, 'fecha'=>$fecha, 'id_acta'=>$id_acta, 'id_descriptor'=>$id_descriptor, 'id_autoridad'=>$id_autoridad, 'id_regional'=>$id_regional, 'id_municipal'=>$id_municipal, 'desicion'=>$desicion, 'destino2'=>$destino2,'ruta2'=>$ruta2, 'identificacion'=>$identificacion, 'nombre'=>$nombre, 'apellido'=>$apellido, 'id_asociado'=>$id_asociado, 'id_resolucion'=>$id_resolucion])){
$mensaje='
Exitoso! Resolucion Nro. '.$numero.' Modificado
Correctamente.
';
}else{
$mensaje='
Error Al Intentar Editar La Resolucion '.$numero.'
Por Favor, Intentalo de Nuevo.
';
}
$this->view->mensaje=$mensaje;
$this->render();
}
function eliminar($param = null){
$id_resolucion = $param[0];
if($this->model->delete($id_resolucion)){
$mensaje='
Exitoso! Se ha Eliminado La Resolución
Correctamente.
';
}else{
$mensaje='
Error Al Intentar Eliminar La resolucion
Por Favor, Intentalo de Nuevo
';
}
$this->view->mensaje=$mensaje;
$this->render();
}
function viewDetalle($param = null){
$id_resolucion=$param[0];
$id_asociado=$param[0];
$reso=$this->model->getView($id_resolucion);
$this->view->reso=$reso;
$edicion1=$this->model->getIDAsociado($id_asociado);
$this->view->edicion1=$edicion1;
$this->view->render('resolucion/viewDetalle');
}
}
?>