Home > Backend Development > PHP Tutorial > PHP imitation Comsenz installation effect code is packaged and provided for download_PHP tutorial

PHP imitation Comsenz installation effect code is packaged and provided for download_PHP tutorial

WBOY
Release: 2016-07-21 15:38:00
Original
828 people have browsed it

The final effect is as follows:

step.inc.php installation step effect class:

Copy code The code is as follows:

/**
* step.inc.php installation step effect class*
* Extract the main code from the data sheet installation effect of Comsenz products for everyone to learn
* @author tianxin
* @version 1.0 .0 *
*/
class StepClass {
function show_header() {
define('SHOW_HEADER', TRUE);
$step = 1;
$version = 'beta1.0';
$release = '20100223';
$install_lang = 'Simplified Chinese UTF8 version';
$title = 'Imitate Comsenz installation';
$charset = 'uft-8';
echo <<



$title


< ;meta content="Comsenz Inc." name="Copyright" />


$title


$version $install_lang $release
EOT;
$step > 0 && $this-> show_step($step);
}
function show_step($step) {
$laststep = 4;
$title = 'Imitate Comsenz installation';
$comment = 'Performing operation ';
$stepclass = array();
for($i = 1; $i <= $laststep; $i++) {
$stepclass[$i] = $i == $step ? 'current' : ($i < $step ? '' : 'unactivated');
}
$stepclass[$laststep] .= ' last';
echo <<< EOT

$title


$comment


< /div>


  • 1

  • < li class="$stepclass[2]">2
  • 3

  • 4




< ;/div>

EOT;
}
function show_install() {
?>






}
function runquery() {
for($i=1;$i<=15;$i++)
{
$this->showjsmessage('Perform operation'.' '.$i.' ... '.'Success');
//Simulate the delay of each action completed
sleep(1);
}
}
function showjsmessage($message) {
echo ''."rn";
flush();
ob_flush();
}
function show_footer($quit = true) {
echo <<



EOT;
$quit && exit();
}
}

Calling method:
Copy code The code is as follows:

header('Content-Type: text/html; charset=utf-8');
include('step.inc.php');
$step=new StepClass();
//Show the page header
$step->show_header();
//Show the operation progress
$step->show_install();
//Run the operation
$step->runquery();
echo ''."rn";
//Show the end of the page
$step->show_footer();

Complete demo: stepdemo.rar

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321810.htmlTechArticleThe final effect is as follows: step.inc.php Installation step effect class: Copy the code as follows: /** * step.inc.php Installation step effect class* * Extracted from the data sheet installation effect of Comsenz products...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template