// ファイルハンドリング // if (isset($file_id) && $file_id) { // $tgt_file = DST_DIR . $file_id . ".xls"; $tgt_file = DST_DIR . $file_id . ORIG_EXT; } else { print "不正なアクセスです\n"; // put_err_page("不正なアクセスです"); die; } $conf = new FileConf($file_id); // Excelファイル読み込み処理 if ($tgt_file) { list($xls, $errmsg) = excel_peruser_factory($charset, $tgt_file); } put_config($file_id, $_REQUEST, $group_id, $sheet_id, $xls, $conf); $field_index = get_config($file_id, $conf); $marker_window = new MarkerWindowWebUI($conf->get("block_width"), $conf->get("block_height"), $conf->get("block_offsetx"), $conf->get("block_offsety"), $conf->get("block_size"), $_REQUEST['scale']); $sheet_marker = new SheetCellFitMarker($xls, $marker_window); put_rails($file_id, $sheet_marker, $rails_env, $conf); // // HTMLファイル作成処理 // if ($xls) { $html = put_header(); $html .= put_css($xls); $html .= put_excel($xls, $marker_window, $sheet_marker, $field_index, $conf, $debug_mode); $html .= put_footer(); file_put_contents(DST_DIR . $file_id . ".html", $html); $msg .= "put_excel\n"; }
/* $msg .= "tmp file: " . $tmp_file . "\n"; */ /* $msg .= "tmp xls: " . $template_xls . "\n"; */ if (filesize($tgt_file)) { $result = $reviser->buildFile($tmp_file, TMP_DIR); echo "rviser:" . $result; } if (!file_exists(DST_DIR . $file_id . ORIG_EXT)) { copy($tgt_file, DST_DIR . $file_id . ORIG_EXT); } if (file_exists(TMP_DIR . $tmp_file)) { rename(TMP_DIR . $tmp_file, $tgt_file); } flock($lockfp, LOCK_UN); fclose($lockfp); unlink(LOCK_FILE . $file_id); put_config($file_id, $_REQUEST, $target, $sheet_name, $list_colspan); // XXX: debugging purpose /* file_put_contents("/tmp/faxocr.log", "----------------------------------------\n" . date("Y/m/d H:i:s") . "\n(" . count($_REQUEST) . ")\n" . $msg . "\n\n", FILE_APPEND | LOCK_EX ); */ die; function is_next($prev, $next) { if (!isset($prev) || !isset($next)) { return false;