From 9774eb87f984e8a15381b55ed58cd2850c9955f5 Mon Sep 17 00:00:00 2001 From: Florian SYLVAIN Date: Fri, 24 Sep 2021 09:55:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20Cleaning=20index.php.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjetProgWeb/index.php | 52 ++++++++--------------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/ProjetProgWeb/index.php b/ProjetProgWeb/index.php index c43b04d..55c612e 100644 --- a/ProjetProgWeb/index.php +++ b/ProjetProgWeb/index.php @@ -4,52 +4,20 @@ require_once("conf.php"); require_once("class/these.php"); require_once("class/dump.php"); -$these = new these("Florian", - "967125", - "Ma thèse très sympa", - "Didier Deschamps", - "Deschamps Didier", - "8516243", - "IUT Marne la vallée", - "128675", - "Informatique", - "passée", - "2001-1-3", - "2000-12-24", - "en", - "2146795", - false, - "2000-1-1", - "2000-1-1" -); -$dump = new dump($these); -$dump->sendThese(); - -/* -$row = 1; if (($handle = fopen("scripts/dump_abes_thesesfr.csv", "r")) !== FALSE) { + $row = 1; + $new_these = these::emptyThese(); while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) { $num = count($data); - echo "

---------------- " . $row . " -----------------

\n"; - $row++; - for ($c=0; $c < $num; $c++) { - if ($data[$c]) { - echo $data[$c] . "
\n"; - } else { - echo "NULL
\n"; + // echo "

---------------- " . $row . " -----------------

\n"; + if ($row > 1) { + for ($c = 0 ; $c < $num ; $c++) { + $new_these->insertField($data[$c], $c); } - } + $dump = new dump($new_these); + $dump->sendThese(); + } $row++; } fclose($handle); -}*/ - - -/* - $sql = 'SELECT * FROM theses'; - $req = $pdo->query($sql); - while($row = $req->fetch()) { - echo "

" . $row['author'] . " | " . $row['title'] . "

"; - } - $req->closeCursor(); -*/ +}