コード例 #1
0
<?php

require 'lib/Inter.php';
$Y = new Inter();
$accion = $_POST['accion'];
switch ($accion) {
    case 1:
        $id = $_POST['id'];
        $datosCitas = $Y->SeleccionarCitasIdDoctor($id);
        $tabla = "<table class='table table-bordered'>\n                       <tr>\n                            <td></td>\n                           <td>Nombre Doc/Psi</td>\n                           <td>Paciente</td>\n                           <td>Codigo Paciente</td>\n                           <td>Numero Cita</td>\n                           <td>Fecha</td>\n                       </tr>";
        foreach ($datosCitas as $us) {
            $cont++;
            $userDatos = $Y->BuscarUsuarioId($us['idUsuario']);
            foreach ($userDatos as $key) {
                $nombreUsuario = $key['nombre'] . " " . $key['apellido'];
                $tipoUser = $key['tipoUser'];
            }
            switch ($tipoUser) {
                case '1':
                    $type = 'Doctor';
                    break;
                case '2':
                    $type = 'Psicologo';
                    break;
            }
            $pacienData = $Y->SeleccionarPacienteCodigo($us['codigoPaciente']);
            foreach ($pacienData as $key) {
                $nombrePacie = $key['nombre'] . " " . $key['apellido'];
                $codiPac = $key['codigoPaciente'];
            }
            $tabla .= "<tr>\n                                   <td>" . utf8_encode($type) . "</td>\n                                   <td>" . utf8_encode($nombreUsuario) . "</td>\n                                   <td>" . utf8_encode($nombrePacie) . "</td>\n                                   <td>" . utf8_encode($codiPac) . "</td>\n                                   <td>" . utf8_encode($us['numeroCita']) . "</td>\n                                   <td>" . utf8_encode($us['fechaCita']) . "</td>\n                                   <td><a href=\"#\" class=\"btn-diag\" data-param=" . $us['idCita'] . " data-toggle=\"modal\" data-target=\".bs-example-modal-lg\">Receta/Diagnostico</a></td>\n                               </tr>";