<?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 (!empty($_POST)) { $r = new BookData(); $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->add(); } //Core::alert("Agregado exitosamente!"); Core::redir("./index.php?view=books");
<?php if (isset($_GET["product"]) && $_GET["product"] != "") { ?> <?php $products = BookData::getLike($_GET["product"]); if (count($products) > 0) { ?> <h3>Resultados de la Busqueda</h3> <table class="table table-bordered table-hover"> <thead> <th>ISBN</th> <th>Titulo</th> <th>Cantidad</th> </thead> <?php $products_in_cero = 0; foreach ($products as $product) { ?> <tr> <td style="width:80px;"><?php echo $product->isbn; ?> </td> <td><?php echo $product->title; ?> </td> <td style="width:250px;"><form method="post" action="index.php?action=addtocart"> <input type="hidden" name="book_id" value="<?php
<?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>
<div class="row"> <div class="col-md-12"> <a href="index.php?view=newbook" class="btn btn-default pull-right"><i class="fa fa-book"></i> Nuevo Libro</a> <h1>Libros</h1> <?php $books = BookData::getAll(); if (count($books) > 0) { // si hay usuarios ?> <table class="table table-bordered table-hover"> <thead> <th>ISBN</th> <th>Titulo</th> <th>Subtitulo</th> <th>Ejemplares</th> <th>Disponibles</th> <th>Categoria</th> <th></th> </thead> <?php foreach ($books as $user) { $category = $user->getCategory(); ?> <tr> <td><?php echo $user->isbn; ?> </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>";