当前位置: 首页>>代码示例>>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;未经允许,请勿转载。