当前位置: 首页>>代码示例>>PHP>>正文


PHP DateUtil::findPreviousMonday方法代码示例

本文整理汇总了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.");
     }
 }
开发者ID:ramielrowe,项目名称:Web-Ads,代码行数:28,代码来源:CreateAdHandler.php

示例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;
 }
开发者ID:ramielrowe,项目名称:Web-Ads,代码行数:10,代码来源:WebAdDao.php

示例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;
 }
开发者ID:ramielrowe,项目名称:Web-Ads,代码行数:14,代码来源:ViewAdsBody.php


注:本文中的DateUtil::findPreviousMonday方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。