Commit 7e1be034 authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Rename SQL function

parent 79470c2d
......@@ -35,7 +35,7 @@ if ($pdo = connect_db()) {
$equipment_selected['barcode'] = '';
if ($equipment_selected['loanable'] == 1)
$loan = get_loan_active_listall_by_equipment($pdo, $id_equipment);
$loan = get_loans_all_not_return_by_equipment($pdo, $id_equipment);
$equipment_blacklist = get_loans_all_by_equipment_and_borrowed($pdo, $id_equipment);
$equipment_loan_reserved = get_loan_all_last_returned($pdo, $id_equipment);
......
......@@ -53,7 +53,7 @@ if ($mode == 'Modifier') {
$num_line = 0;
$equipment_selected = get_equipment_by_id($pdo, $equipment_id);
$equipment_blacklist = get_loans_all_by_equipment_and_borrowed($pdo, $equipment_id);
$equipment_loans = get_loan_active_listall_by_equipment($pdo, $equipment_selected['id']);
$equipment_loans = get_loans_all_not_return_by_equipment($pdo, $equipment_selected['id']);
$equipment_loan_reserved = get_loan_all_last_returned($pdo, $equipment_id);
loan_list_container($pdo, $equipment_loans, $equipment_loan_reserved, $equipment_blacklist, $logged_level);?>
......
......@@ -548,7 +548,7 @@ function get_loan_all_by_id($pdo, $id) {
/**
* Récupere tout les prets liés à un équipement qui ne sont pas retourné
*
* @deprecated Remplacé par la fonction get_loan_active_listall_by_equipment()
* @deprecated Remplacé par la fonction get_loans_all_not_return_by_equipment()
*/
function get_loans_all_by_equipment($pdo, $equipment_id) {
$sql = 'SELECT * FROM pret WHERE nom = ? AND NOT status = ?;';
......@@ -566,7 +566,7 @@ function get_loans_all_by_equipment($pdo, $equipment_id) {
* Récupere tout les prets liés à un équipement qui ne sont pas retourné,
* rangé dans un certaine ordre de priorité.
*/
function get_loan_active_listall_by_equipment($pdo, $equipment_id) {
function get_loans_all_not_return_by_equipment($pdo, $equipment_id) {
$sql = 'SELECT * FROM pret WHERE nom = ? AND status != ? ORDER BY status DESC, emprunt ASC, retour ASC;';
$stmt = $pdo->prepare($sql);
$stmt->execute(array($equipment_id, STATUS_LOAN_RETURNED));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment