HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Source for file default2.php

Documentation is available at default2.php

  1. <?php
  2. @include '../include_path.php';
  3. /**
  4.  * Default Monitor ProgressBar example with logging events.
  5.  *
  6.  * @version    $Id: default2.php,v 1.1 2004/06/27 13:08:50 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  */
  10.  
  11. require_once 'HTML/Progress/monitor.php';
  12.  
  13. function logger($progressValue&$obj)
  14. {
  15.     include_once 'Log.php';
  16.     $logger &Log::singleton('file''monitor.log'$_SERVER['REMOTE_ADDR']);
  17.  
  18.     if (fmod($progressValue,25== 0{
  19.         $logger->info("$progressValue % has been reached");
  20.     else {
  21.         $logger->debug("Progress ... $progressValue %");
  22.     }
  23. }
  24.  
  25. $monitor = new HTML_Progress_Monitor();
  26. $monitor->setProgressHandler('logger');
  27. ?>
  28. <html>
  29. <head>
  30. <title>ProgressBar Monitor - Default renderer </title>
  31. <style type="text/css">
  32. <!--
  33. .progressStatus {
  34.     color:#000000; 
  35.     font-size:10px;
  36. }
  37. <?php echo $monitor->getStyle()?>
  38. // -->
  39. </style>
  40. <script type="text/javascript">
  41. <!--
  42. <?php echo $monitor->getScript()?>
  43. //-->
  44. </script>
  45. </head>
  46. <body>
  47. <h1><?php echo basename(__FILE__)?></h1>
  48.  
  49. <?php 
  50. echo $monitor->toHtml();
  51. $monitor->run();
  52. ?>
  53.  
  54. <p>&lt;&lt; <a href="../index.html">Back examples TOC</a></p>
  55.  
  56. </body>
  57. </html>

Documentation generated on Mon, 11 Mar 2019 13:52:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.