Changeset 734 for trunk/Modules/Export
- Timestamp:
- Jan 8, 2014, 4:43:28 PM (11 years ago)
- Location:
- trunk/Modules/Export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ExportOutput.php
r733 r734 228 228 global $System; 229 229 $Output = ''; 230 $DbResult = $System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$Export->Id); 231 $Task = $DbResult->fetch_assoc(); 232 233 // $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 234 // 'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&Auto&ExportId='.$Export->Id).'\'", 5000)'. 235 // '</script>'; '.ProgressBar(300, $Task['Progress']).' 236 $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'. 230 $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'. 231 ' LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE (`Export`.`OutputType` = 9 OR `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL ORDER BY `Progress` DESC');// `Export`='.$Export->Id 232 $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />'; 233 while($Task = $DbResult->fetch_assoc()) { 234 $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'. 237 235 '<script>'. 238 236 '$(document).ready(function() {'. 239 237 'var refreshId = setInterval(function() {'. 240 '$("#progress ").load("'.$System->Link('/Modules/Export/Progress.php?ExportId='.$Export->Id).'"); '.238 '$("#progress'.$Task['Export'].'").load("'.$System->Link('/Modules/Export/Progress.php?ExportId='.$Task['Export']).'"); '. 241 239 '}, 1000);'. 242 240 '});'. 243 241 '</script>'; 244 $Output .= ' <strong>Dokončeno procent: <div id="progress">'.ProgressBar(300, $Task['Progress']).'</div></strong>'; 245 // $(\'#load_progress\').load(\''.'?Action=View&Tab=7&Auto&ExportId='.$Export->Id.'\'); 246 // Modules/Export/Progress.php?ExportId=37 247 if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>'; 248 242 $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>'; 243 if ($_GET['ExportId'] == $Task['Export']) 244 $Export = ''.$Export.' (aktuální)'; 245 246 $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />'; 247 // if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>'; 248 249 } 249 250 return ($Output); 250 251 } -
trunk/Modules/Export/ProcessTask.php
r732 r734 21 21 $System->Database->query('UPDATE `ExportTask` SET `Progress`='.$per.' WHERE `Export`='.$Export->Id); 22 22 } 23 function SetOnline() { 24 global $System; 25 $File = new FileStream(); 26 $File->CreateFile(dirname(__FILE__).'/../../'.$System->Config['Web']['TempFolder'].'ProcessTask'); 27 $File->WriteLine(1); 28 } 23 29 24 30 25 function DeleteOldFiles($deldir) … … 102 97 while(1) 103 98 { 104 //setonline105 SetOnline();106 99 // DBC files 107 100 $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask`'.
Note:
See TracChangeset
for help on using the changeset viewer.