All pastes #493885 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-18 00:10 UTC
rendered paste body
$dow = intval(strftime("%u"));
    if ($dow == 1) // monday
    {
      $monday = strtotime("today");
    }
    else
    {
      $monday = strtotime("last monday");
    }
    
    $startdate = strftime("%Y-%m-%d %H:%M", $monday);

    $sunday = strtotime("+6 days", $monday);
    $enddate = strftime("%Y-%m-%d %H:%M", $sunday);


    $sql = "select *, DATE_FORMAT(received, '%w'),price, title, venue as day_of_week from weekcalendar order by day_of_week";
    $res = mysql_query($sql) or die( mysql_error() );
    while ($row = mysql_fetch_assoc($res))
    {
      $date = strftime("%m/%d", $row["received"]);
      $d = intval(strftime("%u", $row["received"]));
 
        $currentday = $row["received"];
        print strftime("%A", $row["receivedepoch"]) . "<br />";
      
      print "&bull; {$date} <font color='#FF00FF'>Event: </font><a href='weekevents.php?mode=view&amp;id={$row[id]}'>{$row[title]}</a></font>ent_type]} <font color='#FF00FF'>price: </font>{$row[price]}<font color='#FF00FF'> Venue: </font>{$row[venue]}<br />\n";
    } print "<BR><br>";
    print <<<KEY