本文整理汇总了PHP中createDate函数的典型用法代码示例。如果您正苦于以下问题:PHP createDate函数的具体用法?PHP createDate怎么用?PHP createDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editPage
function editPage($id)
{
include_once 'login.php';
include_once 'database_conn.php';
include_once 'showEventFunction.php';
$pageHeader = "Event Edit Page";
$sql = "SELECT * FROM te_events WHERE eventID = {$id}";
$rslt = mysqli_query($conn, $sql) or die(mysqli_error($conn));
// error message return if return empty result
$row = mysqli_fetch_row($rslt);
$venues = getFromDb($conn, "SELECT * FROM te_venue");
$categories = getFromDb($conn, "SELECT * FROM te_category");
$output = "<h1>{$pageHeader}</h1>";
$i = 1;
$output .= "<form id=\"editForm\" action=\"handleEditPage.php\" method=\"post\">";
$output .= "<table border=0 >";
$output .= createRowData("Title", createTextField("title", $row[$i++]));
$output .= createRowData("Description", createTextArea("desc", $row[$i++], 5, 40));
$output .= createRowData("Venue Name", createCombobox("venue", $row[$i++], $venues));
$output .= createRowData("Category", createCombobox("category", $row[$i++], $categories));
$output .= createRowData("Start Time", createDate("startTime", $row[$i++]));
$output .= createRowData("End Time", createDate("endTime", $row[$i++]));
$output .= createRowData("Price", createTextField("price", $row[$i++]));
$output .= "<tr><td><input type=\"submit\" name=\"submit\" value=\"Submit\"></td></tr>";
$output .= "<input type=\"hidden\" name=\"e_id\" value=\"{$id}\">";
$output .= "</table></form>";
mysqli_free_result($rslt);
mysqli_close($conn);
return $output;
}
示例2: getCountPerWeek
/**
*
* Counts holidays per week for a given timeframe.
* @param int $domain
* @param int $start
* @param int $end
* @return multitype:number
*/
public static function getCountPerWeek($domain, $start, $end)
{
$holidays = HolidayQuery::create()->filterByDomain($domain)->filterByDate($start, Criteria::GREATER_EQUAL)->filterByDate($end, Criteria::LESS_EQUAL)->find();
$holidaysWeeks = array();
foreach ($holidays as $holiday) {
$date = createDate($holiday->getDate());
$key = $date->format('W-Y');
if (array_key_exists($key, $holidaysWeeks)) {
$holidaysWeeks[$key] = $holidaysWeeks[$key] + 1;
} else {
$holidaysWeeks[$key] = 1;
}
}
return $holidaysWeeks;
}
示例3: searchPage
function searchPage()
{
include_once 'login.php';
include_once 'database_conn.php';
include_once 'showEventFunction.php';
$pageHeader = "Search Page";
$backURL = "<br/><a href = \"index.php\">Back to Home</a>";
$venues = getFromDb($conn, "SELECT * FROM te_venue");
$categories = getFromDb($conn, "SELECT * FROM te_category");
$output = "<h1>{$pageHeader}</h1>";
$output .= "<form id=\"searchForm\" action=\"handleSearchPage.php\" method=\"post\">";
$output .= "<table border=0 >";
$output .= createRowData("Title", createTextField("title", ""));
$output .= createRowData("Venue Name", createCombobox("venue", "", $venues));
$output .= createRowData("Category", createCombobox("category", "", $categories));
$output .= createRowData("Start Time", createDate("startTime", ""));
$output .= createRowData("End Time", createDate("endTime", ""));
$output .= createRowData("Price", createTextField("price", ""));
$output .= "<tr><td><input type=\"submit\" name=\"submit\" value=\"Search\"></td></tr>";
$output .= "</table></form>";
return $output . $backURL;
}
示例4: preg_match
preg_match("|\\[status:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches);
$listUpdates->upd_comments[$i] = ereg_replace("\\[status:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>");
$listUpdates->upd_comments[$i] .= $strings["status"] . " " . $status[$matches[1]];
}
if (ereg("\\[priority:([0-9])\\]", $listUpdates->upd_comments[$i])) {
preg_match("|\\[priority:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches);
$listUpdates->upd_comments[$i] = ereg_replace("\\[priority:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>");
$listUpdates->upd_comments[$i] .= $strings["priority"] . " " . $priority[$matches[1]];
}
if (ereg("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", $listUpdates->upd_comments[$i])) {
preg_match("|\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]|i", $listUpdates->upd_comments[$i], $matches);
$listUpdates->upd_comments[$i] = ereg_replace("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", "", $listUpdates->upd_comments[$i] . "<br>");
$listUpdates->upd_comments[$i] .= $strings["due_date"] . " " . $matches[1];
}
$abbrev = substr($listUpdates->upd_comments[$i], 0, 100);
echo "<b>" . $j . ".</b> <i>" . createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession']) . "</i> {$abbrev}";
if (100 < strlen($listUpdates->upd_comments[$i])) {
echo "...<br>";
} else {
echo "<br>";
}
$j++;
}
echo "<br>" . buildLink("../meetings/historymeeting.php?type=1&item={$id}", $strings["show_details"], LINK_INSIDE);
} else {
echo $strings["no_items"];
}
echo "</td></tr>";
$block1->closeContent();
$block1->closeToggle();
$block1->closeForm();
示例5: request
<?php
#Application name: PhpCollab
#Status page: 0
$checkSession = "true";
include "../includes/library.php";
include "../includes/jpgraph/jpgraph.php";
include "../includes/jpgraph/jpgraph_gantt.php";
$tmpquery = "WHERE tas.id = '" . $task . "'";
$taskDetail = new request();
$taskDetail->openTasks($tmpquery);
$tmpquery = "WHERE pro.id = '" . $taskDetail->tas_project[0] . "'";
$projectDetail = new request();
$projectDetail->openProjects($tmpquery);
$projectDetail->pro_created[0] = createDate($projectDetail->pro_created[0], $timezoneSession);
$projectDetail->pro_name[0] = str_replace('"', '"', $projectDetail->pro_name[0]);
$projectDetail->pro_name[0] = str_replace("'", "'", $projectDetail->pro_name[0]);
$graph = new GanttGraph();
$graph->SetBox();
$graph->SetMarginColor("white");
$graph->SetColor("white");
$graph->title->Set($strings["task"] . " " . $taskDetail->tas_name[0]);
$graph->subtitle->Set("(" . $strings["created"] . ": " . $taskDetail->tas_created[0] . ")");
$graph->title->SetFont(FF_FONT1);
$graph->SetColor("white");
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT0);
$graph->scale->year->SetFont(FF_FONT1);
$tmpquery = "WHERE subtas.task = '{$task}' AND subtas.start_date != '--' AND subtas.due_date != '--' AND tas.published != '1' ORDER BY subtas.due_date";
$listTasks = new request();
示例6: buildLink
//--- header ---
$breadcrumbs[] = buildLink("../clients/listclients.php?", $strings["organizations"], LINK_INSIDE);
$breadcrumbs[] = $strings["organizations"];
//--- content ----
require_once "../themes/" . THEME . "/header.php";
$block1 = new block();
$block1->form = "ecD";
$block1->openForm("../projects/listprojects.php#" . $block1->form . "Anchor");
$block1->headingToggle($strings["organization"] . " : " . $clientDetail->org_name[0]);
$block1->openPaletteIcon();
$block1->paletteIcon(0, "remove", $strings["delete"]);
$block1->paletteIcon(1, "edit", $strings["edit"]);
$block1->closePaletteIcon();
$block1->openContent();
$block1->contentTitle($strings["details"]);
$block1->contentRow($strings["name"], $clientDetail->org_name[0]);
$block1->contentRow($strings["address"], $clientDetail->org_address1[0]);
$block1->contentRow($strings["phone"], $clientDetail->org_phone[0]);
$block1->contentRow($strings["url"], buildLink($clientDetail->org_url[0], $clientDetail->org_url[0], LINK_OUT));
$block1->contentRow($strings["email"], buildLink($clientDetail->org_email[0], $clientDetail->org_email[0], LINK_MAIL));
$block1->contentTitle($strings["details"]);
$block1->contentRow($strings["comments"], nl2br($clientDetail->org_comments[0]));
$block1->contentRow($strings["created"], createDate($clientDetail->org_created[0], $_SESSION['timezoneSession']));
$block1->closeContent();
$block1->closeToggle();
$block1->closeForm();
$block1->openPaletteScript();
$block1->paletteScript(0, "remove", "../clients/deleteclients.php?id=" . $clientDetail->org_id[0] . "", "true,true,false", $strings["delete"]);
$block1->paletteScript(1, "edit", "../clients/editclient.php?id=" . $clientDetail->org_id[0] . "", "true,true,false", $strings["edit"]);
$block1->closePaletteScript("", "");
require_once "../themes/" . THEME . "/footer.php";
示例7: array
$block1->openForm("../reports/listreports.php#" . $block1->form . "Anchor");
$block1->heading($strings["my_reports"]);
$block1->openPaletteIcon();
$block1->paletteIcon(0, "add", $strings["add"]);
$block1->paletteIcon(1, "remove", $strings["delete"]);
$block1->closePaletteIcon();
$block1->sorting("reports", $sortingUser->sor_reports[0], "rep.name ASC", $sortingFields = array(0 => "rep.name", 1 => "rep.created"));
$tmpquery = "WHERE rep.owner = '" . $_SESSION['idSession'] . "' ORDER BY {$block1->sortingValue}";
$listReports = new request();
$listReports->openReports($tmpquery);
$comptListReports = count($listReports->rep_id);
if ($comptListReports != "0") {
$block1->openResults();
$block1->labels($labels = array(0 => $strings["name"], 1 => $strings["created"]), "false");
for ($i = 0; $i < $comptListReports; $i++) {
$block1->openRow($listReports->rep_id[$i]);
$block1->checkboxRow($listReports->rep_id[$i]);
$block1->cellRow(buildLink("../reports/resultsreport.php?id=" . $listReports->rep_id[$i], $listReports->rep_name[$i], LINK_INSIDE));
$block1->cellRow(createDate($listReports->rep_created[$i], $_SESSION['timezoneSession']));
}
$block1->closeResults();
} else {
$block1->noresults();
}
$block1->closeFormResults();
$block1->block_close();
$block1->openPaletteScript();
$block1->paletteScript(0, "add", "../reports/createreport.php?", "true,true,true", $strings["add"]);
$block1->paletteScript(1, "remove", "../reports/deletereports.php?", "false,true,true", $strings["delete"]);
$block1->closePaletteScript($comptListReports, $listReports->rep_id);
require_once "../themes/" . THEME . "/footer.php";
示例8: block
}
$block0->closeContent();
$block0->block_close();
if ($comptListProjects != "0") {
for ($j = 0; $j < $comptListProjects; $j++) {
$projectTitle = $listProjects->pro_name[$j];
$projectId = $listProjects->pro_id[$j];
$projectPriority = $listProjects->pro_priority[$j];
$blockProject = new block();
$blockProject->headingForm(buildLink("../projects/viewproject.php?id=" . $projectId, $projectTitle, LINK_INSIDE));
$blockProject->openContent();
// correct order????
$blockProject->contentTitle($strings["details"]);
$blockProject->contentRow($strings["priority"], "<img src=\"../themes/" . THEME . "/gfx_priority/" . $projectPriority . ".gif\" alt=\"\"> " . $priority[$projectPriority]);
$blockProject->contentRow($strings["created"], createDate($listProjects->pro_created[$j], $_SESSION['timezoneSession']));
$blockProject->contentRow($strings["modified"], createDate($listProjects->pro_modified[$j], $_SESSION['timezoneSession']));
if ($listProjects->pro_org_id[$j] == "1") {
$blockProject->contentRow($strings["organization"], $strings["none"]);
} else {
$blockProject->contentRow($strings["organization"], buildLink("../clients/viewclient.php?id=" . $listProjects->pro_org_id[$j], $listProjects->pro_org_name[$j], LINK_INSIDE));
}
$blockProject->contentRow($strings["status"], $status[$listProjects->pro_status[$j]]);
$queryTask = " WHERE tas.project = '{$projectId}'";
$tmpqueryTask = "{$queryTask} ORDER BY tas.due_date";
$blockProject->closeContent();
$blockProject->heading_close();
$listTasks = new request();
$listTasks->openTasks($tmpqueryTask);
$comptListTasks = count($listTasks->tas_id);
$blockProject->openResults("false");
$blockProject->labels($labels = array(0 => $strings["task"], 1 => $strings["priority"], 2 => $strings["status"], 3 => $strings["due_date"], 4 => $strings["completed"], 5 => $strings["assigned_to"], 6 => $strings["published"]), "true");
示例9: buildLink
}
}
$block1->contentRow($strings["project"], buildLink("../projects/viewproject.php?id=" . $requestDetail->sr_project[0], $requestDetail->sr_pro_name[0], LINK_INSIDE));
$block1->contentRow($strings["subject"], $requestDetail->sr_subject[0]);
$block1->contentRow($strings["priority"], $requestPriority);
$block1->contentRow($strings["status"], $status);
$block1->contentRow($strings["date"], $requestDetail->sr_date_open[0]);
$block1->contentRow($strings["user"], buildLink($requestDetail->sr_mem_email_work[0], $requestDetail->sr_mem_name[0], LINK_MAIL));
$block1->contentRow($strings["message"], nl2br($requestDetail->sr_message[0]));
$block1->contentTitle($strings["responses"]);
if ($teamMember == "true" || $_SESSION['profilSession'] != "0") {
$block1->contentRow("", buildLink("../support/addpost.php?id=" . $requestDetail->sr_id[0], $strings["add_support_response"], LINK_INSIDE));
}
for ($i = 0; $i < $comptListPosts; $i++) {
$block1->contentRow($strings["posted_by"], buildLink($listPosts->sp_mem_email_work[$i], $listPosts->sp_mem_name[$i], LINK_MAIL));
$block1->contentRow($strings["date"], createDate($listPosts->sp_date[$i], $_SESSION['timezoneSession']));
if ($teamMember == "true" || $_SESSION['profilSession'] == "0") {
$block1->contentRow(buildLink("../support/deleterequests.php?action=deleteP&id=" . $listPosts->sp_id[$i], $strings["delete_message"], LINK_INSIDE), nl2br($listPosts->sp_message[$i]));
} else {
$block1->contentRow("", nl2br($listPosts->sp_message[$i]));
}
$block1->contentRow("", "", "true");
}
if ($status == $requestStatus[0]) {
$status = "new";
} elseif ($status == $requestStatus[1]) {
$status = "open";
} elseif ($status == $requestStatus[2]) {
$status = "complete";
}
$block1->closeContent();
示例10: request
exit;
}
$bouton[5] = "over";
$titlePage = $strings["bulletin_board_topic"];
require_once "include_header.php";
$tmpquery = "WHERE pos.topic = '" . $detailTopic->top_id[0] . "' ORDER BY pos.created DESC";
$listPosts = new request();
$listPosts->openPosts($tmpquery);
$comptListPosts = count($listPosts->pos_id);
$idStatus = $detailTopic->top_status[0];
echo "<table cellspacing=\"0\" width=\"90%\" cellpadding=\"3\">\n<tr><th colspan=\"4\">" . $strings["information"] . ":</th></tr>\n<tr><th>" . $strings["subject"] . ":</th><td>" . $detailTopic->top_subject[0] . "</td><th>" . $strings["posts"] . ":</th><td>" . $detailTopic->top_posts[0] . "</td></tr>\n<tr><th>" . $strings["project"] . ":</th><td>" . $projectDetail->pro_name[0] . "</td><th>" . $strings["last_post"] . ":</th><td>" . createDate($detailTopic->top_last_post[0], $_SESSION['timezoneSession']) . "</td></tr>\n<tr><th> </th><td> </td><th>" . $strings["retired"] . ":</th><td>{$statusTopicBis[$idStatus]}</td></tr>\n<tr><th>" . $strings["owner"] . ":</th><td colspan=\"3\"><a href=\"mailto:" . $detailTopic->top_mem_email_work[0] . "\">" . $detailTopic->top_mem_login[0] . "</a></td></tr>\n<tr><td colspan=\"4\"> </td></tr>\n<tr><th colspan=\"4\">" . $strings["discussion"] . ":</th></tr>\n<tr><td colspan=\"4\" align=\"right\"><a href=\"threadpost.php?id={$id}\">" . $strings["post_reply"] . "</a></td></tr>";
if ($comptListPosts != "0") {
for ($i = 0; $i < $comptListPosts; $i++) {
if (!($i % 2)) {
$class = "odd";
} else {
$class = "even";
}
echo "<tr><td colspan=\"4\" class=\"{$class}\"> </td></tr>\n<tr class=\"{$class}\"><th>" . $strings["posted_by"] . " :</th><td>" . $listPosts->pos_mem_name[$i] . "</td><td colspan=\"2\" align=\"right\">";
if ($detailProject->pro_owner[0] == $_SESSION['idSession'] || $_SESSION['profilSession'] == "0" || $listPosts->pos_member[$i] == $_SESSION['idSession']) {
echo "<a href=\"../projects_site/showallthreads.php?id={$id}&action=delete&post=" . $listPosts->pos_id[$i] . "\">" . $strings["delete_message"] . "</a>";
} else {
echo " ";
}
echo "</td></tr>\n<tr class=\"{$class}\"><th>" . $strings["email"] . " :</th><td colspan=\"3\"><a href=\"mailto:" . $listPosts->pos_mem_email_work[$i] . "\">" . $listPosts->pos_mem_email_work[$i] . "</a></td></tr>\n<tr class=\"{$class}\"><th nowrap>" . $strings["when"] . " :</th><td colspan=\"3\">" . createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']) . "</td></tr>\n<tr class=\"{$class}\"><th>" . $strings["message"] . " :</th><td colspan=\"3\">" . nl2br($listPosts->pos_message[$i]) . "</td></tr>";
}
} else {
echo "<tr><td colspan=\"4\" class=\"ListOddRow\">" . $strings["no_items"] . "</td></tr>";
}
echo "</table>";
require_once "include_footer.php";
示例11: request
}
if ($taskDetail->tas_start_date[0] != "") {
echo "<tr><td>" . $strings["start_date"] . " :</td><td>" . $taskDetail->tas_start_date[0] . "</td></tr>";
}
if ($taskDetail->tas_due_date[0] != "") {
echo "<tr><td>" . $strings["due_date"] . " :</td><td>" . $taskDetail->tas_due_date[0] . "</td></tr>";
}
echo "<tr><td>" . $strings["updates_task"] . " :</td><td>";
$tmpquery = "WHERE upd.type='1' AND upd.item = '{$id}' ORDER BY upd.created DESC";
$listUpdates = new request();
$listUpdates->openUpdates($tmpquery);
$comptListUpdates = count($listUpdates->upd_id);
if ($comptListUpdates != "0") {
$j = 1;
for ($i = 0; $i < $comptListUpdates; $i++) {
echo "<b>" . $j . ".</b> <i>" . createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession']) . "</i><br>" . nl2br($listUpdates->upd_comments[$i]);
echo "<br>";
$j++;
}
} else {
echo $strings["no_items"];
}
echo "</td></tr>\n</table>\n<hr>";
echo "<form accept-charset=\"UNKNOWN\" method=\"post\" action=\"../projects_site/clienttaskdetail.php?action=update\" name=\"clientTaskUpdate\" enctype=\"multipart/form-data\"><input name=\"id\" type=\"HIDDEN\" value=\"{$id}\">";
echo "<table cellspacing=\"0\" cellpadding=\"3\">\n<tr><th colspan=\"2\">" . $strings["client_change_status"] . "</th></tr>\n<tr><td>" . $strings["status"] . " :</td><td>";
if ($taskDetail->tas_status[0] == "0") {
echo "<input checked value=\"checkbox\" name=\"checkbox\" type=\"checkbox\">";
} else {
echo "<input value=\"checkbox\" name=\"checkbox\" type=\"checkbox\">";
}
echo " {$status['0']}</td></tr>\n<tr valign=\"top\"><td>" . $strings["comments"] . " :</td><td><textarea cols=\"40\" name=\"comments\" rows=\"5\">" . $taskDetail->tas_comments[0] . "</textarea></td></tr><tr align=\"top\"><td> </td><td><input name=\"submit\" type=\"submit\" value=\"" . $strings["save"] . "\"></td></tr>\n</table>\n</form>";
示例12:
<?php
require 'dbadapter.php';
include_once 'header.php';
if (createBill("bill", 300, 15, 1)) {
echo "<p>Bill created</p>";
}
if (createDate("trash", 21, 1)) {
echo "<p>Date created</p>";
}
if (createPurchase("Dish Soap", 21, "2014-10-06", 1, 1)) {
echo "<p>Purchase created</p>";
}
if (createRoom(50, 1, 1)) {
echo "<p>Room created</p>";
}
include_once 'footer.php';
示例13: count
$comptListTopics = count($listTopics->top_id);
if ($comptListTopics != "0") {
$block1->openResults();
$block1->labels($labels = array(0 => $strings["topic"], 1 => $strings["owner"], 2 => $strings["posts"], 3 => $strings["last_post"], 4 => $strings["status"], 5 => $strings["published"]), "true");
for ($i = 0; $i < $comptListTopics; $i++) {
$idStatus = $listTopics->top_status[$i];
$idPublish = $listTopics->top_published[$i];
$block1->openRow();
$block1->checkboxRow($listTopics->top_id[$i]);
$block1->cellRow($blockPage->buildLink("../topics/viewtopic.php?id=" . $listTopics->top_id[$i], $listTopics->top_subject[$i], in));
$block1->cellRow($blockPage->buildLink($listTopics->top_mem_email_work[$i], $listTopics->top_mem_login[$i], mail));
$block1->cellRow($listTopics->top_posts[$i]);
if ($listTopics->top_last_post[$i] > $lastvisiteSession) {
$block1->cellRow("<b>" . createDate($listTopics->top_last_post[$i], $timezoneSession) . "</b>");
} else {
$block1->cellRow(createDate($listTopics->top_last_post[$i], $timezoneSession));
}
$block1->cellRow($statusTopic[$idStatus]);
if ($sitePublish == "true") {
$block1->cellRow($statusPublish[$idPublish]);
}
$block1->closeRow();
}
$block1->closeResults();
} else {
$block1->noresults();
}
$block1->closeFormResults();
$block1->openPaletteScript();
if ($teamMember == "true") {
$block1->paletteScript(0, "add", "../topics/addtopic.php?project=" . $projectDetail->pro_id[0] . "", "true,true,true", $strings["add"]);
示例14: buildLink
}
$block1->headingForm($strings["post_to_discussion"] . " : " . $detailTopic->top_subject[0]);
$block1->openContent();
$block1->contentTitle($strings["info"]);
$block1->contentRow($strings["project"], buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0] . " (#" . $projectDetail->pro_id[0] . ")", LINK_INSIDE));
$block1->contentRow($strings["organization"], $projectDetail->pro_org_name[0]);
$block1->contentRow($strings["owner"], buildLink("../users/viewuser.php?id=" . $projectDetail->pro_mem_id[0], $projectDetail->pro_mem_name[0], LINK_INSIDE) . " (" . buildLink($projectDetail->pro_mem_email_work[0], $projectDetail->pro_mem_login[0], LINK_MAIL) . ")");
if ($sitePublish == "true") {
$block1->contentRow($strings["published"], $statusPublish[$idPublish]);
}
$block1->contentRow($strings["retired"], $statusTopicBis[$idStatus]);
$block1->contentRow($strings["posts"], $detailTopic->top_posts[0]);
$block1->contentRow($strings["last_post"], createDate($detailTopic->top_last_post[0], $_SESSION['timezoneSession']));
$block1->contentTitle($strings["details"]);
$block1->contentRow($strings["message"], "<textarea rows=\"10\" style=\"width: 400px; height: 160px;\" name=\"tpm\" cols=\"47\"></textarea>");
$block1->contentRow("", "<input type=\"SUBMIT\" value=\"" . $strings["save"] . "\">");
$block1->contentTitle($strings["posts"]);
for ($i = 0; $i < $comptListPosts; $i++) {
$block1->contentRow($strings["posted_by"], buildLink($listPosts->pos_mem_email_work[$i], $listPosts->pos_mem_name[$i], LINK_MAIL));
if ($listPosts->pos_created[$i] > $_SESSION['lastvisiteSession']) {
$block1->contentRow($strings["when"], "<b>" . createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']) . "</b>");
} else {
$block1->contentRow($strings["when"], createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']));
}
$block1->contentRow("", nl2br($listPosts->pos_message[$i]));
$block1->contentRow("", "", "true");
}
$block1->closeContent();
$block1->headingForm_close();
$block1->closeForm();
require_once "../themes/" . THEME . "/footer.php";
示例15: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$client = new Client();
$crawler = $client->request('GET', 'http://www.cmc.edu/news/events');
$status_code = $client->getResponse()->getStatus();
if ($status_code == 200) {
echo '200 OK<br>';
}
$time2 = null;
$crawler->filter('div.article')->each(function ($node) {
$title = trimWhiteSpace($node->filter('h4')->text());
//title
$url = "http://www.cmc.edu" . $node->filter('h4 a')->attr('href');
//url
$times = $node->filter('p span')->each(function ($node2, $count) {
//save the values of time in array
if ($count = 0 && $node2->attr('content')) {
$times[0] = $node2->attr('content');
return $times;
}
if ($count = 1 && $node2->attr('content')) {
$times[1] = $node2->attr('content');
return $times;
}
$count++;
});
$times = array_slice(array_filter($times), 0);
//array gets messy, cleaned up
$time1 = substr(str_replace("T", " ", $times[0][1]), 0, -6);
//remove T, and remove last 6 digits of time
$date = substr($time1, 0, 10);
//get date of start
if (isset($times[1][1])) {
$time2 = substr(str_replace("T", " ", $times[1][1]), 0, -6);
//second time
}
echo "<br>";
$id = DB::table('email_articles')->where('post_date', $date)->value('article_id');
if (EventAndNews::where('title', '=', $title)->exists()) {
echo $title . " already exists";
} else {
$event = new EventAndNews();
$event->article_id = $id;
$event->title = $title;
$event->url = $url;
$event->time1 = $time1;
if (isset($time2)) {
$event->time2 = $time2;
}
$event->type = 'event';
$event->save();
echo "stored!";
}
});
$client = new Client();
$crawler = $client->request('GET', 'http://www.cmc.edu/news/news-releases');
$status_code = $client->getResponse()->getStatus();
if ($status_code == 200) {
echo '200 OK<br>';
}
$crawler->filter('div.view-content > div')->each(function ($node) {
$imgUrl = null;
$title = $node->filter('h4 a')->text();
//title
$url = "http://www.cmc.edu" . $node->filter('h4 a')->attr('href');
//url
if ($node->filter('a img')->count()) {
$imgUrl = $node->filter('img')->attr('src');
//img src
}
$date = $node->filter('p')->text();
$date = createDate($date);
//date
$id = DB::table('email_articles')->where('post_date', $date)->value('article_id');
if (EventAndNews::where('title', '=', $title)->exists()) {
echo $title . " exists";
echo "<br>";
} else {
$event = new EventAndNews();
$event->article_id = $id;
$event->title = $title;
$event->url = $url;
if (isset($imgUrl)) {
$event->imgUrl = $imgUrl;
}
$event->time1 = $date;
$event->type = 'news';
$event->save();
echo "stored: " . $title;
}
});
}