Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

initial commmit de la branche Nude with composer

git authored on 14/03/2019 16:48:02
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,35 +0,0 @@
1
-<?php
2
-
3
-class Bdd
4
-{
5
-    public $bdd;
6
-
7
-    public function __construct($bdd = 'bdd1')
8
-    {
9
-        switch($bdd) {
10
-            case 'bdd1':
11
-                $this->bdd = new PDO(DSN_BDD1, USER_BDD1, PASS_BDD1);
12
-            break;
13
-            case 'bdd2':
14
-                $this->bdd = new PDO(DSN_BDD2, USER_BDD2, PASS_BDD2);
15
-            break;
16
-            default:
17
-                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
18
-        }
19
-    }
20
-
21
-    public function faireUneRequete($sql)
22
-    {
23
-        $req = $this->bdd->query($sql, PDO::FETCH_ASSOC);
24
-        return $req;
25
-    }
26
-
27
-    public function creerTableau($res){
28
-
29
-        $tab = array();
30
-        foreach($res as $key => $row){
31
-            $tab[$key] = $row;
32
-        }
33
-        return $tab;
34
-    }
35
-}
36 0
\ No newline at end of file
Browse code

intitial commit to branch nude-framework

git authored on 14/03/2019 10:43:54
Showing 1 changed files
... ...
@@ -4,14 +4,14 @@ class Bdd
4 4
 {
5 5
     public $bdd;
6 6
 
7
-    public function __construct($bdd = 'fiches3')
7
+    public function __construct($bdd = 'bdd1')
8 8
     {
9 9
         switch($bdd) {
10
-            case 'fiches3':
11
-                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
10
+            case 'bdd1':
11
+                $this->bdd = new PDO(DSN_BDD1, USER_BDD1, PASS_BDD1);
12 12
             break;
13
-            case 'abitop':
14
-                $this->bdd = new PDO(DSN_ABITOP, USER_ABITOP, PASS_ABITOP);
13
+            case 'bdd2':
14
+                $this->bdd = new PDO(DSN_BDD2, USER_BDD2, PASS_BDD2);
15 15
             break;
16 16
             default:
17 17
                 $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
Browse code

commit initial de la branch template-meny

git authored on 14/03/2019 10:30:11
Showing 1 changed files
... ...
@@ -4,9 +4,18 @@ class Bdd
4 4
 {
5 5
     public $bdd;
6 6
 
7
-    public function __construct()
7
+    public function __construct($bdd = 'fiches3')
8 8
     {
9
-        $this->bdd = new PDO(DSN, USER, PASS);
9
+        switch($bdd) {
10
+            case 'fiches3':
11
+                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
12
+            break;
13
+            case 'abitop':
14
+                $this->bdd = new PDO(DSN_ABITOP, USER_ABITOP, PASS_ABITOP);
15
+            break;
16
+            default:
17
+                $this->bdd = new PDO(DSN_FICHES, USER_FICHES, PASS_FICHES);
18
+        }
10 19
     }
11 20
 
12 21
     public function faireUneRequete($sql)
Browse code

liaison controlleur et vues ok !

git authored on 05/03/2019 16:49:15
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+class Bdd
4
+{
5
+    public $bdd;
6
+
7
+    public function __construct()
8
+    {
9
+        $this->bdd = new PDO(DSN, USER, PASS);
10
+    }
11
+
12
+    public function faireUneRequete($sql)
13
+    {
14
+        $req = $this->bdd->query($sql, PDO::FETCH_ASSOC);
15
+        return $req;
16
+    }
17
+
18
+    public function creerTableau($res){
19
+
20
+        $tab = array();
21
+        foreach($res as $key => $row){
22
+            $tab[$key] = $row;
23
+        }
24
+        return $tab;
25
+    }
26
+}
0 27
\ No newline at end of file