PHP Classes
elePHPant
Icontem

PHP Realtime Clock: Display clock or timer updated in real time

Recommend this page to a friend!

  Author Author  
Name: zinsou A.A.E.Mo´se is available for providing paid consulting. Contact zinsou A.A.E.Mo´se .
Classes: 17 packages by
Country: Benin Benin
Age: 27
All time rank: 21111 in Benin Benin
Week rank: 8 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 2x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This class can display clock or timer updated in real time on a Web page.

It generates HTML and JavaScript to display either a clock with the current time or a timer showing the time that elapsed since the beginning.

The JavaScript code will make the clock or timer be updated on the page in real time.

Details
{startverticalbanner}
Hi,
Numerical clock class is a built in PHP-JS class which allows user to:
-Display digital clock on his website
-display  a real time timer with start ,stop ,pause and resume buttons and which keep track of the time even
when user reload the page without database use...You can use this class to display the same timer on all your pages.
This feature is specially made for that but you can also use different timers on each page of your website
-diplay a real time timer without any button and which start once user start to navigate in your page and stop
automatically when user leave your page.You can use this class to display the same timer on all your pages.
This feature is specially made for that. 

class numericalclock {
				protected $code1,$code2,$hide=0;
				public function __construct($time='',$button=0,$nothiden=1,$trueclock=false,$buttonify=''){
					$time can be an array or can just be an empty string.If you specify an array, you must specify 3 index
					first for hour,second for minute and third for second.The timer or clock will then start from this
					specified time.But if it is the empty string the clock or the timer will start at 00:00:00;
					$button is used for specify if you want a timer with button(1) or no(0).
					$nothiden is above all usefull in the case of a timer without buttons.It is used to specify if you 
					want to hide the timer to user.You may in this case keep the track of leave and enter and timer in your
					database then you just need to add a few line in the ajax.php file to upload the database.
					Put $nothiden to 0 will hide the timer or even the clock but it's not really usefull in the last case and 
					for a timer with buttons...
					$trueclock is used to tell the timer if it just a simple clock or not
					$buttonify is used to specify for which instanceof Numerical clock class the 'timer with buttons' is...
					This allows to use seperate timer on different page or the same...
				}
		
			
		
				public function chronoscript(){
					return the main js script to handle clock, timer and button;
				}
				
				
				public function displayclock() {
					displays the clock or the timer
				}
}

What  you must generally keep in mind is:
We use a lot the global variable in JS so you must read the code to know what name to choose for your JS variables in order to avoid confusion
and ambigity.
We use the PHP session to keep the time of the timers in memory so without S_SESSION globals you couldn't make the class keep track
of anything
You must know that different types of optical pointer like mouse exist so the feature without buttons could be sometimes unstable due to the user use of optical tool
This is not a bug but this is above all due to the peripherics and the reactivity of the browser and even of the client computer capacities.
Anyhow we will work to find some technics to correct that in the future. 

For a real example on how to use it see the testnumericalclock.php file.
You could use the dedicated forum of phpclasses to report bugs and ask your questions or contact me personally at
leizmo@gmail.com for feedback.

  Classes of zinsou A.A.E.Mo´se  >  PHP Realtime Clock  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Realtime Clock
Base name: m7
Description: Display clock or timer updated in real time
Version: 1.0.1
PHP version: 5
License: Custom (specified in a license file)
All time users: 222 users
All time rank: 7809
Week users: 2 users
Week rank: 342 Up
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image HTML HTML generation and processing View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Time and Date Time and date values, formats and conversion View top rated classes


  Recommendations  

Create a real time timer which tell the time spend on page
Time spent on the page will help in billing the user

clock
i need an automztic clock with php code


  User ratings  
Not yet rated by the users

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Accessible without login Plain text file ajax.php Aux. ajax file
Accessible without login Plain text file ajax2.php Aux. ajax file
Accessible without login Plain text file buttontimer.php Aux. ajax file
Accessible without login Plain text file license Lic. license
Plain text file numericalclock.class.php Class class source
Accessible without login Plain text file readme Doc. readme
Accessible without login Plain text file testnumericalclock.php Example example script
Accessible without login Plain text file testnumericalclock2.php Example example script
Accessible without login Plain text file truebuttontimer.php Aux. ajax file

Install with Composer Install with Composer - Download Download all files: m7.tar.gz m7.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.