/**
 * Funcion encargada de obtener un Autor segun si ID
 */
function buscarAutorPorId($idAutor)
{
    global $client;
    //referencia global a la variable client (la cual accede al WS)
    $autor = null;
    $param = array('idAutor' => $idAutor);
    $response = $client->call('buscarAutorPorId', $param);
    if ($response != null) {
        $autor = new Autor();
        $autor->setIdAutor($response[0]['ID_AUTOR']);
        if ($response[0]['PRIMER_NOMBRE'] != null) {
            $autor->setPrimerNombre($response[0]['PRIMER_NOMBRE']);
        }
        if ($response[0]['SEGUNDO_NOMBRE'] != null) {
            $autor->setSegundoNombre($response[0]['SEGUNDO_NOMBRE']);
        }
        if ($response[0]['PRIMER_APELLIDO'] != null) {
            $autor->setPrimerApellido($response[0]['PRIMER_APELLIDO']);
        }
        if ($response[0]['SEGUNDO_APELLIDO'] != null) {
            $autor->setSegundoApellido($response[0]['SEGUNDO_APELLIDO']);
        }
        if ($response[0]['TIPO_AUTOR'] != null) {
            $autor->setTipoAutor($response[0]['TIPO_AUTOR']);
        }
    }
    return $autor;
}
Пример #2
0
         $usuario->setCodigo($_POST['codigo']);
     }
     if (trim($_POST['rol']) != "") {
         $usuario->setRol($_POST['rol']);
     }
     $_SESSION['usuarioBuscar'] = $usuario;
     echo true;
     break;
 case 'listadoAutores':
     $param = array('primerNombre' => $_SESSION['autorBuscar']->getPrimerNombre(), 'segundoNombre' => $_SESSION['autorBuscar']->getSegundoNombre(), 'primerApellido' => $_SESSION['autorBuscar']->getPrimerApellido(), 'segundoApellido' => $_SESSION['autorBuscar']->getSegundoApellido(), 'tipo' => $_SESSION['autorBuscar']->getTipoAutor());
     $response = $client->call('listadoAutores', $param);
     $listaAutores = array();
     if (count($response) > 0) {
         foreach ($response as $item) {
             $autor = new Autor();
             $autor->setIdAutor($item['ID_AUTOR']);
             if ($item['PRIMER_NOMBRE'] != null) {
                 $autor->setPrimerNombre($item['PRIMER_NOMBRE']);
             }
             if ($item['SEGUNDO_NOMBRE'] != null) {
                 $autor->setSegundoNombre($item['SEGUNDO_NOMBRE']);
             }
             if ($item['PRIMER_APELLIDO'] != null) {
                 $autor->setPrimerApellido($item['PRIMER_APELLIDO']);
             }
             if ($item['SEGUNDO_APELLIDO'] != null) {
                 $autor->setSegundoApellido($item['SEGUNDO_APELLIDO']);
             }
             if ($item['TIPO_AUTOR'] != null) {
                 $autor->setTipoAutor($item['TIPO_AUTOR']);
             }