moved more stuff from index.php to output.php
authorarun <arun@nubati.net>
Fri, 15 Dec 2006 11:26:22 +0000 (11:26 +0000)
committerarun <arun>
Fri, 15 Dec 2006 11:26:22 +0000 (11:26 +0000)
index.php
output.php

index 20ca7faf5e7d609df4bfecc261d002fe4869428c..cf556803ad17b6f8a84f9ac26b4baf21594064d8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,44 +1,4 @@
-<!DOCTYPE html PUBLIC
-    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
-    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-  <head>
-     <title>e-Doko</title>
-     <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
-     <link rel="stylesheet" type="text/css" href="css/standard.css" /> 
-     <script type="text/javascript">
-       function hl(num) {
-         if(document.getElementById){
-          var i;
-          for(i=1;i<13;i++){
-            if(document.getElementById("trick"+i))
-              document.getElementById("trick"+i).style.display = 'none';
-          }
-          document.getElementById("trick"+num).style.display = 'block';
-        }
-       }
-       function high_last(){
-        if(document.getElementById){
-          var i;
-          for(i=12;i>0;i--) {
-            if(document.getElementById("trick"+i))
-              {
-                hl(i);
-                break;
-              }
-          }
-        }
-       }
-     </script>
-  </head>
-<body onload="high_last();">
-<div class="header">
-<h1> Welcome to E-Doko </h1>
-</div>
-
 <?php
 <?php
-/* end header */
-
 error_reporting(E_ALL);
 
 include_once("config.php");     
 error_reporting(E_ALL);
 
 include_once("config.php");     
@@ -49,6 +9,8 @@ include_once("functions.php");   /* the rest */
 DB_open();
 
 /*****************  M A I N **************************/
 DB_open();
 
 /*****************  M A I N **************************/
+output_header();
+
 
 /* check if we want to start a new game */
 if(isset($_REQUEST["new"]))
 
 /* check if we want to start a new game */
 if(isset($_REQUEST["new"]))
@@ -685,11 +647,8 @@ else
   { /* no new game, not in a game */
     home_page();
   }
   { /* no new game, not in a game */
     home_page();
   }
-?>
-</body>
-</html>
 
 
-<?php
+output_footer();
 
 DB_close();
 
 
 DB_close();
 
index a2f91e4606210771c9748f46ac90f355c8004aa4..68cfb28f7fa96fdc3eda723c448853ec78dcf999 100644 (file)
@@ -168,4 +168,56 @@ function home_page()
  return;
 }
 
  return;
 }
 
+function output_header()
+{
+?>
+<!DOCTYPE html PUBLIC
+    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
+    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+  <head>
+     <title>e-Doko</title>
+     <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
+     <link rel="stylesheet" type="text/css" href="css/standard.css" /> 
+     <script type="text/javascript">
+       function hl(num) {
+         if(document.getElementById){
+          var i;
+          for(i=1;i<13;i++){
+            if(document.getElementById("trick"+i))
+              document.getElementById("trick"+i).style.display = 'none';
+          }
+          document.getElementById("trick"+num).style.display = 'block';
+        }
+       }
+       function high_last(){
+        if(document.getElementById){
+          var i;
+          for(i=12;i>0;i--) {
+            if(document.getElementById("trick"+i))
+              {
+                hl(i);
+                break;
+              }
+          }
+        }
+       }
+     </script>
+  </head>
+<body onload="high_last();">
+<div class="header">
+<h1> Welcome to E-Doko </h1>
+</div>
+
+<?php
+  return;
+}
+
+function output_footer()
+{
+  echo "</body>\n";
+  echo "</html>\n";
+
+  return;
+}
 ?>
\ No newline at end of file
 ?>
\ No newline at end of file