php 仿Comsenz安裝效果代碼打包提供下載
更新時(shí)間:2010年05月09日 10:25:58 作者:
一直都覺(jué)得Comsenz產(chǎn)品的數(shù)據(jù)表安裝效果很漂亮,今天抽了個(gè)空,把它的核心代碼都提煉出來(lái)了。
最終的效果如下:
/**
* step.inc.php 安裝步驟效果類(lèi) *
* 從Comsenz產(chǎn)品的數(shù)據(jù)表安裝效果中提取出主要代碼,以供大家學(xué)習(xí)
* @author tianxin
* @version 1.0.0 *
*/
class StepClass {
function show_header() {
define('SHOW_HEADER', TRUE);
$step = 1;
$version = 'beta1.0';
$release = '20100223';
$install_lang = '簡(jiǎn)體中文UTF8版';
$title = '仿Comsenz安裝';
$charset = 'uft-8';
echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>$title</title>
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<script type="text/javascript">
function $(id) {
return document.getElementById(id);
}
function showmessage(message) {
$('notice').value += message + "\\r\\n";
}
</script>
<meta content="Comsenz Inc." name="Copyright" />
</head>
<div class="container">
<div class="header">
<h1>$title</h1>
<span>$version $install_lang $release</span>
EOT;
$step > 0 && $this->show_step($step);
}
function show_step($step) {
$laststep = 4;
$title = '仿Comsenz安裝';
$comment = '正在執(zhí)行操作';
$stepclass = array();
for($i = 1; $i <= $laststep; $i++) {
$stepclass[$i] = $i == $step ? 'current' : ($i < $step ? '' : 'unactivated');
}
$stepclass[$laststep] .= ' last';
echo <<<EOT
<div class="setup step{$step}">
<h2>$title</h2>
<p>$comment</p>
</div>
<div class="stepstat">
<ul>
<li class="$stepclass[1]">1</li>
<li class="$stepclass[2]">2</li>
<li class="$stepclass[3]">3</li>
<li class="$stepclass[4]">4</li>
</ul>
<div class="stepstatbg stepstat1"></div>
</div>
</div>
<div class="main">
EOT;
}
function show_install() {
?>
<script type="text/javascript">
function showmessage(message) {
document.getElementById('notice').value += message + "\r\n";
}
function initinput() {
window.location='http://www.dhdzp.com';
}
</script>
<div class="main">
<div class="btnbox"><textarea name="notice" style="width: 80%;" readonly="readonly" id="notice"></textarea></div>
<div class="btnbox marginbot">
<input type="button" name="submit" value="正在執(zhí)行……" disabled style="height: 25" id="laststep" onclick="initinput()">
</div>
<?php
}
function runquery() {
for($i=1;$i<=15;$i++)
{
$this->showjsmessage('執(zhí)行操作'.' '.$i.' ... '.'成功');
//模擬每執(zhí)行完一個(gè)動(dòng)作的延時(shí)
sleep(1);
}
}
function showjsmessage($message) {
echo '<script type="text/javascript">showmessage(\''.addslashes($message).' \');</script>'."\r\n";
flush();
ob_flush();
}
function show_footer($quit = true) {
echo <<<EOT
<div class="footer">©2001 - 2010 <a href="http://www.dhdzp.com/">甜心</a> 瑤瑤說(shuō)殺很大.</div>
</div>
</div>
</body>
</html>
EOT;
$quit && exit();
}
}
調(diào)用方法:
header('Content-Type: text/html; charset=utf-8');
include('step.inc.php');
$step=new StepClass();
//顯示頁(yè)面頭部
$step->show_header();
//顯示操作進(jìn)度
$step->show_install();
//運(yùn)行操作
$step->runquery();
echo '<script type="text/javascript">document.getElementById("laststep").disabled=false;document.getElementById("laststep").value = \'執(zhí)行完所有操作,進(jìn)入下一步\';</script>'."\r\n";
//顯示頁(yè)面尾部
$step->show_footer();
完整的demo:stepdemo.rar

step.inc.php 安裝步驟效果類(lèi):
復(fù)制代碼 代碼如下:
/**
* step.inc.php 安裝步驟效果類(lèi) *
* 從Comsenz產(chǎn)品的數(shù)據(jù)表安裝效果中提取出主要代碼,以供大家學(xué)習(xí)
* @author tianxin
* @version 1.0.0 *
*/
class StepClass {
function show_header() {
define('SHOW_HEADER', TRUE);
$step = 1;
$version = 'beta1.0';
$release = '20100223';
$install_lang = '簡(jiǎn)體中文UTF8版';
$title = '仿Comsenz安裝';
$charset = 'uft-8';
echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>$title</title>
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<script type="text/javascript">
function $(id) {
return document.getElementById(id);
}
function showmessage(message) {
$('notice').value += message + "\\r\\n";
}
</script>
<meta content="Comsenz Inc." name="Copyright" />
</head>
<div class="container">
<div class="header">
<h1>$title</h1>
<span>$version $install_lang $release</span>
EOT;
$step > 0 && $this->show_step($step);
}
function show_step($step) {
$laststep = 4;
$title = '仿Comsenz安裝';
$comment = '正在執(zhí)行操作';
$stepclass = array();
for($i = 1; $i <= $laststep; $i++) {
$stepclass[$i] = $i == $step ? 'current' : ($i < $step ? '' : 'unactivated');
}
$stepclass[$laststep] .= ' last';
echo <<<EOT
<div class="setup step{$step}">
<h2>$title</h2>
<p>$comment</p>
</div>
<div class="stepstat">
<ul>
<li class="$stepclass[1]">1</li>
<li class="$stepclass[2]">2</li>
<li class="$stepclass[3]">3</li>
<li class="$stepclass[4]">4</li>
</ul>
<div class="stepstatbg stepstat1"></div>
</div>
</div>
<div class="main">
EOT;
}
function show_install() {
?>
<script type="text/javascript">
function showmessage(message) {
document.getElementById('notice').value += message + "\r\n";
}
function initinput() {
window.location='http://www.dhdzp.com';
}
</script>
<div class="main">
<div class="btnbox"><textarea name="notice" style="width: 80%;" readonly="readonly" id="notice"></textarea></div>
<div class="btnbox marginbot">
<input type="button" name="submit" value="正在執(zhí)行……" disabled style="height: 25" id="laststep" onclick="initinput()">
</div>
<?php
}
function runquery() {
for($i=1;$i<=15;$i++)
{
$this->showjsmessage('執(zhí)行操作'.' '.$i.' ... '.'成功');
//模擬每執(zhí)行完一個(gè)動(dòng)作的延時(shí)
sleep(1);
}
}
function showjsmessage($message) {
echo '<script type="text/javascript">showmessage(\''.addslashes($message).' \');</script>'."\r\n";
flush();
ob_flush();
}
function show_footer($quit = true) {
echo <<<EOT
<div class="footer">©2001 - 2010 <a href="http://www.dhdzp.com/">甜心</a> 瑤瑤說(shuō)殺很大.</div>
</div>
</div>
</body>
</html>
EOT;
$quit && exit();
}
}
調(diào)用方法:
復(fù)制代碼 代碼如下:
header('Content-Type: text/html; charset=utf-8');
include('step.inc.php');
$step=new StepClass();
//顯示頁(yè)面頭部
$step->show_header();
//顯示操作進(jìn)度
$step->show_install();
//運(yùn)行操作
$step->runquery();
echo '<script type="text/javascript">document.getElementById("laststep").disabled=false;document.getElementById("laststep").value = \'執(zhí)行完所有操作,進(jìn)入下一步\';</script>'."\r\n";
//顯示頁(yè)面尾部
$step->show_footer();
完整的demo:stepdemo.rar
您可能感興趣的文章:
- PHP/ThinkPHP實(shí)現(xiàn)批量打包下載文件的方法示例
- php在線打包程序源碼
- ThinkPHP實(shí)現(xiàn)將本地文件打包成zip下載
- php將文件夾打包成zip文件的簡(jiǎn)單實(shí)現(xiàn)方法
- PHP簡(jiǎn)單系統(tǒng)查詢(xún)模塊代碼打包下載
- 幾行代碼輕松實(shí)現(xiàn)PHP文件打包下載zip
- php打包網(wǎng)站并在線壓縮為zip
- PHP實(shí)現(xiàn)圖片批量打包下載功能
- php項(xiàng)目打包方法
- PHP在線打包下載功能示例
- php打包壓縮文件之ZipArchive方法用法分析
- PHP實(shí)現(xiàn)打包下載文件的方法示例
相關(guān)文章
基于php解決json_encode中文UNICODE轉(zhuǎn)碼問(wèn)題
這篇文章主要介紹了基于php解決json_encode中文UNICODE轉(zhuǎn)碼問(wèn)題,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-11-11
php中的雙引號(hào)與單引號(hào)的基本使用及區(qū)別
字符串是一個(gè)非常要的知識(shí),在開(kāi)發(fā)中,有的使用單引號(hào),有的使用雙引號(hào),這個(gè)是有區(qū)別的,這篇文章主要介紹了php中的雙引號(hào)與單引號(hào)的基本使用,需要的朋友可以參考下2023-06-06
thinkPHP框架實(shí)現(xiàn)生成條形碼的方法示例
這篇文章主要介紹了thinkPHP框架實(shí)現(xiàn)生成條形碼的方法,結(jié)合實(shí)例形式分析了thinkPHP結(jié)合第三方barcode類(lèi)文件生成條形碼的相關(guān)操作技巧,需要的朋友可以參考下2018-06-06
laravel-admin利用ModelTree實(shí)現(xiàn)對(duì)分類(lèi)信息的管理
這篇文章主要介紹了laravel-admin利用ModelTree實(shí)現(xiàn)對(duì)分類(lèi)信息的管理,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-01-01
php中對(duì)內(nèi)置函數(shù)json_encode和json_decode的異常處理
這篇文章主要介紹了php中對(duì)內(nèi)置函數(shù)json_encode和json_decode的異常處理,本篇文章通過(guò)定義描述和列舉表格以及最后代碼的展示,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-07-07
laravel dingo API返回自定義錯(cuò)誤信息的實(shí)例
今天小編就為大家分享一篇laravel dingo API返回自定義錯(cuò)誤信息的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09

