diff --git a/SwichGIT/MorpionMulti/.idea/.gitignore b/SwichGIT/MorpionMulti/.idea/.gitignore deleted file mode 100644 index 36c467d..0000000 --- a/SwichGIT/MorpionMulti/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/../../../../../../:\wamp64\www\Test\TP2\.idea/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/SwichGIT/MorpionMulti/.idea/.idea/codeStyles/codeStyleConfig.xml b/SwichGIT/MorpionMulti/.idea/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/SwichGIT/MorpionMulti/.idea/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/.idea/deployment.xml b/SwichGIT/MorpionMulti/.idea/.idea/deployment.xml deleted file mode 100644 index 5512eb5..0000000 --- a/SwichGIT/MorpionMulti/.idea/.idea/deployment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/.idea/modules.xml b/SwichGIT/MorpionMulti/.idea/.idea/modules.xml deleted file mode 100644 index 08f54a6..0000000 --- a/SwichGIT/MorpionMulti/.idea/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/.name b/SwichGIT/MorpionMulti/.idea/.name deleted file mode 100644 index 40daab1..0000000 --- a/SwichGIT/MorpionMulti/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -bddt.php \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/TP2.iml b/SwichGIT/MorpionMulti/.idea/TP2.iml deleted file mode 100644 index c956989..0000000 --- a/SwichGIT/MorpionMulti/.idea/TP2.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/codeStyles/codeStyleConfig.xml b/SwichGIT/MorpionMulti/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/SwichGIT/MorpionMulti/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/DB.php b/SwichGIT/MorpionMulti/DB.php deleted file mode 100644 index d7ed019..0000000 --- a/SwichGIT/MorpionMulti/DB.php +++ /dev/null @@ -1,134 +0,0 @@ - - - - - -
- -
-
- - -
-

Morpion

- -
- - - -
- - -

- -query('INSERT INTO partie(Id) VALUES("'.$partiecreer.'")'); - $idpartie=$partiecreer; - require("DB.php"); -} -if($action=="Rejoindre"){ - $idpartie=$_POST['placer']; - $idpartie=$partiecreer; - require("DB.php"); -} - -echo "

Id : $idpartie

" ; -$colonne=""; - -if(isset($_POST['case'])){ - - if($_POST['case']=='1'){ - $colonne='un'; -} -elseif ($_POST['case']=='2'){ - $colonne='deux'; -} -elseif ($_POST['case']=='3'){ - $colonne='trois'; -} -elseif ($_POST['case']=='4'){ - $colonne='quatre'; -} -elseif ($_POST['case']=='5'){ - $colonne='cinq'; -} -elseif ($_POST['case']=='6'){ - $colonne='six'; -} -elseif ($_POST['case']=='7'){ - $colonne='sept'; -} -elseif ($_POST['case']=='8'){ - $colonne='huit'; -} -elseif ($_POST['case']=='9'){ - $colonne='neuf'; -} - else{ - $colonne='null'; - } -} -$valeur=""; -if(isset($_POST['forme'])){ - $valeur=$_POST['forme']; -} - - -header("refresh: 2"); -//$db->exec('CREATE TABLE partie(Id STRING,un STRING,deux STRING,trois STRING, quatre STRING,cinq STRING,six STRING,sept STRING,huit STRING,neuf STRING)'); -if(isset($colonne)and $valeur!="" and $colonne!=''){ - - $aff=$db->query('SELECT "'.$colonne.'" FROM partie where Id="'.$idpartie.'" '); - $res = $aff->fetchArray(); - - if(strlen($res[$colonne])==1){ - echo "

Insertion impossible une valeur est déjà à l'intérieur


"; - } - else{ - $update = $db->query('UPDATE partie SET "'.$colonne.'" = "'.$valeur.'" where Id="'.$idpartie.'" '); - } -} - -$afficher = $db->query('SELECT * FROM partie where Id="'.$idpartie.'" '); -while ($row = $afficher->fetchArray()) { - -$un=$row['un']; -$deux=$row['deux']; -$trois=$row['trois']; -$quatre=$row['quatre']; -$cinq=$row['cinq']; -$six=$row['six']; -$sept=$row['sept']; -$huit=$row['huit']; -$neuf=$row['neuf']; -} -echo " - - - - - - - - - - - - - - - - -
$un$deux$trois
$quatre$cinq$six
$sept$huit$neuf
- "; - -?> diff --git a/SwichGIT/MorpionMulti/accueil.php b/SwichGIT/MorpionMulti/accueil.php deleted file mode 100644 index f395f27..0000000 --- a/SwichGIT/MorpionMulti/accueil.php +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - -

-

- - - - - - -
-
- -
- -

- - - - - - - diff --git a/SwichGIT/MorpionMulti/bddt.php b/SwichGIT/MorpionMulti/bddt.php deleted file mode 100644 index 5eef32f..0000000 --- a/SwichGIT/MorpionMulti/bddt.php +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/js.js b/SwichGIT/MorpionMulti/js.js deleted file mode 100644 index e69de29..0000000 diff --git a/SwichGIT/MorpionMulti/mysqlitedb.db b/SwichGIT/MorpionMulti/mysqlitedb.db deleted file mode 100644 index cea990e..0000000 Binary files a/SwichGIT/MorpionMulti/mysqlitedb.db and /dev/null differ diff --git a/SwichGIT/MorpionMulti/.idea/.idea/.idea.iml b/SwichGIT/MorpionPhp/.idea/MorpionPhp.iml similarity index 100% rename from SwichGIT/MorpionMulti/.idea/.idea/.idea.iml rename to SwichGIT/MorpionPhp/.idea/MorpionPhp.iml diff --git a/SwichGIT/MorpionPhp/.idea/dataSources.local.xml b/SwichGIT/MorpionPhp/.idea/dataSources.local.xml new file mode 100644 index 0000000..d38783c --- /dev/null +++ b/SwichGIT/MorpionPhp/.idea/dataSources.local.xml @@ -0,0 +1,10 @@ + + + + + + no-auth + + + + \ No newline at end of file diff --git a/SwichGIT/MorpionPhp/.idea/dataSources.xml b/SwichGIT/MorpionPhp/.idea/dataSources.xml new file mode 100644 index 0000000..fec054a --- /dev/null +++ b/SwichGIT/MorpionPhp/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + sqlite.xerial + true + org.sqlite.JDBC + jdbc:sqlite:D:\wamp64\www\Test\MorpionPhp\mysqlitedb.db + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/deployment.xml b/SwichGIT/MorpionPhp/.idea/deployment.xml similarity index 86% rename from SwichGIT/MorpionMulti/.idea/deployment.xml rename to SwichGIT/MorpionPhp/.idea/deployment.xml index f921b39..64a32fd 100644 --- a/SwichGIT/MorpionMulti/.idea/deployment.xml +++ b/SwichGIT/MorpionPhp/.idea/deployment.xml @@ -5,7 +5,7 @@ - + diff --git a/SwichGIT/MorpionMulti/.idea/modules.xml b/SwichGIT/MorpionPhp/.idea/modules.xml similarity index 54% rename from SwichGIT/MorpionMulti/.idea/modules.xml rename to SwichGIT/MorpionPhp/.idea/modules.xml index c693d56..eba4f80 100644 --- a/SwichGIT/MorpionMulti/.idea/modules.xml +++ b/SwichGIT/MorpionPhp/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/SwichGIT/MorpionMulti/.idea/php.xml b/SwichGIT/MorpionPhp/.idea/php.xml similarity index 100% rename from SwichGIT/MorpionMulti/.idea/php.xml rename to SwichGIT/MorpionPhp/.idea/php.xml diff --git a/SwichGIT/MorpionMulti/.idea/.idea/workspace.xml b/SwichGIT/MorpionPhp/.idea/workspace.xml similarity index 61% rename from SwichGIT/MorpionMulti/.idea/.idea/workspace.xml rename to SwichGIT/MorpionPhp/.idea/workspace.xml index 5161708..b9e793c 100644 --- a/SwichGIT/MorpionMulti/.idea/.idea/workspace.xml +++ b/SwichGIT/MorpionPhp/.idea/workspace.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/SwichGIT/MorpionPhp/ActualiserIDPartie.php b/SwichGIT/MorpionPhp/ActualiserIDPartie.php new file mode 100644 index 0000000..279412d --- /dev/null +++ b/SwichGIT/MorpionPhp/ActualiserIDPartie.php @@ -0,0 +1,7 @@ +Identifiant partie : $idparte " ; +echo ""; +?> + diff --git a/SwichGIT/MorpionPhp/ActualiserMorpion.php b/SwichGIT/MorpionPhp/ActualiserMorpion.php new file mode 100644 index 0000000..f023169 --- /dev/null +++ b/SwichGIT/MorpionPhp/ActualiserMorpion.php @@ -0,0 +1,63 @@ +open('mysqlitedb.db'); + } +} + + + +session_start(); +$idpartie = $_SESSION['idpartie']; +$db = new MyDB(); + +$rows = $db->query('SELECT COUNT(*) as count FROM partie where Id="'.$idpartie.'" '); +$row = $rows->fetchArray(); +$numRows = $row['count']; + +$afficher = $db->query('SELECT * FROM partie where Id="'.$idpartie.'" '); +while ($row = $afficher->fetchArray()) { + +$un=$row['un']; +$deux=$row['deux']; +$trois=$row['trois']; +$quatre=$row['quatre']; +$cinq=$row['cinq']; +$six=$row['six']; +$sept=$row['sept']; +$huit=$row['huit']; +$neuf=$row['neuf']; + + +} +if($numRows!=1){ + echo "

Identifiant inconnu

"; +} +else{ + echo " + + + + + + + + + + + + + + + + +
$un$deux$trois
$quatre$cinq$six
$sept$huit$neuf
+ +"; +} + + +?> diff --git a/SwichGIT/MorpionMulti/MyDB.php b/SwichGIT/MorpionPhp/MaDB.php similarity index 99% rename from SwichGIT/MorpionMulti/MyDB.php rename to SwichGIT/MorpionPhp/MaDB.php index 1c579bd..58e90b3 100644 --- a/SwichGIT/MorpionMulti/MyDB.php +++ b/SwichGIT/MorpionPhp/MaDB.php @@ -1,6 +1,4 @@ + + + + Morpion + + + + + + + + +

Morpion

+ + + +
+ + +
+Identifiant partie : $idpartie"; +?> + + + +
+ + + +
+ + + +
+ + + + + + + + +
+
+ + + +query('SELECT "'.$colonne.'" FROM partie where Id="'.$idpartie.'" '); + $res = $aff->fetchArray(); + + if(strlen($res[$colonne])!=0){ + echo "

Insertion impossible une valeur est déjà à l'intérieur


"; + } + else{ + $update = $db->query('UPDATE partie SET "'.$colonne.'" = "'.$valeur.'" where Id="'.$idpartie.'" '); + } + +} \ No newline at end of file diff --git a/SwichGIT/MorpionPhp/SupprimerPartieActuelEtCreer.php b/SwichGIT/MorpionPhp/SupprimerPartieActuelEtCreer.php new file mode 100644 index 0000000..a31418a --- /dev/null +++ b/SwichGIT/MorpionPhp/SupprimerPartieActuelEtCreer.php @@ -0,0 +1,12 @@ +query($requete); + +$newid=genererChaineAleatoire(10); +$_SESSION['idpartie']=$newid; +$db->query('INSERT INTO partie(Id) VALUES("'.$newid.'")'); \ No newline at end of file diff --git a/SwichGIT/MorpionPhp/SupprimerPartieActuelle.php b/SwichGIT/MorpionPhp/SupprimerPartieActuelle.php new file mode 100644 index 0000000..e86d695 --- /dev/null +++ b/SwichGIT/MorpionPhp/SupprimerPartieActuelle.php @@ -0,0 +1,10 @@ +query($requete); + + diff --git a/SwichGIT/MorpionMulti/css.css b/SwichGIT/MorpionPhp/css.css similarity index 84% rename from SwichGIT/MorpionMulti/css.css rename to SwichGIT/MorpionPhp/css.css index b0e2494..690d7dc 100644 --- a/SwichGIT/MorpionMulti/css.css +++ b/SwichGIT/MorpionPhp/css.css @@ -1,9 +1,14 @@ body{ margin: 0; /* pour éviter les marges */ text-align: center; /* pour corriger le bug de centrage IE */ + background-color: #9DD9D2; } - +.myInput{ + background-color: #ff8500; + height: 0px; + width: 0px; +} h1 { font-size: 4em; font-weight: 700; @@ -34,7 +39,3 @@ p{ text-align: center; color: #F43C3F } - - - - diff --git a/SwichGIT/MorpionPhp/js.js b/SwichGIT/MorpionPhp/js.js new file mode 100644 index 0000000..38977a6 --- /dev/null +++ b/SwichGIT/MorpionPhp/js.js @@ -0,0 +1,14 @@ +function myFunction() { + /* Get the text field */ + var copyText = document.getElementById("myInput"); + + /* Select the text field */ + copyText.select(); + copyText.setSelectionRange(0, 99999); /* For mobile devices */ + + /* Copy the text inside the text field */ + document.execCommand("copy"); + + /* Alert the copied text */ + alert("Copied the text: " + copyText.value); +} \ No newline at end of file diff --git a/SwichGIT/MorpionPhp/mysqlitedb.db b/SwichGIT/MorpionPhp/mysqlitedb.db new file mode 100644 index 0000000..9555096 Binary files /dev/null and b/SwichGIT/MorpionPhp/mysqlitedb.db differ diff --git a/SwichGIT/MorpionMulti/test.ico b/SwichGIT/MorpionPhp/test.ico similarity index 100% rename from SwichGIT/MorpionMulti/test.ico rename to SwichGIT/MorpionPhp/test.ico