<center>
<div id="countdown"></div>
<span id="span">remain</span>
</center>
CountDownTimer('<?php echo date("m/d/Y H:i A", time()); ?>', 'countdown');
function CountDownTimer(dt, id)
{
var end = new Date(dt);
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemaining() {
var now = new Date();
var distance = end - now;
if (distance < 0) {
clearInterval(timer);
document.getElementById(id).innerHTML = 'EXPIRED!';
return;
}
var days = Math.floor(distance / _day);
var hours = Math.floor((distance % _day) / _hour);
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);
document.getElementById(id).innerHTML = days + 'days ';
document.getElementById(id).innerHTML += hours + 'hrs ';
document.getElementById(id).innerHTML += minutes + 'mins ';
document.getElementById(id).innerHTML += seconds + 'secs';
}
timer = setInterval(showRemaining, 1000);
}
function getElement(&$array, $path)
{
if (count($path)==0) return $array;
return getElement($array[array_shift($path)], $path);
}
$arr = array(
'one' => array(
'two' => array(
'three' => 'stroka'
)
)
);
$path = array(
'one',
'two',
'three'
);
echo getElement($arr, $path);
angular.forEach(ProductsList, function(value, key) {
}
var counter = 4;
var inter = setInterval(function() {
a.innerHTML = counter--;
if (!counter) clearInterval(inter);
}, 2000);
function fix(e, value) {
e = $(e);
e.find("option").each(function(id, e) {
if (e.value == value) {
e.selected = true;
retunr;
}
});
}
fix("#chooser", "20px");
Adblock отключите
$db->query("UPDATE users SET happiness = happiness + 1 WHERE happiness >= 10 AND happiness < 15");
$db->query("UPDATE users SET happiness = happiness + 3 WHERE happiness >= 0 AND happiness < 5");