All pastes #492474 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-17 06:02 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 *, unix_timestamp(received) as receivedepoch from weekcalendar order by received";
    $res = mysql_query($sql);
    while ($row = mysql_fetch_assoc($res))
    {
      $date = strftime("%m/%d", $row["receivedepoch"]);
      $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 color='#FF00FF'>Type:</font> {$row[event_type]} <font color='#FF00FF'>price: </font>{$row[price]}<br />\n";
    } print "<BR><br>";
    print <<<KEY