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


PHP Spreadsheet_Excel_Reader::hyperlink方法代碼示例

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


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

示例1: phpform


//.........這裏部分代碼省略.........
             //db fields
             for ($i = 2; $i <= $data->rowcount($sheetnum); $i++) {
                 $record = array();
                 $emptyrow = true;
                 //db fields
                 reset($fields);
                 foreach ($fields as $k => $v) {
                     //k  Field position into database
                     //k2 Position in Excel file
                     $k2 = array_search($fieldMapping[$v], $excelColNames);
                     //Is it in Excel file?
                     if ($k2 !== false) {
                         $excelColName = camila_strtoupper_utf8($data->value(1, $k2 + 1, $sheetnum));
                         //$excelColName = $v;
                         $worktableColName = array_search($excelColName, $fieldMapping);
                         $worktableColName = $v;
                         if ($worktableColName != '') {
                             if ($types[$k] == 'date' && $data->val($i, $k2 + 1, $sheetnum) != '') {
                                 $numValue = $data->sheets[$sheetnum]['cellsInfo'][$i][$k2 + 1]['raw'];
                                 $utcDays = floor($numValue - ($data->nineteenFour ? SPREADSHEET_EXCEL_READER_UTCOFFSETDAYS1904 : SPREADSHEET_EXCEL_READER_UTCOFFSETDAYS));
                                 $utcValue = $utcDays * SPREADSHEET_EXCEL_READER_MSINADAY;
                                 $dateinfo = gmgetdate($utcValue);
                                 $fractionalDay = $numValue - floor($numValue) + 1.0E-7;
                                 // The .0000001 is to fix for php/excel fractional diffs
                                 $totalseconds = floor(SPREADSHEET_EXCEL_READER_MSINADAY * $fractionalDay);
                                 $secs = $totalseconds % 60;
                                 $totalseconds -= $secs;
                                 $hours = floor($totalseconds / (60 * 60));
                                 $mins = floor($totalseconds / 60) % 60;
                                 $dt = date('Y-m-d', mktime($hours, $mins, $secs, $dateinfo["mon"], $dateinfo["mday"], $dateinfo["year"]));
                                 $record[$worktableColName] = $_CAMILA['db']->BindDate($dt);
                             } elseif ($orig_types[$k] == 'number' && $data->sheets[$sheetnum]['cellsInfo'][$i][$k2 + 1]['raw'] != '') {
                                 $record[$worktableColName] = $data->sheets[$sheetnum]['cellsInfo'][$i][$k2 + 1]['raw'];
                             } elseif ($types[$k] == 'hyperlink' && $data->hyperlink($i, $k2 + 1, $sheetnum) != '') {
                                 //$record[$worktableColName] = '<a href="' . $data->hyperlink($i, $k2+1, $sheetnum) . '" target="_blank">' . $data->value($i, $k2+1, $sheetnum) . '</a>';
                                 $record[$worktableColName] = $data->hyperlink($i, $k2 + 1, $sheetnum);
                             } else {
                                 $record[$worktableColName] = $data->value($i, $k2 + 1, $sheetnum);
                             }
                             if ($defVals[$k] != '' && $record[$worktableColName] == '') {
                                 $record[$worktableColName] = camila_parse_default_expression($defVals[$k], '_camila_seq_num_', true);
                             }
                             if ($record[$worktableColName] != '') {
                                 if ($forceCase[$k] == 'upper') {
                                     $record[$worktableColName] = mb_strtoupper($record[$worktableColName], 'UTF-8');
                                 }
                                 if ($forceCase[$k] == 'lower') {
                                     $record[$worktableColName] = mb_strtolower($record[$worktableColName], 'UTF-8');
                                 }
                                 $emptyrow = false;
                             }
                         }
                     } else {
                         if ($defVals[$k] != '') {
                             $record[$fields[$k]] = camila_parse_default_expression($defVals[$k], '_camila_seq_num_', true);
                         }
                     }
                 }
                 if (!$emptyrow) {
                     $now = $_CAMILA['db']->BindTimeStamp(gmdate("Y-m-d H:i:s", time()));
                     $id = $_CAMILA['db']->GenID('worktableseq', 100000);
                     foreach ($record as $k => $v) {
                         $record[$k] = str_replace('_camila_seq_num_', $id, $v);
                     }
                     $record['id'] = $id;
                     $record['created'] = $now;
開發者ID:umbecr,項目名稱:camilaframework,代碼行數:67,代碼來源:configurator.class.php


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