Commit 38f3f155 authored by Estéban Ristich's avatar Estéban Ristich
Browse files

Rename SQL function

parent b0681dc6
...@@ -37,7 +37,7 @@ if ($valid == 'yes') { ...@@ -37,7 +37,7 @@ if ($valid == 'yes') {
} }
$datasheet_pathname = $datasheet_selected['pathname']; $datasheet_pathname = $datasheet_selected['pathname'];
$equipment_name = get_equipment_by_id($pdo, $equipment_id )['nom']; $equipment_name = get_equipment_listshort_by_id($pdo, $equipment_id )['nom'];
// $datasheet_id // $datasheet_id
// $datasheet_pathname // $datasheet_pathname
......
...@@ -17,7 +17,7 @@ if ($equipment_id == 0 || $valid == 'cancel') ...@@ -17,7 +17,7 @@ if ($equipment_id == 0 || $valid == 'cancel')
redirect('equipment-list.php'); redirect('equipment-list.php');
$pdo = connect_db_or_alert(); $pdo = connect_db_or_alert();
$equipment_name = get_equipment_by_id($pdo, $equipment_id)['nom']; $equipment_name = get_equipment_listshort_by_id($pdo, $equipment_id)['nom'];
if ($valid == 'yes') { if ($valid == 'yes') {
$iostat = del_equipment_by_id($pdo, $equipment_id); $iostat = del_equipment_by_id($pdo, $equipment_id);
......
...@@ -22,7 +22,7 @@ if ($valid == 'edit') ...@@ -22,7 +22,7 @@ if ($valid == 'edit')
$pdo = connect_db_or_alert(); $pdo = connect_db_or_alert();
$loan_selected = get_loan_all_by_id($pdo, $loan_id); $loan_selected = get_loan_all_by_id($pdo, $loan_id);
$equipment = get_equipment_by_id($pdo, $loan_selected['nom']); $equipment = get_equipment_listshort_by_id($pdo, $loan_selected['nom']);
$equipment_name = $equipment["nom"]; $equipment_name = $equipment["nom"];
$equipment_id = $equipment["id"]; $equipment_id = $equipment["id"];
......
...@@ -51,7 +51,7 @@ if ($mode == 'Modifier') { ...@@ -51,7 +51,7 @@ if ($mode == 'Modifier') {
$equipment_id = $loan_selected['nom']; $equipment_id = $loan_selected['nom'];
} }
$num_line = 0; $num_line = 0;
$equipment_selected = get_equipment_by_id($pdo, $equipment_id); $equipment_selected = get_equipment_listshort_by_id($pdo, $equipment_id);
$equipment_blacklist = get_loans_all_by_equipment_borrowed($pdo, $equipment_id); $equipment_blacklist = get_loans_all_by_equipment_borrowed($pdo, $equipment_id);
$equipment_loans = get_loans_all_not_return_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); $equipment_loan_reserved = get_loan_all_last_returned($pdo, $equipment_id);
......
...@@ -71,7 +71,7 @@ foreach ($loan_fetch as $loan_current) { ...@@ -71,7 +71,7 @@ foreach ($loan_fetch as $loan_current) {
$num_line++; $num_line++;
// recupere le nom de l'appareil via l'ID qui est mis dans un champs texte ! // recupere le nom de l'appareil via l'ID qui est mis dans un champs texte !
// $appareil_selected = get_equipment_by_id($pdo, $loan_current['nom']); // $appareil_selected = get_equipment_listshort_by_id($pdo, $loan_current['nom']);
echo ' <td>'; echo ' <td>';
echo ' <a href="equipment-view.php?id='.$loan_current['nom'].'">'.$loan_current['equipment_name'].'</a>'; echo ' <a href="equipment-view.php?id='.$loan_current['nom'].'">'.$loan_current['equipment_name'].'</a>';
echo ' </td>'.PHP_EOL; echo ' </td>'.PHP_EOL;
......
...@@ -390,7 +390,7 @@ function del_datasheet_by_id($pdo, $id) { ...@@ -390,7 +390,7 @@ function del_datasheet_by_id($pdo, $id) {
* *
* @return false|array Le contenu d'un équipement directement * @return false|array Le contenu d'un équipement directement
*/ */
function get_equipment_by_id($pdo, $id) { function get_equipment_listshort_by_id($pdo, $id) {
$sql = 'SELECT id, nom FROM Listing WHERE id = ?;'; $sql = 'SELECT id, nom FROM Listing WHERE id = ?;';
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute(array($id)); $stmt->execute(array($id));
......
...@@ -52,7 +52,7 @@ if ($pdo = connect_db()) { ...@@ -52,7 +52,7 @@ if ($pdo = connect_db()) {
echo '<tr class="impair">'.PHP_EOL; echo '<tr class="impair">'.PHP_EOL;
$num_line++; $num_line++;
$equipment = get_equipment_by_id($pdo, $loan_current['nom']); $equipment = get_equipment_listshort_by_id($pdo, $loan_current['nom']);
echo ' <td>'; echo ' <td>';
echo $equipment['nom']; echo $equipment['nom'];
echo ' </td>'.PHP_EOL; echo ' </td>'.PHP_EOL;
......
Supports Markdown
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