Example #1
0
 public function getAuthor()
 {
     return $this->author_id != null ? AuthorData::getById($this->author_id) : null;
 }
Example #2
0
<?php

/**
* @author evilnapsis
* @brief Eliminar autores 
**/
$category = AuthorData::getById($_GET["id"]);
$category->del();
Core::redir("./index.php?view=authors");
Example #3
0
<?php

$categories = CategoryData::getAll();
$authors = AuthorData::getAll();
$editorials = EditorialData::getAll();
?>

<div class="row">
<div class="col-md-12">
<h1>Nuevo Libro</h1>
<form class="form-horizontal" role="form" method="post" action="./?action=addbook" id="addbook">
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">ISBN</label>
    <div class="col-lg-10">
      <input type="text" name="isbn" class="form-control" id="inputEmail1" placeholder="ISBN">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Titulo</label>
    <div class="col-lg-10">
      <input type="text" name="title" required class="form-control" id="inputEmail1" placeholder="Titulo">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Subtitulo</label>
    <div class="col-lg-10">
      <input type="text" name="subtitle" class="form-control" id="inputEmail1" placeholder="Subtitulo">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Descripcion</label>
Example #4
0
<div class="row">
	<div class="col-md-12">
<div class="btn-group pull-right">
	<a href="index.php?view=newauthor" class="btn btn-default"><i class='fa fa-th-list'></i> Nuevo Autor</a>
</div>
		<h1>Autores</h1>
<br>
		<?php 
$users = AuthorData::getAll();
if (count($users) > 0) {
    // si hay usuarios
    ?>

			<table class="table table-bordered table-hover">
			<thead>
			<th>Nombre</th>
			<th></th>
			</thead>
			<?php 
    foreach ($users as $user) {
        ?>
				<tr>
				<td><?php 
        echo $user->name . " " . $user->lastname;
        ?>
</td>
				<td style="width:130px;"><a href="index.php?view=editauthor&id=<?php 
        echo $user->id;
        ?>
" class="btn btn-warning btn-xs">Editar</a> <a href="index.php?action=delauthor&id=<?php 
        echo $user->id;
Example #5
0
<?php

if (count($_POST) > 0) {
    $user = new AuthorData();
    $user->name = $_POST["name"];
    $user->lastname = $_POST["lastname"];
    $user->add();
    print "<script>window.location='index.php?view=authors';</script>";
}
Example #6
0
<?php

$user = AuthorData::getById($_GET["id"]);
?>
<div class="row">
	<div class="col-md-12">
	<h1>Editar Autor</h1>
	<br>
		<form class="form-horizontal" method="post" id="addproduct" action="index.php?action=updateauthor" role="form">


  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Nombre*</label>
    <div class="col-md-6">
      <input type="text" name="name" value="<?php 
echo $user->name;
?>
" class="form-control" id="name" placeholder="Nombre">
    </div>
  </div>

  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Apellido*</label>
    <div class="col-md-6">
      <input type="text" name="lastname" value="<?php 
echo $user->lastname;
?>
" class="form-control" id="name" placeholder="Apellido">
    </div>
  </div>
Example #7
0
<?php

if (count($_POST) > 0) {
    $user = AuthorData::getById($_POST["user_id"]);
    $user->name = $_POST["name"];
    $user->lastname = $_POST["lastname"];
    $user->update();
    print "<script>window.location='index.php?view=authors';</script>";
}