Blame view

app/views/fbo-flight/flightDept.controller.js 3.58 KB
e4e496d13   Rishav   setup admin acufu...
1
2
3
4
  'use strict';
  
   //Load controller
    angular.module('inspinia')
7379f005b   Rishav   FBO client page d...
5
6
  	.controller('FlightDeptController', function ($scope, FBOFlight) {
  		FBOFlight
e4e496d13   Rishav   setup admin acufu...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
        $(document).ready(function(){
              // Examle data for jqGrid
  
            var mydata = [
                {tail: "N2722D", make: "", model: "", size: ""} ,
                {tail: "N615ME", make: "", model: "", size: ""},
                {tail: "N827TY", make: "", model: "", size: ""},
                {tail: "N765TR", make: "", model: "", size: ""},
                {tail: "N8712G", make: "", model: "", size: ""}
            ];
  
            // Configuration for jqGrid Example 2
            $("#table_list_2").jqGrid({
                data: mydata,
                datatype: "local",
                height: 140,
                autowidth: true,
                shrinkToFit: true,
                rowNum: 5,
                rowList: [10, 20, 30],
                colNames:['Tail #','Make', 'Model', 'Size'],
                colModel:[
                    {name:'tail',index:'tail', editable: true, width:60, sorttype:"int",search:true},
5c6477d3d   Rishav   Admin Acufuel set...
30
                    { name: 'make', index: 'make', width: 80, formatter: 'select', edittype: 'select', editoptions: { value: "1:One;2:Two"} },
e4e496d13   Rishav   setup admin acufu...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
                    {name:'model',index:'model', editable: true, width:100},
                    {name:'size',index:'size', editable: true, width:80, align:"right",sorttype:"int"},
                ],
                pager: "#pager_list_2",
                viewrecords: true,
                caption: "AIRCRAFT LIST",
                add: true,
                edit: true,
                addtext: 'Add',
                edittext: 'Edit',
                hidegrid: false
            });
  
            // Add selection
            $("#table_list_2").setSelection(4, true);
  
  
            // Setup buttons
            $("#table_list_2").jqGrid('navGrid', '#pager_list_2',
                    {edit: true, add: true, del: true, search: true},
                    {height: 200, reloadAfterSubmit: true}
            );
  
            // Add responsive to jqGrid
            $(window).bind('resize', function () {
                var width = $('.jqGrid_wrapper').width();
                $('#table_list_2').setGridWidth(width);
            });
  
  
            setTimeout(function(){
                $('.wrapper-content').removeClass('animated fadeInRight');
            },700);
        });
0a4eb77cc   Rishav   FBO admin impleme...
65
        $scope.data = {};
5c6477d3d   Rishav   Admin Acufuel set...
66
67
68
69
70
71
72
73
74
75
76
        $scope.user = {};
        $scope.userData = function(){
            if($scope.status == true){
              $scope.user.status = 'active';
            }else{
              $scope.user.status = 'inactive';
            }
            $scope.user.username = $scope.user.email;
            $scope.user.userType = 'flightDetp';
            console.log($scope.user)
            var formdata = "email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote;
7379f005b   Rishav   FBO client page d...
77
78
79
            FBOFlight.registerUser(formdata).then(function(result) {
              $scope.registerId = result;
              $scope.data.accountId = $scope.registerId;
5c6477d3d   Rishav   Admin Acufuel set...
80
81
82
                
            })
        }
0a4eb77cc   Rishav   FBO admin impleme...
83
84
  
        $scope.data.cardType = 'creditCard';
7379f005b   Rishav   FBO client page d...
85
86
87
88
89
90
91
92
93
94
        var cardData = {}
        cardData.paymentMethodList = [];
        $scope.addCard = function(){
          cardData.paymentMethodList.push($scope.data);
          console.log("cardData", cardData);
          FBOFlight.addCardInformation(cardData).then(function(result) {
            console.log(result)
              
          })
        }
0a4eb77cc   Rishav   FBO admin impleme...
95
        
5c6477d3d   Rishav   Admin Acufuel set...
96
97
        
    });