Exemple #1
0
//And the item is due for exchange
//If the exchange is over (case1 or case2)
if ($case1 || $case2) {
    //Print out the rating tool
    $newRating = new Rater($other_id);
    $newRating->output();
} else {
    if ($case3) {
        //Show the pickup countdown
        $newPickup = new Pickup($duedate);
        $newPickup->output();
    } else {
        //If the meeting date has not been determined...
        if ($meetdt == 0) {
            //...show the calender
            $newCal = new Calender(trim($oid));
            $newCal->output();
        } else {
            //...print out the countdown to the meetup
            $newMeetup = new Meetup($meetdt);
            $newMeetup->output();
        }
    }
}
echo "</div>";
//Close the main container
?>
			<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
			<script type="text/javascript" src="/lib/min/?g=js"></script>

<?php 
Exemple #2
0
        $days = $this->getWDay();
        for ($i = 0; $i < $days; $i++) {
            $html .= "<td>&nbsp;</td>";
        }
        return $html;
    }
    //日历末尾填充
    function padLast()
    {
        $html = '';
        $days = 6 - $this->getWday($this->getDays());
        for ($i = 0; $i < $days; $i++) {
            $html .= "<td>&nbsp;</td>";
        }
        return $html;
    }
    //上个月
    function lastMonth()
    {
        $year = $this->date['year'];
        $lastmonth = $this->date['mon'] - 1;
        if ($lastmonth < 1) {
            $year = $year - 1;
            $laetmonth = 1;
        }
        return "<a href='{$_SERVER['PHP_SELF']}?date={$year}-{$lastmonth}'>&lt;&lt;</a>";
    }
}
list($year, $month) = explode('-', $_GET['date']);
$c = new Calender();
echo $c->build($year, $month);
Exemple #3
0
                $html .= "</tr>";
            }
        }
        $html .= "</table>";
        return $html;
    }
    function buildMonth()
    {
        return date('t', mktime(0, 0, 0, $this->month, 1, $this->year));
    }
    function isFirst($day)
    {
        if (date('w', mktime(0, 0, 0, $this->month, $day, $this->year)) == 0) {
            return true;
        }
        return false;
    }
    function isLast($day)
    {
        if (date('w', mktime(0, 0, 0, $this->month, $day, $this->year)) == 6) {
            return true;
        }
        return false;
    }
    function getDay($day)
    {
        return date('w', mktime(0, 0, 0, $this->month, $day, $this->year));
    }
}
$c = new Calender();
echo $c->build();
<?php

namespace vhOrganizer\calender;

class Calender
{
    function __construct($month)
    {
        //$month should be an integer between 1-12
        if (is_int($month)) {
            if ($month > 0 && $month < 13) {
                $this->month = $month;
            } else {
                throw new Exception();
            }
        } else {
            throw new Exception();
        }
    }
    public function returnEmpty()
    {
        require 'content/calender.html';
    }
    public function returnMonth()
    {
    }
}
$calender = new Calender(1);
$calender->returnEmpty();