Updates
This commit is contained in:
parent
e0f5bbe905
commit
a8688ba4b8
|
|
@ -11,8 +11,13 @@ class CASS_View_Race_Edit
|
||||||
$race = new Race;
|
$race = new Race;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Default state of form
|
//Default state of form
|
||||||
$stateForm = "create";
|
$stateForm = "create";
|
||||||
|
$race->setSubscriptionEnable(true);
|
||||||
|
$race->setSubscriptionStart("0001-01-01T00:00:00");
|
||||||
|
$race->setSubscriptionEnd("0001-01-01T00:00:00");
|
||||||
|
|
||||||
//Default values tramsitted
|
//Default values tramsitted
|
||||||
$IDRace = 0;
|
$IDRace = 0;
|
||||||
|
|
@ -36,8 +41,6 @@ class CASS_View_Race_Edit
|
||||||
//Create mode
|
//Create mode
|
||||||
$race->setStart(date("Y-m-d H:i:s"));
|
$race->setStart(date("Y-m-d H:i:s"));
|
||||||
$race->setEnd(date("Y-m-d H:i:s"));
|
$race->setEnd(date("Y-m-d H:i:s"));
|
||||||
$race->setSubscriptionStart(null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Validating data
|
//Validating data
|
||||||
|
|
@ -163,7 +166,7 @@ class CASS_View_Race_Edit
|
||||||
$race->setMeetingPlaceLongitude(doubleval($_POST["meetingPlaceLongitude"]));
|
$race->setMeetingPlaceLongitude(doubleval($_POST["meetingPlaceLongitude"]));
|
||||||
$race->setMeetingPlaceLatitude(doubleval($_POST["meetingPlaceLatitude"]));
|
$race->setMeetingPlaceLatitude(doubleval($_POST["meetingPlaceLatitude"]));
|
||||||
$race->setDescriptionPublic($_POST["descriptionPublic"]);
|
$race->setDescriptionPublic($_POST["descriptionPublic"]);
|
||||||
$race->setDescriptionMemberSubscribed(SantizeGlobal($_POST["descriptionMemberSubscribed"]));
|
$race->setDescriptionMemberSubscribed($_POST["descriptionMemberSubscribed"]);
|
||||||
$race->setFormType(intval($_POST["formType"]));
|
$race->setFormType(intval($_POST["formType"]));
|
||||||
$race->setComment(SantizeGlobal($_POST["comment"]));
|
$race->setComment(SantizeGlobal($_POST["comment"]));
|
||||||
$race->setParticipantMax(intval($_POST["participantMax"]));
|
$race->setParticipantMax(intval($_POST["participantMax"]));
|
||||||
|
|
@ -273,8 +276,7 @@ class CASS_View_Race_Edit
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<label class="form-element">Etat*</label>
|
<label class="form-element">Etat*</label>
|
||||||
<select name="state" id="state" required
|
<select name="state" id="state" required onchange="stateChangeNotification()">
|
||||||
onchange="stateChangeNotification()">
|
|
||||||
<option value="">Sélectionner un état</option>;
|
<option value="">Sélectionner un état</option>;
|
||||||
<?php
|
<?php
|
||||||
$selDrafted = "";
|
$selDrafted = "";
|
||||||
|
|
@ -322,7 +324,8 @@ class CASS_View_Race_Edit
|
||||||
<div hidden class="form-element" id='stateChangeNotification'>
|
<div hidden class="form-element" id='stateChangeNotification'>
|
||||||
<br />
|
<br />
|
||||||
<label class="form-element">Notification</label>
|
<label class="form-element">Notification</label>
|
||||||
<span class="cass" style='color:red;'>Vous pouvez notifier le changement du status en activant la notifiation par mail (fond du formulaire)</span>
|
<span class="cass" style='color:red;'>Vous pouvez notifier le changement du status en activant la notifiation par
|
||||||
|
mail (fond du formulaire)</span>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
|
|
@ -408,7 +411,8 @@ class CASS_View_Race_Edit
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<label class="form-element">Localité*</label>
|
<label class="form-element">Localité*</label>
|
||||||
<input required class="cass" type="text" name="placeLocality" value="<?php echo ReadGlobal($race->getPlaceLocality()) ?>" required>
|
<input required class="cass" type="text" name="placeLocality"
|
||||||
|
value="<?php echo ReadGlobal($race->getPlaceLocality()) ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
|
|
@ -429,14 +433,15 @@ class CASS_View_Race_Edit
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
<!--
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<label class="form-element">Choisir date inscriptions</label>
|
<label class="form-element">Choisir date inscriptions</label>
|
||||||
<input type="checkbox" id="inscriptionsDate" />
|
<input type="checkbox" id="inscriptionsDate" />
|
||||||
</div>
|
</div>
|
||||||
|
!-->
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="inscriptionFields" class="hidden">
|
<div id="inscriptionFields">
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<label class="form-element">Début des inscriptions</label>
|
<label class="form-element">Début des inscriptions</label>
|
||||||
<input class="cass" type="datetime-local" name="subscriptionStart"
|
<input class="cass" type="datetime-local" name="subscriptionStart"
|
||||||
|
|
@ -488,7 +493,8 @@ class CASS_View_Race_Edit
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<label class="form-element">Lieu de rencontre*</label>
|
<label class="form-element">Lieu de rencontre*</label>
|
||||||
<input class="cass" type="text" name="meetingPlaceName" value="<?php echo ReadGlobal($race->getMeetingPlaceName()) ?>" required>
|
<input class="cass" type="text" name="meetingPlaceName"
|
||||||
|
value="<?php echo ReadGlobal($race->getMeetingPlaceName()) ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
|
|
@ -632,6 +638,7 @@ class CASS_View_Race_Edit
|
||||||
|
|
||||||
<script>initializeTinyMCE("#descriptionPublic, #descriptionMemberSubscribed");</script>
|
<script>initializeTinyMCE("#descriptionPublic, #descriptionMemberSubscribed");</script>
|
||||||
|
|
||||||
|
<!--
|
||||||
<script>
|
<script>
|
||||||
document.getElementById('inscriptionsDate').addEventListener('change', function () {
|
document.getElementById('inscriptionsDate').addEventListener('change', function () {
|
||||||
const inscriptionFields = document.getElementById('inscriptionFields');
|
const inscriptionFields = document.getElementById('inscriptionFields');
|
||||||
|
|
@ -642,10 +649,12 @@ class CASS_View_Race_Edit
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
-->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.form-element {
|
.form-element {
|
||||||
display: flex; /* Disposition en ligne */
|
display: flex;
|
||||||
|
/* Disposition en ligne */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,23 @@ function view_race_list_initialisation()
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const links = document.querySelectorAll('th a'); // Sélectionner les liens de tri dans les colonnes
|
||||||
|
const seasonField = document.querySelector('#IDSeason'); // Sélectionner le champ de filtre IDSeason
|
||||||
|
|
||||||
|
if (seasonField) {
|
||||||
|
const currentIDSeason = seasonField.value; // Récupérer la saison actuellement sélectionnée
|
||||||
|
|
||||||
|
links.forEach(function(link) {
|
||||||
|
const url = new URL(link.href); // Transformer l'URL en objet manipulable
|
||||||
|
url.searchParams.set('IDSeason', currentIDSeason); // Ajouter ou remplacer le paramètre IDSeason
|
||||||
|
link.href = url.toString(); // Appliquer la nouvelle URL au lien
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,7 +103,12 @@ function view_race_list_initialisation()
|
||||||
$season = new Season();
|
$season = new Season();
|
||||||
|
|
||||||
$rows = Season::selectAll();
|
$rows = Season::selectAll();
|
||||||
$selectedValue = isset($_POST['IDSeason']) ? $_POST['IDSeason'] : $season->getCurrentSeason();
|
$selectedValue = isset($_POST['IDSeason']) && $_POST['IDSeason'] !== ''
|
||||||
|
? $_POST['IDSeason'] // Priorité à POST
|
||||||
|
: (isset($_GET['IDSeason']) && $_GET['IDSeason'] !== ''
|
||||||
|
? $_GET['IDSeason'] // Sinon, GET
|
||||||
|
: $season->getCurrentSeason() // Sinon, saison actuelle
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($rows as $type) {
|
foreach ($rows as $type) {
|
||||||
$selected = ($selectedValue !== null && intval($selectedValue) == intval($type->IDSeason)) ? "selected" : "";
|
$selected = ($selectedValue !== null && intval($selectedValue) == intval($type->IDSeason)) ? "selected" : "";
|
||||||
|
|
@ -109,6 +131,7 @@ function view_race_list_initialisation()
|
||||||
$table->prepare_items();
|
$table->prepare_items();
|
||||||
// Display table
|
// Display table
|
||||||
echo "<form id='cass-admin-race-list' method='post'>";
|
echo "<form id='cass-admin-race-list' method='post'>";
|
||||||
|
echo '<input type="hidden" name="IDSeason" value="' . esc_attr($_POST['IDSeason'] ?? '') . '">';
|
||||||
$table->display();
|
$table->display();
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
|
|
@ -162,6 +185,9 @@ class CASS_View_Race_List extends WP_List_Table
|
||||||
|
|
||||||
function prepare_items()
|
function prepare_items()
|
||||||
{
|
{
|
||||||
|
echo "HHAH :" + $_POST["IDSeason"];
|
||||||
|
|
||||||
|
|
||||||
//Result of bulk action
|
//Result of bulk action
|
||||||
$action = $this->current_action();
|
$action = $this->current_action();
|
||||||
|
|
||||||
|
|
@ -170,7 +196,6 @@ class CASS_View_Race_List extends WP_List_Table
|
||||||
|
|
||||||
$selected_ids = isset($_POST[$this->_args['singular']]) ? $_POST[$this->_args['singular']] : array();
|
$selected_ids = isset($_POST[$this->_args['singular']]) ? $_POST[$this->_args['singular']] : array();
|
||||||
|
|
||||||
|
|
||||||
// Faire quelque chose avec les IDs
|
// Faire quelque chose avec les IDs
|
||||||
foreach ($selected_ids as $id) {
|
foreach ($selected_ids as $id) {
|
||||||
// Traitement pour chaque ID
|
// Traitement pour chaque ID
|
||||||
|
|
@ -229,27 +254,49 @@ class CASS_View_Race_List extends WP_List_Table
|
||||||
|
|
||||||
$results = null;
|
$results = null;
|
||||||
|
|
||||||
if (isset($_POST["IDSeason"]) && $_POST["IDSeason"] == "all") {
|
// Récupération de l'ID de la saison
|
||||||
|
$currentSeasonID = intval($season->getCurrentSeason()); // Saison actuelle par défaut
|
||||||
|
|
||||||
|
// Priorité à $_POST
|
||||||
|
if (isset($_POST['IDSeason']) && $_POST['IDSeason'] !== '') {
|
||||||
|
$IDSeason = $_POST['IDSeason'];
|
||||||
|
}
|
||||||
|
// Ensuite vérifier $_GET
|
||||||
|
else if (isset($_GET['IDSeason']) && $_GET['IDSeason'] !== '') {
|
||||||
|
$IDSeason = $_GET['IDSeason'];
|
||||||
|
}
|
||||||
|
// Sinon, utiliser la saison actuelle comme fallback
|
||||||
|
else {
|
||||||
|
$IDSeason = $currentSeasonID;
|
||||||
|
}
|
||||||
|
|
||||||
|
// S'assurer que IDSeason est dans $_POST pour une utilisation ultérieure
|
||||||
|
$_POST['IDSeason'] = $IDSeason;
|
||||||
|
|
||||||
|
// Construire la requête en fonction de IDSeason
|
||||||
|
if ($IDSeason === "all") {
|
||||||
// Sélectionner toutes les courses
|
// Sélectionner toutes les courses
|
||||||
$results = $wpdb->get_results(
|
$results = $wpdb->get_results(
|
||||||
"SELECT * from {$table}",
|
"SELECT * FROM {$table}",
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
|
|
||||||
);
|
);
|
||||||
} else if (isset($_POST["IDSeason"]) && intval($_POST["IDSeason"]) != 0) {
|
} else if (intval($IDSeason) != 0) {
|
||||||
$IDSeason = intval($_POST['IDSeason']);
|
// Sélectionner les courses pour une saison spécifique
|
||||||
|
|
||||||
$results = $wpdb->get_results(
|
$results = $wpdb->get_results(
|
||||||
$wpdb->prepare("SELECT * FROM {$table} WHERE IDSeason = %d", $IDSeason),
|
$wpdb->prepare("SELECT * FROM {$table} WHERE IDSeason = %d", intval($IDSeason)),
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Utilisez l'ID de la saison en cours pour filtrer les résultats
|
// Si aucune condition, retourner toutes les courses par défaut
|
||||||
$results = $wpdb->get_results("SELECT * FROM {$table}", ARRAY_A);
|
$results = $wpdb->get_results(
|
||||||
|
"SELECT * FROM {$table}",
|
||||||
|
ARRAY_A
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Filter on CdC or Deputy
|
//Filter on CdC or Deputy
|
||||||
$filtered_data = array();
|
$filtered_data = array();
|
||||||
|
|
||||||
|
|
@ -472,19 +519,20 @@ class CASS_View_Race_List extends WP_List_Table
|
||||||
return sprintf('%1$s %2$s', ReadGlobal($item['name']), $this->row_actions($actions));
|
return sprintf('%1$s %2$s', ReadGlobal($item['name']), $this->row_actions($actions));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function search_box($text, $input_id)
|
function search_box($text, $input_id)
|
||||||
{
|
{
|
||||||
$input_id = $input_id . '-search-input';
|
$input_id = $input_id . '-search-input';
|
||||||
|
|
||||||
echo '<form method="post">';
|
echo '<form method="post">';
|
||||||
echo '<p class="search-box">';
|
echo '<p class="search-box">';
|
||||||
|
echo '<input type="hidden" name="IDSeason" value="' . esc_attr($_POST['IDSeason'] ?? '') . '">';
|
||||||
echo '<label class="screen-reader-text" for="' . esc_attr($input_id) . '">' . $text . ':</label>';
|
echo '<label class="screen-reader-text" for="' . esc_attr($input_id) . '">' . $text . ':</label>';
|
||||||
echo '<input type="search" id="' . esc_attr($input_id) . '" name="' . esc_attr($input_id) . '" value="' . esc_attr($_REQUEST[$input_id] ?? '') . '" />';
|
echo '<input type="search" id="' . esc_attr($input_id) . '" name="' . esc_attr($input_id) . '" value="' . esc_attr($_REQUEST[$input_id] ?? '') . '" />';
|
||||||
echo '<button type="submit" class="button">' . esc_attr($text) . '</button>';
|
echo '<button type="submit" class="button">' . esc_attr($text) . '</button>';
|
||||||
echo '</p>';
|
echo '</p>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,25 @@ function view_race_user_all_courses_list_initialisation()
|
||||||
{
|
{
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
|
echo "
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const links = document.querySelectorAll('th a'); // Sélectionner les liens de tri dans les colonnes
|
||||||
|
const seasonField = document.querySelector('#IDSeason'); // Sélectionner le champ de filtre IDSeason
|
||||||
|
|
||||||
|
if (seasonField) {
|
||||||
|
const currentIDSeason = seasonField.value; // Récupérer la saison actuellement sélectionnée
|
||||||
|
|
||||||
|
links.forEach(function(link) {
|
||||||
|
const url = new URL(link.href); // Transformer l'URL en objet manipulable
|
||||||
|
url.searchParams.set('IDSeason', currentIDSeason); // Ajouter ou remplacer le paramètre IDSeason
|
||||||
|
link.href = url.toString(); // Appliquer la nouvelle URL au lien
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
";
|
||||||
|
|
||||||
$table = new CASS_View_Race_User_All_Courses_List();
|
$table = new CASS_View_Race_User_All_Courses_List();
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
|
|
@ -25,7 +44,12 @@ function view_race_user_all_courses_list_initialisation()
|
||||||
//Select all type
|
//Select all type
|
||||||
$sql = "SELECT IDSeason, name FROM cass_season ORDER BY name ASC;";
|
$sql = "SELECT IDSeason, name FROM cass_season ORDER BY name ASC;";
|
||||||
$rows = $wpdb->get_results($sql);
|
$rows = $wpdb->get_results($sql);
|
||||||
$selectedValue = isset($_POST['IDSeason']) ? $_POST['IDSeason'] : $season->getCurrentSeason() ;
|
$selectedValue = isset($_POST['IDSeason']) && $_POST['IDSeason'] !== ''
|
||||||
|
? $_POST['IDSeason'] // Priorité à POST
|
||||||
|
: (isset($_GET['IDSeason']) && $_GET['IDSeason'] !== ''
|
||||||
|
? $_GET['IDSeason'] // Sinon, GET
|
||||||
|
: $season->getCurrentSeason() // Sinon, saison actuelle
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($rows as $type) {
|
foreach ($rows as $type) {
|
||||||
$selected = ($selectedValue !== null && intval($selectedValue) == intval($type->IDSeason)) ? "selected" : "";
|
$selected = ($selectedValue !== null && intval($selectedValue) == intval($type->IDSeason)) ? "selected" : "";
|
||||||
|
|
@ -35,10 +59,7 @@ function view_race_user_all_courses_list_initialisation()
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button type="submit" class="button-secondary" id="refresh-cache">Filtrer
|
||||||
type="submit"
|
|
||||||
class="button-secondary"
|
|
||||||
id="refresh-cache">Filtrer
|
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
@ -75,6 +96,7 @@ class CASS_View_Race_User_All_Courses_List extends WP_List_Table
|
||||||
{
|
{
|
||||||
$this->table_data = $this->get_table_data();
|
$this->table_data = $this->get_table_data();
|
||||||
|
|
||||||
|
|
||||||
$columns = $this->get_columns();
|
$columns = $this->get_columns();
|
||||||
$hidden = array();
|
$hidden = array();
|
||||||
$sortable = $this->get_sortable_columns();
|
$sortable = $this->get_sortable_columns();
|
||||||
|
|
@ -114,40 +136,63 @@ class CASS_View_Race_User_All_Courses_List extends WP_List_Table
|
||||||
$user = get_userdata($_GET["element"]);
|
$user = get_userdata($_GET["element"]);
|
||||||
$currentUser = $user->id;
|
$currentUser = $user->id;
|
||||||
|
|
||||||
// Obtenez l'ID de la saison en cours
|
// Obtenez l'ID de la saison actuelle
|
||||||
$currentSeasonID = $season->getCurrentSeason();
|
$currentSeasonID = intval($season->getCurrentSeason()); // Saison actuelle par défaut
|
||||||
|
|
||||||
if (isset($_POST["IDSeason"]) && $_POST["IDSeason"] == "all") {
|
// Priorité à $_POST
|
||||||
|
if (isset($_POST['IDSeason']) && $_POST['IDSeason'] !== '') {
|
||||||
|
$IDSeason = $_POST['IDSeason'];
|
||||||
|
}
|
||||||
|
// Ensuite vérifier $_GET
|
||||||
|
else if (isset($_GET['IDSeason']) && $_GET['IDSeason'] !== '') {
|
||||||
|
$IDSeason = $_GET['IDSeason'];
|
||||||
|
}
|
||||||
|
// Sinon, utiliser la saison actuelle comme fallback
|
||||||
|
else {
|
||||||
|
$IDSeason = $currentSeasonID;
|
||||||
|
}
|
||||||
|
|
||||||
|
// S'assurer que IDSeason est dans $_POST pour une utilisation ultérieure
|
||||||
|
$_POST['IDSeason'] = $IDSeason;
|
||||||
|
|
||||||
|
// Construire la requête en fonction de IDSeason
|
||||||
|
if ($IDSeason === "all") {
|
||||||
// Afficher toutes les courses auxquelles l'utilisateur est inscrit
|
// Afficher toutes les courses auxquelles l'utilisateur est inscrit
|
||||||
$results = $wpdb->get_results(
|
$results = $wpdb->get_results(
|
||||||
$wpdb->prepare("SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d", $currentUser),
|
$wpdb->prepare(
|
||||||
|
"SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d",
|
||||||
|
$currentUser
|
||||||
|
),
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
);
|
);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
} else if (intval($IDSeason) != 0) {
|
||||||
} else if (isset($_POST["IDSeason"]) && intval($_POST["IDSeason"]) != 0) {
|
// Afficher toutes les courses auxquelles l'utilisateur est inscrit pour une saison spécifique
|
||||||
// Afficher toutes les courses auxquelles l'utilisateur est inscrit dans la saison selectionné
|
|
||||||
$IDSeason = intval($_POST['IDSeason']);
|
|
||||||
|
|
||||||
$results = $wpdb->get_results(
|
$results = $wpdb->get_results(
|
||||||
$wpdb->prepare("SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d AND IDSeason = %d", $currentUser, $IDSeason),
|
$wpdb->prepare(
|
||||||
|
"SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d AND IDSeason = %d",
|
||||||
|
$currentUser,
|
||||||
|
intval($IDSeason)
|
||||||
|
),
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
);
|
);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Afficher toutes les courses auxquelles l'utilisateur est inscrit dans la saison en cours
|
// Afficher toutes les courses auxquelles l'utilisateur est inscrit dans la saison actuelle
|
||||||
|
|
||||||
$results = $wpdb->get_results(
|
$results = $wpdb->get_results(
|
||||||
$wpdb->prepare("SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d AND IDSeason = %d", $currentUser, $currentSeasonID),
|
$wpdb->prepare(
|
||||||
|
"SELECT * FROM {$table} INNER JOIN cass_race_user ON cass_race.IDRace = cass_race_user.IDRace WHERE IDWPUser = %d AND IDSeason = %d",
|
||||||
|
$currentUser,
|
||||||
|
$currentSeasonID
|
||||||
|
),
|
||||||
ARRAY_A
|
ARRAY_A
|
||||||
);
|
);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function column_default($item, $column_name)
|
function column_default($item, $column_name)
|
||||||
|
|
@ -187,7 +232,7 @@ class CASS_View_Race_User_All_Courses_List extends WP_List_Table
|
||||||
$level->loadFromId($item[$column_name]);
|
$level->loadFromId($item[$column_name]);
|
||||||
return ReadGlobal($level->getName());
|
return ReadGlobal($level->getName());
|
||||||
case 'IDType':
|
case 'IDType':
|
||||||
GLOBAL $wpdb;
|
global $wpdb;
|
||||||
//Type
|
//Type
|
||||||
//Select all type
|
//Select all type
|
||||||
$sql = "SELECT IDType,name FROM cass_type ORDER BY name ASC;";
|
$sql = "SELECT IDType,name FROM cass_type ORDER BY name ASC;";
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ function view_race_user_list_initialisation()
|
||||||
<button type="submit" class="button-secondary" id="refresh-cache">Ajouter</button>
|
<button type="submit" class="button-secondary" id="refresh-cache">Ajouter</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form action='<?php echo admin_url() . "admin.php?page=cass-admin-race-list"; ?>' method='get'>
|
<form action='<?php echo admin_url() . "admin.php?page=cass-admin-race-list"; ?>' method='POST'>
|
||||||
<button type="submit" class="button">Retour aux courses</button>
|
<button type="submit" class="button">Retour aux courses</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
submitForm: function () {
|
submitForm: function () {
|
||||||
const adminUrl = window.adminPostUrl;
|
const adminUrl = window.adminPostUrl;
|
||||||
const siteUrl = window.siteUrl;
|
const siteUrl = window.siteUrl;
|
||||||
|
|
||||||
this.errors = [];
|
this.errors = [];
|
||||||
|
|
||||||
if (this.errors.length === 0) {
|
if (this.errors.length === 0) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ function cass_shortcode_member_register()
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener('DOMContentLoaded', function () {
|
window.addEventListener('DOMContentLoaded', function () {
|
||||||
var input = document.querySelector('#phone');
|
var input = document.querySelector('#inputTelephone');
|
||||||
if (input) {
|
if (input) {
|
||||||
window.intlTelInput(input, {
|
window.intlTelInput(input, {
|
||||||
separateDialCode: true,
|
separateDialCode: true,
|
||||||
|
|
@ -69,7 +69,7 @@ function cass_shortcode_member_register()
|
||||||
</div>
|
</div>
|
||||||
<div class='pure-control-group'>
|
<div class='pure-control-group'>
|
||||||
<label for='inputTelephone'>Téléphone*</label>
|
<label for='inputTelephone'>Téléphone*</label>
|
||||||
<input name='phone' type='text' id='phone'/>
|
<input name='inputTelephone' type='text' id='inputTelephone' v-model='user.inputTelephone' required/>
|
||||||
</div>
|
</div>
|
||||||
<div class='pure-control-group'>
|
<div class='pure-control-group'>
|
||||||
<label for='inputAddress'>Adresse*</label>
|
<label for='inputAddress'>Adresse*</label>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user