Преглед на файлове

Added form for adding data

Brendan Abolivier преди 9 години
родител
ревизия
9987c69a59
променени са 2 файла, в които са добавени 28 реда и са изтрити 2 реда
  1. 7
    0
      views/layout.html.php
  2. 21
    2
      views/list.html.php

+ 7
- 0
views/layout.html.php Целия файл

@@ -7,6 +7,8 @@
7 7
             <?php echo $title; ?>
8 8
         </title>
9 9
         <link rel="stylesheet" href="lib/bootstrap.min.css" />
10
+        <script src="lib/jquery-2.1.4.min.js"></script>
11
+        <script src="lib/jquery.tablesorter.min.js"></script>
10 12
         <script src="lib/bootstrap.min.js"></script>
11 13
     </head>
12 14
     <body>
@@ -30,6 +32,11 @@
30 32
         <div class="container">
31 33
             <?php echo $content; ?>
32 34
         </div>
35
+        <script>
36
+            $(function(){
37
+                $("#mainTable").tablesorter();
38
+            });
39
+        </script>
33 40
     </body>
34 41
 
35 42
 </html>

+ 21
- 2
views/list.html.php Целия файл

@@ -1,8 +1,27 @@
1
-<table class="table">
1
+<div style="text-align:right">
2
+    <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#addForm" aria-expanded="false" aria-controls="addForm">
3
+        Ajouter
4
+    </button>
5
+</div>
6
+
7
+<form class="collapse" id="addForm">
8
+    <div class="well">
9
+        <div class="form-group">
10
+            <label for="rang">Rang :</label>
11
+            <input type="number" class="form-control" />
12
+        </div>
13
+        <div class="form-group">
14
+            <label for="libelle">Libellé : </label>
15
+            <input type="text" class="form-control" id="libelle" placeholder="Libellé" />
16
+        </div>
17
+    </div>
18
+</form>
19
+
20
+<table class="table tablesorter table-striped" id="mainTable">
2 21
     <thead>
3 22
     <?php foreach ($data[0] as $key => $value) {
4 23
         ?>
5
-        <th><?php echo $key; ?></th>
24
+        <th class="th-inner sortable both"><?php echo $key; ?></th>
6 25
         <?php
7 26
     }
8 27
     ?>