Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.directive('datepicker', function () {
- return {
- restrict : 'A',
- link : function (scope, element, attrs) {
- $(element).datepicker({
- autoclose : true,
- format : "dd/mm/yyyy",
- todayHighlight : true,
- });
- }
- }
- });
- app.controller("repportingController", function ($scope, searchFactory, $http, $q) {
- $scope.customers = searchFactory.get_all_customers();
- $scope.repports = null;
- $scope.showRepport = false;
- $scope.repporting = {};
- $scope.repport = function () {
- $scope.showRepport = true;
- $http.post("/admin/repporting/repport", $scope.repporting).success(function (e) {
- $scope.count = e.length + " Customers found";
- $scope.repports = e;
- });
- }
- });
- <div class="center-block">
- <input type="text" datepicker ng-model="repporting.date1"/>
- <span > - </span>
- <input type="text" datepicker ng-model="repporting.date2"/>
- <button class="btn btn-success" value="generate file">Generate File</button>
- </div>
- <form class="form-inline center-block">
- <div class="form-group">
- <select ng-model="repporting.customer" class="form-control">
- <option value="all">ALL</option>
- <option ng-repeat="customer in customers" value={{customer.id}}>{{ customer.customer_name | uppercase}}</option>
- </select>
- <button ng-click="repport()" class="btn btn-default"> Repports</button>
- <span class="label label-success" ng-if="count"> {{count }}</span>
- </div>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement