Jump to content
أحلى نادي لأحلى أعضاء
Search In
  • More options...
Find results that contain...
Find results in...
sasa designe

كود زر الوقت الذي قضيته بالصفحه

Recommended Posts

مش هتكلم كتيييييييير عن الكود لكن
هقولك إنسخه وجربه بنفسك
من
مستعرض الاكواد
  


الكود:
<SCRIPT>

<!--  Activate Cloaking Device



var onHours = " ";

var onMinutes = " ";


var onSeconds = " ";



var offHours = 0;

var offMinutes = 0;

var offSeconds = 0;



var logSeconds = 0;

var logMinutes = 0;

var logHours = 0;



var OnTimeValue = " ";

var OffTimeValue = " ";

var PageTimeValue = " ";



// Back to previous page.

function WinOpen()

   {

   getLogoffTime();

   window.location="js-timet.htm"

   window.location="js-timet.htm"   // double call for Mac users??

   }



// Loads HTML page to full window for View Source.

function WinOpen1()

   {

   alert('View/Document Source from menu bar..., then close new window to return to this page. The animation of the radio buttons on the JavaScript index will be dead upon return. Reload the JavaScript page to get them going again. ');

   window.open("js-timer.htm","DisplayWindow","menubar=yes,scrollbars=yes");

   }



// Captures logon time.

function getLogonTime()

   {

   var now = new Date();

   // Used to display logon time.

   var ampm = (now.getHours() >= 12) ? " مساءً" : " صباحاً"

   var Hours = now.getHours();

         Hours = ((Hours > 12) ? Hours - 12 : Hours);

   var Minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();


   var Seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();

   // String to display log-on time.


   OnTimeValue =(" "


       + Hours


       + Minutes


       + Seconds


       + " "

       + ampm);



   // Capture logon time for use in timer().

   onHours = now.getHours();

   onMinutes = now.getMinutes();

   onSeconds = now.getSeconds();  

   }



function getLogoffTime()

   {

   var now = new Date();

   // Used to display logoff time.

   var ampm = (now.getHours() >= 12) ? " مساءً" : " صباحاً"

   var Hours = now.getHours();

         Hours = ((Hours > 12) ? Hours - 12 : Hours);


   var Minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();


   var Seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();

   // String to display log-off time.


   OffTimeValue =(" "


       + Hours


       + Minutes


       + Seconds


       + " "

       + ampm);



   // Capture logoff time for use in timer().

   offHours = now.getHours();

   offMinutes = now.getMinutes();

   offSeconds = now.getSeconds();



   timer();

   }



// Compute difference between logoff time and logon time.

function timer()

   {

   if (offSeconds >= onSeconds)

      { logSeconds = offSeconds - onSeconds; }

   else

      {

      offMinutes -= 1;

      logSeconds = (offSeconds + 60) - onSeconds;      

      }

   if (offMinutes >= onMinutes)

      { logMinutes = offMinutes - onMinutes; }

   else

      {

      offHours -= 1;

      logMinutes = (offMinutes + 60) - onMinutes;

      }

   logHours = offHours - onHours;



   // Used to display time on page.

   logHours =  ((logHours < 10) ? "0" : ":") + logHours;

   logMinutes = ((logMinutes < 10) ? ":0" : ":") + logMinutes;


   logSeconds = ((logSeconds < 10) ? ":0" : ":") +logSeconds;

   // String to display time on page.

   PageTimeValue =(" "


       + logHours


       + logMinutes


       + logSeconds);



   displayTimes();

   }



function displayTimes()

   {

   alert("\nوقت دخول الصفحة    : " +OnTimeValue+"\n\nوقت الخروج  : "+OffTimeValue+"\n\nالوقت الذي قضيته بالصفحة هو : " + PageTimeValue);

   }



// Deactivate Cloaking -->

</SCRIPT>
 
 <INPUT TYPE="button" value="كم الوقت الذي قضيته بالصفحة" onClick="getLogoffTime()">

 <body onLoad="getLogonTime()">



 

Share this post


Link to post
Share on other sites
يتجسد الابداع دائما في
مواضيعك عندما يكون
لها هذا التميز مجهود جدا رائع..
تحياتي لك

Share this post


Link to post
Share on other sites

موضوع رائع وجميل شكراً جزيلاً لك . وبالتوفيق الدائم.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.