Viewing file: catalogo_view.php (3.83 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<style>
.thumbnail { position: relative;
overflow: hidden; } .thumbnail img { position: absolute; left: 50%; top: 50%; height: 100%; width: auto; max-width:100px; -webkit-transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); transform: translate(-50%,-50%); }
</style> <div ng-app="galeria">
<div class="col-sm-12 col-md-12"> <ul class="breadcrumb"> <li> <a href="<?php echo base_url()?>home/index">Tablero</a> </li> <li class="active">Catalogo Imagenes</li> <li class="right_log hidden-xs"> </li> </ul> </div> <div class="content-wrapper" style="min-height: 946px;"> <div ng-controller="ControlImagenes" style="margin-left:20px;"> <section class="content-header">
<div class="container"> <div class="row"> <div class="col-md-2">FILTRO POR PAGINA: <select ng-model="entryLimit" class="form-control"> <option>5</option> <option>10</option> <option>20</option> <option>50</option> </select> </div> <div class="col-md-3">FILTRO: <input type="text" ng-model="search" ng-change="filter()" placeholder="Buscar..." class="form-control" /> </div>
</div> </section> <section class="content"> <div class="row">
<div class="col-md-12" ng-show="filteredItems > 0"> <table class="table table-striped table-bordered"> <thead> <th>Imagen</th>
</thead> <tbody>
<tr ng-repeat="pic in filtered = (pictures | filter:search | orderBy : predicate :reverse) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit" > <td><center> <ul > <div ng-if="pic.imagen === null"> <img ng-src="<?=base_url()?>uploads/noDisp.png" style="width:200px; height:100px;" > </div> <div ng-if="pic.imagen !== null"> <img ng-src="<?=base_url()?>uploads/<?="{{pic.imagen}}" ?>" style="width:200px; height:100px;" > </div> </ul> <p>{{pic.nombre}}</p> <p>{{pic.descripcion}}</p> </center> </td>
</tr> </tbody> </table> </div>
</div> </div> </div> </div>
</section><!-- /.content --> </div> <script type="text/javascript">
var app = angular.module('galeria', ['ui.bootstrap']); app.filter('startFrom', function() { return function(input, start) { if(input) { start = +start; //parse to int return input.slice(start); } return []; } });
app.controller('ControlImagenes', function ($scope, $http, $modal) {
$scope.pictures=[]; $http.get("<?php echo site_url("producto/getCatalogo");?>").success(function(data){ $scope.pictures = data; $scope.currentPage = 1; //current page $scope.entryLimit = 10; //max no of items to display in a page $scope.filteredItems = $scope.pictures.length; //Initially for no filter $scope.totalItems = $scope.pictures.length; }); $scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; $scope.filter = function() { $timeout(function() { $scope.filteredItems = $scope.filtered.length; }, 10); }; $scope.sort_by = function(predicate) { $scope.predicate = predicate; $scope.reverse = !$scope.reverse; }; //modal para mostrar datos $scope.animationsEnabled = true; });
</script>
|