This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nuevos controladores y se incorporo en cargo el metodo editar #4
- Loading branch information
1 parent
f0551a0
commit 4756b8a
Showing
9 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php namespace controllers; | ||
|
||
use models\Cargo as Cargo; | ||
|
||
class cargoController{ | ||
|
||
private $cargo; | ||
|
||
public function __construct(){ | ||
$this->cargo = new Cargo(); | ||
} | ||
|
||
public function index(){ | ||
$datos = $this->cargo->listar(); | ||
return $datos; | ||
} | ||
|
||
public function agregar(){ | ||
if($_POST){ | ||
$this->cargo->set("nombre", $_POST['descripcion']); | ||
$this->cargo->add(); | ||
header('Location: '. URL . "cargo"); | ||
} | ||
} | ||
|
||
public function editar($id){ | ||
if($_POST){ | ||
$this->cargo->set("id", $_POST['id']); | ||
$this->cargo->set("nombre", $_POST['descripcion']); | ||
$this->cargo->edit(); | ||
header('Location: '. URL . "cargo"); | ||
}else{ | ||
$this->cargo->set("id", $id); | ||
$datos = $this->cargo->view(); | ||
return $datos; | ||
} | ||
} | ||
|
||
public function eliminar($id){ | ||
$this->cargo->set("id", $id); | ||
$this->cargo->delete(); | ||
header ('Location: '.URL.'cargo'); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
<?php namespace controllers; | ||
|
||
use models\Docente as Docente; | ||
use models\Usuario as Usuario; | ||
|
||
class docenteController{ | ||
|
||
private $docente; | ||
private $usuario; | ||
|
||
public function __construct(){ | ||
$this->docente = new Docente(); | ||
$this->usuario = new Usuario(); | ||
} | ||
|
||
public function index(){ | ||
$datos = $this->docente->listar(); | ||
return $datos; | ||
} | ||
|
||
public function agregar(){ | ||
if(!$_POST){ | ||
$datos = $this->usuario->noAsignado(); | ||
return $datos; | ||
}else{ | ||
$this->docente->set("cedula", $_POST['cedula']); | ||
$this->docente->set("nombres", $_POST['nombres']); | ||
$this->docente->set("apellidos", $_POST['apellidos']); | ||
$this->docente->set("telefono", $_POST['telefono']); | ||
$this->docente->set("correo", $_POST['correo']); | ||
$this->docente->set("idUsuario", $_POST['idUsuario']); | ||
$this->docente->add(); | ||
header("Location: " . URL . "docente"); | ||
} | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php namespace controllers; | ||
|
||
use models\Municipio as Municipio; | ||
use models\Parroquia as Parroquia; | ||
|
||
class parroquiaController{ | ||
|
||
private $municipio; | ||
private $parroquia; | ||
|
||
public function __construct(){ | ||
$this->municipio = new Municipio(); | ||
$this->parroquia = new Parroquia(); | ||
} | ||
|
||
public function index(){ | ||
$datos = $this->parroquia->listar(); | ||
return $datos; | ||
} | ||
|
||
public function agregar(){ | ||
if(!$_POST){ | ||
$datos = $this->municipio->listar(); | ||
return $datos; | ||
}else{ | ||
$this->parroquia->set("idMunicipio", $_POST['idMunicipio']); | ||
$this->parroquia->set("nombre", $_POST['nombre']); | ||
$this->parroquia->add(); | ||
header('Location: ' . URL . 'parroquia'); | ||
} | ||
} | ||
} | ||
?> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php namespace controllers; | ||
|
||
use models\Rubro as Rubro; | ||
|
||
class rubroController{ | ||
|
||
private $rubro; | ||
|
||
public function __construct(){ | ||
$this->rubro = new Rubro(); | ||
} | ||
|
||
public function index(){ | ||
$datos = $this->rubro->listar(); | ||
return $datos; | ||
} | ||
|
||
public function agregar(){ | ||
if($_POST){ | ||
$this->rubro->set("nombre", $_POST['descripcion']); | ||
$this->rubro->add(); | ||
header('Location: ' . URL . 'rubro'); | ||
} | ||
} | ||
} | ||
?> |
Empty file.