/*
Theme Name: Royal Elementor Kit
Theme URI: https://royal-elementor-addons.com/royal-elementor-kit
Author: WP Royal
Author URI: https://royal-elementor-addons.com/
Description: Truly all in one Solution For Elementor Lovers. 90+ Elementor Templates KIT, 100+ Professional Elementor Widgets, Elementor theme builder, Elementor Popup Builder, Elementor Premade blocks and many other cool features like Sticky Header, Particle effects, parallax backgrounds and many other elementor addons. Simple Install the theme, click on - Get Started with Templates Kit button and that's it. Very easy to use even for WordPress beginners or professionals. All In one Elementor Solution which outranks all other Elementor themes and Elementor addons. ########### TEMPLATES INCLUDED: Elementor Blog Template, Elementor Magazine Blog Template, Elementor Food Blog Template, Elementor Travel Blog Template, Elementor Portfolio Template, Elementor NFT Template, Elementor Pizza Restaurant Template, Elementor Travel Blogger & Influencer Template, Elementor Cybersecurity Template, Elementor Photographer Portfolio Template, Elementor Crypto Currency Template, Elementor Skin Care Template, Elementor Lawyer Template, Elementor Medical Template, Elementor Digital Agency Template, Elementor Drone Template, Elementro Architecture Template, Elementor Food Delivery Template, Elementor Construction Template, Elementor IT Technology Template, Elementor Real Estate Template, Elementor Restaurant Template, Elementor Wine Bar & Restaurant Template, Elementor Wedding Template & other beautiful elementor business templates. All these templates are created with elementor page builder. Theme Demo Page: https://royal-elementor-addons.com/royal-elementor-kit/
Version: 1.0.124
Requires at least: 4.7
Requires PHP: 5.2
Tested up to: 6.6.1
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: royal-elementor-kit
Tags: blog, e-commerce, one-column, custom-background, custom-colors, full-width-template, custom-menu, custom-logo, featured-images, sticky-post, theme-options, threaded-comments, translation-ready
*/

/* Based on Normalize.css v8.0.0, HTML5 Boilerplate v6.1.0, & Bootstrap Reboot v4.1.0 | Under MIT License */
html {
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
}
*,*::before,*::after {
	box-sizing: border-box;
}
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: #333333;
	background-color: #fff;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
	margin-top: .5rem;
	margin-bottom: 1rem;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.2;
	color: inherit;
}
h1 {
	font-size: 2.5rem;
}
h2 {
	font-size: 2rem;
}
h3 {
	font-size: 1.75rem;
}
h4 {
	font-size: 1.5rem;
}
h5 {
	font-size: 1.25rem;
}
h6 {
	font-size: 1rem;
}
p {
	margin-top: 0;
	margin-bottom: .9rem;
}
hr {
	box-sizing: content-box;
	height: 0;
	overflow: visible;
	
}
pre {
	font-family: monospace, monospace;
	font-size: 1em;
	white-space: pre-wrap;
}
a {
	background-color: transparent;
	color: #605be5;
}
a:hover, a:active {
	color: #333366;
}
a:not([href]):not([tabindex]) {
	color: inherit;
	text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
	color: inherit;
	text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
	outline: 0;
}
abbr[title] {
	border-bottom: none;
	text-decoration: underline dotted;
	
}
b,strong {
	font-weight: bolder;
}
code,kbd,samp {
	font-family: monospace, monospace;
	font-size: 1em;
	
}
small {
	font-size: 80%;
}
sub,sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}
sub {
	bottom: -0.25em;
}
sup {
	top: -0.5em;
}
img {
	border-style: none;
	height: auto;
	max-width: 100%;
}
details {
	display: block;
}
summary {
	display: list-item;
}
figcaption {
	font-size: 16px;
	color: #333333;
	line-height: 1.4;
	font-style: italic;
	font-weight: 400;
}
template {
	display: none;
}

[hidden] {
	display: none;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
@media print {
	*,*:before,*:after {
		background: transparent !important;
		color: #000 !important;
		-webkit-box-shadow: none !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}
	a,a:visited {
		text-decoration: underline;
	}
	a[href]:after {
		content: " (" attr(href) ")";
	}
	abbr[title]:after {
		content: " (" attr(title) ")";
	}
	a[href^="#"]:after,a[href^="javascript:"]:after {
		content: "";
	}
	pre {
		white-space: pre-wrap !important;
	}
	pre,blockquote {
		page-break-inside: avoid;
		border: 1px solid #cccccc;
	}
	thead {
		display: table-header-group;
	}
	tr,img {
		page-break-inside: avoid;
	}
	p,h2,h3 {
		orphans: 3;
		widows: 3;
	}
	h2,h3 {
		page-break-after: avoid;
	}
}
label {
	display: inline-block;
	line-height: 1;
	vertical-align: middle;
}
button,input,optgroup,select,textarea {
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	margin: 0;
	
}
input[type="text"],input[type="date"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="tel"],input[type="url"],select,textarea {
	width: 100%;
	border: solid 1px #666666;
	border-radius: 3px;
	padding: 0.5rem 1rem;
	transition: all .3s;
}
input[type="text"]:focus,input[type="date"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="password"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus,textarea:focus {
	border-color: #333333;
	outline: 0 none;
}
button,input {
	overflow: visible;
}
button,select {
	text-transform: none;
}
button,[type="button"],[type="reset"],[type="submit"] {
	width: auto;
	-webkit-appearance: button;
}
button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner {
	border-style: none;
	padding: 0;
}
button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring {
	outline: 1px dotted ButtonText;
}
button,[type="submit"],[type="button"] {
	display: inline-block;
	font-weight: 400;
	color: #605be5;
	text-align: center;
	white-space: nowrap;
	user-select: none;
	background-color: transparent;
	border: 1px solid #605be5;
	padding: 0.5rem 1rem;
	font-size: 1rem;
	border-radius: 3px;
	transition: all .3s;
}
button:focus,[type="submit"]:focus,[type="button"]:focus {
	outline: 5px auto -webkit-focus-ring-color;
}
button:hover, button:focus,[type="submit"]:hover,[type="submit"]:focus,[type="button"]:hover,[type="button"]:focus {
	color: #ffffff;
	background-color: #605be5;
	text-decoration: none;
}
button:not(:disabled),[type="submit"]:not(:disabled),[type="button"]:not(:disabled) {
	cursor: pointer;
}

fieldset {
	padding: 0.35em 0.75em 0.625em;
}
legend {
	box-sizing: border-box;
	color: inherit;
	display: table;
	max-width: 100%;
	padding: 0;
	white-space: normal;
}
progress {
	vertical-align: baseline;
}
textarea {
	overflow: auto;
	resize: vertical;
}
[type="checkbox"],[type="radio"] {
	box-sizing: border-box;
	padding: 0;
	
}
[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button {
	height: auto;
}

[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
	
}
[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
	
}
select {
	display: block;
}

table {
	background-color: transparent;
	width: 100%;
	margin-bottom: 15px;
	font-size: 0.9em;
	border-spacing: 0;
	border-collapse: collapse;
}
table th,table td {
	padding: 15px;
	line-height: 1.5;
	vertical-align: top;
	border: 1px solid #cccccc;
}
table th {
	font-weight: bold;
}
table thead th,table tfoot th {
	font-size: 1em;
}
table caption + thead tr:first-child th,table caption + thead tr:first-child td,table caption + thead tr:first-child th,table caption + thead tr:first-child td,table colgroup + thead tr:first-child th,table colgroup + thead tr:first-child td,table colgroup + thead tr:first-child th,table colgroup + thead tr:first-child td,table thead:first-child tr:first-child th,table thead:first-child tr:first-child td,table thead:first-child tr:first-child th,table thead:first-child tr:first-child td {
	border-top: 1px solid #cccccc;
}
table tbody > tr:nth-child(odd) > td,table tbody > tr:nth-child(odd) > th {
	background-color: #f7f7f7;
}
table tbody tr:hover > td,table tbody tr:hover > th {
	background-color: #e9e9e9;
}
table tbody + tbody {
	border-top: 2px solid #cccccc;
}
@media (max-width: 767px) {
	table table {
		font-size: 0.8em;
	}
	table table th,table table td {
		padding: 7px;
		line-height: 1.3;
	}
	table table th {
		font-weight: 400;
	}
}
dl,dt,dd,ol,ul,li {
	margin-top: 0;
	margin-bottom: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	vertical-align: baseline;
	background: transparent;
}


/* WordPress Default Class */
.alignright {
	float: right;
	margin-left: 1rem;
}
.alignleft {
	float: left;
	margin-right: 1rem;
}
.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
}
.alignwide {
	margin-left: -80px;
	margin-right: -80px;
}
.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}
.alignfull img {
    width: 100vw;
}
.wp-caption {
	margin-bottom: 1.25rem;
	max-width: 100%;
}
  .wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}
  .wp-caption.alignright {
    margin: 5px 0 20px 20px;
}
.wp-caption img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.wp-caption-text {
	margin: 0;
}
.gallery-caption {
	display: block;
	font-size: 0.8125rem;
	line-height: 1.5;
	margin: 0;
	padding: 0.75rem;
}
.pagination {
	margin: 20px auto;
}
.sticky {
	position: relative;
	display: block;
}
.bypostauthor {
	font-size: inherit;
}
.hide {
	display: none !important;
}
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: polygon(0 0, 0 0,0 0, 0 0);
  position: absolute !important;
  white-space: nowrap;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
.screen-reader-text:focus {
  clip: auto !important;
  display: block;
  height: auto;
  left: 5px;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Theme Styles */
#page-wrap {
     max-width: 960px;
     margin: 0 auto;
}
 #site-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 20px 0;
     margin-bottom: 30px;
}
.site-logo h1, .site-description {
     margin: 0;
}
.main-navigation ul {
     display: flex;
     padding: 0;
     list-style-type: none;
}
.main-navigation ul li {
     margin-left: 20px;
}
.re-theme-post {
     margin-bottom: 50px;
}
.re-theme-post img {
     max-width: 100%;
}
.re-theme-post .post-title {
     margin: 0;
}
.re-theme-post .post-categories {
     margin-bottom: 20px;
}
.re-theme-post .post-footer {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 20px 0;
     border-bottom: 1px solid #e8e8e8;
}
.re-theme-post .read-more {
     display: inline-block;
     padding: 5px 15px;
     border: 1px solid #605be5;
     text-transform: capitalize;
}
.re-theme-post .post-tags a {
     display: inline-block;
     margin-right: 10px;
}
.commentslist {
     list-style-type: none;
     padding: 0;
}
.commentslist .children {
     list-style-type: none;
}
.commentslist li {
     padding: 20px;
     margin-top: 20px;
     margin-bottom: 20px;
     border: 1px solid #e8e8e8;
}
.comment-author img {
     margin-right: 10px;
}
.commentslist .reply {
     display: inline-block;
     padding: 5px 15px;
     border: 1px solid #605be5;
}
.comment-form-comment input, .comment-form-comment textarea {
     border-color: #e8e8e8;
}
 nav.navigation {
     text-align: center;
}
 nav.navigation a, nav.navigation span {
     padding: 5px 10px;
     border: 1px solid #e8e8e8;
}
.footer-copyright {
     text-align: center;
     padding: 30px 0;
}
.site-logo a,
.main-navigation a,
.re-theme-post .read-more a,
.re-theme-post .post-title a {
	text-decoration: none;
}

function create_golf_choice_table() {
    global $wpdb;
    $table_name = $wpdb->prefix . 'golf_choices';  // Nom de la table
    $charset_collate = $wpdb->get_charset_collate();

    $sql = "CREATE TABLE $table_name (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        name varchar(255) NOT NULL,
        email varchar(255) NOT NULL,
        golf_choice varchar(255) NOT NULL,
        time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
        PRIMARY KEY  (id)
    ) $charset_collate;";

    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    dbDelta($sql);
}

add_action('after_setup_theme', 'create_golf_choice_table');

function handle_golf_choice_submission() {
    if (isset($_POST['submit_choice'])) {
        global $wpdb;

        // Récupérer les données du formulaire et les sécuriser
        $name = sanitize_text_field($_POST['name']);
        $email = sanitize_email($_POST['email']);
        $golf_choice = sanitize_text_field($_POST['golf']);

        // Insertion des données dans la base de données
        $wpdb->insert(
            $wpdb->prefix . 'golf_choices',
            array(
                'name' => $name,
                'email' => $email,
                'golf_choice' => $golf_choice
            )
        );

        // Rediriger vers une page de confirmation ou afficher un message de succès
        wp_redirect(home_url('/merci-pour-votre-inscription/'));
        exit;
    }
}

add_action('init', 'handle_golf_choice_submission');

function create_golf_choice_table() {
    global $wpdb;
    $table_name = $wpdb->prefix . 'golf_choices';  // Nom de la table
    $charset_collate = $wpdb->get_charset_collate();

    // SQL pour créer la table
    $sql = "CREATE TABLE IF NOT EXISTS $table_name (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        name varchar(255) NOT NULL,
        email varchar(255) NOT NULL,
        golf_choice varchar(255) NOT NULL,
        time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
        PRIMARY KEY  (id)
    ) $charset_collate;";

    // Inclure le fichier pour gérer les mises à jour de la base de données
    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    dbDelta($sql);
}

// Utiliser l'action 'init' pour forcer la création de la table à chaque chargement de la page
add_action('init', 'create_golf_choice_table');

<?php
function repertoire_form_shortcode() {
    ob_start(); // Démarrer la capture de contenu pour le shortcode

    if (isset($_POST['submit_repertoire'])) {
        // Récupérer les données du formulaire
        $lieu = sanitize_text_field($_POST['lieu']);
        $date = sanitize_text_field($_POST['date']);
        $heure = sanitize_text_field($_POST['heure']);
        $formule = sanitize_text_field($_POST['formule']);
        $mode_depart = sanitize_text_field($_POST['mode_depart']);
        $mode_inscription = sanitize_text_field($_POST['mode_inscription']);
        $tarifs = sanitize_text_field($_POST['tarifs']);
        $serie = sanitize_text_field($_POST['serie']);
        $remise_prix = sanitize_text_field($_POST['remise_prix']);
        $infos_sup = sanitize_textarea_field($_POST['infos_sup']);
        $sponsors = sanitize_text_field($_POST['sponsors']);

        // Affichage des informations après soumission
        echo '<h3>Informations soumises :</h3>';
        echo '<p><strong>Lieu :</strong> ' . esc_html($lieu) . '</p>';
        echo '<p><strong>Date :</strong> ' . esc_html($date) . '</p>';
        echo '<p><strong>Heure de présentation :</strong> ' . esc_html($heure) . '</p>';
        echo '<p><strong>Formule :</strong> ' . esc_html($formule) . '</p>';
        echo '<p><strong>Mode départ :</strong> ' . esc_html($mode_depart) . '</p>';
        echo '<p><strong>Mode INSCRIPTION :</strong> ' . esc_html($mode_inscription) . '</p>';
        echo '<p><strong>Tarifs :</strong> ' . esc_html($tarifs) . '</p>';
        echo '<p><strong>SÉRIE :</strong> ' . esc_html($serie) . '</p>';
        echo '<p><strong>REMISE DES PRIX :</strong> ' . esc_html($remise_prix) . '</p>';
        echo '<p><strong>Informations supplémentaires :</strong> ' . esc_html($infos_sup) . '</p>';
        echo '<p><strong>Sponsors :</strong> ' . esc_html($sponsors) . '</p>';
        echo '<hr>';
    }

    // Formulaire HTML
    ?>
    <form method="POST" action="">
        <label for="lieu">Lieu:</label>
        <input type="text" id="lieu" name="lieu" required><br>

        <label for="date">Date:</label>
        <input type="date" id="date" name="date" required><br>

        <label for="heure">Heure de présentation:</label>
        <input type="time" id="heure" name="heure" required><br>

        <label for="formule">Formule:</label>
        <input type="text" id="formule" name="formule" required><br>

        <label for="mode_depart">Mode départ:</label>
        <input type="text" id="mode_depart" name="mode_depart" required><br>

        <label for="mode_inscription">Mode INSCRIPTION:</label>
        <input type="text" id="mode_inscription" name="mode_inscription" required><br>

        <label for="tarifs">Tarifs:</label>
        <input type="text" id="tarifs" name="tarifs" required><br>

        <label for="serie">SÉRIE:</label>
        <input type="text" id="serie" name="serie" required><br>

        <label for="remise_prix">REMISE DES PRIX:</label>
        <input type="text" id="remise_prix" name="remise_prix" required><br>

        <label for="infos_sup">Informations supplémentaires:</label>
        <textarea id="infos_sup" name="infos_sup"></textarea><br>

        <label for="sponsors">Sponsors:</label>
        <input type="text" id="sponsors" name="sponsors"><br>

        <input type="submit" name="submit_repertoire" value="Ajouter Répertoire">
    </form>
    <?php

    return ob_get_clean(); // Retourne le contenu capturé pour l'afficher dans la page
}
add_shortcode('repertoire_form', 'repertoire_form_shortcode');
?>
