ребят помогите пожалуйста, есть процесс бар и пошаговая установка cms, как сделать чтоб процесс бар закрывал информацию об установки cms и по окончании загрузки процесс бара, чтоб переадресовывалось на окончание установки и выводилась информация о том что cms установлена? вот сам процесс бар Код (PHP): <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script> <style> .timer { position: relative; font-size: 200px; width: 1em; height: 1em; float: left; } .timer>.percent { position: absolute; top: 1.05em; left: 0; width: 3.33em; font-size: 0.3em; text-align: center; } .timer>#slice { position: absolute; width: 1em; height: 1em; clip: rect(0px, 1em, 1em, 0.5em); } .timer>#slice.gt50 { clip: rect(auto, auto, auto, auto); } .timer>#slice>.pie { border: 0.1em solid #c0c0c0; position: absolute; width: 0.8em; /* 1 - (2 * border width) */ height: 0.8em; /* 1 - (2 * border width) */ clip: rect(0em, 0.5em, 1em, 0em); -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; border-radius: 0.5em; } .timer>#slice>.pie.fill { -moz-transform: rotate(180deg) !important; -webkit-transform: rotate(180deg) !important; -o-transform: rotate(180deg) !important; transform: rotate(180deg) !important; } .timer.fill>.percent { display: none; } .timer.fill>#slice>.pie { border: transparent; background-color: #c0c0c0; width: 1em; height: 1em; } </style> <script type="text/javascript"> var timer; var timerCurrent; var timerFinish; var timerSeconds; function drawTimer(percent){ $('div.timer').html( '<div class="percent"></div><div id="slice"'+ (percent > 50?' class="gt50"':'')+ '><div class="pie"></div>'+ (percent > 50?'<div class="pie fill"></div>':'')+'</div>'); var deg = 360/100*percent; $('#slice .pie').css({ '-moz-transform':'rotate('+deg+'deg)', '-webkit-transform':'rotate('+deg+'deg)', '-o-transform':'rotate('+deg+'deg)', 'transform':'rotate('+deg+'deg)' }); $('.percent').html(Math.round(percent)+'%'); } function stopWatch(){ var seconds = (timerFinish-(new Date().getTime()))/1000; if(seconds <= 0){ drawTimer(100); clearInterval(timer); }else{ var percent = 100-((seconds/timerSeconds)*100); drawTimer(percent); } } $(document).ready(function(){ timerSeconds = 42; timerCurrent = 0; timerFinish = new Date().getTime()+(timerSeconds*1000); timer = setInterval('stopWatch()',50); }); </script> ________________________ <div class="timer"></div> а вот сами шаги установки cms Код (PHP): switch ($step) { case 0: $next_step = $step + 1; $next = $steps[$step]['next']; $extra = ''; if (file_exists(dirname(__FILE__).'/../wa-sources/')) { $extra = <<<HTML <input type="checkbox" value="1" name="check_latest" id="check_latest"> <label for="check_latest">{$t->_('Check available updates')}</label> <br> HTML; $extra = <<<HTML <input type="hidden" value="0" name="check_latest"> HTML; } else { $extra = <<<HTML <input type="hidden" value="1" name="check_latest"> HTML; } $locales = waInstallerLocale::listAvailable(); $select_locale = ''; if ($locales) { $select_locale .= '<br><select name="lang" id="wa-installer-locale-select">'; foreach ($locales as $locale) { $t_item = new waInstallerLocale($locale); $selected = ($locale == $lang) ? ' selected="selected"' : ''; $select_locale .= <<<HTML <option value="{$locale}"{$selected}>{$t_item->_($locale)}</option> HTML; } $select_locale .= '</select>'; } else { $select_locale = <<<HTML <input type="hidden" value="{$lang}" name="lang"> HTML; } $content = <<<HTML <center><img src="/img/install-logo.jpg"></center> <div class="i-welcome"> <h1 class="i-url"><span>http://</span>{$host}</h1> <p>{$t->_('Webasyst Installer will deploy archive with Webasyst system files and apps in this folder.')}<br > </p> {$extra} <input type="submit" value="{$t->_('Install Webasyst')}" class="button green large" id="wa-installer-submit"> <br> <br> {$select_locale} </div> HTML; break; case 1: try { if (!file_exists($init_path)) { throw new Exception("File <b>wa-installer/lib/init.php</b> not found"); } require_once($init_path); if (!class_exists('waInstallerApps')) { throw new Exception('Class <b>waInstallerApps</b> not found'); } if (!class_exists('waInstaller')) { throw new Exception('Class <b>waInstaller</b> not found'); } $urls = array(); $local_path = dirname(__FILE__).'/../wa-sources/'; $apps = array(); $plugins = array(); if (!isset($_POST['complete']) || !$_POST['complete']) { if (file_exists($local_path) && is_dir($local_path)) { $cwd = getcwd(); chdir($local_path); $pattern = '{*.tar.gz,wa-apps/*.tar.gz,wa-apps/*/plugins/*.tar.gz,wa-apps/*/themes/*.tar.gz}'; foreach (glob($pattern, GLOB_BRACE) as $path) { if (preg_match('@^([\\w%0-9\\-!]+)\\.tar\\.gz$@', basename($path), $matches)) { $decoded = dirname($path).'/'; if ($decoded == './') { $decoded = ''; } $decoded .= urldecode($matches[1]); $urls[] = array( 'source' => $local_path.$path, 'target' => $decoded, 'slug' => $decoded, ); if (preg_match('@wa-apps/([\\w\\d\\-]+)$@', $decoded, $matches)) { $apps[] = $matches[1]; } elseif (preg_match('@wa-apps/([\\w\\d\\-]+)/plugins/([\\w\\d\\-]+)$@', $decoded, $matches)) { if (!isset($plugins[$matches[1]])) { $plugins[$matches[1]] = array(); } $plugins[$matches[1]][] = $matches[2]; } } } chdir($cwd); } if (!count($urls)) { //not supported since 2.0 $list = array(); $urls = array(); foreach ($list as $target => $item) { if (isset($item['target'])) { $target = $item['target']; } $urls[] = array( 'source' => $item['download_url'], 'target' => $target, 'slug' => $item['slug'], ); if (preg_match('@wa-apps/([\\w\\d\\-]+)$@', $target, $matches)) { $apps[] = $matches[1]; } } } } $installer_apps = new waInstallerApps(); waInstallerApps::setLocale($t->getLocale()); $installer = new waInstaller(waInstaller::LOG_DEBUG); if ($urls && $installer->update($urls)) { foreach ($apps as $app) { $installer_apps->installWebAsystApp($app); if (!empty($plugins[$app])) { foreach ($plugins[$app] as $plugin) { $installer_apps->updateAppPluginsConfig($app, $plugin); } } } } else { $state = $installer->getState(); if (isset($state['stage_status']) && ($state['stage_status'] == waInstaller::STATE_ERROR)) { throw new Exception($state['error']); } } $log = parseLog($installer->getFullState('raw'), $t); $next_step = $step + 1; $next = $steps[$step]['next']; $content = <<<HTML <h1>{$t->_('Files')} <i class="icon16 yes"></i></h1> <div class="i-log">{$log}</div> <p class="i-success">{$t->_('All files successfully extracted. Click "Continue" button below.')} <i class="icon16 yes"></i></p> HTML; } catch (Exception $e) { $content = <<<HTML <h1>{$t->_('Files')} <i class="icon16 no"></i></h1> <p class="i-error">{$t->_('An error occurred during the installation')}</p> <p>{$e->getMessage()}</p> HTML; } break;