Changeset 743 for trunk/Modules/Export
- Timestamp:
- Jan 9, 2014, 2:44:51 PM (11 years ago)
- Location:
- trunk/Modules/Export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ExportOutput.php
r740 r743 229 229 global $System; 230 230 $Output = ''; 231 $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'.232 ' 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->Id233 231 $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />'; 234 while($Task = $DbResult->fetch_assoc()) { 232 233 235 234 $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'. 236 235 '<script>'. 237 236 '$(document).ready(function() {'. 238 237 'var refreshId = setInterval(function() {'. 239 '$("#progress '.$Task['Export'].'").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId'].'&ExportId='.$Task['Export']).'"); '.238 '$("#progress").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId']).'"); '. 240 239 '}, 1000);'. 241 240 '});'. 242 241 '</script>'; 243 $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>'; 244 if ($_GET['ExportId'] == $Task['Export']) 245 $Export = ''.$Export.' (aktuální)'; 246 247 $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />'; 248 // if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>'; 249 250 } 242 243 244 $Output .= ' <strong><div id="progress"></div></strong><br />'; 245 251 246 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE '. 252 247 ' (`Export`.`OutputType` = 9 OR `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL AND `TimeStart` < NOW()-10000'); -
trunk/Modules/Export/Progress.php
r740 r743 8 8 9 9 10 $Output = ''; 11 $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'. 12 ' LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE (`Export`.`OutputType` = 9 OR `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL OR `Export` ='.$_GET['RedirectId'].' ORDER BY `Progress` DESC');// `Export`='.$Export->Id 13 while($Task = $DbResult->fetch_assoc()) { 14 $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>'; 15 if ($_GET['RedirectId'] == $Task['Export']) 16 $Export = ''.$Export.' (tento)'; 17 $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />'; 18 if ( $Task['Progress'] > 99 ) echo '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 19 'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$_GET['RedirectId']).'\'", 500)'. 20 '</script>'; 21 } 10 22 11 $DbResult = $System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$_GET['ExportId']); 12 $Task = $DbResult->fetch_assoc(); 13 14 if ( $Task['Progress'] > 99 ) echo '<script type="text/javascript" language="JavaScript" charset="utf-8">'. 15 'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$_GET['RedirectId']).'\'", 500)'. 16 '</script>'; 23 echo $Output; 24 //echo ''.ProgressBar(300, $Task['Progress']).''; 17 25 18 19 echo ''.ProgressBar(300, $Task['Progress']).'';20
Note:
See TracChangeset
for help on using the changeset viewer.