You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
794 B
37 lines
794 B
<?php |
|
|
|
function dateToSql($date) { |
|
return implode('-', array_reverse(explode('/', $date))); |
|
} |
|
|
|
function dateFromSql($date) { |
|
return implode('/', array_reverse(explode('-', $date))); |
|
} |
|
|
|
function printError($str) { |
|
echo '<div class="alert alert-danger" role="alert">' . $str . '</div>'; |
|
} |
|
|
|
function printSuccess($str) { |
|
echo '<div class="alert alert-success" role="alert">' . $str . '</div>'; |
|
} |
|
|
|
function isInstalled($bdd) { |
|
$req = $bdd->prepare("SHOW TABLES LIKE 'admin'"); |
|
$req->execute(); |
|
|
|
if(!$req->fetch()) |
|
return false; |
|
|
|
return true; |
|
} |
|
|
|
function hashPass($pass) { |
|
return password_hash($pass, PASSWORD_DEFAULT); |
|
} |
|
|
|
function passEqual($pass, $hash) { |
|
return password_verify($pass, $hash); |
|
} |
|
|
|
?>
|