<div class="clearfix"></div> <div class="row"> <section class="col-lg-8"> <div class="panel panel-default"> <div class="panel-heading"> Mesas </div> <table class="table table-bordered table-hover datatable"> <thead> <th>Numero</th> <th></th> </thead> <?php foreach (ItemData::getAll() as $career) { ?> <tr> <td><b><?php echo $career->name; ?> </b></td> <td style="width:90px;"> <?php $sells = SellData::getAllUnAppliedByItemId($career->id); if (count($sells) > 0) { ?> <?php foreach ($sells as $s) { ?> <a href="./?view=onesell&id=<?php
if ($go && isset($_SESSION["cart"])) { $cart = $_SESSION["cart"]; if (count($cart) > 0) { /* $sell = new SellData(); $sell->user_id = $_SESSION["user_id"]; $sell->total = $_POST["total"]; $sell->discount = $_POST["discount"]; $s = $sell->add(); */ foreach ($cart as $c) { $op = new OperationData(); $op->item_id = $c["item_id"]; $op->client_id = $_POST["client_id"]; $op->start_at = $_POST["start_at"]; $op->finish_at = $_POST["finish_at"]; $op->user_id = $_SESSION["user_id"]; $add = $op->add(); $item = ItemData::getById($c["item_id"]); $item->unavaiable(); unset($_SESSION["cart"]); setcookie("selled", "selled"); } //////////////////// } } if ($go) { print "<script>window.location='index.php?view=rents';</script>"; } else { print "<script>alert('Rango de fecha invalido!');</script>"; print "<script>window.location='index.php?view=rent';</script>"; }
<?php $thejson = array(); $events = OperationData::getRents(); foreach ($events as $event) { $item = ItemData::getById($event->item_id); $book = $item->getBook(); $thejson[] = array("title" => $item->code . " - " . $book->title, "url" => "", "start" => $event->start_at, "end" => $event->finish_at); } // print_r(json_encode($thejson)); ?> <script> $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '<?php echo date("Y-m-d"); ?> ', editable: false, eventLimit: true, // allow "more" link when too many events events: <?php echo json_encode($thejson); ?>
<?php if (count($_POST) > 0) { $user = new ItemData(); $user->code = $_POST["code"]; $user->book_id = $_POST["book_id"]; $user->status_id = $_POST["status_id"]; $user->add(); print "<script>window.location='index.php?view=items&id={$_POST['book_id']}';</script>"; }
?> <h2>Lista de venta</h2> <form method="post" action="index.php?view=processsell" class="form-horizontal" id="process"> <div class="form-group"> <div class="col-lg-3"> <label for="inputEmail1" class="control-label">Personas</label> <input type="number" min="1" value="1" name="q" id="theq" class="form-control" placeholder="Personas"> </div> <div class="col-lg-3"> <label for="inputEmail1" class="control-label">No. Mesa</label> <select class="form-control" required name="mesa" id="mesa"> <option value=""> -- No. MESA -- </option> <?php foreach (ItemData::getAll() as $item) { ?> <option value="<?php echo $item->id; ?> "> <?php echo $item->name; ?> </option> <?php } ?> </select> </div> <div class="col-lg-3">
<?php $persons = ItemData::getAll(); ?> <div class="page-content"> <!-- Header Bar --> <?php Action::load("header"); ?> <!-- End Header Bar --> <div class="row"> <div class="col-lg-12"> <h1>Mensajes</h1> <?php if (count($persons) == 0) { ?> <p class="alert alert-danger">No hay Mensajes</p> <?php } ?> <div class="widget"> <div class="widget-title"> <i class="fa fa-th-list"></i> Mensajes </div> <div class="widget-body no-padding"> <div class="table-responsive"> <?php if (count($persons) > 0) {
<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 echo $product->id; ?> "> <?php $items = ItemData::getAvaiableByBookId($product->id); ?> <div class="input-group"> <select class="form-control" name="item_id" required> <option value=""> -- EJEMPLAR --</option> <?php foreach ($items as $item) { ?> <option value="<?php echo $item->id; ?> "> <?php echo $item->code; ?> </option> <?php
<?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) { ?>
/** * Creates a Item in a Category for a particular Catelogue * * @params catalogueName * - Name of the Catalogue to which item has to be added * @params categoryName * - Name of the Category to which item has to be added * @params itemData * - Item Information that has to be added * * @returns Catalogue object containing added item. * @see ItemData * */ function addItem($catalogueName, $categoryName, ItemData $itemData) { $imagePath = $itemData->getImage(); Util::throwExceptionIfNullOrBlank($catalogueName, "Catalogue Name"); Util::throwExceptionIfNullOrBlank($itemData, "Item Data"); Util::throwExceptionIfNullOrBlank($categoryName, "Catagory Name"); Util::throwExceptionIfNotValidImageExtension($imagePath, "imagePath"); $encodedCatName = Util::encodeParams($catalogueName); $encodedCategoryName = Util::encodeParams($categoryName); $objUtil = new Util($this->apiKey, $this->secretKey); //$file = fopen($filePath, r); if (!file_exists($itemData->image)) { throw new App42Exception("File Not Found"); } //$file = new File($filePath); //if(!file_exists($file)){ //throw Exception //} try { $params = null; $headerParams = array(); $queryParams = array(); $signParams = $this->populateSignParams(); $metaHeaders = $this->populateMetaHeaderParams(); $headerParams = array_merge($signParams, $metaHeaders); $queryParams['catalogueName'] = $catalogueName; $queryParams['categoryName'] = $categoryName; $signParams = array_merge($queryParams, $signParams); $postParams = array(); $postParams['itemId'] = $itemData->itemId; $postParams['name'] = $itemData->name; $postParams['description'] = $itemData->description; $postParams['price'] = $itemData->price; $params = array_merge($postParams, $signParams); $signature = urlencode($objUtil->sign($params)); //die(); $params['imageFile'] = "@" . $itemData->image; $headerParams['signature'] = $signature; $contentType = "multipart/form-data"; $body = null; $accept = $this->accept; $baseURL = $this->url; $baseURL = $baseURL . "/" . $encodedCatName . "/" . $encodedCategoryName . "/item"; $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams); $catalogueResponseObj = new CatalogueResponseBuilder(); $catalogueObj = $catalogueResponseObj->buildResponse($response->getResponse()); } catch (App42Exception $e) { throw $e; } catch (Exception $e) { throw new App42Exception($e); } return $catalogueObj; }
<div class="widget-title"> <i class="fa fa-tasks"></i> Grafica de Mensajes (Utilmos 30 dias) </div> <div class="widget-body"> <div id="graph" class="animate" data-animate="fadeInUp" ></div> <script> <?php echo "var c=0;"; echo "var dates=Array();"; echo "var data=Array();"; echo "var total=Array();"; for ($i = 0; $i < 30; $i++) { echo "dates[c]=\"" . date("Y-m-d", time() - 60 * 60 * 24 * $i) . "\";"; echo "data[c]=\"" . ItemData::countAllFromDay(date("Y-m-d", time() - 60 * 60 * 24 * $i))->c . "\";"; echo "total[c]={x: dates[c],y: data[c]};"; echo "c++;"; } ?> // Use Morris.Area instead of Morris.Line Morris.Area({ element: 'graph', data: total, xkey: 'x', ykeys: ['y',], labels: ['Y'] }).on('click', function(i, row){ console.log(i, row); }); </script>
?> </td> <td><?php echo $user->title; ?> </td> <td><?php echo $user->subtitle; ?> </td> <td><?php echo ItemData::countByBookId($user->id)->c; ?> </td> <td><?php echo ItemData::countAvaiableByBookId($user->id)->c; ?> </td> <td><?php if ($category != null) { echo $category->name; } ?> </td> <td style="width:210px;"> <a href="index.php?view=items&id=<?php echo $user->id; ?> " class="btn btn-default btn-xs">Ejemplares</a> <a href="index.php?view=editbook&id=<?php echo $user->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) { ?> <tr> <td><?php
public function getItem() { return ItemData::getById($this->item_id); }
<?php if ($_SESSION["user_id"] != "") { $operation = OperationData::getById($_GET["id"]); $item = ItemData::getById($operation->item_id); $item->avaiable(); $operation->del(); Core::redir("./?view=rents"); }
<?php if (count($_POST) > 0) { $user = ItemData::getById($_POST["item_id"]); $user->code = $_POST["code"]; $user->status_id = $_POST["status_id"]; $user->update(); print "<script>window.location='index.php?view=items&id={$user->book_id}';</script>"; }