Viewing file: pendiente_ingreso_view.php (8.73 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<style>
#content { margin: 0 auto;
width: auto; height: auto;
}
#izquierda{ width:400px; height:40px; float: left; }
#derecha{ width:400px; height:40px; float: right; }
#th{ border-left: 1px solid #3c8dbc; }
.red { color: red; }
.black { color: black; }
.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: 20px; padding: 4px 6px; margin-bottom: 10px; font-size: 24px; line-height: 20px; color: #555555; vertical-align: middle; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
[data-notify="progressbar"] { margin-bottom: 0px; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 5px; } </style>
<div class="content-wrapper" style="min-height: 946px;"> <div ng-app="MenuOperaciones" style="margin-left:20px;"> <section class="content-header"> <h1><?php echo($titulo);?></h1> <br> <div id="content"> <div id="izquierda" align="left"> <input type="text" autofocus ng-model="search" ng-change="filter()" style="width: 600px;height :40px;" placeholder="BUSCAR" class="form-control" /> </div>
</div> </section> <br><br> <!-- Main content --> <section class="content">
<form ng-submit="confirm()" name="pedidos" id="pedidos" action="<?php echo base_url();?>pedido/prepararAcciones/" method="POST" ng-controller="MyCtrl"> <div class="row"> <div class="col-md-12" ng-show="filteredItems > 0"> <table class="table table-striped table-bordered"> <thead> <th>PEDIDO <a ng-click="sort_by('id_pedido');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>VEND <a ng-click="sort_by('vendedor');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>FECHA <a ng-click="sort_by('fecha');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>CONFIRMADO <a ng-click="sort_by('fechaConfirmacion');"><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>RAZON SOCIAL <a ng-click="sort_by('razon_social');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>PAGADO <a ng-click="sort_by('pagado');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>SUBT <a ng-click="sort_by('subtotal');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>TOTAL <a ng-click="sort_by('total');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>ACCION </th> </thead> <tbody> <tr ng-repeat="data in filtered = (list | filter:search) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit">
<td><b>{{data.id_pedido}}</b></td> <td><b>{{data.vendedor}}</b></td> <td><b>{{data.fecha}}</b></td> <td><b>{{data.fechaConfirmado}}</b></td> <td><b>{{data.estado}}</b></td> <td><b>{{data.razon_social}}</b></td> <td><b>{{data.pagado}}</b></td> <td><b>{{data.subtotal}}</b></td> <td><b>{{data.total}}</b></td> <td> <div class="input-group"> <button type="submit" class="btn btn-warning btn-md" title="IMPRIMIR EN PDF" ng-click='ponerDatos(data.id_pedido,data.id,3)' aria-label="Left Align"> <span class="glyphicon glyphicon-print"></span> </button> <button type="submit" class="btn btn-primary btn-md" title="EDITAR PEDIDO" ng-click="ponerDatos(data.id_pedido,data.id,1)" aria-label="Left Align"> <span class="glyphicon glyphicon-edit"></span> </button> <button type="submit" class="btn btn-danger btn-md" ng-click="ponerDatos(data.id_pedido,data.id,15)" title="VOLVER A COTIZAR" aria-label="Left Align"> <span class="glyphicon glyphicon-repeat"></span> </button> <button type="submit" class="btn btn-success btn-md" title="FINALIZAR PREPARACION" ng-click="ponerDatos(data.id_pedido,data.id,12)" aria-label="Left Align"> <span class="glyphicon glyphicon-list-alt"></span> </button> </div> </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}} PEDIDOS </h5> </div> <div class="col-md-6" pagination="" page="currentPage" max-size="10" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"></div>
</div> <input type="hidden" name="accion" id="accion" ng-init="tipoOp = '0'" ng-model="model.accion" value="{{accion}}"> </input> <input type="hidden" name="numeroCliente" id="numeroCliente" ng-init="tipoOp = '0'" ng-model="model.numeroCliente" value="{{numeroCliente}}"> </input> <input type="hidden" name="numeroPedido" id="numeroPedido" ng-init="tipoOp = '0'" ng-model="model.numeroPedido" value="{{numeroPedido}}"> </input> </form> </section><!-- /.content --> </div><!-- /.content-wrapper -->
<script type="text/javascript">
var app = angular.module('MenuOperaciones', ['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, $location) { $scope.accion=''; $scope.numeroCliente=''; $scope.numeroPedido=''; $scope.list=[]; //traigo la fecha 15 dias para atraz $scope.fecha = new Date(); $scope.fecha.setDate($scope.fecha.getDate()- 4); $scope.finFecha= moment($scope.fecha).format('DD/MM/YYYY'); $scope.reloadPage = function(){window.location.reload();} $http.get("<?php echo site_url("pedido/getPedidosPendAajax");?>").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; }; $scope.sort_by = function(predicate) { $scope.predicate = predicate; $scope.reverse = !$scope.reverse; }; $scope.ponerDatos= function (id,numeroCliente,accion){ $scope.accion=accion; $scope.numeroCliente=numeroCliente; $scope.numeroPedido=id; };
function compare(dateTimeA, dateTimeB) { var momentA = moment(dateTimeA,"DD/MM/YYYY"); var momentB = moment(dateTimeB,"DD/MM/YYYY"); if (momentA > momentB) return 1; else if (momentA < momentB) return -1; else return 0; }; $scope.getColor = function(item, fecha){ if (item !=0){ return RGBtoHex(HSVtoRGB(item, fecha)); } }; function RGBtoHex(color){ var r = color.r.toString(16); if(r.length < 2) r = '0' + r; var g = color.g.toString(16); if(g.length < 2) g = '0' + g; var b = color.b.toString(16); if(b.length < 2) b = '0' + b; return r + g + b; }; function HSVtoRGB(s, v) { //traigo la fecha 15 dias para atraz fecha = new Date(); fecha.setDate(fecha.getDate()- 4); finFecha= moment(fecha).format('DD/MM/YYYY');
if(v != undefined){ result =compare(v,finFecha); if (result<=0){
r=1; g=0; b=0; } } if(r!=1){ r=0; g=1; b=0; } return { r: Math.floor(r * 255), g: Math.floor(g * 255), b: Math.floor(b * 255) }; }; $scope.confirm = function() { if (confirm('Estas seguro de esta accion?')){ event.returnValue=true; } else{ event.returnValue=false; } }; }); </script>
|