Commit 0f90b835 authored by Nathan Peraldi's avatar Nathan Peraldi

add javascript for event registration

parent 31305ace
......@@ -15,8 +15,10 @@
function recup_nombre()
{
global $wpdb;
$search = "ag-adullact-2019";
$post = "post_name";
$search = explode("/", $_SERVER["REQUEST_URI"])[2];
$link = $_SERVER["REQUEST_URI"];
$search = explode("/",$link)[2];
$query = "SELECT count(meta_value) as number FROM wp5304_postmeta WHERE meta_value LIKE '%" . $search . "%' && meta_value LIKE '%" . $post . "%'";
$result = $wpdb->get_results($query);
......@@ -28,5 +30,24 @@ global $EM_Event;
recup_nombre();
//du texte inutile à propos de la carte apparait, impossible de le retirer autrement !
echo str_replace("Carte non disponible", "", $EM_Event->output_single()); ?>
\ No newline at end of file
echo str_replace("Carte non disponible","",$EM_Event->output_single()); ?>
<script>
//on effectue les opérations pour afficher / cacher le formulaire d'inscription à l'évènement
function display_mask(){
if (the_form.style.display==="block"){
the_form.style.display="none";
}
else{
the_form.style.display="block"
}
}
var results = document.getElementsByClassName("wpcf7");
var the_form = results[0];
the_form.style.display="none";
var the_button = document.getElementById("adullact-display-mask");
the_button.addEventListener("click",display_mask);
</script>
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