Always show document view
This commit is contained in:
@@ -7,14 +7,21 @@ include_once "console.php";
|
|||||||
include_once "scanner.php";
|
include_once "scanner.php";
|
||||||
|
|
||||||
function RenderDocument($filePath){
|
function RenderDocument($filePath){
|
||||||
|
$render="";
|
||||||
|
if($filePath!=null){
|
||||||
$filename=pathinfo($filePath)["basename"];
|
$filename=pathinfo($filePath)["basename"];
|
||||||
$filePathFixed=htmlentities($filePath,ENT_HTML5, "UTF-8");
|
$filePathFixed=htmlentities($filePath,ENT_HTML5, "UTF-8");
|
||||||
$filenameFixed=htmlentities($filename,ENT_HTML5, "UTF-8");
|
$filenameFixed=htmlentities($filename,ENT_HTML5, "UTF-8");
|
||||||
$render="";
|
|
||||||
$render.='<div><a href="'.$filePathFixed.'" class="button" download="'.$filenameFixed.'">'.
|
$render.='<div><a href="'.$filePathFixed.'" class="button" download="'.$filenameFixed.'">'.
|
||||||
'Download</a></div>'."\n";
|
'Download</a></div>'."\n";
|
||||||
$render.='<iframe src="'.$filePathFixed.'" '.
|
$render.='<iframe src="'.$filePathFixed.'" '.
|
||||||
'class="previewDoc" ></iframe>';
|
'class="previewDoc" ></iframe>';
|
||||||
|
}else{
|
||||||
|
$render.='<div><button class="button" disabled="disabled">'.
|
||||||
|
'Download</button></div>'."\n";
|
||||||
|
$render.='<iframe src="about:blank" '.
|
||||||
|
'class="previewDoc" ></iframe>';
|
||||||
|
}
|
||||||
return $render;
|
return $render;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,11 +65,7 @@ $formFields.=RenderHidden("hidScanDevice",$Scanner["ScanDevice"]);
|
|||||||
$formFields.=RenderHidden("hidScanModel",$Scanner["ScanModel"]);
|
$formFields.=RenderHidden("hidScanModel",$Scanner["ScanModel"]);
|
||||||
$columns="";
|
$columns="";
|
||||||
$columns.=renderDiv("divColLeft",$formFields);
|
$columns.=renderDiv("divColLeft",$formFields);
|
||||||
$result="";
|
$columns.=renderDiv("divColRight",RenderDocument($DestFile));
|
||||||
if($DestFile!=null){
|
|
||||||
$result.=RenderDocument($DestFile);
|
|
||||||
}
|
|
||||||
$columns.=renderDiv("divColRight",$result);
|
|
||||||
$columns.=RenderCommandLog();
|
$columns.=RenderCommandLog();
|
||||||
$columns.=RenderDiv("divLoadBack",RenderDiv("divLoading","Loading","divLoading"),"divLoadBack","display:none;");
|
$columns.=RenderDiv("divLoadBack",RenderDiv("divLoading","Loading","divLoading"),"divLoadBack","display:none;");
|
||||||
echo RenderForm("frmMain",$columns);
|
echo RenderForm("frmMain",$columns);
|
||||||
|
|||||||
Reference in New Issue
Block a user