/**
 * Funcion encargada de obtener una Editorial segun si ID
 */
function buscarEditorialPorId($idEditorial)
{
    global $client;
    //referencia global a la variable client (la cual accede al WS)
    $editorial = null;
    $param = array('idEditorial' => $idEditorial);
    $response = $client->call('buscarEditorialPorId', $param);
    if ($response != null) {
        $editorial = new Editorial();
        $editorial->setIdEditorial($response[0]["ID_EDITORIAL"]);
        $editorial->setDescripcion($response[0]["DESCRIPCION"]);
    }
    return $editorial;
}
 */
require_once $_SERVER["DOCUMENT_ROOT"] . '/BibliotecaFupWeb/config.ini.php';
require_once BASEPATH . 'library/Inputfilter.php';
require_once BASEPATH . 'library/Helpers.php';
require_once BASEPATH . 'library/cliente.php';
require_once BASEPATH . 'util/Autoload.php';
require_once BASEPATH . 'util/UtilidadesBuscarPorId.php';
session_start();
//Funcionalidades ajax
if (isset($_POST['llamadoAjax']) && $_POST['llamadoAjax'] == "true") {
    switch ($_POST['opcion']) {
        case 'cargarCombo':
            $response = null;
            $tabla = $_POST['tabla'];
            if ($tabla == "EDITORIAL") {
                $editorialBuscar = new Editorial();
                //Editorial por defecto (Listará todas las editoriales)
                $param = array('descripcion' => $editorialBuscar->getDescripcion());
                $response = $client->call('listadoEditoriales', $param);
            }
            if ($tabla == "AREA") {
                $response = $client->call('listadoAreas');
            }
            if ($tabla == "SEDE") {
                $response = $client->call('listadoSedes');
            }
            if ($tabla == "PAIS") {
                $response = $client->call('listadoPaises');
            }
            if ($tabla == "CIUDAD") {
                $idPais = $_POST['idPais'];
Beispiel #3
0
echo $form->labelEx($model, 'ISBN');
?>
		<?php 
echo $form->textField($model, 'ISBN', array('size' => 13, 'maxlength' => 13));
?>
		<?php 
echo $form->error($model, 'ISBN');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'IdEditorial');
?>
		<?php 
echo $form->dropDownList($model, 'IdEditorial', CHtml::listData(Editorial::model()->findAll(array('order' => 'Nombre')), 'IdEditorial', 'Nombre'), array('prompt' => 'Seleccione una Editorial'));
?>
		<?php 
echo $form->error($model, 'IdEditorial');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'Titulo');
?>
		<?php 
echo $form->textField($model, 'Titulo', array('size' => 60, 'maxlength' => 100));
?>
		<?php 
echo $form->error($model, 'Titulo');
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Editorial the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Editorial::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
     $_SESSION['autorBuscar'] = new Autor();
     echo json_encode($listaAutores);
     break;
 case 'capurarAutorSeleccionado':
     $idAutor = $_POST['idAutor'];
     $autor = buscarAutorPorId($idAutor);
     $_SESSION['autorSeleccionadoAdmin'] = $autor;
     echo true;
     break;
 case 'listadoEditorial':
     $param = array('descripcion' => $_SESSION['editorialBuscar']->getDescripcion());
     $response = $client->call('listadoEditoriales', $param);
     $listaEditoriales = array();
     if (count($response) > 0) {
         foreach ($response as $item) {
             $editorial = new Editorial();
             $editorial->setIdEditorial($item["ID_EDITORIAL"]);
             $editorial->setDescripcion($item["DESCRIPCION"]);
             $listaEditoriales[] = $editorial;
         }
     }
     $_SESSION['editorialBuscar'] = new Editorial();
     echo json_encode($listaEditoriales);
     break;
 case 'listadoSolicitudes':
     //Buscar por editorial
     $idEditorial = "";
     if ($_SESSION['solicitudBuscar']->getLibro()->getEditorial() != null) {
         $idEditorial = $_SESSION['solicitudBuscar']->getEditorial()->getIdEditorial();
     }
     //Buscar por fechaSolicitud