Connexion · Créer un compte

SKYNET

par henoc Gnaoule · mis à jour il y a 2 h

Skynet est un projet qui pour but de developper une Intelligence artificielle générale

JavaScript Licence MIT 13 fichiers

208 lignes · 13,2 Ko

<?php
error_reporting(0);

$mobile = $_SERVER['HTTP_USER_AGENT'];
 
if(preg_match("(iPhone|BlackBerry|Android|HTC|LG|MOT|Nokia|Palm|SAMSUNG|SonyEricsson)",$mobile)){
    header('Location:/eliora_chat_mobile.php');}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Eliora AI</title>
	<link rel="icon" type="image/png" href="image/apv.ico">
	<link rel="shortcut icon" href="image/apvx.png"/>
	<link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/message_form.css">
    <link rel="stylesheet" type="text/css" href="css/cv_panneau.css">
    <script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/script_form.js"></script>
</head>
<body style="background-color: #F0F0F2">

	<div class="box" style="position:; background-color:#F0F0F2">
		<img src="image/apvx.png" width="30px" style="margin-left:20px; margin-top:10px; background-color:#F0F0F2; display:inline-block; float:left"/>
		<button style="width:50px; height:50px; margin-top:15px; font-size:25px; font-family:Helvetica; border-radius:17px; border:none; cursor:pointer;
		background-color:#F0F0F2; margin-left:5px; margin-top:5px">Eliora</button>

    </div>


<div id="visio" style="width: 100%; height:700px; border:none; margin: 0 auto; background-color:#F0F0F2; position:relative; overflow:auto">
	<div id="affiche_message" style="width: 730px; height:auto; border:none; margin: 0 auto; padding-bottom: 200px; padding-top:70px; background-color:#F0F0F2; position:relative; overflow:auto; display:flex; flex-direction: column">
	 </div>

	 </div>

	 <div id="cv-statut" style="display:none; font-family:Helvetica; font-size:14px; color:gray; margin-top:8px;"></div>
    <div id="label_text" style="width:500px; height:60px; border:none; position:fixed; background-color:#F0F0F2; bottom:62%; left: 50%;
		transform: translateX(-50%);  border-radius:20px; text-align:center">
          <span id="text_chang" style="font-family:Helvetica; font-size:30px">Hello <span style="font-family:Helvetica; font-size:30px;"><?php echo htmlspecialchars((string) ($_SESSION['prenom'] ?? ''), ENT_QUOTES, 'UTF-8'); ?></span></span>
    </div>

		<div id="boto" style="width:750px; height:; border:none; position: fixed; background-color:white; bottom:45%; left: 50%;
		transform: translateX(-50%);  border-radius:20px; z-index:10;
		box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px">


		<form method="POST" action="donnees.php" id="formulaire" >

        <button type="button" id="bouton-menu" onclick="toggleMenu()" style="position:absolute; left:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:#e5e5e7; color:#333; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: transform 0.25s ease, background-color 0.2s;" aria-label="Ouvrir le menu des options">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18" id="icone-menu">
            <line x1="12" y1="5" x2="12" y2="19"></line>
            <line x1="5" y1="12" x2="19" y2="12"></line>
        </svg>
    </button>
			<label for="mess" style="position:absolute; left:-9999px;">Poser une question</label>
			<textarea  id="mess" name="message" placeholder="Comment puis-je vous aider ?" maxlength="" style="width:720px; height:100px;
			border-radius:20px; border:none; padding-top:20px; padding-left:20px; font-size:16px; font-family:Helvetica;
            box-sizing:border-box;line-height:20px;overflow:hidden; padding-bottom:47px; display:block" ></textarea>


    <button type="submit" id="publier" disabled onclick="gre()" style="position:absolute; right:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:dodgerblue; color:gray; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: background-color 0.2s;" aria-label="Envoyer le message">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18">
            <line x1="12" y1="19" x2="12" y2="5"></line>
            <polyline points="5 12 12 5 19 12"></polyline>
        </svg>
    </button>
		<div id="menu-options" style="display:none; position:absolute; left:10px; bottom:55px; background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,0.1); padding:8px; min-width:160px; z-index:20;">
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-family:helvetica" onclick="professionnel()">Professionnel</div>
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-family:helvetica" onclick="finance()">Finance</div>
    </div>
			</form>

<form method="POST" action="donnees_professionnelles.php" id="formulairepro" style="display:none" >

        <button type="button" id="pro-menu" onclick="proMenu()" style="position:absolute; left:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:#e5e5e7; color:#333; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: transform 0.25s ease, background-color 0.2s;" aria-label="Ouvrir le menu des options">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18" id="icone-menu-pro">
            <line x1="12" y1="5" x2="12" y2="19"></line>
            <line x1="5" y1="12" x2="19" y2="12"></line>
        </svg>
    </button>
			<label for="professionnel" style="position:absolute; left:-9999px;">Rechercher un professionnel</label>
			<textarea  id="professionnel" name="messagepro" placeholder="Rechercher un professionnel" maxlength="" style="width:720px; height:100px;
			border-radius:20px; border:none; padding-top:20px; padding-left:20px; font-size:16px; font-family:Helvetica;
            box-sizing:border-box;line-height:20px;overflow:hidden; padding-bottom:47px; display:block" ></textarea>


    <button type="submit" id="envoipro" disabled onclick="gre()" style="position:absolute; right:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:dodgerblue; color:gray; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: background-color 0.2s;" aria-label="Envoyer la recherche">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18">
            <line x1="12" y1="19" x2="12" y2="5"></line>
            <polyline points="5 12 12 5 19 12"></polyline>
        </svg>
    </button>
		<div id="pro-options" style="display:none; position:absolute; left:10px; bottom:55px; background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,0.1); padding:8px; min-width:160px; z-index:20;">
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-weight:bold; font-family:helvetica" onclick="professionnel()">Professionnel</div>
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-family:helvetica" onclick="finance()">Finance</div>
    </div>
     <button id="profe-pro"  style="width:130px; height:30px;  font-family:Helvetica; border-radius:20px; margin-left:60px; position:fixed; bottom:5px; border:1.5px solid #F0F0F2; background-color:transparent; color:gray; cursor:pointer" disabled>
        professionnel
        <img src="image/ferm.png" width="20" style="margin-left:px; margin-top:px; display:inline-block;vertical-align: middle" onclick="ferm_pro()"/>
     </button>
			</form>

<form method="POST" action="donnees_finances.php" id="formulairefin" style="display:none" >

        <button type="button" id="fin-menu" onclick="finMenu()" style="position:absolute; left:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:#e5e5e7; color:#333; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: transform 0.25s ease, background-color 0.2s;" aria-label="Ouvrir le menu des options">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18" id="icone-menu-fin">
            <line x1="12" y1="5" x2="12" y2="19"></line>
            <line x1="5" y1="12" x2="19" y2="12"></line>
        </svg>
    </button>
			<label for="finance" style="position:absolute; left:-9999px;">Entrer votre revenu</label>
			<textarea  id="finance" name="messagefin" placeholder="Entrer votre revenu" maxlength="" style="width:720px; height:100px;
			border-radius:20px; border:none; padding-top:20px; padding-left:20px; font-size:16px; font-family:Helvetica;
            box-sizing:border-box;line-height:20px;overflow:hidden; padding-bottom:47px; display:block" ></textarea>


    <button type="submit" id="okfin" disabled onclick="gre()" style="position:absolute; right:10px; bottom:10px; width:36px; height:36px; border-radius:50%; border:none; background-color:dodgerblue; color:gray; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: background-color 0.2s;" aria-label="Envoyer">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18">
            <line x1="12" y1="19" x2="12" y2="5"></line>
            <polyline points="5 12 12 5 19 12"></polyline>
        </svg>
    </button>
		<div id="fin-options" style="display:none; position:absolute; left:10px; bottom:55px; background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,0.1); padding:8px; min-width:160px; z-index:20;">
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-family:helvetica" onclick="professionnel()">Professionnel</div>
        <div class="option-menu" style="padding:8px 12px; cursor:pointer; border-radius:6px; font-size:14px; font-weight:bold; font-family:helvetica" onclick="finance()">Finance</div>
    </div>


    <button id="profe-fin"  style="width:155px; height:30px;  font-family:Helvetica; border-radius:20px; margin-left:60px; position:fixed; bottom:5px; border:1.5px solid #F0F0F2; background-color:transparent; color:gray; cursor:pointer" onmouseover="ax()" onmouseout="az()" disabled>
        budget & analyse
        <img src="image/ferm.png" width="20" style="margin-left:px; margin-top:px; display:inline-block;vertical-align: middle" onclick="ferm_fin()"/>
     </button>

			</form>

			</div>
	<div id="pied-eliora" style="width:100%; height:40px; position:fixed; bottom:0px; background-color:#F0F0F2; color:; font-family:Helvetica; border:none">
	<center><span class="" style="font-family:Helvetica; font-size:12px; position:fixed; bottom:10px;
	left: 50%; transform: translateX(-50%); ">En utilisant Eliora, vous acceptez les&nbsp;<a href="conditioniaweb.php" style="text-decoration:none;
	color:skyblue">conditions d'utilisation.</a></span></center>
	</div>

    <script type="text/javascript" src="js/script_bouton_ok.js"></script>
    <script type="text/javascript" src="js/script_cv.js"></script>

	<script>
		$(document).ready(function () {

			// --- Validation factorisée : une seule fonction réutilisée
			// pour les 3 champs (message général, professionnel, finance)
			// au lieu de 3 blocs quasi identiques dupliqués.
			function brancherValidation(champId, boutonId) {
				var minuteur = null;

				function verifierSaisie() {
					var input = $('#' + champId).val();
					$.ajax({
						method: "POST",
						url: 'testervaleur.php',
						data: { gen: input },
						dataType: "text",
						success: function (result) {
							var ok = (result.trim() === "true");
							$('#' + boutonId).prop('disabled', !ok);
							$('#' + boutonId).css({
								backgroundColor: ok ? "skyblue" : "#F0F0F2",
								color: ok ? "white" : "gray"
							});
						}
					});
				}

				$('#' + champId).on('input', function () {
					clearTimeout(minuteur);
					minuteur = setTimeout(verifierSaisie, 250);
				});

				// Une <textarea> ne soumet pas le formulaire sur Entrée par défaut
				// (contrairement à un <input type="text">) — elle insère un saut de ligne.
				// On intercepte donc la touche Entrée pour déclencher l'envoi à la place.
				$('#' + champId).on('keydown', function (e) {
					if (e.key === 'Enter' && !e.shiftKey) {
						e.preventDefault();
						gre();
						if (!$('#' + boutonId).prop('disabled')) {
							$('#' + champId).closest('form').trigger('submit');
						}
					}
				});
			}

			brancherValidation('mess', 'publier');
			brancherValidation('professionnel', 'envoipro');
			brancherValidation('finance', 'okfin');

		});
	</script>

<?php include __DIR__ . '/eliora_cv_widget.php'; ?>

	<!-- Panneau CV : ouvre le CV choisi dans un panneau à droite de la conversation -->
	<script type="text/javascript" src="js/script_cv_panneau.js"></script>
</body>
</html>