Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. app.directive('datepicker', function () {
  2. return {
  3. restrict : 'A',
  4.  
  5. link : function (scope, element, attrs) {
  6. $(element).datepicker({
  7. autoclose : true,
  8. format : "dd/mm/yyyy",
  9. todayHighlight : true,
  10. });
  11. }
  12. }
  13. });
  14. app.controller("repportingController", function ($scope, searchFactory, $http, $q) {
  15.  
  16. $scope.customers = searchFactory.get_all_customers();
  17. $scope.repports = null;
  18. $scope.showRepport = false;
  19. $scope.repporting = {};
  20.  
  21. $scope.repport = function () {
  22. $scope.showRepport = true;
  23. $http.post("/admin/repporting/repport", $scope.repporting).success(function (e) {
  24.  
  25. $scope.count = e.length + " Customers found";
  26. $scope.repports = e;
  27.  
  28. });
  29. }
  30. });
  31.  
  32. <div class="center-block">
  33. <input type="text" datepicker ng-model="repporting.date1"/>
  34. <span > - </span>
  35. <input type="text" datepicker ng-model="repporting.date2"/>
  36. <button class="btn btn-success" value="generate file">Generate File</button>
  37. </div>
  38. <form class="form-inline center-block">
  39. <div class="form-group">
  40. <select ng-model="repporting.customer" class="form-control">
  41. <option value="all">ALL</option>
  42. <option ng-repeat="customer in customers" value={{customer.id}}>{{ customer.customer_name | uppercase}}</option>
  43. </select>
  44. <button ng-click="repport()" class="btn btn-default"> Repports</button>
  45. <span class="label label-success" ng-if="count"> {{count }}</span>
  46. </div>
  47. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement