本文整理汇总了PHP中DateUtil::findPreviousMonday方法的典型用法代码示例。如果您正苦于以下问题:PHP DateUtil::findPreviousMonday方法的具体用法?PHP DateUtil::findPreviousMonday怎么用?PHP DateUtil::findPreviousMonday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateUtil
的用法示例。
在下文中一共展示了DateUtil::findPreviousMonday方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleForm
public function handleForm($context, $action)
{
if ($action == "createAd") {
if (isset($_POST['start']) && $_POST['start'] != "" && (isset($_POST['size']) && $_POST['size'] != "") && (isset($_POST['name']) && $_POST['name'] != "") && (isset($_POST['url']) && $_POST['url'] != "")) {
$start = $_POST['start'];
$end = $_POST['end'];
$dayOfWeek = date("D", strtotime($start));
$splitStart = explode("/", $start);
$mysqlStart = $splitStart[2] . "-" . $splitStart[0] . "-" . $splitStart[1];
$splitEnd = explode("/", $end);
$mysqlEnd = $splitEnd[2] . "-" . $splitEnd[0] . "-" . $splitEnd[1];
if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
$filename = $this->saveSampleImage($context, $_FILES['image'], SessionUtil::getUsername());
if ($filename != "") {
WebAdDao::createWebAd($_POST['name'], DateUtil::findPreviousMonday($mysqlStart), $_POST['size'], $filename, $_POST['url'], $mysqlStart, $mysqlEnd);
} else {
$context->addError("Error Uploading File, Please Try Again.");
}
} else {
$context->addError("No File Uploaded.");
}
} else {
$context->addError("Required Field Left Blank.");
}
} else {
$context->addError("Incorrect Action.");
}
}
示例2: getAdsByDay
public static function getAdsByDay($date)
{
$query = "SELECT * FROM " . Database::addPrefix('webads') . " WHERE StartingMonday = '" . DateUtil::findPreviousMonday($date) . "'";
$result = Database::doQuery($query);
$webads = array();
while ($row = mysql_fetch_assoc($result)) {
$webads[] = WebAdDao::makeAd($row);
}
return $webads;
}
示例3: generateMondaySelectForm
public function generateMondaySelectForm()
{
$select = "<form action=\"./index.php?pageid=viewAds\" method=\"POST\">\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"setPageVar\">\n\t\t\t<select name=\"monday\" class=\"bluefocus\">";
$mondays = WebAdDao::getDistinctMondays();
foreach ($mondays as $monday) {
if (DateUtil::findPreviousMonday($this->startingMonday) == $monday) {
$select = $select . "<option value=\"" . $monday . "\" selected=\"selected\">" . $monday . "</option>";
} else {
$select = $select . "<option value=\"" . $monday . "\">" . $monday . "</option>";
}
}
$select = $select . "</select> <input type=\"submit\" value=\"Go\" class=\"stdbutton bluefocus\" \\></form>";
return $select;
}