home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / bale / index.inc < prev    next >
Text File  |  2015-09-21  |  2KB  |  97 lines

  1. <?php
  2. // if you want to do more or less than three months, change that here
  3.  
  4. $nummonths = 3;
  5.  
  6. require("cottonbale.inc");
  7.  
  8. require("dbstart.inc");
  9.  
  10. require("header.inc");
  11.  
  12. // make the dates for the months of the events
  13.  
  14. for ($i=0; $i< ($nummonths + 1); $i++)
  15. {
  16.     $t = mktime(0,0,0,date("m")+$i,1,  date("Y"));
  17.     
  18.     $months[$i] = date("M", $t);
  19.     $years[$i] = date("Y", $t);
  20.     $dates[$i] = date("Y-m-d", $t);
  21. }
  22.  
  23. // now put in the html for the tables
  24.  
  25.  
  26. for ($i=0; $i<$nummonths; $i++)
  27. {
  28.     require("monthhead.inc");
  29.     
  30.     $j = $i + 1;
  31.     
  32.     $query  = "select edate, starttime, endtime, ecity, ename, ";
  33.     $query .= "description from events where edate >= '$dates[$i]' ";
  34.         $query .= "and edate <= '$dates[$j]' order by edate, starttime";
  35.     
  36.     $res = mysql_query($query);
  37.  
  38.     while(list($edate, $start, $end, $city, $name, $descrip)=mysql_fetch_row($res))
  39.     {
  40.  
  41.         echo "<tr><td";
  42.         
  43.         echo $start == 0 ? "><em>" : " class=\"str\">";
  44.         
  45.         echo dateExpand($edate);
  46.  
  47.         echo $start == 0 ? "</em></td><td" : "</td><td";
  48.         
  49.         if ($start == 0)
  50.         {
  51.             echo "><center>-</center>";
  52.         }
  53.         else
  54.         {
  55.             echo " class=\"str\">";
  56.             echo timeExpand($start, true);
  57.             echo "-";
  58.             echo timeExpand($end, true);
  59.             echo "";
  60.         }
  61.         echo "</td><td>$city</td><td>$descrip</td></tr>\n";
  62.         
  63.     }
  64.     
  65.     echo "</table>\n\n\n";
  66. }
  67.  
  68. // put in the bridging html between the table and the groups
  69.  
  70. require("notes.inc");
  71.     
  72. // now put in info about each group; we assume no further markup is needed
  73.  
  74. $query = "select description from groups where outofarea = 0 order by gname";
  75.  
  76. $res = @mysql_query($query);
  77.  
  78. while(list($groupinfo)=@mysql_fetch_row($res))
  79. {
  80.     echo "$groupinfo";
  81. }
  82.  
  83. echo("<p></p><h1 align=\"center\">Groups in Nearby Areas</h1><p></p>");
  84.  
  85. $query = "select description from groups where outofarea = 1 order by gname";
  86.  
  87. $res = @mysql_query($query);
  88.  
  89. while(list($groupinfo)=@mysql_fetch_row($res))
  90. {
  91.     echo "$groupinfo";
  92. }
  93.  
  94. require("footer.inc");
  95.  
  96. ?>
  97.