8385576502c82c412843606ce9a0e4f96c3e067c
[e-DoKo.git] / index.php
1 <!DOCTYPE html PUBLIC
2     "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
3     "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5   <head>
6      <title>e-Doko</title>
7      <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
8      <link rel="stylesheet" type="text/css" href="standard.css" />      
9      <script type="text/javascript">
10        function hl(num) {
11          if(document.getElementById){
12            var i;
13            for(i=1;i<13;i++){
14              if(document.getElementById("trick"+i))
15                document.getElementById("trick"+i).style.display = 'none';
16            }
17            document.getElementById("trick"+num).style.display = 'block';
18          }
19        }
20        function high_last(){
21          if(document.getElementById){
22            var i;
23            for(i=12;i>0;i--) {
24              if(document.getElementById("trick"+i))
25                {
26                  hl(i);
27                  break;
28                }
29            }
30          }
31        }
32      </script>
33   </head>
34 <body onload="high_last();">
35 <div class="header">
36 <h1> Welcome to E-Doko </h1>
37 </div>
38
39 <?php
40 error_reporting(E_ALL);
41      
42 include_once("functions.php");
43 include_once("db.php");
44
45 DB_open();
46
47 /* end header */
48
49 /*****************  M A I N **************************/
50
51 /* check if we want to start a new game */
52 if(isset($_REQUEST["new"]))
53   {
54 ?>
55     <p>Please add 4 names, please make sure that the names are correct! </p>
56        <form action="index.php" method="post">
57    Name:  <input name="PlayerA" type="text" size="10" maxlength="20" /> 
58    Name:  <input name="PlayerB" type="text" size="10" maxlength="20" /> 
59    Name:  <input name="PlayerC" type="text" size="10" maxlength="20" /> 
60    Name:  <input name="PlayerD" type="text" size="10" maxlength="20" /> 
61
62    <input type="submit" value="start game" />
63  </form>
64 <?php
65   } 
66 /* end start a new game */
67
68 /*check if everything is ready to set up a new game */
69 else if( isset($_REQUEST["PlayerA"]) && 
70     isset($_REQUEST["PlayerB"]) && 
71     isset($_REQUEST["PlayerC"]) && 
72     isset($_REQUEST["PlayerD"]) )
73   {
74     $PlayerA = $_REQUEST["PlayerA"];
75     $PlayerB = $_REQUEST["PlayerB"];
76     $PlayerC = $_REQUEST["PlayerC"];
77     $PlayerD = $_REQUEST["PlayerD"];
78     
79     $EmailA  = DB_get_email_by_name($PlayerA);
80     $EmailB  = DB_get_email_by_name($PlayerB);
81     $EmailC  = DB_get_email_by_name($PlayerC);
82     $EmailD  = DB_get_email_by_name($PlayerD);
83     
84     if($EmailA=="" || $EmailB=="" || $EmailC=="" || $EmailD=="")
85       {
86         echo "couldn't find one of the names, please start a new game";
87         exit();
88       }
89     
90     $useridA  = DB_get_userid_by_name($PlayerA);
91     $useridB  = DB_get_userid_by_name($PlayerB);
92     $useridC  = DB_get_userid_by_name($PlayerC);
93     $useridD  = DB_get_userid_by_name($PlayerD);
94     
95     /* create random numbers */
96     $randomNR       = create_array_of_random_numbers();
97     $randomNRstring = join(":",$randomNR);
98     
99     /* create game */
100     $followup = NULL;
101     if(isset($_REQUEST["followup"])) $followup= $_REQUEST["followup"];
102     mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', NULL, NULL,'pre',$followup ,NULL)");
103     $game_id = mysql_insert_id();
104     
105     
106     $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA);
107     $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB);
108     $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC);
109     $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD);
110     
111     /* create hands */
112     mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridA).
113                 ", ".DB_quote_smart($hashA).", 'start','1',NULL,NULL,NULL,'false','false',NULL)");
114     $hand_idA = mysql_insert_id();                                                             
115     mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridB).
116                 ", ".DB_quote_smart($hashB).", 'start','2',NULL,NULL,NULL,'false','false',NULL)");
117     $hand_idB = mysql_insert_id();                                                             
118     mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridC).
119                 ", ".DB_quote_smart($hashC).", 'start','3',NULL,NULL,NULL,'false','false',NULL)");
120     $hand_idC = mysql_insert_id();                                                             
121     mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridD).
122                 ", ".DB_quote_smart($hashD).", 'start','4',NULL,NULL,NULL,'false','false',NULL)");
123     $hand_idD = mysql_insert_id();
124     
125     /* save cards */
126     for($i=0;$i<12;$i++)
127       mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idA', '".$randomNR[$i]."', 'false')");
128     for($i=12;$i<24;$i++)
129       mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idB', '".$randomNR[$i]."', 'false')");
130     for($i=24;$i<36;$i++)
131       mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idC', '".$randomNR[$i]."', 'false')");
132     for($i=36;$i<48;$i++)
133       mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idD', '".$randomNR[$i]."', 'false')");
134
135     /* send out email, check for error with email */
136     $message = "\n".
137       "you are invited to play a game of DoKo (that is to debug the program ;).\n".
138       "Place comments and bug reports here:\n".
139       "http://wiki.nubati.net/index.php?title=EmailDoko\n\n".
140       "The whole round would consist of the following players:\n".
141       "$PlayerA\n".
142       "$PlayerB\n".
143       "$PlayerC\n".
144       "$PlayerD\n\n".
145       "If you want to join this game, please follow this link:\n\n".
146       " ".$host."?me=";
147     
148     mymail($EmailA,"You are invited to a game of DoKo","Hello $PlayerA,\n".$message.$hashA);
149     mymail($EmailB,"You are invited to a game of DoKo","Hello $PlayerB,\n".$message.$hashB);
150     mymail($EmailC,"You are invited to a game of DoKo","Hello $PlayerC,\n".$message.$hashC);
151     mymail($EmailD,"You are invited to a game of DoKo","Hello $PlayerD,\n".$message.$hashD);
152         
153   }    
154 /* end set up a new game */
155
156 else if(isset($_REQUEST["me"]))
157   {
158      /* handle request from one specifig player,
159       * the hash is set on a per game base, so first just handle this game
160       * perhaps also show links to other games in a sidebar
161       */
162     
163     $me = $_REQUEST["me"];
164     
165     $myid = DB_get_userid_by_hash($me);
166     
167     if(!$myid)
168       {
169         echo "Can't find you in the database, please check the url.<br />\n";
170         echo "perhaps the game has been cancled.";
171          exit();
172       }
173     
174     DB_update_user_timestamp($myid);
175     $myname   = DB_get_name_by_hash($me);
176     $mystatus = DB_get_status_by_hash($me);
177
178     /* get game id */
179     $gameid = DB_get_gameid_by_hash($me);
180     
181     switch($mystatus)
182       {
183       case 'start':
184         check_want_to_play($me);
185         DB_set_hand_status_by_hash($me,'init');
186         break;
187         
188       case 'init':
189         if( !isset($_REQUEST["in"]) || !isset($_REQUEST["update"]))
190           {
191             DB_set_hand_status_by_hash($me,'start');
192             echo "you need to answer both question";
193           }
194         else
195           {
196             if($_REQUEST["in"] == "no")
197               {
198                 echo "TODO: email everyone that the game has been canceld<br />";
199                  /*something like
200                  for($i=0;$i<4;$i++)
201                    {
202                      $message = "Hello ".$player[$hash[$i]]["name"].",\n\n".
203                        "the game has been canceled due to the request of one of the players.\n";
204                      mymail($player[$hash[$i]]["email"],"[DoKo-Debug] the game has been canceled",$message); 
205                    }
206                  */
207                 DB_cancel_game($me);
208               }
209             else
210               {
211                 echo "thanks for joining the game... please scroll down";
212                 echo "TODO: make this page nicer<br />";
213                 echo "TODO: set card pref<br />";
214                 
215                 $mycards = DB_get_hand($me);
216                 sort($mycards);
217                 echo "<p class=\"mycards\">your cards are: <br />\n";
218                 foreach($mycards as $card) 
219                   display_card($card);
220                 echo "</p>\n";   
221                 
222                 check_for_sickness($me,$mycards);
223                 
224                 DB_set_hand_status_by_hash($me,'check');
225               }
226            }
227         break;
228         
229       case 'check':
230         echo "no checking at the moment... you need to play a normal game";
231         if(!isset($_REQUEST["solo"])    || 
232            !isset($_REQUEST["wedding"]) ||
233            !isset($_REQUEST["poverty"]) ||
234            !isset($_REQUEST["nines"]) )
235           {
236             DB_set_hand_status_by_hash($me,'init');
237             /* problem: by setting it back to init, variables "in" and "update" are 
238              * not set, so the player will be send back to the start, after seeing his hand
239              */
240             echo "you need to fill out the form";
241           }
242         else
243           {
244             if( $_REQUEST["solo"]!="No")
245               {
246                 DB_set_solo_by_hash($me,$_REQUEST["solo"]);
247                 DB_set_sickness_by_hash($me,"solo");
248               }
249             else if($_REQUEST["wedding"] == "yes")
250               {
251                 echo "wedding was chosen<br />\n";
252                 DB_set_sickness_by_hash($me,"wedding");
253               }
254             else if($_REQUEST["poverty"] == "yes")
255               {
256                 echo "poverty was chosen<br />\n";
257                 DB_set_sickness_by_hash($me,"poverty");
258               }
259             else if($_REQUEST["nines"] == "yes")
260               {
261                 echo "nines was chosen<br />\n";
262                  DB_set_sickness_by_hash($me,"nines");
263               }
264           }
265         DB_set_hand_status_by_hash($me,'poverty');
266         
267         /* check all players and set game to final result, e.g. solo, wedding, povert, redeal */
268         
269         /* reset solo, etc from players who did say something, but it didn't matter? */
270         break;
271       case 'poverty':
272         echo "<br />poverty not handeled at the moment... you need to play a normal game<br />";
273         
274         /* only set this after all poverty, etc. are handeled*/
275         DB_set_hand_status_by_hash($me,'play');
276
277         /* check if the game can start  */
278         $userids = DB_get_all_userid_by_gameid($gameid);
279         $done=1;
280         foreach($userids as $user)
281           if(DB_get_hand_status_by_userid($user)!='play')
282             $done=0;
283
284         if($done)
285           DB_set_game_status_by_gameid($gameid,'play');
286
287         break;
288       case 'play':
289       case 'gameover': /* gameover and play, so that the tricks are visible for both */
290         display_news();
291         display_status();
292                 
293         /* get trick ids */
294         $result = mysql_query("SELECT Hand_Card.card_id as card,".
295                               "       User.fullname as name,".
296                               "       Hand.position as position,".
297                               "       Play.sequence as sequence, ".
298                               "       Hand.hash     as hash,     ".
299                               "       Trick.id ".
300                               "FROM Trick ".
301                               "LEFT JOIN Play ON Trick.id=Play.trick_id ".
302                               "LEFT JOIN Hand_Card ON Play.hand_card_id=Hand_Card.id ".
303                               "LEFT JOIN Hand ON Hand_Card.hand_id=Hand.id ".
304                               "LEFT JOIN User ON User.id=Hand.user_id ".
305                               "WHERE Trick.game_id='".$gameid."' ".
306                               "ORDER BY Trick.id,sequence ASC");
307         
308         
309         $trickNR = 1;
310         
311         $lasttrick = DB_get_max_trickid($gameid);
312         
313         $play = array(); /* needed to calculate winner later  */
314         $seq=1;          
315         $pos=0;
316         
317         echo "\n<ul class=\"oldtrick\">\n";
318         echo "  <li> Hello $myname!   History: </li>\n";
319         
320         while($r = mysql_fetch_array($result,MYSQL_NUM))
321           {
322             $seq   = $r[3];
323             $pos   = $r[2];
324             $trick = $r[5];
325             
326             if($trick!=$lasttrick && $seq==1)
327               {
328                 /* start of an old trick? */
329                 echo "  <li onclick=\"hl('$trickNR');\"><a href=\"#\">Trick $trickNR</a>\n".
330                   "    <div class=\"table\" id=\"trick".$trickNR."\">\n".
331                   "      <img class=\"table\" src=\"pics/table".($pos-1).".png\" alt=\"table\" />\n";
332               }
333             else if($trick==$lasttrick && $seq==1)
334               {
335                 /* start of a last trick? */
336                 echo "  <li onclick=\"hl('$trickNR');\"><a href=\"#\">Current Trick</a>\n".
337                   "    <div class=\"table\" id=\"trick".$trickNR."\">\n".
338                   "      <img class=\"table\" src=\"pics/table".($pos-1).".png\" alt=\"table\" />";
339               }
340             
341             /* display card */
342             echo "      <div class=\"card".($pos-1)."\">\n";
343             
344             $play[$pos]=$r[0];
345             
346             $comment=0;
347             if($comment)
348               echo "        <span class=\"comment\">";
349             else
350               echo "        <span>";
351             
352             /* print name */
353             echo $r[1];
354             
355             /* check for comment */
356             if($comment)
357               echo "<span>".$comment."</span>";
358             echo "</span>\n        ";
359             
360             display_card($r[0]);
361             
362             echo "      </div>\n"; /* end div card */
363             
364             /* end of trick? */
365             if($seq==4)
366               {
367                 $trickNR++;
368                 echo "    </div>\n  </li>\n";  /* end div table, end li table */
369               }
370           }
371         if($seq!=4) 
372           echo "    </div>\n  </li>\n";  /* end div table, end li table */
373         
374         echo "</ul>\n";
375         
376         /* whos turn is it? */
377         if($seq==4)
378           {
379              $winner = get_winner($play); /* returns the position */
380              $next = $winner;
381           }
382         else
383           {
384             $next = $pos+1;
385           }
386         if($next==5) $next=1;
387         
388         /* my turn?, display cards as links, ask for comments*/
389         if(DB_get_pos_by_hash($me) == $next)
390           $myturn = 1;
391         else
392           $myturn = 0;
393
394         if(isset($_REQUEST["comment"]))
395           {
396         
397           }  
398         /* do we want to play a card? */
399         if(isset($_REQUEST["card"]) && $myturn)
400           {
401             $card   = $_REQUEST["card"];
402             $handid = DB_get_handid_by_hash($me); 
403             
404             /* check if we have card and that we haven't played it yet*/
405             /* set played in hand_card to true where hand_id and card_id*/
406             $result = mysql_query("SELECT id FROM Hand_Card WHERE played='false' and ".
407                                   "hand_id='$handid' AND card_id=".DB_quote_smart($card));
408             $r = mysql_fetch_array($result,MYSQL_NUM);
409             $handcardid = $r[0];
410             
411             if($handcardid)
412               {
413                 mysql_query("UPDATE Hand_Card SET played='true' WHERE hand_id='$handid' AND card_id=".DB_quote_smart($card));
414                 
415                 /* get trick id or start new trick */
416                 $a = DB_get_current_trickid($gameid);
417                 $trickid  = $a[0];
418                 $sequence = $a[1];
419                 
420                 DB_play_card($trickid,$handcardid,$sequence);
421                 echo "<div class=\"card\">";
422                 echo " you played  <br />";
423                 display_card($card);
424                 echo "</div>\n";
425                 
426
427                 /*check if we still have cards left, else set status to gameover */
428                 if(sizeof(DB_get_hand($me))==0)
429                   {
430                     DB_set_hand_status_by_hash($me,'gameover');
431                     $mystatus='gameover';
432                   }
433                 
434                 /* if all players are done, set game status also to game over */
435                 $userids = DB_get_all_userid_by_gameid($gameid);
436                 $done=1;
437                 foreach($userids as $user)
438                   if(DB_get_hand_status_by_userid($user)!='gameover')
439                     $done=0;
440
441                 if($done)
442                   DB_set_game_status_by_gameid($gameid,"gameover");
443                 
444                 /* email next player */
445                 if(DB_get_game_status_by_gameid($gameid)=='play')
446                   {
447                     if($sequence==4)
448                       {
449                         $play   = DB_get_cards_by_trick($trickid);
450                         $winner = get_winner($play); /* returns the position */
451                         $next = $winner;
452                       }
453                     else
454                       {
455                         $next = DB_get_pos_by_hash($me)+1;
456                       }
457                     if($next==5) $next=1;
458
459                     echo "TODO: email next player at pos $next <br />";
460                     if($debug)
461                       echo "DEBUG:<a href=\"index.php?me=".DB_get_hash_from_game_and_pos($gameid,$next).
462                         "\"> next player </a> <br />\n";
463
464                   }
465               }
466             else
467               {
468                 echo "couldn't find card <br />\n";
469               }
470           }
471         else if(isset($_REQUEST["card"]) && !$myturn )
472           {
473             echo "please wait until it is your turn! <br />\n";
474           }
475         
476         $mycards = DB_get_hand($me);
477         sort($mycards);
478         echo "<div class=\"mycards\">\n";
479         
480         if($myturn && !isset($_REQUEST["card"]))
481           {
482             echo "Hello ".$myname.", it's your turn!  <br />\n";
483             echo "Your cards are: <br />\n";
484             echo "<form action=\"index.php?me=$me\" method=\"post\">\n";
485             foreach($mycards as $card) 
486               display_link_card($card);
487 ?>
488     <br />A short comments:<input name="comment" type="text" size="30" maxlength="50" /> 
489     <input type="hidden" name="me" value="<?php echo $me; ?>" />
490     <input type="submit" value="move" />
491  </form>
492  <?php
493          }
494         else if($mystatus=='play')
495           {
496             echo "Your cards are: <br />\n";
497             foreach($mycards as $card) 
498               display_card($card);
499           }
500         echo "</div>\n";
501
502         /* check if we need to set status to 'gameover' is done during playing of the card */
503         if($mystatus=='play')
504           break;
505    /* the following happens only when the gamestatus is 'gameover' */
506         /* check if game is over, display results */
507         if(DB_get_game_status_by_gameid($gameid)=='play')
508           {
509             echo "the game is over for you.. other people still need to play though";
510           }
511         else
512           {
513             echo "the game is over now... guess the final score should be displayed here...<br />\n";
514             
515             /* suggest a new game with the same people in it, just rotated once */
516             $names = DB_get_all_names_by_gameid($gameid);
517             
518             echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n";
519             echo "<form action=\"index.php\" methog=\"post\">\n";
520             echo "  <input type=\"hidden\" name=\"PlayerA\" value=\"".($names[1])."\" />\n";
521             echo "  <input type=\"hidden\" name=\"PlayerB\" value=\"".($names[2])."\" />\n";
522             echo "  <input type=\"hidden\" name=\"PlayerC\" value=\"".($names[3])."\" />\n";
523             echo "  <input type=\"hidden\" name=\"PlayerD\" value=\"".($names[0])."\" />\n";
524             echo "  <input type=\"hidden\" name=\"followup\" value=\"".($gameid)."\" />\n";
525             echo "  <input type=\"submit\" value=\"keep playing\" />\n";
526             echo "</form>\n";
527           }
528         break;
529       default:
530         echo "error in testing the status";
531       }
532     exit();
533   } 
534  else if(isset($_REQUEST["email"]) && isset($_REQUEST["password"]))
535   {
536     $ok=1;
537     $uid = DB_get_userid_by_email($_REQUEST["email"]);
538     if(!$uid)
539       $ok=0;
540     if(!DB_get_userid_by_passwd(md5($_REQUEST["password"])))
541       $ok=0;
542
543     if($ok)
544       {
545         $time = DB_get_user_timestamp($uid);
546         $unixtime =strtotime($time);
547         
548         $offset = DB_get_user_timezone($uid);
549         $zone = return_timezone($offset);
550         date_default_timezone_set($zone);
551
552         echo "ok. your logged in, now what? :) <br />last login: ";
553         echo date("r",$unixtime)."<br />";
554
555         DB_update_user_timestamp($uid);
556
557         $names = DB_get_all_names();
558         echo "<p>registered players:<br />\n";
559         foreach ($names as $name)
560           echo "$name <br />\n";
561         echo "</p>\n";
562         echo "<p>Want to start a new game? remember 4 names from the list above and visit ".
563           "<a href=\"http://doko.nubati.net/database/index.php?new\">this page.</a></p>";
564       }
565     else
566       {
567         echo "sorry email and password don't match <br />";
568       }
569     exit();
570   }
571 else if(isset($_REQUEST["register"]) )
572   {
573     echo "TODO: convert timezone into a menu<br />\n";
574     echo "TODO: figure out a way to handle passwrods <br />\n";
575 ?>
576         <form action="index.php" method="post">
577           <fieldset>
578             <legend>Register</legend>
579              <table>
580               <tr>
581                <td><label for="Rfullname">Full name:</label></td>
582                <td><input type="text" id="Rfullname" name="Rfullname" size="20" maxsize="30" /> </td>
583               </tr><tr>
584                <td><label for="Remail">Email:</label></td>
585                <td><input type="text" id="Remail" name="Remail" size="20" maxsize="30" /></td>
586               </tr><tr>
587                <td><label for="Rpassword">Password(will be displayed in cleartext on the next page):</label></td>
588                <td><input type="password" id="Rpassword" name="Rpassword" size="20" maxsize="30" /></td>
589               </tr><tr>
590                <td><label for="Rtimezone">Timezone:</label></td>
591                <td>
592                   <input type="text" id="Rtimezone" name="Rtimezone" size="4" maxsize="4" value="+1" />
593                </td>
594               </tr><tr>
595                <td colspan="2"> <input type="submit" value="register" /></td>
596              </table>
597           </fieldset>
598         </form>
599 <?php
600   }
601 else if(isset($_REQUEST["Rfullname"]) && 
602         isset($_REQUEST["Remail"]   ) && 
603         isset($_REQUEST["Rpassword"]) && 
604         isset($_REQUEST["Rtimezone"]) )
605   {
606         $ok=1;
607         if(DB_get_userid_by_name($_REQUEST["Rfullname"]))
608           {
609             echo "please chose another name<br />";
610             $ok=0;
611           }
612         if(DB_get_userid_by_email($_REQUEST["Remail"]))
613           {
614             echo "this email address is already used ?!<br />";
615             $ok=0;
616           }
617         if($ok)
618           {
619             $r=mysql_query("INSERT INTO User VALUES(NULL,".DB_quote_smart($_REQUEST["Rfullname"]).
620                       ",".DB_quote_smart($_REQUEST["Remail"]).
621                       ",".DB_quote_smart(md5($_REQUEST["Rpassword"])).
622                       ",".DB_quote_smart($_REQUEST["Rtimezone"]).",NULL)"); 
623             
624             if($r)
625               echo "  added you to the database";
626             else
627               echo " something went wrong";
628           }
629   }
630 else
631   { /* no new game, not in a game */
632 ?>
633     <p> If you want to play a game of Doppelkopf, you found the right place ;) </p>
634     <p> Please <a href="index.php?register">register</a>, in case you haven't done yet  <br />
635         or login with you email-address or name and password here:
636         <form action="index.php" method="post">
637           <fieldset>
638             <legend>Login</legend>
639              <table>
640               <tr>
641                <td><label for="email">Email:</label></td><td><input type="text" id="email" name="email" size="20" maxsize="30" /> </td>
642               </tr><tr>
643                <td><label for="password">Password:</label></td><td><input type="password" id="password" name="password" size="20" maxsize="30" /></td>
644               </tr><tr>
645                <td> <input type="submit" value="login" /></td>
646              </table>
647           </fieldset>
648         </form>
649  
650     </p>
651
652
653 <?php
654   }
655 ?>
656 </body>
657 </html>
658
659 <?php
660
661 DB_close();
662
663 /*
664  *Local Variables: 
665  *mode: php
666  *mode: hs-minor
667  *End:
668  */
669 ?>
670
671