Merge branch 'devel' of h1dev:/srv/APKPM/
[APKPM.git] / public / CRM.html
1 <!doctype html>
2 <html xmlns:ng="http://angularjs.org">
3  <script src="http://code.angularjs.org/angular-0.9.12.min.js" ng:autobind></script>
4  <body>
5   <script>
6     function PingCntl($xhr) {
7       var self = this;
8    
9       this.fetch = function() {
10         self.clear();
11         self.url = '/g/' + self.function + '/' + self.args + '?callback=JSON_CALLBACK';
12         $xhr('JSON', self.url, function(code, response) {
13           self.code = code;
14           self.response = response;
15         });
16       };
17    
18       this.clear = function() {
19         self.code = null;
20         self.response = null;
21       };
22     }
23     PingCntl.$inject = ['$xhr'];
24   </script>
25   <div ng:controller="PingCntl">
26     <input type="text" name="function" value="CRM_username"      size="20"/>
27     <input type="text" name="args"     value="test" size="10"/>
28     <button ng:click="fetch()">fetch</button>
29     <button ng:click="clear()">clear</button>
30     <b ng:show="url && ! code">loading {{url}}</b>
31     <table ng:show="response">
32     <tr>
33         <th>USERNAME</th>
34         <th>BROJ</th>
35         <th>USLUGA</th>
36         <th>IP_MANAGEMENT</th>
37         <th>IP_VOICE</th>
38         <th>KOLOKACIJA</th>
39         <th>OPT82</th>
40     </tr>
41     <tr ng:repeat="u in response">
42         <td>{{u.USERNAME}}</td>
43         <td>{{u.BROJ}}</td>
44         <td>{{u.USLUGA}}</td>
45         <td>{{u.IP_MANAGEMENT}}</td>
46         <td>{{u.IP_VOICE}}</td>
47         <td>{{u.KOLOKACIJA}}</td>
48         <td>{{u.OPT82}}</td>
49     </tr>
50     </table>
51     <pre>
52 url={{url}}
53 code={{code}}
54 response={{response}}
55     </pre>
56   </div>
57  </body>
58 </html>