public function add()
 {
     return;
     //<<<<<<<<<<
     $autor = new Autor();
     $autor->setFkUsuario($_REQUEST['id']);
     $daoAutor = new AutorMySqlDAO();
     $daoAutor->insert($autor);
     $autorCurso = new AutorCurso();
     $autorCurso->setFkAutor($_REQUEST['id']);
     $autorCurso->setFkCurso($_REQUEST['f_curso']);
     $autorCurso->setSeq('1');
     $autorCurso->setStatus('1');
     $daoCurso = new AutorCursoMySqlDAO();
     $daoCurso->insert($autorCurso);
 }
Example #2
0
 /**
  * Imprimir individuales
  *
  * Crea los archivos para cada autor
  */
 protected function imprimir_individuales()
 {
     // Cargar la configuración de autores
     $autores_config = new \Configuracion\AutoresConfig();
     // Iniciar la plantilla
     $plantilla = new Plantilla();
     $plantilla->navegacion = new Navegacion();
     $plantilla->mapa_inferior = new MapaInferior();
     $plantilla->directorio = \Configuracion\AutoresConfig::DIRECTORIO;
     $plantilla->navegacion->opcion_activa = \Configuracion\AutoresConfig::NAVEGACION_OPCION_ACTIVA;
     // Bucle por todas los autores
     foreach ($this->recolector->obtener_autores() as $autor_texto) {
         // Obtener instancia de Autor
         $autor = $autores_config->obtener($autor_texto);
         // Si está definido en \Configuracion\AutoresConfig
         if ($autor === false) {
             $autor = new Autor('', '', $autor_texto);
         }
         // Definir ruta del archivo a crear, las banderas en falso hacen que el URL sea autor.html
         $autor->en_raiz = false;
         $autor->en_otro = false;
         $ruta = sprintf('%s/%s', $plantilla->directorio, $autor->url());
         // Filtrar por este autor
         $this->recolector->filtrar_publicaciones_de_autor($autor_texto);
         // Iniciar página
         $pagina = new PaginasAutoresIndividual($autor, $this->recolector);
         $pagina->en_raiz = false;
         $pagina->en_otro = true;
         // Pasar a la plantilla estos valores
         $plantilla->titulo = $pagina->titulo;
         $plantilla->descripcion = $pagina->descripcion;
         $plantilla->claves = "Autor, {$autor_texto}";
         $plantilla->archivo_ruta = $ruta;
         // Pasar a la plantilla el HTML y Javascript
         $plantilla->contenido = $pagina->html();
         $plantilla->javascript = $pagina->javascript();
         // Crear archivo
         $this->crear_archivo($plantilla->archivo_ruta, $plantilla->html());
         $this->contador++;
     }
 }
 /**
  * Adiciona um novo autor
  * @return false Retorna false caso não passe nas validações
  */
 public function adicionarAutor()
 {
     $db = new Database();
     $autor = new Autor();
     $render = new Render();
     $autor->nome = $_POST['nome'];
     // Valida os campos
     if (trim($autor->nome) == '') {
         $render::renderTemplate('views/templates/alerta', array('tipo' => 'danger', 'msg' => 'O campo Nome não pode estar vazio.'));
         return false;
     } else {
         if (strlen($autor->nome) > 80) {
             $render::renderTemplate('views/templates/alerta', array('tipo' => 'danger', 'msg' => 'O campo Nome não pode possuir mais que 80 caracteres.'));
             return false;
         }
     }
     // Insere no banco de dados
     $autor->insert();
     // Redireciona a página
     header("Location: ?page=autores");
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete($id)
 {
     $this->loadModel($id)->delete();
     Autor::deleteAutor($id);
     // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
     if (!isset($_GET['ajax'])) {
         $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
     }
 }
Example #5
0
 function Update($nr, $autoren, $art, $titel, $jahr, $verlag, $isbn, $beschreibung, $ort, $stichworte)
 {
     global $db_config, $sqldb, $login;
     // Nur wenn wir als Mitglied angemeldet sind
     if ($login->IsMember() === true) {
         // Lösche jede Verbindung zu Autoren in Literatur_Autor mit aktueller Literatur
         $sql = "DELETE FROM " . $db_config['prefix'] . "Literatur_Autor\n\t\t\t\t\t\tWHERE Literatur_Nr='{$nr}'";
         $sqldb->Query($sql);
         // Ändere aktuellen Literatureintrag
         $sql = "UPDATE " . $db_config['prefix'] . "Bibliothek\n\t\t\t\t\t\t\tSET Art='{$art}', Titel='{$titel}', Jahr='{$jahr}', Verlag='{$verlag}', ISBN='{$isbn}', Beschreibung='{$beschreibung}', Ort='{$ort}', Stichworte='{$stichworte}'\n\t\t\t\t\t\t\tWHERE Literatur_Nr='{$nr}'\n\t\t\t\t\t\t\tLIMIT 1";
         $sqldb->Query($sql);
         // Füge neue Autoren hinzu und verbinde sie mit Literatur durch Literatur_Autor
         $autorlist = Autor::Split($autoren);
         foreach ($autorlist as $cur) {
             $sql = "INSERT INTO " . $db_config['prefix'] . "Literatur_Autor\n\t\t\t\t\t\tVALUES ('" . $cur . "', '{$nr}')";
             $sqldb->Query($sql);
         }
         Autor::Clean();
     }
 }
 function addAutorWithName($autorname)
 {
     $autor = new Autor();
     $autor->setNome($autorname);
     if (!isset($this->authorscount)) {
         $this->authorscount = 0;
     }
     $this->authorscount += 1;
     if (!isset($this->autores)) {
         $this->autores = array();
     }
     echo "un autor agregado v2";
     array_push($this->autores, $autor);
 }
Example #7
0
    $objective->updateObjective($objectiveId);
} elseif (isset($_POST["nameUpdateSituation"])) {
    $nameUpdateSituation = $_POST['nameUpdateSituation'];
    $situation = new Situation();
    $situation->setName($nameUpdateSituation);
    $situationId = $_SESSION["situationId"];
    $situation->updateSituation($situationId);
} elseif (isset($_POST["nameUpdateSystem"])) {
    $nameUpdateSystem = $_POST['nameUpdateSystem'];
    $system = new System();
    $system->setName($nameUpdateSystem);
    $systemId = $_SESSION["systemId"];
    $system->updateSystem($systemId);
} elseif (isset($_POST["nameUpdateAutor"])) {
    $nameUpdateAutor = $_POST['nameUpdateAutor'];
    $autor = new Autor();
    $autor->setName($nameUpdateAutor);
    $autorId = $_SESSION["autorId"];
    $autor->updateAutor($autorId);
} elseif (isset($_POST["nameUpdateActor"])) {
    $nameUpdateActor = $_POST['nameUpdateActor'];
    $actor = new Actor();
    $actor->setName($nameUpdateActor);
    $actorId = $_SESSION["actorId"];
    $actor->updateActor($actorId);
}
$categoryList = Category::getAllCategory();
$_SESSION['categoryList'] = $categoryList;
$objectiveList = Objective::getAllObjective();
$_SESSION['objectiveList'] = $objectiveList;
$systemList = System::getAllSystem();
 */
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 'cargarDatosAutorSeleccionado':
            echo json_encode($_SESSION['autorSeleccionadoAdmin']);
            break;
        case 'buscarAutor':
            $autor = new Autor();
            if (trim($_POST['primerNombre']) != "") {
                $autor->setPrimerNombre(trim($_POST['primerNombre']));
            }
            if (trim($_POST['segundoNombre']) != "") {
                $autor->setSegundoNombre(trim($_POST['segundoNombre']));
            }
            if (trim($_POST['primerApellido']) != "") {
                $autor->setPrimerApellido(trim($_POST['primerApellido']));
            }
            if ($_POST['segundoApellido'] != "") {
                $autor->setSegundoApellido(trim($_POST['segundoApellido']));
            }
            if ($_POST['tipoAutor'] != "") {
                $autor->setTipoAutor($_POST['tipoAutor']);
            }
<?php

session_start();
header('Content-Type: text/html; charset=utf-8');
if (isset($_SESSION["login"]) && $_SESSION["login"]) {
} else {
    header("Location: Logout.php");
}
require_once "../Connections/ConexaoDB.php";
require_once "../Connections/AutorDB.php";
require_once "../class/Autor.class.php";
$CodAutor = $_POST['codautor'];
$NomeAutor = addslashes($_POST['autor']);
$DtNascAutor = $_POST['nascimento'];
$Autor = new Autor();
$Autor->setCod_autor($CodAutor);
$Autor->setNome($NomeAutor);
$Autor->setData_nascimento($DtNascAutor);
$AutorDB = new AutorDB();
$execute = $AutorDB->Editar($conexao, $Autor);
$retorno = $execute ? 'editado' : 'erro';
header("Location: ../views/GerenciaAutor.php?retorno=" . $retorno);
 /**
  * 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 Autor the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Autor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #11
0
<h1>Редактировать книги</h1>


<?php 
echo CHtml::link('Расширенный поиск', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
/*echo CHtml::dropDownList('publisher', '',
  CHtml::listData(Publisher::model()->findAll(), 'id', 'publisher_name'),
  array('empty' => 'All'));*/
$this->widget('zii.widgets.grid.CGridView', array('id' => 'books-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('title', array('name' => 'publisher.publisher_name', 'filter' => CHtml::dropDownList('Books[publisher_id]', $model->publisher_id, CHtml::listData(Publisher::model()->findAll(), 'id', 'publisher_name'), array('empty' => 'All'))), array('header' => 'Авторы', 'value' => 'Books::extractObjData($data->autor)', 'filter' => CHtml::dropDownList('Books[id]', $model->id, Books::selectObjData(Autor::model()->findAll(), 'book_id', 'autor_name_id'), array('empty' => 'All')), 'type' => 'raw'), array('name' => 'category.title', 'filter' => CHtml::dropDownList('Books[rubric_id]', $model->rubric_id, CHtml::listData(Category::model()->findAll(), 'id', 'title'), array('empty' => 'All'))), array('header' => 'Фото', 'value' => 'Books::photo($data->id)', 'type' => 'raw', 'htmlOptions' => array('width' => '110px', 'text-align' => 'center')), array('class' => 'CButtonColumn', 'template' => '{update}{delete}'))));
?>

<script>
    function slide(count, id, numPhoto){
        $('#icon_'+id+'_'+numPhoto).hide();
        if (numPhoto < count)
            numPhoto++;
        else
            numPhoto = 1;
        $('#icon_'+id+'_'+numPhoto).show();
    }
</script>
<?php

get_header();
?>
<div class="cuerpo">
	<?php 
$usuarios = get_posts(array('posts_per_page' => -1, 'post_type' => 'coworkers', 'fields' => 'ids'));
if ($usuarios) {
    foreach ($usuarios as $usuario) {
        $autor = new Autor($usuario);
        $autor->ficha_coworkers();
    }
}
?>
</div>
<?php 
get_footer();
 /**
  * atualiza um registro da tabela
  *
  * @parametro AutorMySql autor
  */
 public function update(Autor $Autor)
 {
     $sql = "UPDATE {$this->table} SET  WHERE fk_usuario = :id";
     $id = $Autor->getFkUsuario();
     $stmt = ConnectionFactory::prepare($sql);
     $stmt->bindParam(':id', $id);
     return $stmt->execute();
 }
Example #14
0
            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'];
                //En caso de 0 o vacio, listara todas las ciudades
                $param = array('idPais' => $idPais);
                $response = $client->call('listadoCiudades', $param);
            }
            if ($tabla == "AUTOR") {
                $autorBuscar = new Autor();
                //Autor por defecto (Listará todos los autores)
                $param = array('primerNombre' => $autorBuscar->getPrimerNombre(), 'segundoNombre' => $autorBuscar->getSegundoNombre(), 'primerApellido' => $autorBuscar->getPrimerApellido(), 'segundoApellido' => $autorBuscar->getSegundoApellido(), 'tipo' => $autorBuscar->getTipoAutor());
                $response = $client->call('listadoAutores', $param);
            }
            echo json_encode($response);
            break;
    }
}
 private function cabecera_single()
 {
     $categorias = $this->categorias;
     $cat = $categorias ? reset($categorias)->name : '';
     $fecha = date_i18n('l d \\d\\e F, Y', strtotime($this->fecha));
     if ($this->autor) {
         $autor = new Autor($this->autor);
         $ficha_autor = $autor->ficha_autor($fecha);
     } else {
         $ficha_autor = '';
     }
     return '<header class="entrada--single--cabecera">' . '<hgroup>' . '<h2>' . $this->titulo . '</h2>' . '<h3 class="lekton">' . $cat . '</h3>' . '</hgroup>' . $ficha_autor . '</header>';
 }
 /**
  * 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 Autor the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Autor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'La página solicitada no está disponible.');
     }
     return $model;
 }
Example #17
0
 function Split()
 {
     global $sqldb, $login;
     $login->Level = 0;
     // Gast
     $testAutorNamen = "Schon Vorhanden, Wird Hinzugefügt";
     $autoren = Autor::Split($testAutorNamen);
     $result = $sqldb->Verify();
     if ($result !== true) {
         $result->Unit = 'Autor';
         $result->Test = 'Split (Gast)';
         return $result;
     }
     $testAutoren = array();
     $testAutoren[] = new stdClass();
     $testAutoren[] = new stdClass();
     $testAutoren[0]->Nr = 1;
     $testAutoren[1]->Nr = 2;
     $login->Level = 1;
     // Mitglied
     $sqldb->ExpectQuery('SELECT.*Autor_Nr.*WHERE.*Autorname', $testAutoren[0]);
     $sqldb->ExpectQuery('SELECT.*Autor_Nr.*WHERE.*Autorname', false);
     $sqldb->ExpectQuery('INSERT INTO.*', 1);
     $autoren = Autor::Split($testAutorNamen);
     $result = $sqldb->Verify();
     if ($result !== true) {
         $result->Unit = 'Autor';
         $result->Test = 'Split (Mitglied)';
         return $result;
     }
     if (count($autoren) != count($testAutoren)) {
         return new ErrorMessage('Autor', 'Split (Mitglied)', 'Anzahl Autoren', count($testAutoren), count($autoren));
     }
     return true;
 }
Example #18
0
 function AutorTitelSuche($titel, $autor)
 {
     global $sqldb, $db_config;
     $this->Treffer = array();
     $titel = trim($titel);
     $autor = trim($autor);
     if (empty($titel) === false || empty($autor) === false) {
         // Finde Literatur mit Titel und Autor
         $sql = "SELECT DISTINCT bibliothek.Literatur_Nr AS Nr, Titel, Verlag, ISBN\n\t\t\t\t\t\tFROM (" . $db_config['prefix'] . "Bibliothek AS bibliothek\n\t\t\t\t\t\t\tINNER JOIN  " . $db_config['prefix'] . "Literatur_Autor AS connect\n\t\t\t\t\t\t\tON bibliothek.Literatur_Nr = connect.Literatur_Nr)\n\t\t\t\t\t\tINNER JOIN  " . $db_config['prefix'] . "Autoren AS autoren\n\t\t\t\t\t\tON connect.Autor_Nr = autoren.Autor_Nr\n\t\t\t\t\t\tWHERE bibliothek.Titel like '%" . $titel . "%'";
         // Trenne kommagetrennte Autorenliste und
         // füge es Suche hinzu
         if (empty($autor) === false) {
             $sql .= " AND (";
             $authors = array();
             $authors = split(",", $autor);
             for ($i = 0; $i < count($authors); $i++) {
                 if ($i != 0) {
                     $sql .= " OR ";
                 }
                 $sql .= "autoren.Autorname like '%" . trim($authors[$i]) . "%'";
             }
             $sql .= ")";
         }
         $sqldb->Query($sql);
         // Lese Treffer aus
         while ($cur = $sqldb->Fetch()) {
             $this->Treffer[] = $cur;
         }
         // Lese zu jedem Treffer Autoren
         for ($i = 0; $i < count($this->Treffer); $i++) {
             // Kommagetrennte Autorenliste erstellen
             $authors = Autor::GetAll($this->Treffer[$i]->Nr);
             // Erstelle kommagetrennte Liste der Autoren
             $autorlist = "";
             if (empty($authors) === false) {
                 $autornamen = array();
                 foreach ($authors as $cur) {
                     $autornamen[] = $cur->Name;
                 }
                 $autorlist = implode(", ", $autornamen);
             }
             $this->Treffer[$i]->Autor = $autorlist;
         }
     }
 }
Example #19
0
	<div class="row">
		<?php 
echo $form->label($model, 'title');
?>
		<?php 
echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 500));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'autor_id');
?>
		<?php 
echo $form->dropDownList($model, 'id', Books::selectObjData(Autor::model()->findAll(), 'book_id', 'autor_name_id'), array('empty' => '--выберите автора--'));
?>
	</div>


	<div class="row">
		<?php 
echo $form->label($model, 'publisher_id');
?>
        <?php 
echo $form->dropDownList($model, 'publisher_id', CHtml::listData(Publisher::model()->findAll(), 'id', 'publisher_name'), array('empty' => '--выберите издательство--'));
?>


	</div>
/**
 * 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;
}
 /**
  * Exclude object from result
  *
  * @param     Autor $autor Object to remove from the list of results
  *
  * @return    AutorQuery The current query, for fluid interface
  */
 public function prune($autor = null)
 {
     if ($autor) {
         $this->addUsingAlias(AutorPeer::ID, $autor->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #22
0
     $smarty->assign("menu", $_SESSION['user']->getGroup());
     $smarty->assign("content", "parameters");
     $smarty->assign("paramcontent", $menu . $action);
     break;
 case 'Save':
     $smarty->assign("title", "Gestionnaire des paramètres");
     $smarty->assign("paramtitle", "Liste des auteurs");
     $smarty->assign("menu", $_SESSION['user']->getGroup());
     $smarty->assign("content", "parameters");
     $smarty->assign("paramcontent", "autorList");
     $smarty->assign("autorList", $_SESSION['autorList']);
     $smarty->assign("size", $_SESSION['autorsize']);
     break;
 case 'Update':
     $autorId = $_SESSION["autorId"] = $_GET["id"];
     $autor = Autor::getOneAutor($autorId);
     $smarty->assign("autor", $autor);
     $smarty->assign("title", "Gestionnaire des paramètres");
     $smarty->assign("paramtitle", "Modification d'un auteur");
     $smarty->assign("menu", $_SESSION['user']->getGroup());
     $smarty->assign("content", "parameters");
     $smarty->assign("paramcontent", $menu . $action);
     break;
 case 'Delete':
     $smarty->assign("title", "Gestionnaire des paramètres");
     $smarty->assign("paramtitle", "Gestionnaire des catégories");
     $smarty->assign("menu", $_SESSION['user']->getGroup());
     $smarty->assign("content", "parameters");
     $smarty->assign("paramcontent", $menu);
     $smarty->assign("categoryList", $_SESSION['categoryList']);
     break;
     if (trim($_POST['codigo']) != "") {
         $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']);