git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk/src@1 e2b1556b-49f8-d141-9351-52d6861a72d9
82 lines
1.9 KiB
PHP
82 lines
1.9 KiB
PHP
<?php
|
||
|
||
include_once("seguridad.php");
|
||
include_once("functions.php");
|
||
include_once("Objects/Administracion.php");
|
||
|
||
if(!$usuario->tieneRol("4")){
|
||
header("Location: aplicacion.php?e=permiso");
|
||
exit;
|
||
}
|
||
|
||
include_once("html/cabecera.php");
|
||
include_once("Objects/HTML.php");
|
||
include_once("Objects/Administracion.php");
|
||
$html=new HTML($locale);
|
||
if($_POST['action']!=""){
|
||
$administrador=new Administracion($usuario,$locale);
|
||
switch ($_POST['action']) {
|
||
case "Editar":$texto=$_POST['editName'];
|
||
try{
|
||
$cod=$_POST['campoSelect'];
|
||
$texto=array_merge($cod,$texto);
|
||
$administrador->editItem("salario",$texto);
|
||
$msg=$locale['2300'].$locale['2303'];
|
||
$tipo="ok";
|
||
} catch (Exception $e){
|
||
$msg=$e->getMessage();
|
||
$tipo="error";
|
||
}
|
||
break;
|
||
case "Eliminar":
|
||
$cod=$_POST['campoSelect'];
|
||
$cod=$cod[0];
|
||
try{
|
||
$administrador->removeItem("salario",$cod);
|
||
$msg=$locale['2301'].$locale['2303'];
|
||
$tipo="ok";
|
||
} catch (Exception $e){
|
||
$msg=$e->getMessage();
|
||
$tipo="error";
|
||
}
|
||
|
||
break;
|
||
|
||
case "Anadir": $texto=$_POST['newName'];
|
||
try{
|
||
$administrador->addItem("salario",$texto);
|
||
$msg=$locale['2302'].$locale['2303'];
|
||
$tipo="ok";
|
||
} catch (Exception $e){
|
||
$msg=$e->getMessage();
|
||
$tipo="error";
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
?>
|
||
<!-- ADMINISTRACI<43>N_SALARIOS.PHP -->
|
||
|
||
<h2><?php echo $locale['500']; ?></h2>
|
||
<?php if($msg!=""){
|
||
echo "<div class=\"aviso ".$tipo."\">".$msg."</div>";
|
||
} ?>
|
||
<div id="ContTabul">
|
||
<script src="js/adminTablas.js" language="JavaScript" type="text/javascript"></script>
|
||
<form id="formularioMantenimiento" action="administracion_salarios.php" method="post">
|
||
<?php
|
||
echo $html->adminTabla2("salario","id","nombre");
|
||
|
||
?>
|
||
|
||
</form>
|
||
</div>
|
||
|
||
<?php
|
||
include_once("html/pie.php");
|
||
|
||
?>
|