• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP QDateTime类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中QDateTime的典型用法代码示例。如果您正苦于以下问题:PHP QDateTime类的具体用法?PHP QDateTime怎么用?PHP QDateTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QDateTime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: GetEndScript

 public function GetEndScript()
 {
     $strToReturn = parent::GetEndScript();
     if (QDateTime::$Translate) {
         $strShortNameArray = array();
         $strLongNameArray = array();
         $strDayArray = array();
         $dttMonth = new QDateTime('2000-01-01');
         for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
             $dttMonth->Month = $intMonth;
             $strShortNameArray[] = '"' . $dttMonth->ToString('MMM') . '"';
             $strLongNameArray[] = '"' . $dttMonth->ToString('MMMM') . '"';
         }
         $dttDay = new QDateTime('Sunday');
         for ($intDay = 1; $intDay <= 7; $intDay++) {
             $strDay = $dttDay->ToString('DDD');
             $strDay = html_entity_decode($strDay, ENT_COMPAT, QApplication::$EncodingType);
             if (function_exists('mb_substr')) {
                 $strDay = mb_substr($strDay, 0, 2);
             } else {
                 // Attempt to account for multibyte day -- may not work if the third character is multibyte
                 $strDay = substr($strDay, 0, strlen($strDay) - 1);
             }
             $strDay = QApplication::HtmlEntities($strDay);
             $strDayArray[] = '"' . $strDay . '"';
             $dttDay->Day++;
         }
         $strArrays = sprintf('new Array(new Array(%s), new Array(%s), new Array(%s))', implode(', ', $strLongNameArray), implode(', ', $strShortNameArray), implode(', ', $strDayArray));
         $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", %s); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel'), $strArrays);
     } else {
         $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", null); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel'));
     }
     return $strToReturn;
 }
开发者ID:harshanurodh,项目名称:qcodo,代码行数:34,代码来源:QCalendar.class.php


示例2: dtgItems_Bind

 public function dtgItems_Bind()
 {
     $intYear = QApplication::PathInfo(0);
     $dttStart = new QDateTime($intYear . '-01-01');
     $dttEnd = new QDateTime($dttStart);
     $dttEnd->Year += 1;
     $dttStart->SetTime(null, null, null);
     $dttEnd->SetTime(null, null, null);
     $objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
     $strNameArray = array();
     $strNameValueArray = array();
     while ($objPerson = Person::InstantiateCursor($objPersonCursor)) {
         $strToken = strtolower($objPerson->FirstName . '|' . $objPerson->LastName);
         $strToken = str_replace(' ', '', $strToken);
         $strToken = str_replace('.', '', $strToken);
         $strToken = str_replace(',', '', $strToken);
         $strToken = str_replace('-', '', $strToken);
         $strToken = str_replace('_', '', $strToken);
         $strToken = str_replace('/', '', $strToken);
         if (array_key_exists($strToken, $strNameArray)) {
             $strNameValueArray[$strToken] = $objPerson->FirstName . ' ' . $objPerson->LastName;
         }
         $strNameArray[$strToken] = true;
     }
     $this->dtgItems->DataSource = $strNameValueArray;
 }
开发者ID:alcf,项目名称:chms,代码行数:26,代码来源:duplicate_names.php


示例3: Validate

 /**
  * Validate the control.
  * @return bool
  */
 public function Validate()
 {
     if (!parent::Validate()) {
         return false;
     }
     if ($this->strText != '') {
         $dttDateTime = new QDateTime($this->strText, null, QDateTime::DateOnlyType);
         if ($dttDateTime->IsDateNull()) {
             $this->ValidationError = QApplication::Translate("Invalid date");
             return false;
         }
         if (!is_null($this->Minimum)) {
             if ($dttDateTime->IsEarlierThan($this->Minimum)) {
                 if ($this->strMinDateErrorMsg) {
                     $this->ValidationError = $this->strMinDateErrorMsg;
                 } else {
                     $this->ValidationError = QApplication::Translate("Date is earlier than minimum allowed");
                 }
                 return false;
             }
         }
         if (!is_null($this->Maximum)) {
             if ($dttDateTime->IsLaterThan($this->Maximum)) {
                 if ($this->strMaxDateErrorMsg) {
                     $this->ValidationError = $this->strMaxDateErrorMsg;
                 } else {
                     $this->ValidationError = QApplication::Translate("Date is later than maximum allowed");
                 }
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:38,代码来源:QDatepickerBoxBase.class.php


示例4: testQueryCount

 public function testQueryCount()
 {
     $someDate = new QDateTime();
     $someDate->setDate(2006, 1, 1);
     $intItemCount = Milestone::QueryCount(QQ::GreaterThan(QQN::Milestone()->Project->StartDate, $someDate), QQ::Distinct());
     $this->assertEqual($intItemCount, 3);
     $intItemCount2 = Milestone::QueryCount(QQ::GreaterThan(QQN::Milestone()->Project->StartDate, $someDate), QQ::Clause(QQ::Distinct(), QQ::Distinct()));
     $this->assertEqual($intItemCount2, 3);
 }
开发者ID:tomVertuoz,项目名称:framework,代码行数:9,代码来源:BasicOrmTests.php


示例5: Q

 public static function Q(QDateTime $objQDateTime)
 {
     if ($objQDateTime->IsTimeNull()) {
         //error_log("NotNUll: " . sprintf("'%s'", $objQDateTime->__toString('YYYY-MM-DD')));
         return $objQDateTime->__toString('YYYY-MM-DD');
     } else {
         //error_log("IS NULL: " . sprintf("'%s'", $objQDateTime->__toString(QDateTime::FormatIso)));
         return $objQDateTime->__toString(QDateTime::FormatIso);
     }
 }
开发者ID:laiello,项目名称:schematical-open-source,代码行数:10,代码来源:MFBDateTime.class.php


示例6: dtgItems_Bind

 public function dtgItems_Bind()
 {
     $intYear = QApplication::PathInfo(0);
     $dttStart = new QDateTime($intYear . '-01-01');
     $dttEnd = new QDateTime($dttStart);
     $dttEnd->Year += 1;
     $dttStart->SetTime(null, null, null);
     $dttEnd->SetTime(null, null, null);
     $this->dtgItems->DataSource = Person::QueryArray(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd), QQ::IsNull(QQN::Person()->PrimaryAddressText), QQ::IsNull(QQN::Person()->StewardshipAddressId)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
 }
开发者ID:alcf,项目名称:chms,代码行数:10,代码来源:invalid_addresses.php


示例7: testQueryArray

 public function testQueryArray()
 {
     $someDate = new QDateTime();
     $someDate->setDate(2006, 1, 1);
     $objItems = Milestone::QueryArray(QQ::GreaterThan(QQN::Milestone()->Project->StartDate, $someDate), QQ::OrderBy(QQN::Milestone()->Project->Name));
     $this->assertEqual(sizeof($objItems), 3);
     $this->assertEqual($objItems[0]->Name, "Milestone F");
     $this->assertEqual($objItems[0]->Project->Name, "Blueman Industrial Site Architecture");
     $this->assertEqual($objItems[1]->Name, "Milestone D");
     $this->assertEqual($objItems[1]->Project->Name, "State College HR System");
     $this->assertEqual($objItems[2]->Name, "Milestone E");
     $this->assertEqual($objItems[2]->Project->Name, "State College HR System");
 }
开发者ID:hiptc,项目名称:dle2wordpress,代码行数:13,代码来源:BasicOrmTests.php


示例8: ParsePostData

 public function ParsePostData()
 {
     $blnChanged = false;
     $dttNewDateTime = new QDateTime();
     // Update Date Component
     switch ($this->strCalendarType) {
         case QCalendarType::DateOnly:
         case QCalendarType::DateTime:
         case QCalendarType::DateTimeSeconds:
             $strKey = $this->strControlId . "_intTimestamp";
             if (array_key_exists($strKey, $_POST)) {
                 // If no date was set, set to null and return
                 $intTimestamp = $_POST[$strKey];
                 if (!$intTimestamp) {
                     $this->intTimestamp = null;
                     return;
                 }
                 // Otherwise, set up a new date object, and update dttNewDateTime accordingly
                 $blnChanged = true;
                 $dttSelectedDate = new QDateTime($_POST[$strKey]);
                 $dttNewDateTime->SetDate($dttSelectedDate->Year, $dttSelectedDate->Month, $dttSelectedDate->Day);
             }
     }
     // Update Time Component
     switch ($this->strCalendarType) {
         case QCalendarType::TimeOnly:
         case QCalendarType::TimeSecondsOnly:
         case QCalendarType::DateTime:
         case QCalendarType::DateTimeSeconds:
             // Hour
             $strKey = $this->strControlId . "_intHour";
             if (array_key_exists($strKey, $_POST)) {
                 $blnChanged = true;
                 $dttNewDateTime->SetTime($_POST[$strKey], $dttNewDateTime->Minute, $dttNewDateTime->Second);
             }
             // Minute
             $strKey = $this->strControlId . "_intMinute";
             if (array_key_exists($strKey, $_POST)) {
                 $blnChanged = true;
                 $dttNewDateTime->SetTime($dttNewDateTime->Hour, $_POST[$strKey], $dttNewDateTime->Second);
             }
             // Second
             $strKey = $this->strControlId . "_intSecond";
             if (array_key_exists($strKey, $_POST)) {
                 $blnChanged = true;
                 $dttNewDateTime->SetTime($dttNewDateTime->Hour, $dttNewDateTime->Minute, $_POST[$strKey]);
             }
     }
     // Update local intTimestamp
     $this->intTimestamp = $dttNewDateTime->Timestamp;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:51,代码来源:QCalendar.class.php


示例9: __get

 public function __get($strName)
 {
     switch ($strName) {
         case 'GeneratedDescription':
             if ($this->strLocation || $this->dttDateStart || $this->dttDateEnd) {
                 $strToReturn = ', to be held';
                 if ($this->strLocation) {
                     $strToReturn .= ' at ' . $this->strLocation;
                 }
                 if ($this->dttDateStart && $this->dttDateEnd) {
                     $dttCompare1 = new QDateTime($this->dttDateStart);
                     $dttCompare2 = new QDateTime($this->dttDateEnd);
                     $dttCompare1->SetTime(null, null, null);
                     $dttCompare2->SetTime(null, null, null);
                     if ($dttCompare1->IsEqualTo($dttCompare2)) {
                         $strToReturn .= ' on ' . $this->dttDateStart->ToString('MMMM D YYYY');
                         $strToReturn .= ' from ' . $this->dttDateStart->ToString('h:mm z');
                         $strToReturn .= ' to ' . $this->dttDateEnd->ToString('h:mm z');
                     } else {
                         $strToReturn .= ' from ' . $this->dttDateStart->ToString('MMMM D');
                         $strToReturn .= ' to ' . $this->dttDateEnd->ToString('MMMM D YYYY');
                     }
                 } else {
                     if ($this->dttDateStart) {
                         $strToReturn .= ' on ' . $this->dttDateStart->ToString('MMMM D YYYY');
                         if ($this->dttDateStart->Hour || $this->dttDateStart->Minute) {
                             $strToReturn .= ' @ ' . $this->dttDateStart->ToString('h:mm z');
                         }
                     } else {
                         if ($this->dttDateEnd) {
                             $strToReturn .= ' until ' . $this->dttDateEnd->ToString('MMMM D YYYY');
                             if ($this->dttDateStart->Hour || $this->dttDateEnd->Minute) {
                                 $strToReturn .= ' @ ' . $this->dttDateEnd->ToString('h:mm z');
                             }
                         }
                     }
                 }
                 return $strToReturn;
             } else {
                 return null;
             }
             break;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:51,代码来源:EventSignupForm.class.php


示例10: GetReportYtdByFundForMonth

 /**
  * Returns an array of 2-item arrays, where each item has the following index:
  * 	0: stewardship_fund_id
  * 	1; total amount YTD
  * for a given month
  * @param QDateTime $dttMonth
  * @return string[][]
  */
 public static function GetReportYtdByFundForMonth(QDateTime $dttMonth)
 {
     $dttMonth->Day = 1;
     $dttMonth->SetTime(null, null, null);
     $dttNextMonth = new QDateTime($dttMonth);
     $dttNextMonth->Month++;
     $dttNextMonth->SetTime(null, null, null);
     $dttMonth->Month = 1;
     $objResult = StewardshipPostAmount::GetDatabase()->Query(sprintf("SELECT stewardship_fund_id, SUM(amount) AS sum_amount FROM stewardship_post_amount, stewardship_post, stewardship_batch WHERE\n\t\t\t\tstewardship_batch_id=stewardship_batch.id AND\n\t\t\t\tstewardship_post_id=stewardship_post.id AND date_credited >= '%s' AND date_credited < '%s' GROUP BY stewardship_fund_id ORDER BY SUM(amount) DESC;", $dttMonth->ToString('YYYY-MM-DD'), $dttNextMonth->ToString('YYYY-MM-DD')));
     $strToReturn = array();
     while ($objRow = $objResult->GetNextRow()) {
         $strToReturn[] = array($objRow->GetColumn('stewardship_fund_id'), $objRow->GetColumn('sum_amount'));
     }
     return $strToReturn;
 }
开发者ID:alcf,项目名称:chms,代码行数:23,代码来源:StewardshipPost.class.php


示例11: SetupPanel

 protected function SetupPanel()
 {
     $this->mctPledge = StewardshipPledgeMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);
     if (!$this->mctPledge->EditMode) {
         // Trying to create a NEW comment
         $this->mctPledge->StewardshipPledge->DateStarted = QDateTime::Now();
         $this->mctPledge->StewardshipPledge->Person = $this->objPerson;
         $this->mctPledge->StewardshipPledge->FulfilledFlag = false;
         $this->mctPledge->StewardshipPledge->ActiveFlag = true;
         $this->btnSave->Text = 'Create';
     } else {
         $this->btnSave->Text = 'Update';
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this pledge?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
     // Create Controls
     $this->lstStewardshipFund = $this->mctPledge->lstStewardshipFund_Create(null, QQ::All(), array(QQ::OrderBy(QQN::StewardshipFund()->Name)));
     $this->calDateStarted = $this->mctPledge->calDateStarted_Create();
     $this->calDateEnded = $this->mctPledge->calDateEnded_Create();
     $this->txtPledgeAmount = $this->mctPledge->txtPledgeAmount_Create();
     $this->chkActiveFlag = $this->mctPledge->chkActiveFlag_Create();
     $this->chkActiveFlag->Text = 'Note: All fulfilled pledges automatically considred "inactive".';
     $this->calDateStarted->MinimumYear = 2000;
     $this->calDateStarted->MaximumYear = date('Y') + 10;
     $this->calDateEnded->MinimumYear = 2000;
     $this->calDateEnded->MaximumYear = date('Y') + 10;
 }
开发者ID:alcf,项目名称:chms,代码行数:31,代码来源:Vicp_Stewardship_EditPledge.class.php


示例12: Log

 private static function Log($strMessage, $intPriority, $intProjectId = null, $intLanguageId = null, $intUserId = null)
 {
     if (SERVER_INSTANCE != 'dev' && $intPriority == NarroLog::PRIORITY_DEBUG) {
         return true;
     }
     $objLogEntry = new NarroLog();
     $objLogEntry->Date = QDateTime::Now();
     $objLogEntry->Priority = $intPriority;
     $objLogEntry->Message = $strMessage;
     $objLogEntry->ProjectId = is_null($intProjectId) ? is_null(self::$intProjectId) ? null : self::$intProjectId : $intProjectId;
     $objLogEntry->LanguageId = is_null($intLanguageId) ? is_null(self::$intLanguageId) ? null : self::$intLanguageId : $intLanguageId;
     $objLogEntry->UserId = is_null($intUserId) ? is_null(self::$intUserId) ? null : self::$intUserId : $intUserId;
     try {
         $objLogEntry->Save();
     } catch (Exception $objEx) {
         error_log($objEx->getMessage() . $objEx->getTraceAsString());
     }
     if (QFirebug::getEnabled()) {
         switch ($intPriority) {
             case NarroLog::PRIORITY_INFO:
                 QFirebug::info($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId);
                 break;
             case NarroLog::PRIORITY_WARN:
                 QFirebug::warn($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId);
                 break;
             case NarroLog::PRIORITY_ERROR:
                 QFirebug::error($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId);
                 break;
             default:
                 QFirebug::log($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId);
         }
     }
 }
开发者ID:Jobava,项目名称:narro,代码行数:33,代码来源:NarroLogger.class.php


示例13: Log

 /**
  * This will log a message to the Qcodo Log.  Location of the log file is defined in __QCODO_LOG__
  * 
  * By default, this will log a "Normal" level log entry in the "default" Qcodo log file, which is
  * located at __QCODO_LOG__/default.log.txt
  * 
  * Either parameter can be overridden.
  * 
  * @param string $strMessage
  * @param integer $intLogLevel
  * @param string $strLogModule
  * @return void
  */
 public static function Log($strMessage, $intLogLevel = QLogLevel::Normal, $strLogModule = 'default')
 {
     // Cancel out if log level is too low
     if ($intLogLevel > self::$MinimumLogLevel) {
         return;
     }
     // Setup Log Path
     if (!defined('__QCODO_LOG__')) {
         throw new QCallerException('__QCODO_LOG__ must be defined before running QLog::Log');
     }
     // Cancel out if log path is null
     if (!__QCODO_LOG__) {
         return;
     }
     // Create the Log Directory if it does NOT yet exist
     if (!is_dir(__QCODO_LOG__)) {
         QApplication::MakeDirectory(__QCODO_LOG__, 0777);
     }
     // Setup the Line
     $strLine = sprintf("%5s | %s | %s | %s\r\n", getmypid(), QLogLevel::$NameArray[$intLogLevel], QDateTime::Now()->NowToString(QDateTime::FormatIso), self::FormatMessage($strMessage));
     // Open the File for Writing
     $strLogFilePath = __QCODO_LOG__ . '/' . $strLogModule . self::$Extension;
     $objFile = fopen($strLogFilePath, 'a');
     // Write the Line
     fwrite($objFile, $strLine);
     fclose($objFile);
 }
开发者ID:klucznik,项目名称:qcodo,代码行数:40,代码来源:QLog.class.php


示例14: btnOkay_Click

 public function btnOkay_Click($strFormId, $strControlId, $strParameter)
 {
     $this->btnOkay->Enabled = true;
     $blnNewTopic = false;
     // Setup stuff if it's a NEW message being posted (either a NEW response or a NEW topic)
     if (!$this->blnEditMode) {
         // For NEW TOPIC in this Forum
         if (!$this->mctMessage->Message->Topic) {
             $objForum = Forum::Load($this->lstForum->SelectedValue);
             $objNewTopic = $objForum->PostTopic(trim($this->txtTopicName->Text), trim($this->txtMessage->Text), QApplication::$Person);
             QApplication::Redirect(sprintf('/forums/forum.php/%s/%s/', $objForum->Id, $objNewTopic->Id));
             // Otherwise, it's a new POST in this TOPIC
         } else {
             $this->mctMessage->Message->PostDate = QDateTime::Now();
         }
         // Set the Reply Number for this New Message
         $this->mctMessage->Message->ReplyNumber = $this->mctMessage->Message->Topic->GetNextReplyNumber();
     }
     // Save Everything Else
     $this->mctMessage->SaveMessage();
     $this->mctMessage->Message->RefreshCompiledHtml();
     $this->mctMessage->SaveMessage();
     // Refresh Stats and Stuff
     $this->mctMessage->Message->Topic->RefreshStats();
     $this->mctMessage->Message->Topic->RefreshSearchIndex();
     $this->mctMessage->Message->TopicLink->RefreshStats();
     // Send Alerts and Reset Read Flag on any NEW post
     if (!$this->blnEditMode) {
         $this->mctMessage->Message->SendAlerts();
         $this->mctMessage->Message->Topic->UnassociateAllPeopleAsRead();
         //Mark as read for poster
         $this->mctMessage->Message->Topic->AssociatePersonAsRead(QApplication::$Person);
     }
     $this->ParentControl->CloseMessageDialog(true, !$this->blnEditMode);
 }
开发者ID:qcodo,项目名称:qcodo-website,代码行数:35,代码来源:MessageEditDialogBox.class.php


示例15: Save

 public function Save($blnForceInsert = false, $blnForceUpdate = false)
 {
     $this->intSuggestionWordCount = NarroString::WordCount($this->strSuggestionValue);
     $this->intSuggestionCharCount = mb_strlen($this->strSuggestionValue);
     $this->strSuggestionValueMd5 = md5($this->strSuggestionValue);
     if (!isset($this->blnIsImported)) {
         $this->blnIsImported = false;
     }
     if (!$this->__blnRestored || $blnForceInsert) {
         $this->dttCreated = QDateTime::Now();
     } else {
         $this->dttModified = QDateTime::Now();
     }
     parent::Save($blnForceInsert, $blnForceUpdate);
     /**
      * Update all context infos with the has suggestion property
      */
     $arrContextInfo = NarroContextInfo::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroContextInfo()->Context->TextId, $this->intTextId), QQ::Equal(QQN::NarroContextInfo()->LanguageId, $this->intLanguageId), QQ::Equal(QQN::NarroContextInfo()->HasSuggestions, 0)));
     foreach ($arrContextInfo as $objOneContextInfo) {
         $objOneContextInfo->HasSuggestions = 1;
         $objOneContextInfo->Modified = QDateTime::Now();
         try {
             $objOneContextInfo->Save();
         } catch (Exception $objEx) {
             NarroLogger::LogWarn($objEx->getMessage());
         }
     }
 }
开发者ID:Jobava,项目名称:narro,代码行数:28,代码来源:NarroSuggestion.class.php


示例16: Form_Create

 protected function Form_Create()
 {
     $this->txtDescription = new QTextBox($this);
     $this->txtDescription->Name = 'Description';
     $this->lstStackCount = new QListBox($this);
     $this->lstStackCount->Name = 'Number of Stacks';
     $this->calDateCredited = new QDateTimePicker($this);
     $this->calDateCredited->MaximumYear = date('Y') + 5;
     $this->calDateCredited->DateTime = QDateTime::Now();
     $this->txtReportedTotals = array();
     for ($i = 1; $i <= 20; $i++) {
         $this->lstStackCount->AddItem($i, $i, $i == 1);
         $txtReportedTotal = new QFloatTextBox($this, 'txtReportedTotal' . $i);
         $txtReportedTotal->Name = 'Reported Total for Stack #' . $i;
         $txtReportedTotal->Visible = false;
         $this->txtReportedTotals[$i] = $txtReportedTotal;
     }
     $this->lstStackCount->AddAction(new QChangeEvent(), new QAjaxAction('lstStackCount_Change'));
     $this->lstStackCount_Change();
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Create Stack';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->CausesValidation = true;
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
 }
开发者ID:alcf,项目名称:chms,代码行数:30,代码来源:new.php


示例17: process_object

 /**
  * @param DleUsers $objDleUsers The DB ORM object to process
  */
 protected function process_object($objDleUsers)
 {
     // wp: ID,      user_login, user_nicename, user_email, user_registered,           display_name
     // dl: user_id, name,       name,          email,      FROM_UNIXTIME( reg_date ), fullname
     $strEmail = $objDleUsers->Email;
     if ($strEmail && strlen($strEmail)) {
         // check if already copied
         if (!WpUsers::QueryCount(QQ::Equal(QQN::WpUsers()->UserEmail, $strEmail))) {
             $objWpUsers = new WpUsers();
             $objWpUsers->Initialize();
             // set defaults
             $objWpUsers->UserLogin = $objDleUsers->Name;
             $objWpUsers->UserNicename = $objDleUsers->Name;
             $objWpUsers->UserEmail = $objDleUsers->Email;
             $objWpUsers->UserRegistered = QDateTime::FromTimestamp(intval($objDleUsers->RegDate));
             $objWpUsers->DisplayName = $objDleUsers->Fullname;
             $objWpUsers->UserPass = '';
             $objWpUsers->UserUrl = '';
             $objWpUsers->UserActivationKey = '';
             $objWpUsers->UserStatus = 0;
             $objWpUsers->Save();
             $this->intUserCount++;
         }
     }
 }
开发者ID:hiptc,项目名称:dle2wordpress,代码行数:28,代码来源:WpUsersTask.class.php


示例18: Form_Create

 protected function Form_Create()
 {
     $this->lstYear = new QListBox($this);
     for ($intYear = 2002; $intYear <= date('Y'); $intYear++) {
         $this->lstYear->AddItem($intYear, $intYear, QApplication::PathInfo(0) ? QApplication::PathInfo(0) == $intYear : $intYear == QDateTime::Now()->Year);
     }
     $this->lstMonth = new QListBox($this);
     for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
         $dttDate = new QDateTime('2000-' . $intMonth . '-01');
         $this->lstMonth->AddItem($dttDate->ToString('MMMM'), $intMonth, QApplication::PathInfo(1) ? QApplication::PathInfo(1) == $intMonth : $intMonth == QDateTime::Now()->Month);
     }
     $this->lstYear->AddAction(new QChangeEvent(), new QAjaxAction('lstDate_Change'));
     $this->lstMonth->AddAction(new QChangeEvent(), new QAjaxAction('lstDate_Change'));
     $this->dtgReport = new QDataGrid($this);
     $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_FORM->RenderRow($_ITEM); ?><?= StewardshipFund::Load($_ITEM[0])->Name; ?>', 'Width=400px'));
     $this->dtgReport->AddColumn(new QDataGridColumn('Monthly Total', '<?= QApplication::DisplayCurrency($_ITEM[1]); ?>', 'Width=400px'));
     $this->dtgReport->AddColumn(new QDataGridColumn('YTD', '<?= QApplication::DisplayCurrency($_ITEM[2]); ?>', 'Width=400px'));
     $this->dttDate = new QDateTime($this->lstYear->SelectedValue . '-' . $this->lstMonth->SelectedValue . '-01');
     $this->dttDate->SetTime(null, null, null);
     // Get the Data
     $objReportArray = StewardshipPost::GetReportByFundAndMonth($this->dttDate);
     $objReportYtdArray = StewardshipPost::GetReportYtdByFundForMonth($this->dttDate);
     // Setup the data holders
     $this->fltTotal = 0;
     $this->fltTotalYtd = 0;
     $objArray = array();
     foreach ($objReportArray as $objLineItem) {
         $objFund = StewardshipFund::Load($objLineItem[0]);
         if ($objFund->AccountNumber == '7011.010' || substr($objFund->AccountNumber, 0, 1) == '4') {
             $this->fltTotal += $objLineItem[1];
             $objArray[$objLineItem[0]] = array($objLineItem[0], $objLineItem[1], null);
         }
     }
     foreach ($objReportYtdArray as $objLineItem) {
         $objFund = StewardshipFund::Load($objLineItem[0]);
         if ($objFund->AccountNumber == '7011.010' || substr($objFund->AccountNumber, 0, 1) == '4') {
             $this->fltTotalYtd += $objLineItem[1];
             if (array_key_exists($objLineItem[0], $objArray)) {
                 $objArray[$objLineItem[0]][2] = $objLineItem[1];
             } else {
                 $objArray[$objLineItem[0]] = array($objLineItem[0], null, $objLineItem[1]);
             }
         }
     }
     // Bind the data
     $this->dtgReport->DataSource = $objArray;
 }
开发者ID:alcf,项目名称:chms,代码行数:47,代码来源:monthly_giving.php


示例19: setUp

 protected function setUp()
 {
     $this->dttOne = new QDateTime();
     $this->dttTwo = new QDateTime();
     $this->arrTimes = array(QDateTime::FromTimeOnly('00:00:00'), QDateTime::FromTimeOnly('06:35:00'), QDateTime::FromTimeOnly('23:59:59'));
     $this->arrDates = array(new QDateTime('1980-06-13'), new QDateTime('today'));
     $this->arrDatetimes = array(new QDateTime('1980-06-13 04:34'), new QDateTime(QDateTime::Now));
 }
开发者ID:qcodo,项目名称:qcodo,代码行数:8,代码来源:QDateTimeTest.php


示例20: btnSave_Click

 public function btnSave_Click()
 {
     if (!$this->mctComments->EditMode) {
         $this->mctComments->Comment->DatePosted = QDateTime::Now();
     }
     $this->mctComments->SaveComment();
     QApplication::ExecuteJavaScript('document.location="#comments";');
 }
开发者ID:alcf,项目名称:chms,代码行数:8,代码来源:Vicp_Comments_EditComment.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP QM_Collectors类代码示例发布时间:2022-05-23
下一篇:
PHP QDatabaseRowBase类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap