<?php include '../controller/cEmpleados.php'; $emp = new cEmpleados(); if ($_POST) { switch ($_POST['opcion']) { case 'nuevoEmpleado': $datos = array('a_pat' => $_POST['a_pat'], 'a_mat' => $_POST['a_mat'], 'nombres' => $_POST['nombres'], 'rfc' => $_POST['rfc'], 'curp' => $_POST['curp'], 'fnac' => $_POST['fnac'], 'ife' => $_POST['ife'], 'nacionalidad' => $_POST['nacionalidad'], 'telefono' => $_POST['telefono'], 'email' => $_POST['email'], 'calle' => $_POST['calle'], 'avenida' => $_POST['avenida'], 'col' => $_POST['col'], 'n_ext' => $_POST['n_ext'], 'n_int' => $_POST['n_int'], 'cp' => $_POST['cp'], 'delegacion' => $_POST['delegacion'], 'ciudad' => $_POST['ciudad'], 'estado' => $_POST['estado'], 'pais' => $_POST['pais'], 'giro' => $_POST['giro'], 'status' => $_POST['status'], 'sucursal' => $_POST['sucursal'], 'participacion' => $_POST['participacion'], 'cargo' => $_POST['cargo'], 'observaciones' => $_POST['observaciones']); $emp->nvoEmp($datos); break; case 'editar': $datos = array('id_empleado' => $_POST['id_empleado'], 'a_pat' => $_POST['a_pat'], 'a_mat' => $_POST['a_mat'], 'nombres' => $_POST['nombres'], 'rfc' => $_POST['rfc'], 'curp' => $_POST['curp'], 'fnac' => $_POST['fnac'], 'ife' => $_POST['ife'], 'nacionalidad' => $_POST['nacionalidad'], 'telefono' => $_POST['telefono'], 'email' => $_POST['email'], 'calle' => $_POST['calle'], 'avenida' => $_POST['avenida'], 'col' => $_POST['col'], 'n_ext' => $_POST['n_ext'], 'n_int' => $_POST['n_int'], 'cp' => $_POST['cp'], 'delegacion' => $_POST['delegacion'], 'ciudad' => $_POST['ciudad'], 'estado' => $_POST['estado'], 'pais' => $_POST['pais'], 'giro' => $_POST['giro'], 'status' => $_POST['status'], 'sucursal' => $_POST['sucursal'], 'participacion' => $_POST['participacion'], 'cargo' => $_POST['cargo'], 'observaciones' => $_POST['observaciones'], 'id_dom' => $_POST['id_dom']); $emp->updateEmpleado($datos); break; case 'listaSucursal': $con = $emp->listaSucursal(); $i = 0; while ($row = $con->NextRow()) { if ($i == 0) { echo "<option value='" . $row['id_sucursal'] . "'selected='selected'>" . $row['nombre'] . "</option>"; } else { echo "<option value='" . $row['id_sucursal'] . "'>" . $row['nombre'] . "</option>"; } $i++; } break; case 'getEmpleados': $emp->buscarEmpleado($_POST['fecha_inicio'], $_POST['fecha_fin'], $_POST['sucursal']); break; case 'familiar': $datos = array('parentesco' => $_POST['parentesco'], 'a_pat' => $_POST['a_pat'], 'a_mat' => $_POST['a_mat'], 'nombres' => $_POST['nombres'], 'rfc' => $_POST['rfc'], 'curp' => $_POST['curp'], 'fnac' => $_POST['fnac'], 'ife' => $_POST['ife'], 'nacionalidad' => $_POST['nacionalidad'], 'telefono' => $_POST['telefono'], 'email' => $_POST['email'], 'calle' => $_POST['calle'], 'avenida' => $_POST['avenida'], 'col' => $_POST['col'], 'n_ext' => $_POST['n_ext'], 'n_int' => $_POST['n_int'], 'cp' => $_POST['cp'], 'delegacion' => $_POST['delegacion'], 'ciudad' => $_POST['ciudad'], 'estado' => $_POST['estado'], 'pais' => $_POST['pais'], 'giro' => $_POST['giro']);
<?php include_once "../controller/cEmpleados.php"; $emps = new cEmpleados(); $emps->cambiaPass($_POST['idEmp'], $_POST['nvaContra']); echo "CONTRASEÑA CAMBIADA CON ÉXTITO";
<?php include_once "../controller/cEmpleados.php"; $empl = new cEmpleados(); $e = $empl->getEmple($_POST['idEmp']); ?> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Detalles de: <?php echo $e['nombre']; ?> </h4> </div> <div class="modal-body"> <table class="table"> <tr> <th style="width: 30%">Nombre</th> <td><?php echo $e['nombre']; ?> </td> </tr> <tr> <th>Fecha de Nacimiento</th> <td><?php echo $e['fecha_nacimiento']; ?> </td> </tr> <tr>
<?php include_once "../controller/cEmpleados.php"; //script que funge como alta y edicion de empleados $emple = new cEmpleados(); //si no se ha pasado el id del empleado se trata de una alta if (!isset($_POST['idEmp'])) { $emple->altaEmp($_POST['nempleado'], $_POST['edad'], $_POST['fnac'], $_POST['direccion'], $_POST['telefono'], $_POST['puesto'], $_POST['salario']); } else { $emple->editEmpleado($_POST['nempleado'], $_POST['edad'], $_POST['fnac'], $_POST['direccion'], $_POST['telefono'], $_POST['puesto'], $_POST['salario'], $_POST['idEmp']); }
<?php include_once "../controller/cEmpleados.php"; $emple = new cEmpleados(); $curso = 0; if (isset($_POST['curso'])) { $curso = 1; } $emple->addCursoEmp($_POST['idemp'], $curso, $_POST['porcentaje'], $_POST['lenguaje']); $conoc = $emple->getConocEmp($_POST['idemp']); foreach ($conoc as $cc) { $st = "btn-danger"; if ($cc['curso'] == 0) { $st = "btn-primary"; } //escribe el nombre del conocimiento o lenguaje ?> <button id="BT<?php echo $cc['id']; ?> " onclick="modalConfirmacionDelete(<?php echo $cc['id']; ?> ,'modalNvoEmp',3)" style="margin: 3px" class="btn <?php echo $st; ?> btn-xs"><?php echo $cc['lenguaje']; ?> </button>
<th>Nombre</th> <th>Apellido Paterno</th> <th>Apellido Materno</th> <th>Correo</th> <th>CURP</th> <th>RFC</th> <th>Telefono</th> <th>Puesto</th> <th>Acciones</th> </tr> </thead> <!--cuerpo de la tabla empleados--> <tbody style="text-transform: uppercase;"> <?php include '../controller/cEmpleados.php'; $empl = new cEmpleados(); $emples = $empl->listaEmpleados(); while ($em = $emples->NextRow()) { ?> <tr> <td><?php echo $em['nombre']; ?> </td> <td><?php echo $em['apd_paterno']; ?> </td> <td><?php echo $em['apd_materno']; ?>
<?php include_once "../controller/cEmpleados.php"; $empl = new cEmpleados(); $e = $empl->devuelveEmpleado($_POST['id']); ?> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Justificar Dia a: <?php echo $e['nombres'] . " " . $e['a_pat'] . " " . $e['a_mat']; ?> </h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-4 col-md-offset-4"> <div class="form-group"> <label>Seleccione Dia</label> <input class="form-control datepicker" id="diajusti" /> <input type="hidden" id="idEmp" value="<?php echo $_POST['id']; ?> " /> </div> </div> </div> </div> <div class="modal-footer"> <span id="spanbto"></span>
<?php if (isset($_POST['id_empleado'])) { include_once "../controller/cEmpleados.php"; $empleados = new cEmpleados(); $con = $empleados->geDatosEmpleados($_POST['id_empleado']); while ($row = $con->NextRow()) { $a_pat = $row['apd_paterno']; $a_mat = $row['apd_materno']; $nombres = $row['nombre']; $telefono = $row['telefono']; $email = $row['correo_electronico']; $cargo = $row['puesto']; $rfc = $row['rfc']; $curp = $row['curp']; $fnac = $row['fecha_nac']; $status = $row['status']; $ife = $row['ife']; $nacionalidad = $row['nacionalidad']; $giro = $row['giro']; $participacion = $row['participacion']; $sucursal = $row['sucursal']; $observaciones = $row['observaciones']; } $con = $empleados->getDatosEmpleadosDomicilio($_POST['id_empleado']); while ($row = $con->NextRow()) { $id_dom = $row['id_dom']; $calle = $row['calle']; $avenida = $row['via']; $n_ext = $row['num']; $n_int = $row['num_int'];
<?php include_once "../controller/cEmpleados.php"; $emps = new cEmpleados(); //listamos los empleados activos $listE = $emps->listaEmpleados(1); ?> <div class="row"> <div class="col-md-10"> <h1 class="page-header"> Empleados </h1> </div> <div class="col-md-2"> <br /> <small> <button onclick="modalNvoEmp()" class="btn btn-success"> Agregar Empleado <i class="fa fa-user"></i> </button> </small> </div> </div> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-body"> <ul class="nav nav-pills"> <li class="active"> <a href="#home-pills" data-toggle="tab">Administracion</a> </li> <li class=""> <a href="#profile-pills" data-toggle="tab">Lenguajes y Cursos </a> </li> </ul>
<?php //script que elimina un elemento de acuerdo a los parametros deseados // 'lugar' = ubicacion de la accion 1=empleados 2= lenguajes 3=conocimientos del empleado switch ($_POST['lugar']) { case 1: include "../controller/cEmpleados.php"; $emp = new cEmpleados(); $emp->eliminaEmp($_POST['id']); echo "EMPLEADO ELIMINADO CON EXITO"; break; case 2: include "../controller/cLenguajes.php"; $leng = new cLenguajes(); echo $leng->borraLenguaje($_POST['id']); break; case 3: include "../controller/cEmpleados.php"; $emp = new cEmpleados(); $emp->eliminaCurso($_POST['id']); echo "CURSO ELMINADO CON EXITO"; break; }
<?php include_once "../controller/cEmpleados.php"; $emp = new cEmpleados(); $lista = $emp->listaEmpleados(1); ?> <!--botones de accion--> <div class="row"> <div class="col-md-3"> <button class="btn btn-block btn-success" onclick="modalNuevoEmpleado()">Nuevo Empleado</button> </div> </div> <!--tabla con los empleados--> <div class="row"> <div class="col-md-12"> <hr /> <div class="table-responsive"> <table class="table" id="tablaEmpleados"> <thead> <tr> <th>ID</th> <th>Nombre</th> <th>Puesto</th> <th>Salario</th> <th>Acciones</th> </tr> </thead> <tbody> <?php while ($l = $lista->fetch()) { ?>
public function editarEmpleado() { $emp = new cEmpleados(); $datos = array('id_empleado' => $_POST['id_empleado'], 'a_pat' => $_POST['a_pat'], 'a_mat' => $_POST['a_mat'], 'nombres' => $_POST['nombres'], 'rfc' => $_POST['rfc'], 'curp' => $_POST['curp'], 'fnac' => $_POST['fnac'], 'ife' => $_POST['ife'], 'nacionalidad' => $_POST['nacionalidad'], 'telefono' => $_POST['telefono'], 'email' => $_POST['email'], 'calle' => $_POST['calle'], 'avenida' => $_POST['avenida'], 'col' => $_POST['col'], 'n_ext' => $_POST['n_ext'], 'n_int' => $_POST['n_int'], 'cp' => $_POST['cp'], 'delegacion' => $_POST['delegacion'], 'ciudad' => $_POST['ciudad'], 'estado' => $_POST['estado'], 'pais' => $_POST['pais'], 'giro' => $_POST['giro'], 'status' => $_POST['status'], 'sucursal' => $_POST['sucursal'], 'participacion' => $_POST['participacion'], 'cargo' => $_POST['cargo'], 'observaciones' => $_POST['observaciones'], 'id_dom' => $_POST['id_dom']); $emp->updateEmpleado($datos); }
<?php require '../fpdf/fpdf.php'; include_once "../controller/cUtilerias.php"; include_once "../controller/cEmpleados.php"; include_once "../controller/cAsistencias.php"; $asistencia = new cAsistencias(); $emp = new cEmpleados(); $util = new cUtilerias(); $emple = $emp->devuelveEmpleado($_GET['id']); $lista = $asistencia->listaAsistenciasEmpleado($util->cambiaFFecha($_GET['inicio'], "Y-m-d"), $util->cambiaFFecha($_GET['fin'], "Y-m-d"), $_GET['id']); class PDF extends FPDF { //header function Header() { $this->Image('../img/logo.png', 37, 6, 130); $this->Ln(20); } //footer function Footer() { $this->SetY(-15); $this->SetFont('Arial', 'I', 8); $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 14);
<?php //modal que permite ver las estadisticas de cursos de un empleado include_once "../controller/cEmpleados.php"; $emps = new cEmpleados(); $conoc = $emps->getConocEmp($_POST['id']); //obtiene los datos del sistema ?> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">REVISANDO ESTADISTICAS</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <?php //ciclo que recaba la informacion del avance en cuanto a conocimientos foreach ($conoc as $cn) { //define el color de acuerdo si es curso o lenguaje //si es curso if ($cn['curso'] == 1) { $lb = "danger"; $eti = "CURSO DE "; } else { $lb = "primary"; $eti = "LENGUAJE/TECNOLOGÍA "; } ?> <div class="panel panel-default">