recette2
cherif 2024-10-15 18:05:03 +02:00
parent 8e2d53633c
commit 6e418e5320
4 changed files with 544 additions and 24 deletions

View File

@ -23,6 +23,8 @@ import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle'; import DialogTitle from '@mui/material/DialogTitle';
import { format } from 'date-fns' import { format } from 'date-fns'
import moment from "moment"; import moment from "moment";
import SendIcon from '@mui/icons-material/Send';
import axios from "axios";
const ButtonHilight = () => { const ButtonHilight = () => {
const history = useHistory(); const history = useHistory();
@ -31,6 +33,17 @@ const ButtonHilight = () => {
const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']); const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']);
const [partcookie, setpartCookie, removepartCookie] = useCookies(['tokenmysypart']); const [partcookie, setpartCookie, removepartCookie] = useCookies(['tokenmysypart']);
const [country_code, setcountry_code] = useState("FR");
const [country_name, setcountry_name] = useState("France");
const [city, setcity] = useState("Paris");
const [postal, setpostal] = useState("75001");
const [latitude, setlatitude] = useState("48.861000061035156");
const [longitude, setlongitude] = useState("2.3380000591278076");
const [IPv4, setIPv4] = useState("172.71.122.128");
const [state, setstate] = useState("France");
const [userIp, setuserIp] = useState("172.71.122.128");
const controlNavbar = () => { const controlNavbar = () => {
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
@ -310,9 +323,255 @@ const ButtonHilight = () => {
}; };
const [Dialog_contact_message, setDialog_contact_message] = React.useState(false);
const [Dialog_contact_open, setDialog_contact_open] = React.useState(false);
function Dialog_contact_handle_change_participant_session(message) {
setDialog_contact_message(message);
setDialog_contact_open(true);
}
const Dialog_contact_handleClose = () => {
};
const Dialog_contact_handleClose_buton = () => {
setDialog_contact_open(false);
clear_contact_message_fields();
};
function clear_contact_message_fields() {
setcontact_message_nom_prenom("");
setcontact_message_email("");
setcontact_message_phone("");
setcontact_message_sujet("");
setcontact_message_sujet("");
setcontact_message_message("");
}
const [contact_message_nom_prenom, setcontact_message_nom_prenom] = React.useState("");
const [contact_message_email, setcontact_message_email] = React.useState("");
const [contact_message_phone, setcontact_message_phone] = React.useState("");
const [contact_message_sujet, setcontact_message_sujet] = React.useState("");
const [contact_message_message, setcontact_message_message] = React.useState("");
function Send_Contact_Message(e) {
var sender_mail = "";
var sender_tel = "";
var token = "";
////console.log("contacter " + sender_mail + " - " + sender_tel + " - ")
var mysubject = contact_message_sujet;
var mymessage = contact_message_message;
var mysender_name = contact_message_nom_prenom;
var mysender_email = contact_message_email;
//alert("contacter "+mysender_email+" - "+mymessage+" - url = "
//+process.env.REACT_APP_API_URL+" - user_ip ="+IPv4+" - "+latitude);
var re = /\S+@\S+\.\S+/;
if (re.test(mysender_email) == false) {
alert("l'email est incorrecte");
return;
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/add_user_message/";
var form = new FormData();
form.append("type", "email");
form.append("recever_mail", "contact@mysy-training.com");
form.append("recever_tel", "+33769203945");
form.append("sender_mail", mysender_email);
form.append("sender_tel", sender_tel);
form.append("object", mysubject);
form.append("message", mymessage);
form.append("sender_name", mysender_name);
form.append("token", "");
form.append("user_ip", IPv4);
form.append("user_country_code", country_code);
form.append("user_country_name", country_name);
form.append("user_city", city);
form.append("user_postal", postal);
form.append("user_latitude", latitude);
form.append("user_longitude", longitude);
form.append("user_state", state);
// console.log("## form = ", form);
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("false")) {
alert(res.data.message);
}
else if (String(res.data.status) === String("true")) {
Dialog_contact_handleClose_buton();
alert(res.data.message);
}
else {
}
}).catch((error) => {
console.warn('contact-nous Not good man :( mysearchtext = ');
})
}
return ( return (
<div className='ButtonHilight'> <div className='ButtonHilight'>
{/*** GESTION Contact */}
<Dialog
open={Dialog_contact_open}
onClose={Dialog_contact_handleClose}
className="displaypartnersession"
>
<DialogTitle>Contactez Nous</DialogTitle>
<DialogContent className="DialogContent_width">
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
Nom & Prénom
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='text'
name='name'
value={contact_message_nom_prenom}
onChange={(e) => {
setcontact_message_nom_prenom(e.target.value);
}}
className='form-control formInput'
placeholder='Nom'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
E-mail
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='email'
name='email'
id='email'
value={contact_message_email}
onChange={(e) => {
setcontact_message_email(e.target.value);
}}
className='form-control formInput'
placeholder='Adresse email'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
Téléphone
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='text'
name='phone'
id='phone'
value={contact_message_phone}
onChange={(e) => {
setcontact_message_phone(e.target.value);
}}
className='form-control formInput'
placeholder='Numéro Tél'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_dialog" style={{ "textAlign": 'left' }}>
Sujet
</div>
<div className="div_row_dialog" >
<input
type='text'
name='subject'
value={contact_message_sujet}
onChange={(e) => {
setcontact_message_sujet(e.target.value);
}}
className='form-control formInput'
placeholder='Sujet'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_dialog" style={{ "textAlign": 'left' }}>
Votre message
</div>
<div className="div_row_dialog" >
<textarea
rows={3}
name='message'
value={contact_message_message}
onChange={(e) => {
setcontact_message_message(e.target.value);
}}
className='form-control formInput'
placeholder='Message'
></textarea>
</div>
</div>
<div className="div_row_dialog" >
<div>MySy Training Technology<br />
</div>
<div style={{ fontSize: "small" }}>
Adresse : 1 Cr du Havre, 75008 Paris <br />
Adresse email :
<a href="mailto: contact@mysy-training.com?subject=Mail from mysy website" target="_blank"> contact@mysy-training.com</a> <br />
Téléphone fixe : +331 77 00 38 57<br />
</div>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Dialog_contact_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Send_Contact_Message} className="bton_enreg_dialog">Envoyer&nbsp; <SendIcon /></Button>
</div>
</div>
</DialogActions>
</Dialog>
{/*** FIN GESTION Contact */}
<Dialog <Dialog
open={Dialog_1_open} open={Dialog_1_open}
@ -468,18 +727,6 @@ const ButtonHilight = () => {
S'inscrire S'inscrire
</div>} </div>}
<div className="hilight_menuPrincipal" onClick={handleProduitMenu}>
Nos Services
</div>
{/* <div className="hilight_menuPrincipal" onClick={handleBlogMenu}>
Le blog
</div>*/}
<div className="hilight_menuPrincipal" onClick={handleQuisommesNousMenu}>
Qui Sommes nous ?
</div>
{<div className="hilight_menuPrincipal" onClick={(e) => { {<div className="hilight_menuPrincipal" onClick={(e) => {
// console.log(" oooooo ") // console.log(" oooooo ")
e.preventDefault(); e.preventDefault();
@ -492,9 +739,29 @@ const ButtonHilight = () => {
); );
}} }}
style={{ "background": "#53B7EB", "borderRadius": "5px", "paddingLeft": "3px", "paddingRight": "3px" }}> style={{ "background": "#53B7EB", "borderRadius": "5px", "paddingLeft": "3px", "paddingRight": "3px" }}>
Resa. Demo ? Une Demo ?
</div>} </div>}
<div className="hilight_menuPrincipal" onClick={(event) => {
setDialog_contact_open(true);
}}>
Contact
</div>
<div className="hilight_menuPrincipal" onClick={handleProduitMenu}>
Nos Services
</div>
{/* <div className="hilight_menuPrincipal" onClick={handleBlogMenu}>
Le blog
</div>*/}
<div className="hilight_menuPrincipal" onClick={handleQuisommesNousMenu}>
Qui Sommes nous ?
</div>
</div> </div>

View File

@ -43,7 +43,6 @@ const ContactForm = () => {
const onSubmit = async (data) => { const onSubmit = async (data) => {
const { name, email, subject, message } = data; const { name, email, subject, message } = data;
SendMail(); SendMail();
}; };
@ -310,6 +309,7 @@ const ContactForm = () => {
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,8 +5,9 @@ import Formation from "./Formation";
import { FaSearch, FaRegArrowAltCircleDown, FaRegArrowAltCircleUp } from 'react-icons/fa'; import { FaSearch, FaRegArrowAltCircleDown, FaRegArrowAltCircleUp } from 'react-icons/fa';
import { BsFillXCircleFill } from "react-icons/bs"; import { BsFillXCircleFill } from "react-icons/bs";
import { FacebookShareButton, LinkedinShareButton, TwitterShareButton } from "react-share";
import { SocialIcon } from 'react-social-icons';
import SendIcon from '@mui/icons-material/Send';
import Pagination from "./TestPagination"; import Pagination from "./TestPagination";
import data from "./data/mock-data.json"; import data from "./data/mock-data.json";
@ -2646,6 +2647,111 @@ const Recherche_new_v2 = () => {
} }
const [Dialog_contact_message, setDialog_contact_message] = React.useState(false);
const [Dialog_contact_open, setDialog_contact_open] = React.useState(false);
function Dialog_contact_handle_change_participant_session(message) {
setDialog_contact_message(message);
setDialog_contact_open(true);
}
const Dialog_contact_handleClose = () => {
};
const Dialog_contact_handleClose_buton = () => {
setDialog_contact_open(false);
clear_contact_message_fields();
};
const [contact_message_nom_prenom, setcontact_message_nom_prenom] = React.useState("");
const [contact_message_email, setcontact_message_email] = React.useState("");
const [contact_message_phone, setcontact_message_phone] = React.useState("");
const [contact_message_sujet, setcontact_message_sujet] = React.useState("");
const [contact_message_message, setcontact_message_message] = React.useState("");
function clear_contact_message_fields() {
setcontact_message_nom_prenom("");
setcontact_message_email("");
setcontact_message_phone("");
setcontact_message_sujet("");
setcontact_message_sujet("");
setcontact_message_message("");
}
function Send_Contact_Message(e) {
var sender_mail = "";
var sender_tel = "";
var token = "";
////console.log("contacter " + sender_mail + " - " + sender_tel + " - ")
var mysubject = contact_message_sujet;
var mymessage = contact_message_message;
var mysender_name = contact_message_nom_prenom;
var mysender_email = contact_message_email;
//alert("contacter "+mysender_email+" - "+mymessage+" - url = "
//+process.env.REACT_APP_API_URL+" - user_ip ="+IPv4+" - "+latitude);
var re = /\S+@\S+\.\S+/;
if (re.test(mysender_email) == false) {
alert("l'email est incorrecte");
return;
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/add_user_message/";
var form = new FormData();
form.append("type", "email");
form.append("recever_mail", "contact@mysy-training.com");
form.append("recever_tel", "+33769203945");
form.append("sender_mail", mysender_email);
form.append("sender_tel", sender_tel);
form.append("object", mysubject);
form.append("message", mymessage);
form.append("sender_name", mysender_name);
form.append("token", "");
form.append("user_ip", IPv4);
form.append("user_country_code", country_code);
form.append("user_country_name", country_name);
form.append("user_city", city);
form.append("user_postal", postal);
form.append("user_latitude", latitude);
form.append("user_longitude", longitude);
form.append("user_state", state);
// console.log("## form = ", form);
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("false")) {
alert(res.data.message);
}
else if (String(res.data.status) === String("true")) {
Dialog_contact_handleClose_buton();
alert(res.data.message);
}
else {
}
}).catch((error) => {
console.warn('contact-nous Not good man :( mysearchtext = ');
})
}
return ( return (
@ -2653,6 +2759,146 @@ const Recherche_new_v2 = () => {
<div className="reherche_new_v2" > <div className="reherche_new_v2" >
{/*** GESTION Contact */}
<Dialog
open={Dialog_contact_open}
onClose={Dialog_contact_handleClose}
className="displaypartnersession"
>
<DialogTitle>Contactez Nous</DialogTitle>
<DialogContent className="DialogContent_width">
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
Nom & Prénom
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='text'
name='name'
value={contact_message_nom_prenom}
onChange={(e) => {
setcontact_message_nom_prenom(e.target.value);
}}
className='form-control formInput'
placeholder='Nom'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
E-mail
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='email'
name='email'
id='email'
value={contact_message_email}
onChange={(e) => {
setcontact_message_email(e.target.value);
}}
className='form-control formInput'
placeholder='Adresse email'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', fontWeight: '400px' }}>
Téléphone
</div>
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
<input
type='text'
name='phone'
id='phone'
value={contact_message_phone}
onChange={(e) => {
setcontact_message_phone(e.target.value);
}}
className='form-control formInput'
placeholder='Numéro Tél'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_dialog" style={{ "textAlign": 'left' }}>
Sujet
</div>
<div className="div_row_dialog" >
<input
type='text'
name='subject'
value={contact_message_sujet}
onChange={(e) => {
setcontact_message_sujet(e.target.value);
}}
className='form-control formInput'
placeholder='Sujet'
></input>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_dialog" style={{ "textAlign": 'left' }}>
Votre message
</div>
<div className="div_row_dialog" >
<textarea
rows={3}
name='message'
value={contact_message_message}
onChange={(e) => {
setcontact_message_message(e.target.value);
}}
className='form-control formInput'
placeholder='Message'
></textarea>
</div>
</div>
<div className="div_row_dialog" >
<div>MySy Training Technology<br />
</div>
<div style={{ fontSize: "small" }}>
Adresse : 1 Cr du Havre, 75008 Paris <br />
Adresse email :
<a href="mailto: contact@mysy-training.com?subject=Mail from mysy website" target="_blank"> contact@mysy-training.com</a> <br />
Téléphone fixe : +331 77 00 38 57<br />
</div>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Dialog_contact_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Send_Contact_Message} className="bton_enreg_dialog">Envoyer&nbsp; <SendIcon /></Button>
</div>
</div>
</DialogActions>
</Dialog>
{/*** FIN GESTION Contact */}
<Dialog <Dialog
open={Dialog_1_open} open={Dialog_1_open}
onClose={Dialog_1_handleClose} onClose={Dialog_1_handleClose}
@ -2931,13 +3177,20 @@ const Recherche_new_v2 = () => {
{/*<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav> */} {/*<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav> */}
<nav className="header_menu" onClick={handleQuisommesNousMenu}> Qui Sommes nous ? </nav> <nav className="header_menu" onClick={handleQuisommesNousMenu}> Qui Sommes-nous ? </nav>
<nav className="header_menu" onClick={handleProduitMenu}> <nav className="header_menu" onClick={handleProduitMenu}>
Nos Services Nos Services
</nav> </nav>
<nav className="header_menu" onClick={(event) => {
setDialog_contact_open(true);
}}>
Contact
</nav>
<nav className="header_menu"> &nbsp; </nav> <nav className="header_menu"> &nbsp; </nav>
<nav className="bar_vert"> </nav> <nav className="bar_vert"> </nav>