diff --git a/include/ajax.php b/include/ajax.php index 45839ba..515a5f1 100644 --- a/include/ajax.php +++ b/include/ajax.php @@ -4,7 +4,7 @@ if(!isset($_SESSION['admin_id'])) exit -1; - require(basename(__FILE__) . 'connexion_bdd.php'); + require(dirname(__FILE__) . '/connexion_bdd.php'); function datetosql($date) { return implode('-', array_reverse(explode('/', $date))); diff --git a/include/config.php b/include/config.php index 6e226a3..13a0c21 100644 --- a/include/config.php +++ b/include/config.php @@ -2,6 +2,6 @@ $hote='localhost'; $port='3306'; $bd='vpn'; - $utilisateur='user'; - $mdp="password"; + $utilisateur='florian'; + $mdp="sysko&'"; ?> diff --git a/include/connexion_bdd.php b/include/connexion_bdd.php index b4f2895..4d3ff8f 100644 --- a/include/connexion_bdd.php +++ b/include/connexion_bdd.php @@ -1,6 +1,6 @@ diff --git a/index.php b/index.php index 3d76111..502a29b 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ // Tentative de connexion ? if(isset($_POST['id'], $_POST['pass'])){ - require('include/connexion_bdd.php'); + require(dirname(__FILE__) . '/include/connexion_bdd.php'); $req = $bdd->prepare('SELECT * FROM admin WHERE admin_id = ? AND admin_pass = ?'); $req->execute(array($_POST['id'], sha1($_POST['pass']))); @@ -17,6 +17,9 @@ $_SESSION['admin_id'] = $data['admin_id']; header("Location: ."); } + else { + $connexion_erreur = true; + } } ?> @@ -36,6 +39,8 @@ Erreur connexion"; ?>
diff --git a/js/index.js b/js/index.js index bc060ce..70d8a93 100644 --- a/js/index.js +++ b/js/index.js @@ -140,7 +140,7 @@ $(function () { $.ajax({ type: "POST", - url: "ajax.php", + url: "include/ajax.php", dataType: "json", data: item, error: function () { @@ -168,7 +168,7 @@ $(function () { // Selection des admins $.ajax({ type: "POST", - url: "ajax.php", + url: "include/ajax.php", dataType: 'json', data: "select=admin", success: function (json) { @@ -212,7 +212,7 @@ $(function () { var me = $(this), id = me.attr('id'), data = grid.getData(); $.ajax({ type: "POST", - url: "ajax.php", + url: "include/ajax.php", dataType: "json", data: {del_admin_id: id}, error: function () { @@ -260,7 +260,7 @@ $(function () { // Modification de la bdd $.ajax({ type: "POST", - url: "ajax.php", + url: "include/ajax.php", dataType: "json", data: item, error: function () { @@ -285,7 +285,7 @@ $(function () { // Maj de la bdd $.ajax({ type: "POST", - url: "ajax.php", + url: "include/ajax.php", dataType: "json", data: item, error: function () { @@ -347,7 +347,7 @@ $(function () { // Pagination pager = new Slick.Controls.EnhancementPager({ container: $("#pagination"), - remoteUrl: "ajax.php", + remoteUrl: "include/ajax.php", params: {select: "log"}, datagrid: grid, pagerType: ""