當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilFormat::ftimestamp2dateDB方法代碼示例

本文整理匯總了PHP中ilFormat::ftimestamp2dateDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilFormat::ftimestamp2dateDB方法的具體用法?PHP ilFormat::ftimestamp2dateDB怎麽用?PHP ilFormat::ftimestamp2dateDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilFormat的用法示例。


在下文中一共展示了ilFormat::ftimestamp2dateDB方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildExportFileXLS

 /**
  * build xml export file
  */
 function buildExportFileXLS()
 {
     global $ilBench;
     $ilBench->start("QuestionpoolExport", "buildExportFile");
     include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php";
     $adapter = new ilExcelWriterAdapter($this->export_dir . "/" . $this->filename, FALSE);
     $workbook = $adapter->getWorkbook();
     $workbook->setVersion(8);
     // Use Excel97/2000 Format
     $format_bold =& $workbook->addFormat();
     $format_bold->setBold();
     $format_percent =& $workbook->addFormat();
     $format_percent->setNumFormat("0.00%");
     $format_datetime =& $workbook->addFormat();
     $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
     $format_title =& $workbook->addFormat();
     $format_title->setBold();
     $format_title->setColor('black');
     $format_title->setPattern(1);
     $format_title->setFgColor('silver');
     $worksheet =& $workbook->addWorksheet();
     $row = 0;
     $col = 0;
     // title row
     include_once "./Services/Excel/classes/class.ilExcelUtils.php";
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("title"), "latin1"), $format_title);
     $col++;
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("description"), "latin1"), $format_title);
     $col++;
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("question_type"), "latin1"), $format_title);
     $col++;
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("author"), "latin1"), $format_title);
     $col++;
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("create_date"), "latin1"), $format_title);
     $col++;
     $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt("last_update"), "latin1"), $format_title);
     $col = 0;
     $row++;
     $questions = $this->qpl_obj->getQuestionList();
     foreach ($questions as $question) {
         $worksheet->write($row, $col, ilExcelUtils::_convert_text($question["title"], "latin1"));
         $col++;
         $worksheet->write($row, $col, ilExcelUtils::_convert_text($question["description"], "latin1"));
         $col++;
         $worksheet->write($row, $col, ilExcelUtils::_convert_text($this->lng->txt($question["type_tag"]), "latin1"));
         $col++;
         $worksheet->write($row, $col, ilExcelUtils::_convert_text($question["author"], "latin1"));
         $col++;
         //			ilDatePresentation::formatDate(new ilDateTime($question["created"],IL_CAL_UNIX))
         $worksheet->write($row, $col, ilExcelUtils::_convert_text(ilFormat::formatDate(ilFormat::ftimestamp2dateDB($question["created"]), "date"), "latin1"));
         $col++;
         $worksheet->write($row, $col, ilExcelUtils::_convert_text(ilFormat::formatDate(ilFormat::ftimestamp2dateDB($question["tstamp"]), "date"), "latin1"));
         $col = 0;
         $row++;
     }
     $workbook->close();
     ilUtil::zip($this->export_dir . "/" . $this->filename, $this->export_dir . "/" . $this->zipfilename);
     if (@file_exists($this->export_dir . "/" . $this->filename)) {
         @unlink($this->export_dir . "/" . $this->filename);
     }
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:65,代碼來源:class.ilQuestionpoolExport.php


注:本文中的ilFormat::ftimestamp2dateDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。