<?php $item = ItemData::getById($_GET["id"]); $book = BookData::getById($item->book_id); ?> <div class="row"> <div class="col-md-12"> <h1><?php echo $book->title; ?> <small>Editar Ejemplar</small></h1> <br> <form class="form-horizontal" method="post" id="addcategory" action="./index.php?action=updateitem" role="form"> <div class="form-group"> <label for="inputEmail1" class="col-lg-2 control-label">Codigo*</label> <div class="col-md-6"> <input type="text" name="code" required value="<?php echo $item->code; ?> " class="form-control" id="code" placeholder="Codigo"> </div> </div> <div class="form-group"> <label for="inputEmail1" class="col-lg-2 control-label">Status*</label> <div class="col-md-6"> <select name="status_id" class="form-control"> <?php foreach (StatusData::getAll() as $p) { ?>
<?php if (count($_POST) > 0) { $r = BookData::getById($_POST["id"]); $r->title = $_POST["title"]; $r->subtitle = $_POST["subtitle"]; $r->description = $_POST["description"]; $r->isbn = $_POST["isbn"]; $r->n_pag = $_POST["n_pag"]; $r->year = $_POST["year"]; $r->category_id = $_POST["category_id"] != "" ? $_POST["category_id"] : "NULL"; $r->editorial_id = $_POST["editorial_id"] != "" ? $_POST["editorial_id"] : "NULL"; $r->author_id = $_POST["author_id"] != "" ? $_POST["author_id"] : "NULL"; $r->update(); Core::alert("Actualizado exitosamente!"); print "<script>window.location='./index.php?view=books';</script>"; }
<label class="control-label"><br></label> <a href="./?action=clearcart" class="btn btn-danger btn-block"><i class="fa fa-trash"></i></a> </div> </div> </form> <table class="table table-bordered table-hover"> <thead> <th style="width:40px;">Codigo</th> <th style="width:40px;">Ejemplar</th> <th>Titulo</th> <th></th> </thead> <?php foreach ($_SESSION["cart"] as $p) { $book = BookData::getById($p["book_id"]); $item = ItemData::getById($p["item_id"]); ?> <tr > <td><?php echo $book->isbn; ?> </td> <td ><?php echo $item->code; ?> </td> <td ><?php echo $book->title; ?> </td>
public function getBook() { return BookData::getById($this->book_id); }
<?php $book = BookData::getById($_GET["id"]); ?> <div class="row"> <div class="col-md-12"> <div class="btn-group pull-right"> <a href="index.php?view=newitem&book_id=<?php echo $book->id; ?> " class="btn btn-default"><i class='fa fa-th-list'></i> Nuevo Ejemplar</a> </div> <h1><?php echo $book->title; ?> <small>Ejemplares</small></h1> <br> <?php $users = ItemData::getAllByBookId($book->id); if (count($users) > 0) { // si hay usuarios ?> <table class="table table-bordered table-hover"> <thead> <th>Codigo</th> <th>Estado</th> <th></th> </thead> <?php foreach ($users as $user) {
<?php $user = BookData::getById($_GET["id"]); $user->del(); print "<script>window.location='index.php?view=books';</script>";