Jump to content

Submitting a date to a counter


Pofski

Recommended Posts

Hi,

 

i was wondering if anybody could help me out with the following problem.

 

I have a counter that counts up from a certain date.

the counter date is the date of any type of incident at the company where i work.

Whenever something happens, i change the date in the script, but i was wondering if there would be a more user friendly way of doing this.

 

What i am trying to do is integrate a datafield where certain users, depending on their user id, could enter a new date in case something happens, and this would change the date in the script.

 

 

Thank you in advance for your help.

 

 

 

 <head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Untitled 1</title> <script>window.onload=function(){var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")  var myDate=new Date(); function countUp(yr, mo, da){   var today=new Date()   var todayy=today.getYear()   if (todayy < 1000)   todayy+=1900   var todaym=today.getMonth()   var todayd=today.getDate()   var todayh=today.getHours()   var todaymin=today.getMinutes()   var todaysec=today.getSeconds()   var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec   paststring=montharray[mo-1]+" "+da+", "+yr   dd=Date.parse(todaystring)-Date.parse(paststring)   dday=Math.floor(dd/(60*60*1000*24)*1)   dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)   dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)   dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)   return (dday + " days, " + dhour + " hours, " + dmin + "mins, " + dsec + " seconds");} function drawCountUp(){    var tdOne = document.getElementById("one");    tdOne.innerHTML = countUp(2012, 9, 19);    var tdTwo = document.getElementById("two");    tdTwo.innerHTML = countUp(2012, 8, 19);    var tdThree = document.getElementById("three");    tdThree.innerHTML = countUp(2012,7, 19);}drawCountUp();   setInterval(drawCountUp,1000);}</script>  </head> <body>   <table><tr><td>One</td><td id='one'></td></tr><tr><td>Two</td><td id='two'></td></tr><tr><td>Three</td><td id='three'></td></tr> </table>  <input datafld="first" name="one" size="35" type="text" /><button onclick="myFunction{}">input date</button> </body>  

 

 

Link to comment
Share on other sites

I'm editing my web pages using php.

All you need is read/write permissions to editable files for web server user and editor script.

Edited by es131245
Link to comment
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...