Use header.html in all pages

This commit is contained in:
Némunaire 2012-06-18 20:57:57 +02:00
parent 6d762d3b1d
commit f2a4098897
11 changed files with 34 additions and 204 deletions

View File

@ -58,9 +58,12 @@ class Course
$treeXML = new DOMDocument('1.0', 'UTF-8'); $treeXML = new DOMDocument('1.0', 'UTF-8');
if (@$treeXML->load($filename)) if (@$treeXML->load($filename))
return new Course($treeXML->getElementById($id)); {
else $c = $treeXML->getElementById($id);
return null; if ($c)
return new Course($c);
}
return null;
} }
public static function setCourses($courses, $filename = "courses.xml") public static function setCourses($courses, $filename = "courses.xml")

View File

@ -1,32 +1,4 @@
<!DOCTYPE html><html> <?php include("header.html") ?>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<title>Every Questions (BETA)</title>
<script type="text/javascript">
function add()
{
var element = document.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("id", "answer");
element.setAttribute("name", "answer" + nbAnswer);
nbAnswer++;
element.setAttribute("placeholder", "Nouvelle réponse");
var foo = document.getElementById("answerList");
foo.appendChild(element);
}
</script>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>
<section id="introduction"> <section id="introduction">
<article> <article>
<?php <?php
@ -122,7 +94,7 @@ if (!$question->isValidated())
<article> <article>
<h2>... ou la confirmer telle quelle !</h2> <h2>... ou la confirmer telle quelle !</h2>
<p> <p>
Si la question vous semble corect, vous pouvez directement Si la question vous semble correcte, vous pouvez directement
la confirmer ici :<br> la confirmer ici :<br>
</p> </p>
<form method="post" <form method="post"

17
header.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="script.js"></script>
<title>AskWeb (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>

View File

@ -1,47 +1,4 @@
<!DOCTYPE html> <?php include("header.html") ?>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<title>AskWeb (BETA)</title>
<script type="text/javascript">
var nbAnswer = 1;
function add()
{
var element = document.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("id", "answer");
element.setAttribute("name", "answer" + nbAnswer);
nbAnswer++;
element.setAttribute("placeholder", "Nouvelle réponse");
var foo = document.getElementById("answerList");
foo.appendChild(element);
}
function hideShow(which)
{
if (!document.getElementById)
return
if (which.style.display == "block")
which.style.display = "none"
else
which.style.display = "block"
}
</script>
</head>
<body>
<header id="main_title">
<a href="http://www.h2g2.com" id="banner">
<img src="marvin-robot_normal.png" alt="Marvin">
</a>
<h1>Nemubot AskWeb (BETA)</h1>
</header>
<section id="introduction"> <section id="introduction">
<a id="hideShow" href=""> <a id="hideShow" href="">
<img src="topArrow.png" alt="icon"> <img src="topArrow.png" alt="icon">
@ -178,8 +135,6 @@ foreach($cs as $c)
</form> </form>
</section> </section>
<?php include('footer.html') ?> <?php include('footer.html') ?>
</body> </body>
</html> </html>

View File

@ -1,6 +1,5 @@
<?php <?php
function mail_utf8($to, $subject = '(No subject)', function mail_utf8($to, $subject = '(No subject)',
$message = '', $header = '') $message = '', $header = '')
{ {
@ -10,7 +9,6 @@ function mail_utf8($to, $subject = '(No subject)',
$message, $header_ . $header)); $message, $header_ . $header));
} }
$email = $_POST['email']; $email = $_POST['email'];
echo $email; echo $email;
$subject = "[Nemubot] Confirmation d'inscription"; $subject = "[Nemubot] Confirmation d'inscription";

View File

@ -1,21 +1,10 @@
<!DOCTYPE html><html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<title>Every Questions (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>
<?php <?php
include("Question.class.php"); include("Question.class.php");
include("QuestionsFile.class.php"); include("QuestionsFile.class.php");
include("header.html");
$id = $_GET['id']; $id = $_GET['id'];
$file = new QuestionsFile("questions.xml"); $file = new QuestionsFile("questions.xml");
$question = $file->get_question($id); $question = $file->get_question($id);

View File

@ -1,18 +1,4 @@
<!DOCTYPE html> <?php include("header.html") ?>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<title>AskWeb (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions</h1>
</header>
<section id="introduction"> <section id="introduction">
<article> <article>
<h2>Merci de votre participation</h2> <h2>Merci de votre participation</h2>

View File

@ -1,18 +1,4 @@
<!DOCTYPE html> <?php include("header.html") ?>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<title>Every Questions (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>
<section id="introduction"> <section id="introduction">
<article id="validate"> <article id="validate">
<h2><?php <h2><?php

View File

@ -1,18 +1,4 @@
<!DOCTYPE html> <?php include("header.html") ?>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<title>Every Questions (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>
<section id="introduction"> <section id="introduction">
<article id="validate"> <article id="validate">
<h2><?php <h2><?php

View File

@ -1,49 +0,0 @@
<!DOCTYPE html>
<?php
//error_reporting(E_ALL);
define("FILENAME", "questions_file.nemubot");
include("Question.class.php");
include("QuestionsFile.class.php");
echo "id" . $_POST['id'];
if (isset ($_POST['send']))
{
//Gets parameters: course, question and answers
$course = "";
$answers = array();
foreach ($_POST as $key => $value)
{
if ($key == "question")
$question = $value;
else if ($key == "course")
$course = $value;
else if (preg_match("#^answer#", $key) && $key != "")
$answers[] = $value;
}
//Check we have at least a question and an answer
/*
if (empty($question))
die("Veuillez indiquer une question !");
else if (count($answers) <= 0)
die("Veuillez indiquer au moins une réponse correcte !");
else
{
$file = new QuestionsFile('questions.xml');
$id = $_POST['id'];
$quest = $file->get_question($id);
$quest->setCourse($couse);
$quest->setQuestion($question);
$quest->setAnswer($answers);
$file->save();
echo "File saved";
header("Location: ./confirmation.php?id=" . $quest->getId());
*/
?>

View File

@ -1,19 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="Stylesheet" href="style.css">
<title>Every Questions (BETA)</title>
</head>
<body>
<header>
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions (BETA)</h1>
</header>
<?php <?php
include("header.html");
include("Question.class.php"); include("Question.class.php");
include("QuestionsFile.class.php"); include("QuestionsFile.class.php");
@ -60,5 +46,6 @@ else
<?php } ?> <?php } ?>
</article> </article>
</section> </section>
<?php include('footer.html') ?>
<body> <body>
</html> </html>