Viewing file: log_prod_cambios_view.php (10.06 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<style> .h1, .h2, .h3, h1, h2, h3 { margin-top: 0px; margin-bottom: 10px; }
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; height: 40px; padding: 4px 6px; margin-bottom: 10px; font-size: 14px; line-height: 20px; color: #555555; vertical-align: middle; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
@media (min-width: 768px) .modal-dialog { width: auto; margin: 30px auto; }
ul, ol { padding: 0; margin: 0 0 10px 5px; }
#searchResult{ list-style: none; padding: 0px; width: 600px; position: relative; z-index: 1000; margin: 0; }
#searchResult li{ background: lavender; padding: 4px; margin-bottom: 1px; }
#searchResult li:nth-child(even){ background: cadetblue; color: white; }
#searchResult li:hover{ cursor: pointer; }
input[type=text]{ padding: 5px; width: auto; letter-spacing: 1px; } </style> <div class="content-wrapper">
<div> <br> <div style="margin-left:60px;"> <h2>LOG DE CAMBIOS</h2></div> <div ng-app="myApp" ng-controller="MyCtrl"> <div class="container"> <div class="row"> <div class="col-md-2">CANTIDAD 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">BUSQUEDA ARTICULO: <input type="text" autofocus style="width: 600px;" ng-model='searchText' ng-keyup='fechArticulos()' ng-click='searchboxClicked($event);' ng-change="filter()" placeholder="Buscar..." class="form-control" /> <ul class="container" id='searchResult' > <li ng-click='setValue($index,$event)' ng-repeat="result in searchResult" > {{ result.nombre }} </li> </ul> </div>
</div> <br/> <div class="row"> <div class="col-md-12" ng-show="filteredItems > 0"> <table class="table table-striped table-bordered"> <thead> <th>ARTICULO <a ng-click="sort_by('nombre_producto');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>FECHA CAMBIO <a ng-click="sort_by('fecha');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>USUARIO <a ng-click="sort_by('cotizador');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>IMAGEN ACTUAL</th> <th>DESCRIPCION <a ng-click="sort_by('descripcion');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>ESTADO <a ng-click="sort_by('estado');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>CATEGORIA <a ng-click="sort_by('categoria');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>PRECIO VENTA <a ng-click="sort_by('precio_venta');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>STOCK <a ng-click="sort_by('stock');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>CODIGO DE BARRA <a ng-click="sort_by('numero');"><i class="glyphicon glyphicon-sort"></i></a></th> </thead> <tbody> <tr ng-repeat="productos in filtered = (list | filter:searchText | orderBy : predicate :reverse) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit" > <td><b>{{productos.nombre}}</b></td> <td><b>{{productos.fecha}}</b></td> <td><b>{{productos.cotizador}}</b></td> <td><center> <ul class="enlarge"> <img id="imagen" ng-mouseover="zoom()" ng-src="../../../../imagenesAlmazen_new/{{productos.imagen}}" style="width:65px; height:65px;" class="img-circle"> </ul> </center> </td> <td><b>{{productos.descripcion}}</b></td> <td><b>{{productos.categoria}}</b></td> <td><b>{{productos.estado}}</b></td> <td><b>{{productos.precio_venta}}</b></td> <td><b>{{productos.stock}}</b></td> <td><b>{{productos.numero}}</b></td> </tr> </tbody> </table> </div> <div class="col-md-10" ng-show="filteredItems == 0"> <div class="col-md-10"> <h4>NO HAY PRODUCTOS DISPONIBLES</h4> </div> </div> <div class="col-md-10" ng-show="filteredItems > 0"> <div class="col-md-4"> <h5>Obtenidos {{ filtered.length }} De {{ totalItems}} Productos Totales</h5> </div> <div class="col-md-16" pagination="" max-size="10" page="currentPage" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"> </div> </div> </div> </div> </div> </div>
<script type="text/javascript">
var app = angular.module('myApp', ['ui.bootstrap']);
app.filter('startFrom', function() { return function(input, start) { if(input) { start = +start; //parse to int return input.slice(start); } return []; } }); app.controller('MyCtrl', function ($scope, $http, $modal) { $scope.estados=[]; $scope.categorias=[]; $scope.list=[]; $http.get("<?php echo site_url("productos/getCategoriasAjax");?>").success(function(data){ $scope.categorias = data; }); $http.get("<?php echo site_url("productos/getEstadosAjax");?>").success(function(data){ $scope.estados = data; }); $http.get("<?php echo site_url("productos/getArticulosLogAjax");?>").success(function(data){ $scope.list = data; $scope.currentPage = 1; //current page $scope.entryLimit = 10; //max no of items to display in a page $scope.filteredItems = $scope.list.length; //Initially for no filter $scope.totalItems = $scope.list.length; }); $scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; // Set value to search box $scope.setValue = function(index,$event){
$scope.searchText = $scope.searchResult[index].nombre; $scope.searchResult = {}; $event.stopPropagation(); };
$scope.searchboxClicked = function($event){ $event.stopPropagation(); };
$scope.containerClicked = function(){ $scope.searchResult = {}; }; $scope.fechArticulos =function(){ var searchText_len = $scope.searchText.trim().length;
// Check search text length if(searchText_len > 0){ var dato=$scope.searchText; $http({ method: 'POST', url: '<?php echo site_url("productos/autoCompleteArticulos");?>', data: {searchText:dato} }).then(function successCallback(response) { $scope.searchResult = response.data; }); }else{ $scope.searchResult = {}; } }; $scope.sort_by = function(predicate) { $scope.predicate = predicate; $scope.reverse = !$scope.reverse; }; $scope.zoom = function() { /* var imageId = document.getElementById('imagen'); if(imageId.style.width == "400px"){ imageId.style.width = "300px"; imageId.style.height = "300px"; }else{ imageId.style.width = "400px"; imageId.style.height = "400px"; }*/ };
//agregamos items al carrito $scope.insertarImagenServidor =function(){ $.ajax({ type: 'POST', url: '<?php echo site_url("productos/cargar_archivo");?>', data: {},
success:function(data){ alert("salida"); }, error: function () { alert("fallo"); } }); }; //modal para mostrar datos $scope.animationsEnabled = true; $scope.open = function (id) { $scope.items = []; size="lg"; $http({ method: 'GET', url: "<?php echo site_url("productos/getProductoPuntual");?>", params: { producto: id } }).success(function(data){ $scope.items = data; var modalInstance = $modal.open({ animation: $scope.animationsEnabled, templateUrl: 'myModalContent.html', controller: 'controladorModalProducto', size: size, resolve: { items: function () { return $scope.items; }, estados: function () { return $scope.estados; }, categorias: function () { return $scope.categorias; } } });
modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { }); }); }; $scope.nuevo =function(){ $scope.items = []; size="lg"; var modalInstance = $modal.open({ animation: $scope.animationsEnabled, templateUrl: 'myModalContentNew.html', controller: 'controladorModalProductoNuevo', size: size, resolve: { items: function () { return $scope.items; }, estados: function () { return $scope.estados; }, categorias: function () { return $scope.categorias; } } }); } $scope.toggleAnimation = function () { $scope.animationsEnabled = !$scope.animationsEnabled; }; });
</script>
|