Вывод новостей, как на сайте http://seasonvar.ru/
grimmR 29.07.2015 Стол заказов 2150 5 комментариев
Здравствуйте, Уважаемые кодеры.
Нужен вывод новостей как на сайте seasonvar.ru.
Нужен вывод новостей как на сайте seasonvar.ru.
grimmR 29.07.2015 Стол заказов 2150 5 комментариев
<html>
<head>
<title>Время</title>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<?php
if($_SERVER[REQUEST_METHOD]=='POST'){ // Если форма отравлялась (был метод POST) - тогда выполняй, если GET - не выполняй
$br = "
"; // делаем переменную с переносом
$times = trim($_POST['time']); // приход Продолжительностей
$res = '00:00:00';
$array_times = explode($br, $times);
for($i=0,$cnt=count($array_times);$i<$cnt;$i++){
$res = strtotime($res) + strtotime($array_times[$i]) -strtotime("00:00:00");
$res = date('G:i:s',$res);
}
}
?>
<style>
html,body,TEXTAREA {font-size: 14pt;
font-family: 'Times New Roman';}
body {background-color: #ADD8E6; text-align: center;}
TEXTAREA {background-color: #DCDCDC;}
#post {
width: 750px;
height: 200px;
padding-left: 5px;
}
#html{
width: 750px;
height: 200px;
}
.x1280{
margin-left: 265px;
width: 1280px;
}
input[type="text"] {
border: 1px solid #000;
background: #DCDCDC !important;
width: 750px;
font-size: 14pt;
font-family: 'Times New Roman';
padding-left: 5px;
}
#submit,#copy {
font-size: 22pt;
margin-top: 10px;
}
HR {height: 4px; COLOR: #000000; background-color: #000000; noshade;}
.leviy{
font-size: 14pt;
width: 300px;
}
.praviy{
font-size: 14pt;
padding-left: 10px;
}
.praviydop{
font-size: 14pt;
padding-left: 10px;
}
.praviydop input[type="text"] {
border: 1px solid #0000CD;
background: #c9c9c9 !important;
}
#short{
width: 400px;
}
#postlinks{
width: 750px;
height: 250px;
padding-left: 5px;
}
dopolnitelno {
color: #0000CD;
}
</style>
<form action="times.php" method='post'>
<div class="x1280">
<br><br><br><br>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center" ><tr>
<td align="right" class="leviy">
<B>Время:</B>
</td>
<td class="praviy">
<textarea name='time' id="postlinks"><?php
echo $times;
?></textarea>
</td></tr></table>
</div>
<br>
<input type='submit' value="Отправить" id="submit">
</form>
<br><br><B>Готовое Время:</B><br>
<textarea id="html" name="html"><?php
echo $res;
?></textarea><br>
<input type="button" value="Копировать" id="copy" onclick="copy_to_clipboard('html');">
<script>
function copy_to_clipboard(id)
{
document.getElementById(id).select();
document.execCommand('copy');
}
</script>
<br><br><br>
</body>
</html>
$res = strtotime('0:13:00') + strtotime('1:00:25') -strtotime("00:00:00");
echo date('H:i:s',$res);