1
1
<?php
2
2
include 'db.php ' ;
3
- include 'utils.php ' ;
4
- hasAccess ('' );
3
+ include "utils.php " ;
5
4
require_once "header.php " ;
5
+ include "popup_infos.php " ;
6
+ autoload ();
7
+ hasAccess ();
6
8
?>
7
- <body >
8
-
9
+ <html >
10
+ <body>
9
11
<?php require_once "top_bar.php " ?>
10
12
11
13
<div class="content">
12
- <div class="banner">
13
- <div class="logoSlovenia"><img src="images/slovenia.png" style="padding-top : 5px" /></div>
14
- <div class="logoFlag"><img src="images/banner.jpg" /></div>
15
- </div>
16
- <?php require_once "menu.php " ;?>
17
- <form>
18
- <table id='myTable' class="table table-striped">
19
- <thead>
20
- <tr>
21
- <td>Company Name</td>
22
- <td>Info</td>
23
- <td>Location</td>
24
- <td>Staff</td>
25
- <td>Website</td>
26
- <td>Phone</td>
27
- <td></td>
28
- </tr>
29
- </thead>
30
- <tbody>
31
- <?php
32
- $ sql = 'SELECT * FROM `company` ' ;
33
- $ res = $ db ->query ($ sql );
34
- while ($ row = $ res ->fetch ())
35
- {
36
- echo '<tr id="row ' .$ row ['id ' ].'"> ' ;
37
- echo "<td> " ;
38
- echo '<input class="input-small" type="text" value=" ' .$ row ['name ' ].'"> ' ;
39
- echo "</td> " ;
40
- echo "<td> " ;
41
- echo '<textarea type="text"> ' .$ row ['info ' ].'</textarea> ' ;
42
- echo "</td> " ;
43
- echo "<td> " ;
44
- echo '<input type="text" value=" ' .$ row ['location ' ].'"> ' ;
45
- echo "</td> " ;
46
- echo "<td> " ;
47
- echo '<input type="text" value=" ' .$ row ['staff ' ].'"> ' ;
48
- echo "</td> " ;
49
- echo "<td> " ;
50
- echo '<input type="text" value=" ' .$ row ['website ' ].'"> ' ;
51
- echo "</td> " ;
52
- echo "<td> " ;
53
- echo '<input type="text" value=" ' .$ row ['phone ' ].'"> ' ;
54
- echo "</td> " ;
55
- echo "<td><a class='btn' onclick='deleteUser( " .$ row ['id ' ].", \"./ajax/adminGestion.php \", \"delete \");'><i class='icon-remove'></i></a></td> " ;
56
- echo "</tr> " ;
57
- }
58
- $ res ->closeCursor ();
59
- ?>
60
- </tbody>
61
- </table>
62
- <a class='btn' onclick='addRow();'><i class='icon-plus-sign'></i></a>
63
- <div class="form-actions">
64
- <button type="submit" class="btn btn-primary">Save changes</button>
65
- <a href="index.php"><button type="button" class="btn">Cancel</button></a>
14
+ <div class="banner">
15
+ <div class="logoSlovenia"><img src="images/slovenia.png" style="padding-top : 5px" /></div>
16
+ <div class="logoFlag"><img src="images/banner.jpg" /></div>
17
+ </div>
18
+ <script type="text/javascript">
19
+
20
+ $(document).ready(function() {
21
+
22
+ $('#example').dataTable( {
23
+ "bPaginate": false,
24
+ "bStateSave": true
25
+ } );
26
+
27
+ /* Init DataTables */
28
+ var oTable = $('#example').dataTable();
29
+
30
+ /* Apply the jEditable handlers to the table */
31
+ oTable.$('td').editable( './admin_js.php', {
32
+ "callback": function( sValue, y ) {
33
+ var aPos = oTable.fnGetPosition( this );
34
+ oTable.fnUpdate( sValue, aPos[0], aPos[1] );
35
+ window.location.reload();
36
+ },
37
+ "submitdata": function ( value, settings ) {
38
+ return {
39
+ "row_id": this.parentNode.getAttribute('id\'),
40
+ "column": oTable.fnGetPosition( this )[2]
41
+ };
42
+ },
43
+ "height": "14px",
44
+ "width": "100%"
45
+ } );
46
+ } );
47
+
48
+ </script>
49
+ <?php require_once "menu.php " ; ?>
50
+ <div>
51
+ <table cellpadding="0" cellspacing="0" border="0" class="display" id='example' class="table table-striped">
52
+ <thead>
53
+ <tr>
54
+ <td>Company Name</td>
55
+ <td>Info</td>
56
+ <td>Location</td>
57
+ <td>Contact</td>
58
+ <td>Website</td>
59
+ <td>Phone</td>
60
+ <td></td>
61
+ </tr>
62
+ </thead>
63
+ <tbody>
64
+ <?php
65
+ $ sql = 'SELECT country.country, company.* FROM `company` LEFT JOIN country ON company.location=country.id_country ORDER BY name ' ;
66
+ $ res = $ db ->query ($ sql );
67
+ while ($ row = $ res ->fetch ())
68
+ {
69
+ echo '<tr id="row ' .$ row ['id ' ].'"> ' ;
70
+ echo "<td> " .$ row ['name ' ]."</td> " ;
71
+ echo "<td> " .$ row ['info ' ]."</td> " ;
72
+ echo "<td> " .$ row ['country ' ]."</td> " ;
73
+ echo "<td> " .$ row ['contact ' ]."</td> " ;
74
+ echo "<td> " .$ row ['website ' ]."</td> " ;
75
+ echo "<td> " .$ row ['phone ' ]."</td> " ;
76
+ echo "<td><a class='btn' onclick='deleteUser( " .$ row ['id ' ].", \"./ajax/adminGestion.php \", \"delete \");'><i class='icon-remove'></i></a></td> " ;
77
+ echo '</tr> ' ;
78
+ }
79
+ $ res ->closeCursor ();
80
+ ?>
81
+ </tbody>
82
+ </table>
66
83
</div>
67
- </form>
68
- <?php require_once "footer.php " ; /* footer */ ?>
84
+ <?php require_once "footer.php " ; /* footer */ ?>
69
85
</div>
70
86
<script src="./js/ajaxRequest.js"></script>
71
- <?php require_once "inc_script.php " ; ?> <!-- load all script -->
87
+ <?php require_once "inc_script.php " ; ?> <!-- load all script -->
72
88
</body>
73
89
</html>
0 commit comments