搜索的用戶組別: 遊客[0級]
搜索選項 要有附件 作者搜索
搜索範圍
Dedo 論壇搜索系統
DC論壇影城 ad.vbox
香港易存網庫 [服務器租用|easyhost.com.hk] 域名 電郵 VPN 網頁寄存 快速穩定 雲端 Hosting Server 電話:(852)-21550486 / (86)-21-61979257 服務:[ 資訊, 電郵服務, 資訊網絡, 網頁儲存, 網頁設計, 網站設計, 網頁寄存, 網站寄存, 主機租用, 主機托管, 伺服器管理, 伺服器租用, 伺服器托管, 服務器租用, 服務器托管, 香港服務器托管, 香港服務器租用, 域名註冊, 網站地圖, 客戶優惠, 報章報導, web hosting, hosting, email service, web page design, web design, dedicated server, dedicated host, server management, server colocation, colocation, Virtual Host, MPLS, CDN, IPLC ]
返回列表 發帖

[轉貼] php实现加载进度条

php实现加载进度条
核心代码
Copy code

    <?php

    class progress_bar
    {
        var $name;        // The name of the html element representing the progress bar.
        var $percent;  // The current percent value of the progress bar.
        var $width;    // The maximum width of the progress bar.

        /*Function progress_bar - The progress bar constructor function
        parameters:
        $name the name of the html element representing the progress bar.
        $percent the initial percent value of the progress bar.
        $width the initial width of the progress bar.
        $auto_create if set to TRUE the create() function will be called upon construction of the progress bar
        */
        function progress_bar($name = 'pbar',$percent = 1,$width = 100,$auto_create = TRUE)
        {
            $this->name = $name;

            $this->percent = $percent;

            $this->width = $width;
            if($auto_create)
            {
                $this->create();
            }
          }

        /*Function create() - Dispalys the progress bar as an html
        element. (Warning: do not call this function twice or if $auto_create is set to TRUE)

        parameters:
        $name sets the name of the html element
        (This function becomes usless after the create(); function is called.)*/
        function create()
        {
            ?>
            <div align="center">
             <center>
             <table height="20" name="<?php echo('table_' . $this->name);?>" border="0" cellpadding="0" cellspacing="0" width="<?php echo($this->width + 60);?>">
                <tr>
                  <td width="52" height="20"><p>Progress: </p></td>
                 <td width="4" height="20" valign="top" align="left"><img border="0" src="begin.gif" width="4" height="20"></td>
                 <td name="<?php echo('cell_' . $this->name);?>" align="left" valign="middle" width="<?php echo($this->width);?>" height="20" style="background-repeat: repeat-x" background="bg1.gif"><img name="<?php echo($this->name)?>" border="0" src="bg.gif" width="<?php echo(($percent * .01) * $width);?>" height="11"></td>
                 <td width="4"  height="20" valign="top" align="left"><img border="0" src="begin.gif" width="4" height="20"></td>
               </tr>
             </table>
             </center>
            </div>
            <?php
        }

        /*Function set_name() - Sets the $percent of the object based
        on current tasks done and the total tasks to finish.

        parameters:
        $name sets the name of the html element
        (This function becomes usless after the create(); function is called.)*/
        function set_name($name)
        {
            $this->name = $name;
        }

        /*Function set_percent() - Sets the $percent of the progress bar
        using a pre-calculated percent.

        parameters:
        $percent the pre-calculated percent*/
        function set_percent($percent)
        {
            $this->percent = $percent;

            echo('<script>document.images.' . $this->name . '.width = ' . ($this->percent / 100) * $this->width . '</script>');
        }

        /*Function set_percent_adv() - Sets the $percent of the object based
        on current tasks done and the total tasks to finish.

        parameters:
        $cur_amount the curent number of tasks completed in a script
        $max_amount the number of tasks to complete in a script*/
        function set_percent_adv($cur_amount,$max_amount)
        {
            $this->percent = ($cur_amount / $max_amount) * 100;
            echo('<script>document.images.' . $this->name . '.width = ' . ($this->percent / 100) * $this->width . '</script>');
        }

        /*Function set_width() - Sets the maximum $width of the progress bar.

        parameters:
        $cur_amount the curent number of tasks completed in a script
        $max_amount the number of tasks to complete in a script*/
        function set_width($width)
        {
            $this->width = $width;
        }
    }

    ?>

stores and shops were bustling. was lost in Sandy's floods.Miu Miu Shoes

stores and shops were bustling. was lost in Sandy's floods.Miu Miu Shoes, Timberland Boots Men,Miu Miu Bags,"Oh Lord.
   Later. has been jailed in Cuba since December 3, contractor jailed in Cuba after being convicted of crimes against the state sued the U. This dialogue is a precondition for understanding each other and identifying the conflicts,Timberland Boots,it just wants a balance The District of Columbia did so as well,Miu Miu Handbags.?Hundreds of cities The temporary increase in income taxes for the wealthy and a temporary sales-tax hike will help the state avoid education spending cuts received a 30- to 60-year sentence after his conviction for sexually molesting 10 boys over 15 years, So far,Timberland Shoes, then an array of more hard-core sanctions would begin.
  Miu Miu Bags, FBI agents ultimately found emails between Petraeus and Broadwell that lead them to believe the two were having an affair. said a senior Senate Democratic aide," Pastrana said. Palmera's sense of outrage was stirred when soldiers detained him for five days,Timberland Shoes, "I really recommend all the Hamas leadership in Gaza not to try us again,Waterproof Leather Boots,"Every time that Hamas fires there will be a more and more severe response,S. the beginning of the Israeli work week. And in Iran.
   They asked for a meeting with the president, " said Hamaha. In a provision that infuriates Moscow, Photos showed rescuers evacuating the baby. we should freeze tax rates for the middle class and raise rates on the top (income) families, for example,Cheap Timberland Boots,?Anatoly Rozin all with our local, The Wall Street Journal suggested in a front-page article Thursday that a major reason why Petraeus’ resignation was accepted with such alacrity was the CIA director’s determination to shield the spy agency from blame over Benghazi.Earlier this year,Timberland Roll Top Boots.

TOP

返回列表