<?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); ?>
</div> </div> <div class="col-lg-6"> <button class="btn btn-primary btn-block">Procesar</button> </div> </div> </form> <?php $products = array(); if (isset($_GET["start_at"]) && $_GET["start_at"] != "" && isset($_GET["finish_at"]) && $_GET["finish_at"] != "") { if ($_GET["start_at"] < $_GET["finish_at"]) { $products = OperationData::getRentsByRange($_GET["start_at"], $_GET["finish_at"]); } } else { $products = OperationData::getRents(); } if (count($products) > 0) { ?> <br> <table class="table table-bordered table-hover "> <thead> <th>Ejemplar</th> <th>Libro</th> <th>Cliente</th> <th>Inicio</th> <th>Fin</th> <th></th> <th></th> </thead> <?php