diff --git a/code/scans.php b/code/scans.php index 4787fbd..458e8cc 100644 --- a/code/scans.php +++ b/code/scans.php @@ -4,6 +4,7 @@ include_once "config.php"; include_once "utils.php"; include_once "ui.php"; + $Commands=array(); function ExecCommand($command){ @@ -136,16 +137,27 @@ function CropImage($file){ } +function RenderDocument($filePath){ + $filename=pathinfo($filePath)["basename"]; + $filePathFixed=htmlentities($filePath,ENT_HTML5, "UTF-8"); + $filenameFixed=htmlentities($filename,ENT_HTML5, "UTF-8"); + $render=""; + $render.='
'. + 'Download
'."\n"; + $render.=''; + return $render; +} + // Detect scanner $Scanner=array(); $Scanner["ScanDevice"]=RequestParm("hidScanDevice",""); -$Scanner["ScanModel"]=RequestParm("hidScanDevice",""); +$Scanner["ScanModel"]=RequestParm("hidScanModel",""); if($Scanner["ScanDevice"]=="" || $Scanner["ScanModel"]==""){ $Scanner=ScannerDetect(); } - // Configure with formdata $Resolution=RequestParm("ddlResolution",$Resolution); $Format=RequestParm("ddlFormat",$Format); @@ -165,31 +177,24 @@ if(RequestParm("btnScan",false)){ MoveToDest($DestFile); } - -echo '
'."\n"; - -// Render header info -echo RenderFieldInfo("Scanner",$Scanner["ScanModel"]); -echo RenderFieldCombo("Resolution","ddlResolution",$Resolutions,$Resolution); -echo RenderFieldCombo("Format","ddlFormat",$Formats,$Format); -echo RenderFieldCombo("Size","ddlSize",$Sizes,$Size); -echo RenderFieldCheckText("Cropping","chkCrop",$Crop,"txtCropFuzz",$CropFuzz); -echo RenderFieldButton("","btnScan","Scan"); -echo RenderHidden("hidScanDevice",$Scanner["ScanDevice"]); -echo RenderHidden("hidScanModel",$Scanner["ScanModel"]); - +// Render Form +$formFields=""; +$formFields.=RenderFieldInfo("Scanner",$Scanner["ScanModel"]); +$formFields.=RenderFieldCombo("Resolution","ddlResolution",$Resolutions,$Resolution); +$formFields.=RenderFieldCombo("Format","ddlFormat",$Formats,$Format); +$formFields.=RenderFieldCombo("Size","ddlSize",$Sizes,$Size); +$formFields.=RenderFieldCheckText("Cropping","chkCrop",$Crop,"txtCropFuzz",$CropFuzz); +$formFields.=RenderFieldButton("","btnScan","Scan"); +$formFields.=RenderHidden("hidScanDevice",$Scanner["ScanDevice"]); +$formFields.=RenderHidden("hidScanModel",$Scanner["ScanModel"]); +$columns=""; +$columns.=renderDiv("divColLeft",$formFields); +$result=""; if($DestFile!=null){ - $DestFilenane=pathinfo($DestFile)["basename"]; - $DestFileFixed=htmlentities($DestFilenane,ENT_HTML5, "UTF-8"); - $DestPathFixed=htmlentities($DestFile,ENT_HTML5, "UTF-8"); - echo '
'. - 'Download
'."\n"; - echo ''; + $result.=RenderDocument($DestFile); } - -echo RenderCommandLog(); - -echo "
\n"; +$columns.=renderDiv("divColRight",$result); +$columns.=RenderCommandLog(); +echo RenderForm("frmMain",$columns); diff --git a/style.css b/style.css index 15c7a8d..ba6a0e0 100644 --- a/style.css +++ b/style.css @@ -1,9 +1,12 @@ * {margin:0;padding:0;border:none;font-family:Arial,sans-serif; color:rgb(32,32,32);background-color: #E9F0F0; box-sizing:border-box; -moz-box-sizing:border-box;} +html{height: 100%;} +body{height:100%;} + h1{ font-size: 40px; color: rgb(128,128,128); - margin:15px; + padding:15px; } .field{ display:block; @@ -14,7 +17,7 @@ h1{ } .fieldLabel{ display:inline-block; - width:20%; + width:40%; font-weight: bold; vertical-align:top; white-space: normal; @@ -23,7 +26,7 @@ h1{ } .fieldContent{ display:inline-block; - width:80%; + width:60%; white-space: normal; vertical-align:top; word-break: break-word; @@ -57,13 +60,6 @@ h1{ background-color: white; } -.previewImage{ - margin:5px; - border: solid 1px rgb(32,32,32); - max-width:200px; - max-height:200px; -} - #divConsoleContainer{ margin:5px; } @@ -90,6 +86,29 @@ h1{ color: red; } -.divHidden{ - display: none; -} \ No newline at end of file +form{ + white-space: nowrap; + height: calc(100% - 120px); +} + +#divColLeft{ + box-sizing: border-box; + display: inline-block; + width:40%; + vertical-align:top; +} + +#divColRight{ + box-sizing: border-box; + display: inline-block; + width:59%; + height: 100%; + padding: 15px; + vertical-align:top; +} +#divColRight .previewDoc{ + box-sizing: border-box; + width:100%; + height: calc(100% - 35px); + border: solid 1px rgb(32,32,32); +}