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


PHP QDateTime::NowToString方法代码示例

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


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

示例1: Send


//.........这里部分代码省略.........
         throw new QEmailException(sprintf('Not a valid To address: %s', $objMessage->To));
     }
     $strAddressCcArray = QEmailServer::GetEmailAddresses($objMessage->Cc);
     if (!$strAddressCcArray) {
         $strAddressCcArray = array();
     }
     $strAddressBccArray = QEmailServer::GetEmailAddresses($objMessage->Bcc);
     if (!$strAddressBccArray) {
         $strAddressBccArray = array();
     }
     $strAddressCcBccArray = array_merge($strAddressCcArray, $strAddressBccArray);
     $strAddressArray = array_merge($strAddressToArray, $strAddressCcBccArray);
     // Send: RCPT TO line(s)
     foreach ($strAddressArray as $strAddress) {
         fwrite($objResource, sprintf("RCPT TO: <%s>\r\n", $strAddress));
         if (!QEmailServer::$TestMode && !feof($objResource)) {
             $strResponse = fgets($objResource, 4096);
             // Check for a "250" response
             if (strpos($strResponse, "250") === false || strpos($strResponse, "250") != 0) {
                 throw new QEmailException(sprintf('Error Response on RCPT TO: %s', $strResponse));
             }
         }
     }
     // Send: DATA
     fwrite($objResource, "DATA\r\n");
     if (!QEmailServer::$TestMode && !feof($objResource)) {
         $strResponse = fgets($objResource, 4096);
         // Check for a "354" response
         if (strpos($strResponse, "354") === false || strpos($strResponse, "354") != 0) {
             throw new QEmailException(sprintf('Error Response on DATA: %s', $strResponse));
         }
     }
     // Send: Required Headers
     fwrite($objResource, sprintf("Date: %s\r\n", QDateTime::NowToString(QDateTime::FormatRfc822)));
     fwrite($objResource, sprintf("To: %s\r\n", $objMessage->To));
     fwrite($objResource, sprintf("From: %s\r\n", $objMessage->From));
     // Send: Optional Headers
     if ($objMessage->Subject) {
         fwrite($objResource, sprintf("Subject: %s\r\n", $objMessage->Subject));
     }
     if ($objMessage->Cc) {
         fwrite($objResource, sprintf("Cc: %s\r\n", $objMessage->Cc));
     }
     // Send: Content-Type Header (if applicable)
     $semi_random = md5(time());
     $strBoundary = sprintf('==qcodo_qemailserver_multipart_boundary____x%sx', $semi_random);
     // Send: Other Headers (if any)
     foreach ($objArray = $objMessage->HeaderArray as $strKey => $strValue) {
         fwrite($objResource, sprintf("%s: %s\r\n", $strKey, $strValue));
     }
     // if we are adding an html or files to the message we need these headers.
     if ($objMessage->HasFiles || $objMessage->HtmlBody) {
         fwrite($objResource, "MIME-Version: 1.0\r\n");
         fwrite($objResource, sprintf("Content-Type: multipart/mixed;\r\n boundary=\"%s\"\r\n", $strBoundary));
         fwrite($objResource, sprintf("This is a multipart message in MIME format.\r\n\r\n", $strBoundary));
         fwrite($objResource, sprintf("--%s\r\n", $strBoundary));
     }
     $strAltBoundary = sprintf('==qcodo_qemailserver_alternative_boundary____x%sx', $semi_random);
     // Send: Body
     // Setup Encoding Type (use QEmailServer if specified, otherwise default to QApplication's)
     if (!($strEncodingType = QEmailServer::$EncodingType)) {
         $strEncodingType = QApplication::$EncodingType;
     }
     if ($objMessage->HtmlBody) {
         fwrite($objResource, sprintf("Content-Type: multipart/alternative;\r\n boundary=\"%s\"\r\n\r\n", $strAltBoundary));
         fwrite($objResource, sprintf("--%s\r\n", $strAltBoundary));
开发者ID:RCorbet,项目名称:zf-codo,代码行数:67,代码来源:QEmailServer.class.php

示例2: QEmailMessage

	
	For obvious reasons, this page is non-functional.  To view the commented out source,
	please click on <b>View Source</b> at the top right of the page.

<?php 
// We want to define our email SMTP server (it defaults to "localhost")
// This would typically be done in prepend.inc, and its value should probably be a constant
// that is defined in _configuration.inc
QEmailServer::$SmtpServer = 'mx.acme.com';
// Create a new message
// Note that you can list multiple addresses and that Qcodo supports Bcc and Cc
$objMessage = new QEmailMessage();
$objMessage->From = 'ACME Reporting Service <reporting@acme.com>';
$objMessage->To = 'John Doe <jdoe@acme.com>, Jane Doe <jdoe2@acme.com>';
$objMessage->Bcc = 'audit-system@acme.com';
$objMessage->Subject = 'Report for ' . QDateTime::NowToString(QDateTime::FormatDisplayDate);
// Setup Plaintext Message
$strBody = "Dear John and Jane Doe,\r\n\r\n";
$strBody .= "You have new reports to review.  Please go to the ACME Portal at http://portal.acme.com/ to review.\r\n\r\n";
$strBody .= "Regards,\r\nACME Reporting Service";
$objMessage->Body = $strBody;
// Also setup HTML message (optional)
$strBody = 'Dear John and Jane Doe,<br/><br/>';
$strBody .= '<b>You have new reports to review.</b>  Please go to the <a href="http://portal.acme.com/">ACME Portal</a> to review.<br/><br/>';
$strBody .= 'Regards,<br/><b>ACME Reporting Service</b>';
$objMessage->HtmlBody = $strBody;
// Add random/custom email headers
$objMessage->SetHeader('x-application', 'ACME Reporting Service v1.2a');
// Send the Message (Commented out for obvious reasons)
//	QEmailServer::Send($objMessage);
// Note that you can also shortcut the Send command to one line for simple messages (similar to PHP's mail())
开发者ID:kmcelhinney,项目名称:qcodo,代码行数:30,代码来源:email.php

示例3: CalculateMessageHeaderAndBody

 /**
  * Given the way this object is set up, it will return two-index string array containing the correct
  * SMTP Message Header and Message Body for this object.
  * 
  * This will make changes, cleanup and any additional setup to the HeaderArray in order to complete its task
  * 
  * @param string $strEncodingType the encoding type to use (if null, then it uses QApplication's)
  * @param QDateTime $dttSendDate the optional QDateTime to use for the Date field or NULL if you want to use Now()
  * @return string[] index 0 is the Header and index 1 is the Body
  */
 public function CalculateMessageHeaderAndBody($strEncodingType = null, QDateTime $dttSendDate = null)
 {
     // Setup Headers
     $this->RemoveHeader('Message-Id');
     $this->SetHeader('From', $this->From);
     $this->SetHeader('To', $this->To);
     if ($dttSendDate) {
         $this->SetHeader('Date', $dttSendDate->ToString(QDateTime::FormatRfc822));
     } else {
         $this->SetHeader('Date', QDateTime::NowToString(QDateTime::FormatRfc822));
     }
     // Setup Encoding Type (default to QApplication's if not specified)
     if (!$strEncodingType) {
         $strEncodingType = QApplication::$EncodingType;
     }
     // Additional "Optional" Headers
     if ($this->Subject) {
         $strSubject = self::QuotedPrintableEncode($this->Subject);
         $strSubject = str_replace('?', '=3F', $strSubject);
         $this->SetHeader('Subject', sprintf("=?%s?Q?%s?=", $strEncodingType, $strSubject));
     }
     if ($this->Cc) {
         $this->SetHeader('Cc', $this->Cc);
     }
     // Setup for MIME and Content Encoding
     $strBoundaryArray = $this->SetupMimeHeaders($strEncodingType);
     $strBoundary = $strBoundaryArray[0];
     $strAltBoundary = $strBoundaryArray[1];
     // Generate MessageHeader
     $strHeader = $this->CalculateMessageHeader();
     // Generate MessageBody
     $strBody = $this->CalculateMessageBody($strEncodingType, $strBoundary, $strAltBoundary);
     return array($strHeader, $strBody);
 }
开发者ID:harshanurodh,项目名称:qcodo,代码行数:44,代码来源:QEmailServer.class.php

示例4: GetTmx

 /**
  * Returns a tmx file
  * @param QQCondition $objLangCondition e.g. QQ::In(QQN::NarroText()->NarroSuggestionAsText->LanguageId, QApplication::GetLanguageId());
  * @return a tmx file, formatted as a string
  */
 public static function GetTmx($objLangCondition)
 {
     $tmx = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE tmx SYSTEM "tmx13.dtd"><tmx />');
     $tmx->addAttribute('version', '1.3');
     $header = $tmx->addChild('header');
     // mandatory
     $header->addAttribute('creationtool', "Narro");
     $header->addAttribute('creationtoolversion', NARRO_VERSION);
     $header->addAttribute('segtype', "sentence");
     $header->addAttribute('o-tmf', "ABCTransMem");
     $header->addAttribute('adminlang', NarroLanguage::SOURCE_LANGUAGE_CODE);
     $header->addAttribute('srclang', NarroLanguage::SOURCE_LANGUAGE_CODE);
     $header->addAttribute('datatype', "PlainText");
     // optional
     $header->addAttribute('creationdate', QDateTime::NowToString('YYYYMMDDThhmmssZ'));
     if (QApplication::$User) {
         $header->addAttribute('creationid', QApplication::$User->Username);
     }
     $header->addAttribute('changedate', "19970314T023401Z");
     $header->addAttribute('o-encoding', "utf-8");
     $body = $tmx->addChild('body');
     $strQuery = NarroText::GetQueryStatement($objQueryBuilder, QQ::AndCondition(QQ::IsNotNull(QQN::NarroText()->NarroSuggestionAsText->SuggestionId), $objLangCondition), array(QQ::ExpandAsArray(QQN::NarroText()->NarroSuggestionAsText)), array(), false);
     $objDbResult = NarroText::GetDatabase()->Query($strQuery);
     $intRowCount = $objDbResult->CountRows();
     $intLastTextId = 0;
     while ($objDbRow = $objDbResult->GetNextRow()) {
         $objText = NarroText::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, null, $objQueryBuilder->ColumnAliasArray);
         if ($intLastTextId != $objText->TextId) {
             $intLastTextId = $objText->TextId;
             $tu = $body->addChild('tu');
             $tu->addAttribute('tuid', $objText->TextId);
             $tu->addAttribute('datatype', 'Text');
             // $tu->addAttribute('usagecount', $objText->CountNarroContextsAsText());
             // $objLastContext = NarroContext::QuerySingle(QQ::Equal(QQN::NarroContext()->TextId, $objText->TextId), array(QQ::OrderBy(QQN::NarroContext()->Created, 0)));
             // if ($objLastContext && $objLastContext->Created instanceof QDateTime)
             // $tu->addAttribute('lastusagedate', $objLastContext->Created->qFormat('YYYYMMDDThhmmssZ'));
             $tuv = $tu->addChild('tuv');
             $tuv->addAttribute('xml:lang', NarroLanguage::SOURCE_LANGUAGE_CODE);
             $seg = $tuv->addChild('seg');
             $tuv->seg = $objText->TextValue;
             if ($objText->Created instanceof QDateTime) {
                 $tuv->addAttribute('creationdate', $objText->Created->qFormat('YYYYMMDDThhmmssZ'));
             }
             if ($objText->Modified instanceof QDateTime) {
                 $tuv->addAttribute('changedate', $objText->Modified->qFormat('YYYYMMDDThhmmssZ'));
             }
         }
         foreach ($objText->_NarroSuggestionAsTextArray as $objSuggestion) {
             /* @var $objSuggestion NarroSuggestion */
             $tuv = $tu->addChild('tuv');
             $tuv->addAttribute('xml:lang', $objSuggestion->Language->LanguageCode);
             $seg = $tuv->addChild('seg');
             $tuv->seg = $objSuggestion->SuggestionValue;
             if ($objSuggestion->Created instanceof QDateTime) {
                 $tuv->addAttribute('creationdate', $objSuggestion->Created->qFormat('YYYYMMDDThhmmssZ'));
             }
             if ($objSuggestion->Modified instanceof QDateTime) {
                 $tuv->addAttribute('changedate', $objSuggestion->Modified->qFormat('YYYYMMDDThhmmssZ'));
             }
             if ($objSuggestion->User instanceof NarroUser) {
                 $tuv->addAttribute('creationid', $objSuggestion->User->RealName);
             }
             // $tuv->addAttribute('usagecount', $objSuggestion->CountNarroContextInfosAsValidSuggestion());
             // $objLastContextInfo = NarroContextInfo::QuerySingle(QQ::Equal(QQN::NarroContextInfo()->ValidSuggestionId, $objSuggestion->SuggestionId), array(QQ::OrderBy(QQN::NarroContextInfo()->Created, 0)));
             // if ($objLastContextInfo && $objLastContextInfo->Created instanceof QDateTime)
             // $tuv->addAttribute('lastusagedate', $objLastContextInfo->Created->qFormat('YYYYMMDDThhmmssZ'));
         }
     }
     return $tmx->asXML();
 }
开发者ID:Jobava,项目名称:narro,代码行数:75,代码来源:NarroLanguage.class.php

示例5: Send


//.........这里部分代码省略.........
     $strAddressArray = QEmailServer::GetEmailAddresses($objMessage->From);
     if (count($strAddressArray) != 1) {
         throw new QEmailException(sprintf('Not a valid From address: %s', $objMessage->From));
     }
     // Send: MAIL FROM line
     fwrite($objResource, sprintf("MAIL FROM: %s\r\n", $strAddressArray[0]));
     if (!feof($objResource)) {
         $strResponse = fgets($objResource, 4096);
         // Check for a "250" response
         if (strpos($strResponse, "250") === false || strpos($strResponse, "250") != 0) {
             throw new QEmailException(sprintf('Error Response on MAIL FROM: %s', $strResponse));
         }
     }
     // Setup RCPT TO line(s)
     $strAddressToArray = QEmailServer::GetEmailAddresses($objMessage->To);
     if (!$strAddressToArray) {
         throw new QEmailException(sprintf('Not a valid To address: %s', $objMessage->To));
     }
     $strAddressCcArray = QEmailServer::GetEmailAddresses($objMessage->Cc);
     if (!$strAddressCcArray) {
         $strAddressCcArray = array();
     }
     $strAddressBccArray = QEmailServer::GetEmailAddresses($objMessage->Bcc);
     if (!$strAddressBccArray) {
         $strAddressBccArray = array();
     }
     $strAddressCcBccArray = array_merge($strAddressCcArray, $strAddressBccArray);
     $strAddressArray = array_merge($strAddressToArray, $strAddressCcBccArray);
     // Send: RCPT TO line(s)
     foreach ($strAddressArray as $strAddress) {
         fwrite($objResource, sprintf("RCPT TO: %s\r\n", $strAddress));
         if (!feof($objResource)) {
             $strResponse = fgets($objResource, 4096);
             // Check for a "250" response
             if (strpos($strResponse, "250") === false || strpos($strResponse, "250") != 0) {
                 throw new QEmailException(sprintf('Error Response on RCPT TO: %s', $strResponse));
             }
         }
     }
     // Send: DATA
     fwrite($objResource, "DATA\r\n");
     if (!feof($objResource)) {
         $strResponse = fgets($objResource, 4096);
         // Check for a "354" response
         if (strpos($strResponse, "354") === false || strpos($strResponse, "354") != 0) {
             throw new QEmailException(sprintf('Error Response on DATA: %s', $strResponse));
         }
     }
     // Send: Required Headers
     fwrite($objResource, sprintf("Date: %s\r\n", QDateTime::NowToString(QDateTime::FormatRfc822)));
     fwrite($objResource, sprintf("To: %s\r\n", $objMessage->To));
     fwrite($objResource, sprintf("From: %s\r\n", $objMessage->From));
     // Send: Optional Headers
     if ($objMessage->Subject) {
         fwrite($objResource, sprintf("Subject: %s\r\n", $objMessage->Subject));
     }
     if ($objMessage->Cc) {
         fwrite($objResource, sprintf("Cc: %s\r\n", $objMessage->Cc));
     }
     // Send: Content-Type Header (if applicable)
     $strBoundary = 'qcodo_qemailserver_multipart_boundary____';
     if ($objMessage->HtmlBody) {
         fwrite($objResource, sprintf("Content-Type: multipart/alternative; boundary=\"%s\"\r\n", $strBoundary));
     }
     // Send: Other Headers (if any)
     foreach ($objArray = $objMessage->HeaderArray as $strKey => $strValue) {
         fwrite($objResource, sprintf("%s: %s\r\n", $strKey, $strValue));
     }
     // Send: Body
     fwrite($objResource, "\r\n");
     if ($objMessage->HtmlBody) {
         fwrite($objResource, sprintf("--%s\r\n", $strBoundary));
         fwrite($objResource, sprintf("Content-Type: text/plain; charset=%s\r\n\r\n", QApplication::$EncodingType));
         fwrite($objResource, $objMessage->Body);
         fwrite($objResource, "\r\n\r\n\r\n");
         fwrite($objResource, sprintf("--%s\r\n", $strBoundary));
         fwrite($objResource, sprintf("Content-Type: text/html; charset=%s\r\n\r\n", QApplication::$EncodingType));
         fwrite($objResource, $objMessage->HtmlBody);
         fwrite($objResource, "\r\n\r\n\r\n");
         fwrite($objResource, sprintf("--%s--\r\n", $strBoundary));
     } else {
         fwrite($objResource, $objMessage->Body);
     }
     // Send: Message End
     fwrite($objResource, "\r\n.\r\n");
     if (!feof($objResource)) {
         $strResponse = fgets($objResource, 4096);
         // Check for a "250" response
         if (strpos($strResponse, "250") === false || strpos($strResponse, "250") != 0) {
             throw new QEmailException(sprintf('Error Response on MAIL FROM: %s', $strResponse));
         }
     }
     // Send: QUIT
     fwrite($objResource, "QUIT\r\n");
     if (!feof($objResource)) {
         $strResponse = fgets($objResource, 4096);
     }
     // Close the Resource
     fclose($objResource);
 }
开发者ID:qcodo,项目名称:qcodo-api,代码行数:101,代码来源:QEmailServer.class.php

示例6: foreach

<?php

require_once '../qcubed.inc.php';
QApplication::CheckRemoteAdmin();
echo "<h2>Unattended Plugin Installer</h2>";
echo "<p><em>" . QDateTime::NowToString(QDateTime::FormatDisplayDateTime) . "</em></p>";
$directory = __INCLUDES__ . '/tmp/plugin.install';
$arrFiles = QFolder::listFilesInFolder($directory, false, "/\\.zip\$/i");
if (sizeof($arrFiles) > 0) {
    foreach ($arrFiles as $strFile) {
        echo "<h2>Installing " . $strFile . "</h2>";
        $fullFilePath = $directory . '/' . $strFile;
        try {
            $pluginFolder = QPluginInstaller::installPluginFromZip($fullFilePath);
            if ($pluginFolder) {
                list($strStatus, $strLog) = QPluginInstaller::installFromExpanded($pluginFolder);
                unlink($fullFilePath);
                echo nl2br($strLog);
            }
        } catch (Exception $e) {
            echo '<div class="error">Error installing the plugin: ' . $e->getMessage() . '</div>';
        }
    }
} else {
    echo "<p>No plugin zip files found in the unattended install directory: " . $directory . "</p>";
    echo "<p>Download new plugins from the <a target='_blank' href='" . QPluginInstaller::ONLINE_PLUGIN_REPOSITORY . "'>" . "Online repository of QCubed plugins</a></p>";
}
开发者ID:tomVertuoz,项目名称:framework,代码行数:27,代码来源:plugin_unattended.php

示例7: LogTime

function LogTime($strSection)
{
    global $__fltTime;
    file_put_contents('/tmp/trace.txt', QDateTime::NowToString(QDateTime::FormatIso) . ' - ' . $strSection . ' - ' . (microtime(true) - $__fltTime) . "\r\n", FILE_APPEND);
    $__fltTime = microtime(true);
}
开发者ID:qcodo,项目名称:qcodo-api,代码行数:6,代码来源:QFormBase+(0.3.9).class.php

示例8: PaymentGatewaySubmitRequest

 /**
  * This will submit a NVP Request to paypal and return the repsonse
  * or NULL if there was a connection error.
  * 
  * @param string[] $strNvpRequestArray a structured array containing the NVP Request
  * @return string[] a structured array based on the NVP Response, or NULL if there was a connection error
  */
 protected static function PaymentGatewaySubmitRequest($strNvpRequestArray)
 {
     $strLogFile = 'paypal_' . QDateTime::NowToString('YYYY-MM-DD');
     $strLogHash = substr(md5(microtime()), 0, 8);
     $objCurl = curl_init();
     curl_setopt($objCurl, CURLOPT_URL, PAYPAL_ENDPOINT);
     curl_setopt($objCurl, CURLOPT_VERBOSE, false);
     // Turning off the server and peer verification (TrustManager Concept)
     curl_setopt($objCurl, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($objCurl, CURLOPT_SSL_VERIFYHOST, false);
     curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($objCurl, CURLOPT_POST, true);
     // Add Credentials to NVP-based Request for submitting to server
     $strNvpRequestArray['PARTNER'] = PAYPAL_PARTNER;
     $strNvpRequestArray['USER'] = PAYPAL_USER;
     $strNvpRequestArray['VENDOR'] = PAYPAL_VENDOR;
     $strNvpRequestArray['PWD'] = PAYPAL_PASSWORD;
     $strNvpRequest = self::FormatNvp($strNvpRequestArray);
     // First, we Sanitize NVP Request for Logging and then log it
     $strNvpRequestToLog = $strNvpRequestArray;
     $strNvpRequestToLog['PARTNER'] = 'xxxxx';
     $strNvpRequestToLog['USER'] = 'xxxxx';
     $strNvpRequestToLog['VENDOR'] = 'xxxxx';
     $strNvpRequestToLog['PWD'] = 'xxxxx';
     if (array_key_exists('ACCT', $strNvpRequestToLog)) {
         $intLength = strlen($strNvpRequestToLog['ACCT']);
         $strNvpRequestToLog['ACCT'] = str_repeat('x', $intLength - 4) . substr($strNvpRequestToLog['ACCT'], $intLength - 4);
     }
     QLog::Log($strLogHash . ' - ' . self::FormatNvp($strNvpRequestToLog), QLogLevel::Normal, $strLogFile);
     // Setting the entire NvpRequest as POST FIELD to curl
     curl_setopt($objCurl, CURLOPT_POSTFIELDS, $strNvpRequest);
     // Getting response from server
     $strResponse = @curl_exec($objCurl);
     curl_close($objCurl);
     if ($strResponse) {
         $arrToReturn = self::DeformatNvp($strResponse);
         QLog::Log($strLogHash . ' - ' . var_export($arrToReturn, true), QLogLevel::Normal, $strLogFile);
         return $arrToReturn;
     } else {
         QLog::Log($strLogHash . ' - ' . 'ERROR', QLogLevel::Normal, $strLogFile);
         return null;
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:50,代码来源:CreditCardPayment.class.php

示例9: DrawInfo

 protected static function DrawInfo(Zend_Pdf_Page $objPage, $objPersonOrHousehold, $intYear, $intQuarter, $intY, $intPageNumber, $intTotalPages)
 {
     $intXRight = 8 * 72;
     $objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD), 12);
     self::DrawTextRight($objPage, $intXRight, $intY, 'Giving Receipt');
     $intY -= 13.2;
     $objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 12);
     if ($intQuarter) {
         $strQuarter = '';
         switch ($intQuarter) {
             case 1:
                 $strQuarter = '1st Quarter';
                 break;
             case 2:
                 $strQuarter = '2nd Quarter';
                 break;
             case 3:
                 $strQuarter = '3rd Quarter';
                 break;
         }
         self::DrawTextRight($objPage, $intXRight, $intY, 'Reflects ' . $intYear . ' Gifts for ' . $strQuarter);
     } else {
         self::DrawTextRight($objPage, $intXRight, $intY, 'Reflects ' . $intYear . ' Gifts');
     }
     $intY -= 15;
     $objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_ITALIC), 8);
     self::DrawTextRight($objPage, $intXRight, $intY, 'Receipt generated on ' . QDateTime::NowToString('MMMM D, YYYY'));
     $intY -= 10;
     $objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_ITALIC), 8);
     self::DrawTextRight($objPage, $intXRight, $intY, sprintf('Page %s of %s', $intPageNumber, $intTotalPages));
 }
开发者ID:alcf,项目名称:chms,代码行数:31,代码来源:StewardshipContribution.class.php

示例10: Form_Create

 protected function Form_Create()
 {
     $this->objBatch = PaypalBatch::Load(QApplication::PathInfo(0));
     if (!$this->objBatch) {
         QApplication::Redirect('/stewardship/paypal');
     }
     $this->strPageTitle .= $this->objBatch->Number;
     $this->dtgTransactions = new QDataGrid($this);
     $this->dtgTransactions->SetDataBinder('dtgTransactions_Bind');
     $this->dtgTransactions->AddColumn(new QDataGridColumn('Date Captured', '<?= $_ITEM[0]; ?>', 'Width=150px', 'HtmlEntities=false', 'VerticalAlign=top'));
     $this->dtgTransactions->AddColumn(new QDataGridColumn('Total Amount Charged', '<?= $_ITEM[1]; ?>', 'Width=150px', 'VerticalAlign=top'));
     $this->dtgTransactions->AddColumn(new QDataGridColumn('Transaction Code', '<?= $_ITEM[2]; ?>', 'Width=120px', 'VerticalAlign=top'));
     $this->dtgTransactions->AddColumn(new QDataGridColumn('Account Funding', '<?= $_ITEM[3]; ?>', 'Width=330px', 'HtmlEntities=false', 'VerticalAlign=top', 'FontSize=10px'));
     $this->dtgTransactions->AddColumn(new QDataGridColumn('Funding Amount', '<?= $_ITEM[4]; ?>', 'Width=150px', 'HtmlEntities=false', 'VerticalAlign=top', 'FontSize=10px'));
     $this->dtgFunding = new QDataGrid($this);
     $this->dtgFunding->SetDataBinder('dtgFunding_Bind');
     $this->dtgFunding->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM[0]; ?>', 'Width=340px', 'HtmlEntities=false'));
     $this->dtgFunding->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM[1]; ?>', 'Width=200px'));
     $this->dtgFunding->AddColumn(new QDataGridColumn('Amount', '<?= $_ITEM[2]; ?>', 'HtmlEntities=false', 'Width=380px', 'HtmlEntities=false'));
     $this->dtgUnaccounted = new CreditCardPaymentDataGrid($this);
     $this->dtgUnaccounted->MetaAddColumn('DateCaptured', 'Width=200px');
     $this->dtgUnaccounted->MetaAddColumn('AmountCharged', 'Html=<?= QApplication::DisplayCurrency($_ITEM->AmountCharged); ?>', 'Width=150px');
     $this->dtgUnaccounted->MetaAddColumn('TransactionCode', 'Width=500px');
     $this->dtgUnaccounted->SortColumnIndex = 0;
     $this->dtgUnaccounted->SetDataBinder('dtgUnaccounted_Bind');
     $this->dtgUnaccounted->NoDataHtml = 'Good!  There are no unaccounted-for credit card transaction entries in this PayPal batch.';
     $this->pxyEditFundDonationLineItem = new QControlProxy($this);
     $this->pxyEditFundDonationLineItem->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFundDonationLineItem_Click'));
     $this->pxyEditFundDonationLineItem->AddAction(new QClickEvent(), new QTerminateAction());
     $this->pxyEditFundSignupPayment = new QControlProxy($this);
     $this->pxyEditFundSignupPayment->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFundSignupPayment_Click'));
     $this->pxyEditFundSignupPayment->AddAction(new QClickEvent(), new QTerminateAction());
     $this->lblInstructionHtml = new QLabel($this);
     $this->lblInstructionHtml->TagName = 'p';
     $this->lblInstructionHtml->HtmlEntities = false;
     $this->dtxDateCredited = new QDateTimeTextBox($this);
     $this->dtxDateCredited->Name = 'Date to Credit Stewardship Contributions';
     $this->dtxDateCredited->Text = QDateTime::NowToString('MMMM D YYYY');
     $this->dtxDateCredited->Required = true;
     $this->btnPost = new QButton($this);
     $this->btnPost->Text = 'Post to NOAH';
     $this->btnPost->CssClass = 'primary';
     $this->btnPost->CausesValidation = $this->dtxDateCredited;
     $this->btnSplit = new QButton($this);
     $this->btnSplit->Text = 'Split This Batch';
     $this->btnSplit->CssClass = 'alternate';
     $this->btnSplit->SetCustomStyle('float', 'right');
     $this->btnSplit->AddAction(new QClickEvent(), new QAjaxAction('btnSplit_Click'));
     $this->dlgEditFund = new QDialogBox($this);
     $this->dlgEditFund->MatteClickable = false;
     $this->dlgEditFund->HideDialogBox();
     $this->dlgEditFund->Template = dirname(__FILE__) . '/dlgEditFund.tpl.php';
     $this->lblDialogFund = new QLabel($this->dlgEditFund);
     $this->lblDialogFund->Text = 'Please specify the appropriate Stewardship Funding Account for this line item.';
     $this->lblDialogFund->Visible = false;
     $this->lstDialogFund = new QListBox($this->dlgEditFund);
     $this->lstDialogFund->Name = 'Stewardship Fund';
     $this->lstDialogFund->AddItem('- Select One -', null);
     $this->lstDialogFund->Required = true;
     foreach (StewardshipFund::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) {
         $this->lstDialogFund->AddItem($objFund->Name, $objFund->Id);
     }
     $this->lstDialogFund->AddItem('- Other (Non-Donation)... -', -1);
     $this->lstDialogFund->AddAction(new QChangeEvent(), new QAjaxAction('lstDialogFund_Change'));
     $this->lstDialogFund->Visible = false;
     $this->txtDialogOther = new QTextBox($this->dlgEditFund);
     $this->txtDialogOther->Name = 'Non-Donation Funding Account';
     $this->txtDialogOther->Visible = false;
     $this->lblDialogSplitFund = new QLabel($this->dlgEditFund);
     $this->lblDialogSplitFund->Visible = false;
     $this->lstDialogSplitFund = array();
     $this->txtDialogSplitOther = array();
     $this->txtDialogSplitAmount = array();
     $this->lblDialogSplitFundTitle = array();
     for ($i = 0; $i < 2; $i++) {
         $this->lblDialogSplitFundTitle[$i] = new QLabel($this->dlgEditFund);
         $this->lblDialogSplitFundTitle[$i]->HtmlEntities = false;
         $this->lblDialogSplitFundTitle[$i]->Text = '<h4>Line Item ' . ($i + 1) . '</h4>';
         $this->lblDialogSplitFundTitle[$i]->Visible = false;
         $this->lstDialogSplitFund[$i] = new QListBox($this->dlgEditFund);
         $this->lstDialogSplitFund[$i]->Name = 'Stewardship Fund';
         $this->lstDialogSplitFund[$i]->AddItem('- Select One -', null);
         $this->lstDialogSplitFund[$i]->Required = true;
         foreach (StewardshipFund::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) {
             $this->lstDialogSplitFund[$i]->AddItem($objFund->Name, $objFund->Id);
         }
         $this->lstDialogSplitFund[$i]->AddItem('- Other (Non-Donation)... -', -1);
         $this->lstDialogSplitFund[$i]->ActionParameter = $i;
         $this->lstDialogSplitFund[$i]->AddAction(new QChangeEvent(), new QAjaxAction('lstDialogSplitFund_Change'));
         $this->lstDialogSplitFund[$i]->Visible = false;
         $this->txtDialogSplitOther[$i] = new QTextBox($this->dlgEditFund);
         $this->txtDialogSplitOther[$i]->Name = 'Non-Donation Funding Account';
         $this->txtDialogSplitOther[$i]->Visible = false;
         $this->txtDialogSplitAmount[$i] = new QFloatTextBox($this->dlgEditFund);
         $this->txtDialogSplitAmount[$i]->Name = 'Funding Amount';
         $this->txtDialogSplitAmount[$i]->Visible = false;
     }
     $this->rbtnUpdateFundSelection = new QRadioButtonList($this->dlgEditFund);
     $this->rbtnUpdateFundSelection->AddItem('Change Stewardship Funding Account of the Line Item', 1);
     $this->rbtnUpdateFundSelection->AddItem('Split this Line Item into two separate Funding Accounts', 2);
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:batch.php


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