Corrections bugs dus à la nouvelle arborescence
This commit is contained in:
parent
4c5f7a8287
commit
6751b6aaf2
@ -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)));
|
||||
|
@ -2,6 +2,6 @@
|
||||
$hote='localhost';
|
||||
$port='3306';
|
||||
$bd='vpn';
|
||||
$utilisateur='user';
|
||||
$mdp="password";
|
||||
$utilisateur='florian';
|
||||
$mdp="sysko&'";
|
||||
?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
require(basename(__FILE__) . "/config.php");
|
||||
require(dirname(__FILE__) . "/config.php");
|
||||
|
||||
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
|
||||
$bdd = new PDO("mysql:host='.$hote.';port='.$port.';dbname='.$bd, $utilisateur, $mdp, $options);
|
||||
$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
|
||||
$bdd = new PDO("mysql:host=$hote;port=$port;dbname=$bd", $utilisateur, $mdp, $options);
|
||||
?>
|
||||
|
@ -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 @@
|
||||
<?php
|
||||
// Si pas connecté on affiche le formulaire
|
||||
if(!isset($_SESSION['admin_id'])){
|
||||
if($connexion_erreur)
|
||||
echo "<strong style='color: red'>Erreur connexion</strong>";
|
||||
?>
|
||||
<div id="bloc_connexion">
|
||||
<form id="form_connexion" method="POST">
|
||||
|
12
js/index.js
12
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: ""
|
||||
|
Loading…
Reference in New Issue
Block a user