本文整理汇总了PHP中strtotime函数的典型用法代码示例。如果您正苦于以下问题:PHP strtotime函数的具体用法?PHP strtotime怎么用?PHP strtotime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strtotime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test
public function test(CqmPatient $patient, $beginDate, $endDate)
{
// See if user has been a tobacco user before or simultaneosly to the encounter within two years (24 months)
$date_array = array();
foreach ($this->getApplicableEncounters() as $encType) {
$dates = Helper::fetchEncounterDates($encType, $patient, $beginDate, $endDate);
$date_array = array_merge($date_array, $dates);
}
// sort array to get the most recent encounter first
$date_array = array_unique($date_array);
rsort($date_array);
// go through each unique date from most recent
foreach ($date_array as $date) {
// encounters time stamp is always 00:00:00, so change it to 23:59:59 or 00:00:00 as applicable
$date = date('Y-m-d 23:59:59', strtotime($date));
$beginMinus24Months = strtotime('-24 month', strtotime($date));
$beginMinus24Months = date('Y-m-d 00:00:00', $beginMinus24Months);
// this is basically a check to see if the patient is an reported as an active smoker on their last encounter
if (Helper::check(ClinicalType::CHARACTERISTIC, Characteristic::TOBACCO_USER, $patient, $beginMinus24Months, $date)) {
return true;
} else {
if (Helper::check(ClinicalType::CHARACTERISTIC, Characteristic::TOBACCO_NON_USER, $patient, $beginMinus24Months, $date)) {
return false;
} else {
// nothing reported during this date period, so move on to next encounter
}
}
}
return false;
}
开发者ID:katopenzz,项目名称:openemr,代码行数:30,代码来源:Denominator.php
示例2: dateDiff
function dateDiff($start, $end)
{
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
}
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:7,代码来源:ReadOnly.php
示例3: getDatesBetween
public function getDatesBetween($dStart, $dEnd)
{
if ($dStart > $dEnd) {
$var = $dStart;
$dStart = $dEnd;
$dEnd = $var;
}
$iStart = strtotime($dStart);
$iEnd = strtotime($dEnd);
if (false === $iStart || false === $iEnd) {
return false;
}
$aStart = explode('-', $dStart);
$aEnd = explode('-', $dEnd);
if (count($aStart) !== 3 || count($aEnd) !== 3) {
return false;
}
if (false === checkdate($aStart[1], $aStart[2], $aStart[0]) || false === checkdate($aEnd[1], $aEnd[2], $aEnd[0]) || $iEnd < $iStart) {
return false;
}
for ($i = $iStart; $i < $iEnd + 86400; $i = strtotime('+1 day', $i)) {
$sDateToArr = strftime('%Y-%m-%d', $i);
$sYear = substr($sDateToArr, 0, 4);
$sMonth = substr($sDateToArr, 5, 2);
//$aDates[$sYear][$sMonth][]=$sDateToArr;
$aDates[] = $sDateToArr;
}
if (isset($aDates) && !empty($aDates)) {
return $aDates;
} else {
return false;
}
}
开发者ID:NadaNafti,项目名称:Thalassa,代码行数:33,代码来源:Library.php
示例4: collectData
public function collectData(array $param)
{
$html = $this->file_get_html('http://www.maliki.com/') or $this->returnError('Could not request Maliki.', 404);
$count = 0;
$latest = 1;
$latest_title = "";
$latest = $html->find('div.conteneur_page a', 1)->href;
$latest_title = $html->find('div.conteneur_page img', 0)->title;
function MalikiExtractContent($url)
{
$html2 = $this->file_get_html($url);
$text = 'http://www.maliki.com/' . $html2->find('img', 0)->src;
$text = '<img alt="" src="' . $text . '"/><br>' . $html2->find('div.imageetnews', 0)->plaintext;
return $text;
}
$item = new \Item();
$item->uri = 'http://www.maliki.com/' . $latest;
$item->title = $latest_title;
$item->timestamp = time();
$item->content = MalikiExtractContent($item->uri);
$this->items[] = $item;
foreach ($html->find('div.boite_strip') as $element) {
if (!empty($element->find('a', 0)->href) and $count < 3) {
$item = new \Item();
$item->uri = 'http://www.maliki.com/' . $element->find('a', 0)->href;
$item->title = $element->find('img', 0)->title;
$item->timestamp = strtotime(str_replace('/', '-', $element->find('span.stylepetit', 0)->innertext));
$item->content = MalikiExtractContent($item->uri);
$this->items[] = $item;
$count++;
}
}
}
开发者ID:ORelio,项目名称:rss-bridge,代码行数:33,代码来源:MalikiBridge.php
示例5: calculateGFRResult
function calculateGFRResult()
{
$tmpArr = array();
$tmpArr[] = date('Y-m-d H:i:s');
//observation time
$tmpArr[] = 'GFR (CALC)';
//desc
$gender = NSDR::populate($this->_patientId . "::com.clearhealth.person.displayGender");
$crea = NSDR::populate($this->_patientId . "::com.clearhealth.labResults[populate(@description=CREA)]");
$genderFactor = null;
$creaValue = null;
$personAge = null;
$raceFactor = 1;
switch ($gender[key($gender)]) {
case 'M':
$genderFactor = 1;
break;
case 'F':
$genderFactor = 0.742;
break;
}
if ((int) strtotime($crea['observation_time']) >= strtotime('now - 60 days') && strtolower($crea[key($crea)]['units']) == 'mg/dl') {
$creaValue = $crea[key($crea)]['value'];
}
$person = new Person();
$person->personId = $this->_patientId;
$person->populate();
if ($person->age > 0) {
$personAge = $person->age;
}
$personStat = new PatientStatistics();
$personStat->personId = $this->_patientId;
$personStat->populate();
if ($personStat->race == "AFAM") {
$raceFactor = 1.21;
}
$gfrValue = "INC";
if ($personAge > 0 && $creaValue > 0) {
$gfrValue = "" . (int) round(pow($creaValue, -1.154) * pow($personAge, -0.203) * $genderFactor * $raceFactor * 186);
}
trigger_error("gfr:: " . $gfrValue, E_USER_NOTICE);
$tmpArr[] = $gfrValue;
// lab value
$tmpArr[] = 'mL/min/1.73 m2';
//units
$tmpArr[] = '';
//ref range
$tmpArr[] = '';
//abnormal
$tmpArr[] = 'F';
//status
$tmpArr[] = date('Y-m-d H:i:s') . '::' . '0';
// observationTime::(boolean)normal; 0 = abnormal, 1 = normal
$tmpArr[] = '0';
//sign
//$this->_calcLabResults[uniqid()] = $tmpArr;
$this->_calcLabResults[1] = $tmpArr;
// temporarily set index to one(1) to be able to include in selected lab results
return $tmpArr;
}
开发者ID:dragonlet,项目名称:clearhealth,代码行数:60,代码来源:CalcLabs.php
示例6: PMA_printGitRevision
/**
* Prints details about the current Git commit revision
*
* @return void
*/
function PMA_printGitRevision()
{
if (!$GLOBALS['PMA_Config']->get('PMA_VERSION_GIT')) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
return;
}
// load revision data from repo
$GLOBALS['PMA_Config']->checkGitRevision();
// if using a remote commit fast-forwarded, link to GitHub
$commit_hash = substr($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH'), 0, 7);
$commit_hash = '<strong title="' . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_MESSAGE')) . '">' . $commit_hash . '</strong>';
if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTECOMMIT')) {
$commit_hash = '<a href="' . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/commit/' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH')) . '" target="_blank">' . $commit_hash . '</a>';
}
$branch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH');
if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTEBRANCH')) {
$branch = '<a href="' . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/tree/' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH')) . '" target="_blank">' . $branch . '</a>';
}
if ($branch !== false) {
$branch = sprintf(__('%1$s from %2$s branch'), $commit_hash, $branch);
} else {
$branch = $commit_hash . ' (' . __('no branch') . ')';
}
$committer = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER');
$author = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR');
PMA_printListItem(__('Git revision:') . ' ' . $branch . ',<br /> ' . sprintf(__('committed on %1$s by %2$s'), PMA_Util::localisedDate(strtotime($committer['date'])), '<a href="' . PMA_linkURL('mailto:' . $committer['email']) . '">' . htmlspecialchars($committer['name']) . '</a>') . ($author != $committer ? ', <br />' . sprintf(__('authored on %1$s by %2$s'), PMA_Util::localisedDate(strtotime($author['date'])), '<a href="' . PMA_linkURL('mailto:' . $author['email']) . '">' . htmlspecialchars($author['name']) . '</a>') : ''), 'li_pma_version_git', null, null, null);
}
开发者ID:graurus,项目名称:testgit_t37,代码行数:33,代码来源:display_git_revision.lib.php
示例7: updateCurrencies
public function updateCurrencies()
{
if (extension_loaded('curl')) {
$data = array();
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "' AND date_modified > '" . date(strtotime('-1 day')) . "'");
foreach ($query->rows as $result) {
$data[] = $this->config->get('config_currency') . $result['code'] . '=X';
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://download.finance.yahoo.com/d/quotes.csv?s=' . implode(',', $data) . '&f=sl1&e=.csv');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
$lines = explode("\n", trim($content));
foreach ($lines as $line) {
$currency = substr($line, 4, 3);
$value = substr($line, 11, 6);
if ((double) $value) {
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '" . (double) $value . "', date_modified = NOW() WHERE code = '" . $this->db->escape($currency) . "'");
}
}
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '1.00000', date_modified = NOW() WHERE code = '" . $this->db->escape($this->config->get('config_currency')) . "'");
$this->cache->delete('currency');
}
}
开发者ID:vverhun,项目名称:hoho,代码行数:25,代码来源:currency.php
示例8: getRec
/**
* Obtiene el listado de grabaciones por cada sala en un intervalo de fechas
* @return json
*/
function getRec()
{
$rec = $_POST['sco_id'];
$records = $this->cliente->getRecordings($rec);
$begrecord = $_POST['inicio'] == "" ? $_POST['tbegin'] : strtotime($_POST['inicio']);
$endrecord = $_POST['finald'] == "" ? date('Y-m-d') : $_POST['finald'];
if (!empty($records['recordings'])) {
if ($records['recordings']['sco'][0]) {
$data = $records['recordings']['sco'];
} else {
$data[] = $records['recordings']['sco'];
}
} else {
$recData->data[]['name'] = 'Sin registros';
echo json_encode($recData);
exit;
}
foreach ($data as $key => $value) {
$acl_id = $value['@attributes']['sco-id'];
$this->cliente->setPublicRecordings($acl_id);
$date_created = strtotime(date('Y-m-d', strtotime($value['date-created'])));
if ($date_created >= $begrecord && $date_created <= strtotime($endrecord)) {
$recData->data[] = $data[$key];
}
}
echo json_encode($recData);
}
开发者ID:Cristian9,项目名称:AdobeConnect,代码行数:31,代码来源:requestController.php
示例9: refresh
public function refresh($force = false)
{
if (extension_loaded('curl')) {
$data = array();
if ($force) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "'");
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "' AND date_modified < '" . $this->db->escape(date('Y-m-d H:i:s', strtotime('-1 day'))) . "'");
}
foreach ($query->rows as $result) {
$data[] = $this->config->get('config_currency') . $result['code'] . '=X';
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://download.finance.yahoo.com/d/quotes.csv?s=' . implode(',', $data) . '&f=sl1&e=.csv');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$content = curl_exec($curl);
curl_close($curl);
$lines = explode("\n", trim($content));
foreach ($lines as $line) {
$currency = utf8_substr($line, 4, 3);
$value = utf8_substr($line, 11, 6);
if ((double) $value) {
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '" . (double) $value . "', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($currency) . "'");
}
}
$this->db->query("UPDATE " . DB_PREFIX . "currency SET value = '1.00000', date_modified = '" . $this->db->escape(date('Y-m-d H:i:s')) . "' WHERE code = '" . $this->db->escape($this->config->get('config_currency')) . "'");
$this->cache->delete('currency');
}
}
开发者ID:royopa,项目名称:arastta,代码行数:32,代码来源:currency.php
示例10: is_datetime
function is_datetime($date)
{
if ($date == date('Y-m-d H:i:s', strtotime($date))) {
return true;
}
return false;
}
开发者ID:sharpmental,项目名称:prcs,代码行数:7,代码来源:auto_codeigniter_helper.php
示例11: updatePost
public function updatePost($id, $created, $source, $title)
{
$data = array('source' => $source, 'title' => $title);
// Valid date given (YYYY-MM-DD)?
if (preg_match('/^\\d{4}.\\d{2}.\\d{2}.+\\d{2}.\\d{2}$/', $created) && strtotime($created)) {
$data['created'] = $created;
$initial = $this->db->getRow('SELECT UNIX_TIMESTAMP(created) as created, image, thumb
FROM ' . ASAPH_TABLE_POSTS . '
WHERE id = :1', $id);
// OK, this sucks hard. If the date changed, we may have to move the thumb and image
// into another path and make sure to not overwrite any other imagess.
$initialPath = date('Y/m', $initial['created']);
$newPath = date('Y/m', strtotime($created));
if ($initialPath != $newPath && !empty($initial['thumb'])) {
$newImageDir = ASAPH_PATH . Asaph_Config::$images['imagePath'] . $newPath;
$newThumbDir = ASAPH_PATH . Asaph_Config::$images['thumbPath'] . $newPath;
$newImageName = $this->getUniqueFileName($newImageDir, $initial['image']);
$newThumbName = $this->getUniqueFileName($newThumbDir, $initial['thumb']);
$initialImagePath = ASAPH_PATH . Asaph_Config::$images['imagePath'] . $initialPath . '/' . $initial['image'];
$initialThumbPath = ASAPH_PATH . Asaph_Config::$images['thumbPath'] . $initialPath . '/' . $initial['thumb'];
$newImagePath = $newImageDir . '/' . $newImageName;
$newThumbPath = $newThumbDir . '/' . $newThumbName;
$data['image'] = $newImageName;
$data['thumb'] = $newThumbName;
if (!$this->mkdirr($newImageDir) || !$this->mkdirr($newThumbDir) || !@rename($initialImagePath, $newImagePath) || !@rename($initialThumbPath, $newThumbPath)) {
return false;
}
}
}
$this->db->updateRow(ASAPH_TABLE_POSTS, array('id' => $id), $data);
return true;
}
开发者ID:stan,项目名称:asaph,代码行数:32,代码来源:asaph_admin.class.php
示例12: index
public function index()
{
if ($this->open_sign == 0) {
//未开启活动提示
}
$set_id = M('sign_set')->where(array('token' => session('token')))->getField('id');
// $where = array('set_id'=>$set_id);
$where = array();
$user_name = $this->_post('user_name', 'htmlspecialchars,trim');
$sort = $this->_post('sort', 'trim');
$startdate = strtotime($this->_post('startdate', 'trim'));
$enddate = strtotime($this->_post('enddate', 'trim'));
if ($startdate && $enddate) {
$where['time'] = array(array('gt', $startdate), array('lt', $enddate), 'and');
}
if ($user_name) {
$where['user_name'] = array('like', '%' . $user_name . '%');
}
if (empty($sort)) {
$order = 'time desc';
} else {
$order = 'time ' . $sort;
}
$count = $this->sign_db->where($where)->count();
$Page = new Page($count, 12);
$list = $this->sign_db->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign('search', array('startdate' => $startdate, 'enddate' => $enddate, 'sort' => $sort));
$this->assign('page', $Page->show());
$this->assign('list', $list);
$this->assign('listinfo', 1);
$this->display();
}
开发者ID:d0oo0b,项目名称:wechatcms,代码行数:32,代码来源:SigninAction.class.php
示例13: created_on
public function created_on()
{
if (preg_match('/Created On :[\\s]+(.*?)\\n/', $this->body, $match)) {
return strtotime($match[1]);
}
return null;
}
开发者ID:jinguanio,项目名称:whois,代码行数:7,代码来源:namebay.php
示例14: updated_on
public function updated_on()
{
if (preg_match('/Last Updated On:(.*?)\\n/', $this->body, $match)) {
return strtotime($match[1]);
}
return null;
}
开发者ID:jinguanio,项目名称:whois,代码行数:7,代码来源:pir.php
示例15: gdlr_print_hotel_availability_item
function gdlr_print_hotel_availability_item($settings = array())
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces, $hotel_option;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$current_date = current_time('Y-m-d');
$next_date = date('Y-m-d', strtotime($current_date . "+1 days"));
$value = array('gdlr-check-in' => $current_date, 'gdlr-night' => 1, 'gdlr-check-out' => $next_date, 'gdlr-room-number' => 1, 'gdlr-adult-number' => 1, 'gdlr-children-number' => 0);
$ret = gdlr_get_item_title($settings);
$ret .= '<div class="gdlr-hotel-availability-wrapper';
if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
$ret .= ' gdlr-hotel-branches-enable';
}
$ret .= '" ' . $margin_style . $item_id . ' >';
$ret .= '<form class="gdlr-hotel-availability gdlr-item" id="gdlr-hotel-availability" method="post" action="' . esc_url(add_query_arg(array($hotel_option['booking-slug'] => ''), home_url('/'))) . '" >';
if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
$ret .= gdlr_get_reservation_branch_combobox(array('title' => __('Hotel Branches', 'gdlr-hotel'), 'slug' => 'gdlr-hotel-branches', 'id' => 'gdlr-hotel-branches', 'value' => ''));
}
$ret .= gdlr_get_reservation_datepicker(array('title' => __('Check In', 'gdlr-hotel'), 'slug' => 'gdlr-check-in', 'id' => 'gdlr-check-in', 'value' => $value['gdlr-check-in']));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Night', 'gdlr-hotel'), 'slug' => 'gdlr-night', 'id' => 'gdlr-night', 'value' => $value['gdlr-night']));
$ret .= gdlr_get_reservation_datepicker(array('title' => __('Check Out', 'gdlr-hotel'), 'slug' => 'gdlr-check-out', 'id' => 'gdlr-check-out', 'value' => $value['gdlr-check-out']));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Adults', 'gdlr-hotel'), 'slug' => 'gdlr-adult-number', 'id' => '', 'value' => $value['gdlr-adult-number'], 'multiple' => true));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Children', 'gdlr-hotel'), 'slug' => 'gdlr-children-number', 'id' => '', 'value' => $value['gdlr-children-number'], 'multiple' => true));
$ret .= '<div class="gdlr-hotel-availability-submit" >';
$ret .= '<input type="hidden" name="hotel_data" value="1" >';
$ret .= '<input type="hidden" name="gdlr-room-number" value="1" />';
$ret .= '<input type="submit" class="gdlr-reservation-bar-button gdlr-button with-border" value="' . __('Check Availability', 'gdlr-hotel') . '" >';
$ret .= '</div>';
$ret .= '<div class="clear"></div>';
$ret .= '</form>';
$ret .= '</div>';
return $ret;
}
开发者ID:konstantin-pr,项目名称:ses215,代码行数:34,代码来源:page-builder-sync.php
示例16: __construct
/**
* Constructor.
*
* @param Integer $groupId Project Id
* @param Integer $weeksNumber Statistics duration in weeks
*
* @return Void
*/
public function __construct($groupId, $weeksNumber)
{
$dao = new GitDao();
// TODO: Optionally include presonal forks in repo list
$allRepositories = $dao->getProjectRepositoryList($groupId);
$um = UserManager::instance();
$user = $um->getCurrentUser();
$repoFactory = new GitRepositoryFactory($dao, ProjectManager::instance());
foreach ($allRepositories as $repo) {
$repository = $repoFactory->getRepositoryById($repo['repository_id']);
if ($repository->userCanRead($user)) {
$this->repoList[] = $repository;
}
}
$this->displayChart = false;
$this->weeksNumber = min($weeksNumber, self::MAX_WEEKSNUMBER);
// Init some class properties according to 'weeks number' parameter
$today = $_SERVER['REQUEST_TIME'];
$startPeriod = strtotime("-{$this->weeksNumber} weeks");
$weekInSeconds = self::WEEKS_IN_SECONDS;
for ($i = $startPeriod + $weekInSeconds; $i < $today + $weekInSeconds; $i += $weekInSeconds) {
$this->dates[] = date('M d', $i);
$this->weekNum[] = intval(date('W', $i));
$this->year[] = intval(date('Y', $i));
}
}
开发者ID:nterray,项目名称:tuleap,代码行数:34,代码来源:Git_LastPushesGraph.class.php
示例17: execute
private function execute()
{
$this->prepareBaseValues();
$listingsProducts = $this->getNextListingsProducts();
if (count($listingsProducts) <= 0) {
$lastTime = strtotime($this->getLastTimeStartCircle());
$interval = $this->getMinIntervalBetweenCircles();
if ($lastTime + $interval > Mage::helper('M2ePro')->getCurrentGmtDate(true)) {
return;
}
$this->setLastListingProductId(0);
$this->resetLastTimeStartCircle();
$listingsProducts = $this->getNextListingsProducts();
if (count($listingsProducts) <= 0) {
return;
}
}
$tempIndex = 0;
$totalItems = count($listingsProducts);
foreach ($listingsProducts as $listingProduct) {
$this->updateListingsProductChange($listingProduct);
if (++$tempIndex % 20 == 0) {
$percentsPerOneItem = self::PERCENTS_INTERVAL / $totalItems;
$this->_lockItem->setPercents($percentsPerOneItem * $tempIndex);
$this->_lockItem->activate();
}
}
$listingProduct = array_pop($listingsProducts);
$this->setLastListingProductId($listingProduct->getId());
}
开发者ID:technomagegithub,项目名称:magento,代码行数:30,代码来源:Circle.php
示例18: getTotalUsedCredits
/**
* @param $main_account_username
* @param $main_account_password
* @param $customer_username
* @param DateTime $date
* @return int
* @throws Exception
*/
public function getTotalUsedCredits($main_account_username, $main_account_password, $customer_username, DateTime $date)
{
$totalCreditUsed = 0;
$this->customer = $customer_username;
$this->date = $date;
$this->main_account_username = $main_account_username;
$this->main_account_password = $main_account_password;
$this->date = $this->date->add(new DateInterval("P1D"));
//the api call doesnt include the current date so we move a day ahead
$dtToday = $this->date->format("Y-m-d");
$requestString = "https://www.voipinfocenter.com/API/Request.ashx?command=calloverview&username={$this->main_account_username}&password={$this->main_account_password}&customer={$this->customer}&date={$dtToday}%2000:00:00&recordcount=500";
$curlRes = curl_init($requestString);
curl_setopt($curlRes, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlRes, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curlRes, CURLOPT_SSL_VERIFYHOST, false);
$requestResult = curl_exec($curlRes);
$this->date = $this->date->sub(new DateInterval("P1D"));
//revert date add
if (is_null($requestResult) || empty($requestResult)) {
throw new Exception("Empty result from API server");
}
$xmlObject = new SimpleXMLElement($requestResult);
$callsTempContainer = (array) $xmlObject->Calls;
$callsTempContainer = $callsTempContainer['Call'];
foreach ($callsTempContainer as $currentCallObj) {
// if date is equal to date passed
$parsedDate = strtotime($currentCallObj['StartTime']);
if ($this->date->format("Y-m-d") === date("Y-m-d", $parsedDate)) {
$totalCreditUsed += floatval($currentCallObj['Charge']);
}
}
return $totalCreditUsed;
}
开发者ID:branJakJak,项目名称:biOwAyPiTransperKreditz,代码行数:41,代码来源:CallOverview.php
示例19: SSL_COMPRA_FACTURA
function SSL_COMPRA_FACTURA($transaccion, $salida = 'enlinea')
{
$c = sprintf('SELECT procon.`codigo_producto`, procon.`titulo` AS "titulo_contenedor", provar.`descripcion` AS "titulo_variedad", provar.foto, comcon.`codigo_compra`, comcon.`codigo_usuario`, comcon.`codigo_variedad`, FORMAT(comcon.`precio_grabado`,2) AS precio_grabado, FORMAT(comcon.`precio_envio`,2) AS precio_envio, comcon.`direccion_entrega`, comcon.`fecha_entrega`, comcon.`tarjeta_de`, comcon.`tarjeta_para`, comcon.`tarjeta_cuerpo`, comcon.`usuario_notas`, comcon.`transaccion`, comcon.`fecha`, `estado`, `correo_contacto`, `telefono_remitente`, `usuario_notas`, `nombre_t_credito`,`estado_notas` FROM `flores_SSL_compra_contenedor` AS comcon LEFT JOIN `flores_producto_variedad` AS provar USING(codigo_variedad) LEFT JOIN `flores_producto_contenedor` AS procon USING(codigo_producto) WHERE transaccion="%s"', db_codex($transaccion));
$r = db_consultar($c);
if (!mysql_num_rows($r)) {
echo '<p>Lo sentimos, tal factura no existe</p>';
return;
}
$f = mysql_fetch_assoc($r);
$buffer = '<style>';
$buffer .= 'table {border-collapse:collapse;}';
$buffer .= 'table th{border-top:thin solid #c0c0c0;border-left:thin solid #c0c0c0;border-right:thin solid #c0c0c0;background-color:#eee;}';
$buffer .= 'table td{border-top:thin solid #c0c0c0;border:1px solid #c0c0c0;}';
$buffer .= '</style>';
$buffer .= '<table style="width:100%">';
$campo = array('Factura' => $f['transaccion'], 'F360' => $f['codigo_producto'] . ':' . $f['codigo_variedad'], 'Producto' => $f['titulo_contenedor'], 'Variedad' => $f['titulo_variedad'], 'Precio' => '$' . $f['precio_grabado'], 'Recargo de envio' => '$' . $f['precio_envio'], 'Total' => '$' . number_format($f['precio_grabado'] + $f['precio_envio'], 2, '.', ','), 'Remitente' => $f['tarjeta_de'], 'Destinatario' => $f['tarjeta_para'], 'Tarjeta' => $f['tarjeta_cuerpo'], 'Enviar a' => $f['direccion_entrega'], 'Fecha pedido' => date('d/m/Y'), 'Fecha de entrega' => date('d/m/Y', strtotime($f['fecha_entrega'])), 'Correo contacto' => $f['correo_contacto'], 'Teléfono remitente' => $f['telefono_remitente'], 'Notas adicionales del comprador' => $f['usuario_notas'] ? $f['usuario_notas'] : '[No especificó nada en especial]');
foreach ($campo as $clave => $valor) {
$buffer .= sprintf('<tr><td>%s</td><td style="font-weight:bold">%s</td></tr>', $clave, $valor);
}
$buffer .= '</table>';
switch ($salida) {
case 'enlinea':
return array($buffer, $f);
break;
case 'pdf':
$buffer = '<html><body>' . $buffer . '</body></html>';
require_once 'PHP/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$dompdf->load_html($buffer);
//$dompdf->render();
//$dompdf->stream("factura-$transaccion.pdf");
}
}
开发者ID:vlad88sv,项目名称:360,代码行数:33,代码来源:ssl.comun.php
示例20: show_day_information
private function show_day_information($type, $date)
{
$filter = new filter($this->db, $this->output, $this->user);
$filter->to_output($this->model->table, $this->model->hostnames);
if (($stats = $this->model->get_day_statistics($type, $date, $filter->hostname, $filter->webserver)) === false) {
$this->output->add_tag("result", "Database error.");
return false;
}
$graph = new graph($this->output);
$graph->title = $this->graphs[$type] . " for " . date("l j F Y", strtotime($date));
$graph->width = 960;
$graph->height = GRAPH_HEIGHT;
foreach ($stats as $hour => $count) {
$graph->add_bar("Hour " . $hour, $count, "hour");
}
$graph->to_output();
if (($stats = $this->model->get_day_information($type, $date, $filter->hostname, $filter->webserver)) === false) {
$this->output->add_tag("result", "Database error.");
return false;
}
$this->output->open_tag("day", array("hostnames" => show_boolean($this->model->hostnames), "label" => $this->graphs[$type]));
foreach ($stats as $stat) {
if ($type == "requests" || $type == "bytes_sent") {
$stat["count"] = $this->model->readable_number($stat["count"]);
}
$this->output->record($stat, "stat");
}
$this->output->close_tag();
}
开发者ID:Wabuo,项目名称:monitor,代码行数:29,代码来源:graph_controller.php
注:本文中的strtotime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论