Changeset 2039

Show
Ignore:
Timestamp:
06/05/06 07:42:22 (7 years ago)
Author:
diego_iastrubni
Message:

in case your server and web browser aer on different time zones, this patch will help you:

in the incomming calls a clock will be displayed which tells you the time on the server

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/1.0/amp_conf/htdocs/admin/incoming.php

    r2032 r2039  
    6868$queues = getqueues(); 
    6969?> 
     70 
     71<div style="float: right; padding: 5; background: #e0e0ff; border: #2E78A7 solid 1px;"> 
     72       Server time: <span id="idTime">00:00:00</span> 
     73</div> 
     74 
     75<script> 
     76 
     77var hour = <?php $l = localtime(); echo $l[2]?>; 
     78var min  = <?php $l = localtime(); echo $l[1]?>; 
     79var sec  = <?php $l = localtime(); echo $l[0]?>; 
     80 
     81// happily stollen from http://www.aspfaq.com/show.asp?id=2300 
     82function PadDigits(n, totalDigits) 
     83{ 
     84  n = n.toString(); 
     85  var pd = ''; 
     86  if (totalDigits > n.length) 
     87  { 
     88    for (i=0; i < (totalDigits-n.length); i++) 
     89    { 
     90      pd += '0'; 
     91    } 
     92  } 
     93  return pd + n.toString(); 
     94} 
     95 
     96function updateTime() 
     97{ 
     98  sec++; 
     99  if (sec==60) 
     100  { 
     101    min++; 
     102    sec = 0; 
     103  } 
     104   
     105  if (min==60) 
     106  { 
     107    hour++; 
     108    min = 0; 
     109  } 
     110   
     111  if (hour==24) 
     112  { 
     113    hour = 0; 
     114  } 
     115   
     116  document.getElementById("idTime").innerHTML = PadDigits(hour,2)+":"+PadDigits(min,2)+":"+PadDigits(sec,2); 
     117  setTimeout('updateTime()',1000); 
     118} 
     119 
     120updateTime(); 
     121</script> 
     122 
    70123 
    71124<form name="incoming" action="config.php" method="post">