<?php /** * @author evilnapsis * @brief Eliminar autores **/ $category = AuthorData::getById($_GET["id"]); $category->del(); Core::redir("./index.php?view=authors");
<?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>
public function getAuthor() { return $this->author_id != null ? AuthorData::getById($this->author_id) : null; }
<?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>"; }