Commit 6b05c839 authored by ibex17's avatar ibex17 🐐
Browse files

init project in php

- inserting user to database finally works mofucka !!
parents
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
raip_php
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="RAIP@SG-RAIP-4399-mysql-master.servers.mongodirector.com" uuid="7d66fe88-a2af-4962-bb70-d9a942fe0d45">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://SG-RAIP-4399-mysql-master.servers.mongodirector.com:3306/RAIP</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/raip_php.iml" filepath="$PROJECT_DIR$/.idea/raip_php.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="PROJECT" dialect="MySQL" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import mysql from 'mysql'
var connection = mysql.createConnection({
host: 'SG-RAIP-4399-mysql-master.servers.mongodirector.com',
user: 'sgroot',
password: 'TTY+Iz0vWzzO1z9b',
database: 'RAIP',
port: 3306,
});
connection.connect(function (err) {
if (err) throw err;
console.log("Connected!");
/* var sql = "INSERT INTO RAIP.utilisateur (email, mot_de_passe, prenom, nom, faculte, niveau_etude, est_un_etudiant, est_un_repetiteur) VALUES ('Ahmed.Buzgheiba@etu.unige.ch', 'Ahmed', 'Buygheiba', 'GSEM', 'Bachelor', 1, 0);";
connection.query(sql, function (err, result) {
if (err) throw err;
console.log("User inserted");
});*/
});
function insertStudentSQL() {
let email = document.querySelector("#email").value;
let mot_De_passe = document.querySelector("#mot_de_passe").value;
let prenom = document.querySelector("#prenom").value;
let nom = document.querySelector("#nom").value;
let faculte = document.querySelector("#faculte").value;
let niveau_etude = document.querySelector("#niveau_etude").value;
let est_un_etudiant = 1;
let est_un_repetiteur = 0;
let sql = "INSERT INTO RAIP.utilisateur (email, mot_de_passe, prenom, nom, faculte, niveau_etude, est_un_etudiant, est_un_repetiteur) VALUES (?,?,?,?,?,?,?);";
connection.query(sql, [email, mot_De_passe, prenom, nom, faculte, niveau_etude, est_un_etudiant, est_un_repetiteur], function (err) {
if (err) throw err;
console.log("User inserted");
});
}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Connexion</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Ici vous pouvez vous connecter</h3>
<!-- Login form -->
</article>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>inscription</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Créer compte étudiant</h3>
<!-- Form -->
<div class="form-style-10">
<form action="studentForm.php" method="post">
<div class="section"><span>1</span>Données personnelles</div>
<div class="inner-wrap">
<label>Prénom <input type="text" name="prenom" value="prenom" id="prenom"/></label>
<label>Nom de famille <input type="text" name="nom" id="nom"/></label>
<label>Faculté <select id="faculte" name="faculte">
<optgroup label="UNIGE">
<option value="Sciences">Sciences</option>
<option value="Lettres">Lettres</option>
<option value="CUI">CUI</option>
<option value="GSEM">GSEM</option>
</optgroup>
</select></label>
<label>Niveau d'étude <select id="niveau_etude" name="niveau_etude">
<optgroup label="UNIGE">
<option value="Bachelor">Bachelor</option>
<option value="Master">Master</option>
</optgroup>
</select></label>
</div>
<div class="section"><span>2</span>Email</div>
<div class="inner-wrap">
<label>Email universitaire <input type="email" name="email" id="email"/></label>
</div>
<div class="section"><span>3</span>Mot de passe</div>
<div class="inner-wrap">
<label>Mot de passe <input type="password" name="mot_de_passe" id="mot_de_passe"/></label>
<label>Confirmez le mot de passe <input type="password" name="field6"
id="mot_de_passe_confirm"/></label>
</div>
<div class="button-section">
<button type="submit" id="submitStudent">Créer compte étudiant-e
</button>
<span class="privacy-policy">
<input type="checkbox" name="field7">En cochant vous acceptez nos conditions d'utilisation.
</span>
</div>
</form>
</div>
</article>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>inscription</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Créer compte pour répétiteur</h3>
<!-- Form -->
<div class="form-style-10">
<form action="repetiteurForm.php" method="post">
<div class="section"><span>1</span>Données personnelles</div>
<div class="inner-wrap">
<label>Prénom <input type="text" name="prenom" value="prenom" id="prenom"/></label>
<label>Nom de famille <input type="text" name="nom" id="nom"/></label>
<label>Faculté <select id="faculte" name="faculte">
<optgroup label="UNIGE">
<option value="Sciences">Sciences</option>
<option value="Lettres">Lettres</option>
<option value="CUI">CUI</option>
<option value="GSEM">GSEM</option>
</optgroup>
</select></label>
<label>Niveau d'étude <select id="niveau_etude" name="niveau_etude">
<optgroup label="UNIGE">
<option value="Bachelor">Bachelor</option>
<option value="Master">Master</option>
</optgroup>
</select></label>
</div>
<div class="section"><span>2</span>Email</div>
<div class="inner-wrap">
<label>Email universitaire <input type="email" name="email" id="email"/></label>
</div>
<div class="section"><span>3</span>Mot de passe</div>
<div class="inner-wrap">
<label>Mot de passe <input type="password" name="mot_de_passe" id="mot_de_passe"/></label>
<label>Confirmez le mot de passe <input type="password" name="field6"
id="mot_de_passe_confirm"/></label>
</div>
<div class="button-section">
<button type="submit" id="submitStudent">Créer compte étudiant-e
</button>
<span class="privacy-policy">
<input type="checkbox" name="field7">En cochant vous acceptez nos conditions d'utilisation.
</span>
</div>
</form>
</div>
</article>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Connexion</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/confirmation.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Confirmation de creation de compte</h3>
<p>Vous avez bien créer un compte utilisateur</p>
</article>
<!-- Right image -->
<aside class="left_article_confirm">
<img src="images/confirmation-icon-13.jpg" alt="" width="300" height="300"
class="placeholder"/>
</aside>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Connexion</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/confirmation.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Confirmation de connexion</h3>
<p>Vous êtes bien connecté à la plateforme</p>
</article>
<!-- Right image -->
<aside class="left_article_confirm">
<img src="images/confirmation-icon-13.jpg" alt="" width="300" height="300"
class="placeholder"/>
</aside>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Connexion</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/confirmation.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Confirmation d'envoi</h3>
<p>Votre message a bien été envoyé</p>
</article>
<!-- Right image -->
<aside class="left_article_confirm">
<img src="images/confirmation-icon-13.jpg" alt="" width="300" height="300"
class="placeholder"/>
</aside>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Connexion</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>
<div class="container">
<header>
<!-- Header -->
<div class="primary_header">
<h1 class="title1"> RAIP&nbsp;</h1>
<h2 class="title2">Répétitoire Académique d'Introduction à la Programmation&nbsp;</h2>
</div>
<!-- Menu -->
<nav class="secondary_header" id="menu">
<ul>
<li><a href="index.html" style="text-decoration: none">ACCUEIL&nbsp;</a></li>
<li><a href="repetitoires.html" style="text-decoration: none">REPETITOIRES&nbsp;</a></li>
<li><a href="creerCompte.html" style="text-decoration: none">CREER COMPTE&nbsp;</a></li>
<li><a href="connexion.html" style="text-decoration: none">CONNEXION&nbsp;</a></li>
<li><a href="contact.html" style="text-decoration: none">CONTACT&nbsp;</a></li>
</ul>
</nav>
</header>
<!-- Content -->
<section>
<!-- Left article -->
<article class="left_article">
<h3>Ici vous pouvez vous connecter</h3>
<!-- Login form -->
<div class="form-style-10">
<form>
<div class="section"><span>1</span>Se connecter</div>
<div class="inner-wrap">
<label>Email <input type="email" name="field2"/></label>
<label>Mot de passe <input type="password" name="field5"/></label>
</div>
<div class="button-section">
<button type="submit">Se connecter</button>
</div>
</form>
</div>
</article>
</section>
<!-- Copyright footer -->
<footer class="secondary_header footer">
<div class="copyright">&copy;2021 - <strong>Prototype projet de Base de Données</strong></div>
</footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>contact</title>
<link href="css/webHeader.css" rel="stylesheet" type="text/css">
<link href="css/formStyle.css" rel="stylesheet" type="text/css">
</head>
<!-- Website page -->
<body>