本文整理汇总了PHP中strToTime函数的典型用法代码示例。如果您正苦于以下问题:PHP strToTime函数的具体用法?PHP strToTime怎么用?PHP strToTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strToTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: displayDatetimeSpan
function displayDatetimeSpan($begin = null, $end = null)
{
$status = false;
if (!$begin) {
$begin = "now";
}
if (!$end) {
$end = "now";
}
$begin = date("U", strToTime($begin));
$end = date("U", strToTime($end));
$span = $end - $begin;
$days = floor($span / 86400);
// seconds in a day
$span = $span % 86400;
$hours = floor($span / 1440);
// minutes in a day
$span = $span % 1440;
$minutes = floor($span / 24);
// hours in a day
$span = $span % 24;
$seconds = floor($span / 1);
// days in a day. HA!
$hours = str_pad($hours, 2, "0", str_pad_left);
$minutes = str_pad($minutes, 2, "0", str_pad_left);
$seconds = str_pad($seconds, 2, "0", str_pad_left);
// $status = "$days days, $hours:$minutes:$seconds";
$status = "{$days} days, {$hours} hours, {$minutes} minutes, {$seconds} seconds";
return $status;
}
开发者ID:reinfurt,项目名称:MOLLYS,代码行数:30,代码来源:displayDatetime.php
示例2: InSeconds
public function InSeconds()
{
$before = date_default_timezone_get();
date_default_timezone_set('UTC');
$seconds = strToTime($this->format('Y-m-d', 'H:i:s'));
date_default_timezone_set($before);
return $seconds;
}
开发者ID:OdysseyDE,项目名称:omer_team_registration,代码行数:8,代码来源:Zeitpunkt.php
示例3: getTime
/**
* Parses time string into time format used by plugin view
* @param string $timeStr
* @return string
*/
public static function getTime($timeStr)
{
if ($timeStr != "" && substr($timeStr, 0, strlen("0000-00-00")) != "0000-00-00") {
return date("d.m.Y / H:i", strToTime($timeStr));
} else {
return "";
}
}
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:13,代码来源:Utils.php
示例4: InSeconds
public function InSeconds()
{
$before = date_default_timezone_get();
date_default_timezone_set('UTC');
$seconds = strToTime($this . ' 00:00:00');
date_default_timezone_set($before);
return $seconds;
}
开发者ID:OdysseyDE,项目名称:omer_team_registration,代码行数:8,代码来源:Datum.php
示例5: outputShortDate
/**
* Shorten date
*
* @param date $date (optional)
* @return supplied (or current) date in format 2012-04-02 converted to string
*/
public static function outputShortDate($date = null)
{
if ($date == null) {
$date = Zend_Date::now();
}
$date = strToTime($date);
$date = new Zend_Date($date);
return $date->toString('y-MM-dd');
}
开发者ID:Ewaldaz,项目名称:Be-your-light,代码行数:15,代码来源:Date.php
示例6: createDays
public static function createDays($schId)
{
$db = Database::getInstance();
$weekId = Week::getLastId();
$schedule = Schedule::getSchedule($schId);
$sql = "INSERT INTO day (weekId, startTime, shiftDate) VALUES (:weekId, :startTime, :shiftDate)";
for ($i = 0; $i < 7; $i++) {
$shift = date('Y-m-d', strToTime("+" . $i . " days", strToTime($schedule['startDate'])));
$result = $db->prepare($sql);
$result->execute(array(":weekId" => $weekId, ":startTime" => null, ":shiftDate" => $shift));
}
}
开发者ID:mhender24,项目名称:WebScheduler,代码行数:12,代码来源:week.php
示例7: update
public static function update($iter)
{
$db = Database::getInstance();
$sql = "Update day SET startTime = :start WHERE id = :id";
$result = $db->prepare($sql);
if ($_POST['start_time_arr'][$iter] == "X") {
$start = null;
} else {
$start = date('H:i:s', strToTime($_POST['start_time_arr'][$iter]));
}
$result->execute(array(":start" => $start, ":id" => $_POST['day_id_arr'][$iter]));
}
开发者ID:mhender24,项目名称:WebScheduler,代码行数:12,代码来源:day.php
示例8: period
/**
* Calculate period between two dates
* If the ending date is not supplied current datetime is taken
*
* @param string $start
* @param string $end (optional)
* @param bool $formatSeconds If set to false will not format seconds to string (optional)
* @return string time period
*/
public static function period($start, $end = null, $formatSeconds = true)
{
if ($end == null) {
$end = Zend_Date::now();
}
$start = new Zend_Date(strToTime($start));
$end = new Zend_Date(strToTime($end));
$difference = $start->sub($end);
if ($formatSeconds) {
return Game_View_Helper_Date::formatSeconds($difference->toValue());
} else {
return $difference->toValue();
}
}
开发者ID:Ewaldaz,项目名称:Be-your-light,代码行数:23,代码来源:Date.php
示例9: smarty_modifier_newmark
function smarty_modifier_newmark($time, $format = '')
{
static $now, $period, $count;
$time = is_numeric($time) ? (int) $time : strToTime($time);
$retval = $format == '' ? '' : smarty_modifier_date_format($time, $format);
if ($now == null) {
$now = time();
$day = 60 * 60 * 24;
$period = array($day, $day * 7);
$count = count($period);
}
for ($i = 0; $i < $count; ++$i) {
if ($now < $time + $period[$i]) {
$retval .= sprintf('<em class="new%d">new!</em>', $i + 1);
break;
}
}
return $retval;
}
开发者ID:hiroki-namekawa,项目名称:test-upr,代码行数:19,代码来源:modifier.newmark.php
示例10: mailRemainderAction
public function mailRemainderAction()
{
$xDay = 3;
$countPerPeriod = 3;
$select = $this->getDb()->select()->from('User', 'id')->from('UserSettings')->where('User.createdAt > ?', date(DATE_ISO8601, strtotime(' - ' . $xDay . ' day')))->where('User.id = UserSettings.userId')->where('UserSettings.name = ?', Model_Verificator_Mail::SETTINGS_MAIL);
foreach ($select->query()->fetchAll(PDO::FETCH_COLUMN) as $userId) {
$user = $this->getTable('User')->find($userId)->current();
$sTime = $this->getTable('UserSettings')->getSettings(Model_Verificator_Mail::SETTINGS_CHANGET_AT, $user);
$this->getLog()->info($user->username . ' LastSend at: ' . $sTime->value);
$lastSendInPeriodPart = (time() - strToTime($sTime->value)) / (3600 * 24 * $xDay / $countPerPeriod);
if ($lastSendInPeriodPart >= 1) {
//no send to often
if ($this->getHelper('EmailVerification')->send($user)) {
$this->getLog()->info("Sent");
}
} else {
$this->getLog()->info("No sent: part " . number_format($lastSendInPeriodPart, 2));
}
}
}
开发者ID:kandy,项目名称:HamsterCMF,代码行数:20,代码来源:IndexController.php
示例11: getRangeOfDates
/**
* Given a starting date and a number of periods, return an array of dates
* where the first date is the last day of the month of the first period
* and every subsequent date is the last day of the following month
*
* @param String $date starting date
* @param int $count number of periods to compute
*
* @return array
*/
public static function getRangeOfDates($date, $count)
{
// the first date is the first of the following month
$month = date("m", strToTime($date)) + 1;
$year = date("Y", strToTime($date));
if ($month == 13) {
$month = 1;
$year++;
}
$dateTime = new DateTime($year . "-" . $month . "-01");
$dateTime->modify("-1 day");
$dates = array($dateTime->format("Y-m-d"));
// now, iterate $count - 1 times adding one month to each
for ($x = 1; $x < $count; $x++) {
$dateTime->modify("+1 day");
$dateTime->modify("+1 month");
$dateTime->modify("-1 day");
array_push($dates, $dateTime->format("Y-m-d"));
}
return $dates;
}
开发者ID:jedrennen,项目名称:intacctws-php,代码行数:31,代码来源:api_util.php
示例12: getBucket
public function getBucket($bucket, $prefix = null, $marker = null, $maxKeys = null)
{
$get = new S3Object('GET', $bucket, '');
if ($prefix !== null) {
$get->setParameter('prefix', $prefix);
}
if ($marker !== null) {
$get->setParameter('marker', $marker);
}
if ($maxKeys !== null) {
$get->setParameter('max-keys', $maxKeys);
}
$get = $get->getResponse($this);
$contents = array();
if (isset($get->body->Contents)) {
foreach ($get->body->Contents as $c) {
$contents[(string) $c->Key] = array('size' => (int) $c->Size, 'time' => strToTime((string) $c->LastModified), 'hash' => substr((string) $c->ETag, 1, -1));
}
}
return $get->code == 200 ? $contents : false;
}
开发者ID:enormego,项目名称:EightPHP,代码行数:21,代码来源:s3.php
示例13: mysql_query
<script src="js/jquery.js"></script>
<style type="text/css"></style>
<script src="js/jquery-ui.js"></script>
<script src="js/inputs.js"></script>
<script src="js/flot.js"></script>
<script src="js/functions.js"></script>
</head>
<body>
<div id="wrapper">
<!--USER PANEL-->
<?php
$login_query = mysql_query("SELECT * FROM {$server_adb}.account WHERE username = '" . mysql_real_escape_string($_SESSION["username"]) . "'");
$login2 = mysql_fetch_assoc($login_query);
$joindate = date("d.m.Y ", strToTime($login2['joindate']));
$uI = mysql_query("SELECT avatar FROM {$server_db}.users WHERE id = '" . $login2['id'] . "'");
$userInfo = mysql_fetch_assoc($uI);
?>
<div id="usr-panel">
<div class="av-overlay"></div>
<img src="<?php
echo $website['root'];
?>
images/avatars/2d/<?php
echo $account_extra['avatar'];
?>
" id="usr-av">
<div id="usr-info">
<span id="usr-name"><?php
echo $account_extra['firstName'];
开发者ID:nerfqxx,项目名称:wowqxweb,代码行数:31,代码来源:info.php
示例14: __
<input type="submit" value="<?php
echo __('Report');
?>
" />
</form>
<hr />
<?php
if ($action == '') {
return;
}
#####################################################################
$t = (int) strToTime("{$month_d} months", $t);
$num_days = (int) date('t', $t);
$y = (int) date('Y', $t);
$m = (int) date('n', $t);
$today_day = (int) date('j', $t);
?>
<?php
/*
<div id="chart" style="position:absolute; left:189px; right:12px; top:14em; bottom:10px; overflow:scroll; border:1px solid #ccc; background:#fff;">
*/
?>
<script type="text/javascript">
function chart_fullscreen_toggle()
开发者ID:philipp-kempgen,项目名称:amooma-gemeinschaft-pbx,代码行数:31,代码来源:stats_qclassical.php
示例15: setCharts
//.........这里部分代码省略.........
switch ($type) {
case 'videodvd':
$query = "INSERT INTO {$tbl_1d_videodvd_charts} (\n\t\t\t\t\t\t\t\tChartID,\n\t\t\t\t\t\t\t\tNo,\n\t\t\t\t\t\t\t\tType,\n\t\t\t\t\t\t\t\tFilm,\n\t\t\t\t\t\t\t\tWeeks,\n\t\t\t\t\t\t\t\ttsWhen\n\t\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($film) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEK']) . " )";
break;
case 'kino':
$query = "INSERT INTO {$tbl_1d_kino_charts} (\n\t\t\t\t\t\t\t\tChartID,\n\t\t\t\t\t\t\t\tNo,\n\t\t\t\t\t\t\t\tType,\n\t\t\t\t\t\t\t\tFilm,\n\t\t\t\t\t\t\t\tBoxOffice,\n\t\t\t\t\t\t\t\tcumBoxOffice,\n\t\t\t\t\t\t\t\tWeeks,\n\t\t\t\t\t\t\t\tScreens,\n\t\t\t\t\t\t\t\ttsWhen\n\t\t\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($film) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['BO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['CBO']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['SCREENS']) . ",\n\t\t\t\t\t\t\t\t" . dbQuote($PARAM['WEEK']) . " )";
break;
}
} else {
switch ($type) {
case 'videodvd':
$query = "UPDATE {$tbl_1d_videodvd_charts} SET\n\t\t\t\t\t\t\t\tChartID = " . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\tNo = " . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\tType = " . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\tFilm = " . dbQuote($film) . ",\n\t\t\t\t\t\t\t\tWeeks = " . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\ttsWhen = " . dbQuote($PARAM['WEEK']) . " \n\t\t\t\t\t\t\tWHERE ID = " . dbQuote($PARAM['id']);
break;
case 'kino':
$query = "UPDATE {$tbl_1d_kino_charts} SET\n\t\t\t\t\t\t\t\tChartID = " . dbQuote($PARAM['PLACES']) . ",\n\t\t\t\t\t\t\t\tNo = " . dbQuote($PARAM['NO']) . ",\n\t\t\t\t\t\t\t\tType = " . dbQuote($PARAM['TYPE']) . ",\n\t\t\t\t\t\t\t\tFilm = " . dbQuote($film) . ",\n\t\t\t\t\t\t\t\tBoxOffice = " . dbQuote($PARAM['BO']) . ",\n\t\t\t\t\t\t\t\tcumBoxOffice = " . dbQuote($PARAM['CBO']) . ",\n\t\t\t\t\t\t\t\tWeeks = " . dbQuote($PARAM['WEEKS']) . ",\n\t\t\t\t\t\t\t\tScreens = " . dbQuote($PARAM['SCREENS']) . ",\n\t\t\t\t\t\t\t\ttsWhen = " . dbQuote($PARAM['WEEK']) . " \n\t\t\t\t\t\t\tWHERE ID = " . dbQuote($PARAM['id']);
break;
}
}
$result = runQuery($query, 'setCharts()', 'SAVE_CHART');
$SUBS['COMMAND'] = $PARAM['cmd'] . "&err=20107&PLACES=" . $PARAM['PLACES'] . "&WHEN=" . $PARAM['WEEK'] . "&WEEK=" . $PARAM['WEEK'];
printPage('_admin_done.htmlt');
return;
} else {
$SUBS['ERROR'] = fileParse('_admin_error.htmlt');
}
}
////----[Mrasnika's] Edition 12.10.2002
if ($PARAM['WHEN']) {
$PARAM['Year1'] = date('Y', $PARAM['WHEN']);
$PARAM['Month1'] = date('m', $PARAM['WHEN']);
$PARAM['Day1'] = date('d', $PARAM['WHEN']);
} else {
if ($PARAM['Day1'] && $PARAM['Month1'] && $PARAM['Year1']) {
$PARAM['WHEN'] = 1 + strToTime($PARAM['Day1'] . ' ' . $MONTHS2[$PARAM['Month1']] . ' ' . $PARAM['Year1']);
} else {
$PARAM['WHEN'] = getNextWeek();
}
}
$SUBS['PREV'] = week($PARAM['WHEN']) - 518400;
$SUBS['NEXT'] = week($PARAM['WHEN']) + 1026800;
//show charts records
switch ($type) {
case 'kino':
$query = "SELECT\t{$tbl_1d_kino_charts}.ID,\n\t\t\t\tChartID,\n\t\t\t\tNo,\n\t\t\t\tType,\n\t\t\t\tFilm,\n\t\t\t\tBoxOffice,\n\t\t\t\tcumBoxOffice,\n\t\t\t\tWeeks,\n\t\t\t\tScreens,\n\t\t\t\ttsWhen,\n\t\t\t\t\n\t\t\t\t{$tbl_1d_films}.Title,\n\t\t\t\t{$tbl_1d_films}.OriginalTitle\n\n\t\t\t\tFROM {$tbl_1d_kino_charts}\n\t\t\t\tLEFT JOIN {$tbl_1d_films}\n\t\t\t\t\tON {$tbl_1d_kino_charts}.Type = 'list'\n\t\t\t\t\t\tAND {$tbl_1d_films}.ID = {$tbl_1d_kino_charts}.Film\n\t\t\t\tWHERE {$tbl_1d_kino_charts}.ChartID = " . dbQuote($PARAM['PLACES']) . "\n\t\t\t\t\tAND {$tbl_1d_kino_charts}.tsWhen >= " . week($PARAM['WHEN']) . "\n\t\t\t\t\tAND {$tbl_1d_kino_charts}.tsWhen <= (" . week($PARAM['WHEN']) . "+604799)\n\t\t\t\tORDER BY {$tbl_1d_kino_charts}.No,\n\t\t\t\t\t{$tbl_1d_kino_charts}.BoxOffice";
break;
case 'videodvd':
$query = "SELECT\t{$tbl_1d_videodvd_charts}.ID,\n\t\t\t\tChartID,\n\t\t\t\tNo,\n\t\t\t\tType,\n\t\t\t\tFilm,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\tWeeks,\n\t\t\t\ttsWhen,\n\t\t\t\t\n\t\t\t\t{$tbl_1d_films}.Title,\n\t\t\t\t{$tbl_1d_films}.OriginalTitle\n\n\t\t\t\tFROM {$tbl_1d_videodvd_charts}\n\t\t\t\tLEFT JOIN {$tbl_1d_films}\n\t\t\t\t\tON {$tbl_1d_videodvd_charts}.Type = 'list'\n\t\t\t\t\t\tAND {$tbl_1d_films}.ID = {$tbl_1d_videodvd_charts}.Film\n\t\t\t\tWHERE {$tbl_1d_videodvd_charts}.ChartID = " . dbQuote($PARAM['PLACES']) . "\n\t\t\t\t\tAND {$tbl_1d_videodvd_charts}.tsWhen >= " . week($PARAM['WHEN']) . "\n\t\t\t\t\tAND {$tbl_1d_videodvd_charts}.tsWhen <= (" . week($PARAM['WHEN']) . "+604799)\n\t\t\t\tORDER BY {$tbl_1d_videodvd_charts}.No ";
break;
}
$result = runQuery($query, 'setCharts()', 'GET_CHART_RECORDS');
while ($row = db_fetch_row($result)) {
$SUBS['CHECK'] = $row[0];
$SUBS['CHARTID'] = $row[1];
$SUBS['NO2'] = sprintf("%02d", $row[2]);
if ($row[3] == 'list') {
if ($row[10]) {
$SUBS['TITLE'] = htmlEncode($row[10]);
} else {
$SUBS['TITLE'] = htmlEncode($row[11]);
}
$SUBS['MOVIE'] = $SUBS['ACTION'] . "?cmd=insertfilm&ID={$row['4']}";
} else {
$SUBS['TITLE'] = htmlEncode($row[4]);
$SUBS['MOVIE'] = "javascript:alert('{$MSG['20031']}')";
}
$SUBS['PRATI'] = $row[9];
开发者ID:kktsvetkov,项目名称:1double.com,代码行数:67,代码来源:admin.php
示例16: affiche_abs
function affiche_abs($potache)
{
global $dtajadebut, $dtajafin;
//$potache=$_POST["eleve"];
$horaire = array("M1", "M2", "M3", "M4", "M5", "S1", "S2", "S3", "S4", "S5");
$nbabs = 0;
$nbrtd = 0;
foreach ($horaire as $cle => $val) {
$rq4 = "SELECT count(*) FROM absences WHERE uidprof='{$_SESSION['login']}' AND {$val}='A' AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ";
$result4 = mysqli_query($dbc, $rq4) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
while ($nb = mysqli_fetch_array($result4, MYSQLI_NUM)) {
$nbabs += $nb[0];
}
$rq5 = "SELECT count(*) FROM absences WHERE uidprof='{$_SESSION['login']}' AND {$val}='R' AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ";
$result5 = @mysqli_query($GLOBALS["___mysqli_ston"], $rq5) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
while ($nb = mysqli_fetch_array($result5, MYSQLI_NUM)) {
$nbrtd += $nb[0];
}
}
//fin foreach $horaire
if ($nbabs > 0) {
echo "<h3 class='perso'><i>" . $nbabs . "h d'absence - ";
} else {
echo "<h3 class='perso'><i>Aucune absence - ";
}
if ($nbrtd > 0) {
if ($nbrtd > 1) {
echo $nbrtd . " retards <br /></i>";
} else {
echo $nbrtd . " retard <br /></i>";
}
} else {
echo "Aucun retard <br /></i>";
}
$rq = "SELECT DATE_FORMAT(date,'%d/%m/%Y'),M1,motifM1,M2,motifM2,M3,motifM3,M4,motifM4,M5,motifM5,\n S1,motifS1,S2,motifS2,S3,motifS3,S4,motifS4,S5,motifS5,date FROM absences WHERE uidprof='{$_SESSION['login']}' \n AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ORDER BY date ASC";
// lancer la requete
$result = mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
// Combien y a-t-il d'enregistrements ?
$nb2 = mysqli_num_rows($result);
while ($ligne = mysqli_fetch_array($result, MYSQLI_NUM)) {
$typmat = "";
foreach ($horaire as $cle => $val) {
if ($ligne[2 * $cle + 1] == A) {
$typmat .= " : absence en {$val} ( " . utf8_encode($ligne[2 * $cle + 2]) . " )";
} elseif ($ligne[2 * $cle + 1] == R) {
$typmat .= " : retard en {$val} ( " . utf8_encode($ligne[2 * $cle + 2]) . " )";
} else {
$typmat .= "";
}
}
echo " - Le " . LeJour(strToTime($ligne[21])) . " " . $ligne[0] . " " . $typmat . "<br />";
}
echo '</h3>';
}
开发者ID:rhertzog,项目名称:lcs,代码行数:54,代码来源:bilan.php
示例17: addslashes
$address1 = addslashes($address1);
$city = addslashes($city);
$state = addslashes($state);
$zip = addslashes($zip);
$country = addslashes($country);
$phone = addslashes($phone);
$email = addslashes($email);
$begin = addslashes($begin);
$end = addslashes($end);
$body = addslashes($body);
$notes = addslashes($notes);
}
// Process variables
if (!$name1) {
$name1 = "Untitled";
}
$begin = $begin ? date("Y-m-d H:i:s", strToTime($begin)) : NULL;
$end = $end ? date("Y-m-d H:i:s", strToTime($end)) : NULL;
// Add object to database
$sql = "INSERT INTO objects (\n\t\t\tcreated, modified, \n\t\t\tname1, name2, \n\t\t\taddress1, city, state, zip, country, \n\t\t\tphone, email, \n\t\t\tbegin, end, \n\t\t\tbody, notes) \n\t\tVALUES ('" . date("Y-m-d H:i:s") . "', '" . date("Y-m-d H:i:s") . "', \n\t\t\t'{$name1}', '{$name2}', \n\t\t\t'{$address1}', '{$city}', '{$state}', '{$zip}', '{$country}', \n\t\t\t'{$phone}', '{$email}', \n\t\t\t'{$begin}', '{$end}', \n\t\t\t'{$body}', '{$notes}'\n\t\t)";
$result = MYSQL_QUERY($sql);
$insertId = MYSQL_INSERT_ID();
/////////////
// WIRES //
/////////////
$sql = "INSERT INTO wires (\n\t\t\tcreated, modified, \n\t\t\tfromid, toid\n\t\t) \n\t\tVALUES('" . date("Y-m-d H:i:s") . "', '" . date("Y-m-d H:i:s") . "', \n\t\t\t'{$object}', '{$insertId}'\n\t\t)";
$result = MYSQL_QUERY($sql);
echo "Object added successfully.<br /><br />";
echo "<a href='" . $dbAdmin . "browse.php" . urlData() . "'>CONTINUE...</a>";
}
require_once "GLOBAL/foot.php";
开发者ID:O-R-G,项目名称:o-r-g.com,代码行数:31,代码来源:add.php
示例18: _normalizeDatesToISO8601
protected function _normalizeDatesToISO8601($data)
{
$date_fields = array('created_at', 'updated_at');
foreach ($date_fields as $key) {
if (!array_key_exists($key, $data)) {
continue;
}
$data[$key] = date(DATE_ISO8601, strToTime($data[$key]));
}
return $data;
}
开发者ID:benmccormick,项目名称:analytics-magento,代码行数:11,代码来源:Data.php
示例19: while
// Display table format
$html = "<table cellpadding='10' border='1' width='900px'>";
// Column headers
$html .= "<tr style='background-color:#CCCCCC;'>";
$html .= "<td width='200px'>NAME</td>";
$html .= "<td width='300px'>ADDRESS</td>";
$html .= "<td width='300px'>EMAIL</td>";
$html .= "<td width='100px'>BEGIN / END</td>";
$html .= "</tr>";
// Data
while ($myrow = MYSQL_FETCH_ARRAY($result)) {
$html .= "<tr style='background-color:#" . ($rowcolor % 2 ? "E9E9E9" : "EFEFEF") . ";'>";
$html .= "<td>" . $myrow['name1'] . " " . $myrow['name2'] . "</td>";
$html .= "<td>" . $myrow['address1'] . "<br />" . $myrow['city'] . " " . $myrow['state'] . " " . $myrow['zip'] . "<br />" . $myrow['country'] . "</td>";
$html .= "<td>" . $myrow['email'] . "</td>";
$html .= "<td>" . date("Y M j", strToTime($myrow['begin'])) . "<br />" . date("Y M j", strToTime($myrow['end'])) . "</td>";
$html .= "</tr>";
$rowcolor++;
$rownumber++;
}
$html .= "</table>";
$html .= "<br />{$rownumber} total results found.";
echo $html;
}
echo "<br /><br />";
if ($report) {
echo "<a href='report.php?object={$object}&csv=1' target='_new'>EXPORT CSV . . .</a> ";
}
if ($report) {
echo "<a href='report.php?object={$object}&emails=1' target='_new'>EXPORT EMAILS . . .</a> ";
}
开发者ID:O-R-G,项目名称:o-r-g.com,代码行数:31,代码来源:report_.php
示例20: week
function week($ts = 0)
{
if ($ts == 0) {
$ts = time();
}
$friday = getDate($ts);
if ($friday['wday'] < 5) {
$friday = -2 - $friday['wday'];
} else {
$friday = 5 - $friday['wday'];
}
//$today = $ts - date('s', $ts) - date('i')*60 - date('H')*3600+2;
//$today = $ts;
$today = $ts - date('s', $ts) - date('i', $ts) * 60 - date('H', $ts) * 3600 + 1;
////----[Mrasnika's] Edition 31.10.2002
//return $friday = $today + $friday*86400 ;
$friday = $today + $friday * 86400;
$ret = 1 + strToTime(date('d F Y', $friday));
return $ret;
}
开发者ID:kktsvetkov,项目名称:1double.com,代码行数:20,代码来源:shared.inc.php
注:本文中的strToTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论