fix user.html link
[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_name + '/' + 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.url = null;
20         self.code = null;
21         self.response = null;
22       };
23     }
24     PingCntl.$inject = ['$xhr'];
25   </script>
26   <div ng:controller="PingCntl">
27     <input type="hidden" name="function_name" value="CRM_search"      size="20"/>
28     <input type="text" name="args"     value="test" size="10"/>
29     <button ng:click="fetch()">fetch</button>
30     <button ng:click="clear()">clear</button>
31     <b ng:show="url && ! code">loading {{url}}</b>
32     <b ng:show="response">{{response.length}} results</b>
33     <table ng:show="response">
34     <tr>
35         <th>USERNAME</th>
36         <th>BROJ</th>
37         <th>USLUGA</th>
38         <th>IP_MANAGEMENT</th>
39         <th>IP_VOICE</th>
40         <th>KOLOKACIJA</th>
41         <th>OPT82</th>
42     </tr>
43     <tr ng:repeat="u in response">
44         <td>{{u.USERNAME}}</td>
45         <td>{{u.BROJ}}</td>
46         <td>{{u.USLUGA}}</td>
47         <td>{{u.IP_MANAGEMENT}}</td>
48         <td>{{u.IP_VOICE}}</td>
49         <td>{{u.KOLOKACIJA}}</td>
50         <td>{{u.OPT82}}</td>
51     </tr>
52     </table>
53     <input type=checkbox name=debug value=1>
54     <pre ng:show=debug>
55 url={{url}}
56 code={{code}}
57 response={{response}}
58     </pre>
59   </div>
60  </body>
61 </html>