Размер файла: 5.84Kb
- <?php
- echo'<table align="center"><tr><td><br>';
- require_once BASEDIR."template/session.php";
- require_once BASEDIR."template/counters.php";
- require_once BASEDIR."template/gzip_foot.php";
- require_once BASEDIR."template/generic.php";
- require_once BASEDIR."template/traffic.php";
- echo'</td></tr></table>';
- echo'</td><tr><td background="../themes/vista/img/3.png" height="17"></td>';
- echo'</tr></table>';
- echo'</td><td width="20%" valign="top">';
- echo '<table cellpadding="5" cellspacing="0" width="100%"><tr><td>';
- if (!defined("BASEDIR")) { header("Location:../index.php"); exit; }
-
- $nfile=file(BASEDIR."local/news.dat");
- $nfile=array_reverse($nfile);
- for($ni=0;$ni<31;$ni++){
- $ndata=explode('|',$nfile[$ni]);
- if($ndata[2]!==""){
-
- if(substr($ndata[2], 0, 1)=="0"){$ndata[2]=substr($ndata[2],1); }
- $array_news[]=$ndata[2];
- $array_komm[$ndata[2]]=$ndata[5];
- }
- }
-
- $now=getdate();
- $cal=makeCal ($now['year'], $now['mon']);
-
- echo '<table>
- <tr>
- <td style="color:#FFFFFF">Пн</td>
- <td style="color:#FFFFFF">Вт</td>
- <td style="color:#FFFFFF">Ср</td>
- <td style="color:#FFFFFF">Чт</td>
- <td style="color:#FFFFFF">Пт</td>
- <td style="color:#FF0000">Сб</td>
- <td style="color:#FF0000">Вс</td>
- </tr>';
-
- foreach ($cal as $row) {
- echo '<tr>';
- foreach ($row as $i=>$v) {
-
- if($i==5 || $i==6){
- $tdcal='<td align="center" style="padding: 3px; background-color:#f4efef; color:#FF0000;">';
- }else{
- $tdcal='<td align="center" style="padding: 3px; background-color:#f4efef; color:#666666;">';}
-
- if($v!=""){
- $cal_date=$v.'.'.date("m").'.'.date("y");
- $cal_den=date("j");
-
- if($cal_den==$v){
- $tdcal='<td align="center" style="padding: 3px; background-color:#ffcccc; color:#FF0000;">';}
-
- if(in_array($cal_date,$array_news)){
- $tdcal='<td align="center" style="padding: 3px; background-color:#e7dfdf; color:#FF0000;">';
-
- echo $tdcal.'<b><a href="'.BASEDIR.'news/komm.php?id='.$array_komm[$cal_date].'&'.SID.'"><font color="#FF0000">'.$v.'</font></a></b></td>';
-
- }else{echo $tdcal.$v.'</td>';}
-
- }else{echo $tdcal.' </td>';}
-
- }
- echo '</tr>';
- }
- echo '</table>';
- echo'</td>
- <tr><td background="../themes/vista/img/clock2.png" width="122px" height="130">';
-
- ?>
- <script>
-
- if ((document.getElementById) &&
- window.addEventListener || window.attachEvent){
-
- (function(){
-
- var fCol="black"; //face colour.
- var dCol="black"; //dots colour.
- var hCol="black"; //hours colour.
- var mCol="black"; //minutes colour.
- var sCol="black"; //seconds colour.
-
- var dial = "3 4 5 6 7 8 9 10 11 12 1 2";
- dial = dial.split(" ");
- var e = 360/dial.length;
- var h = 3;
- var m = 4;
- var s = 5;
- var y = 50;
- var x = 60;
- var cyx = 30/4;
- var theDial = [];
- var theDots = [];
- var theHours = [];
- var theMinutes = [];
- var theSeconds = [];
- var idx = document.getElementsByTagName('div').length;
- var pix = "px";
-
- document.write('<div style="position:relative;width:'+(x*2)+'px;height:'+(y*2)+'px">');
-
- for (i=0; i < dial.length; i++){
- document.write('<div id="F'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:15px;height:15px;'
- +'font-family:arial,sans-serif;font-size:10px;color:'+fCol+';text-align:center">'+dial[i]+'<\/div>');
-
- document.write('<div id="D'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
- +'width:2px;height:2px;font-size:2px;background-color:'+dCol+'"><\/div>');
- }
-
- for (i=0; i < h; i++){
- document.write('<div id="H'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
- +'width:2px;height:2px;font-size:2px;background-color:'+hCol+'"><\/div>');
- }
-
- for (i=0; i < m; i++){
- document.write('<div id="M'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
- +'width:2px;height:2px;font-size:2px;background-color:'+mCol+'"><\/div>');
- }
-
- for (i=0; i < s; i++){
- document.write('<div id="S'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
- +'width:2px;height:2px;font-size:2px;background-color:'+sCol+'"><\/div>');
- }
-
- document.write('<\/div>');
-
-
- function clock(){
- var time = new Date();
-
- var secs = time.getSeconds();
- var secOffSet = secs - 15;
- if (secs < 15){
- secOffSet = secs+45;
- }
- var sec = Math.PI * (secOffSet/30);
-
- var mins = time.getMinutes();
- var minOffSet = mins - 15;
- if (mins < 15){
- minOffSet = mins+45;
- }
- var min = Math.PI * (minOffSet/30);
-
- var hrs = time.getHours();
- if (hrs > 12){
- hrs -= 12;
- }
- var hrOffSet = hrs - 3;
- if (hrs < 3){
- hrOffSet = hrs+9;
- }
- var hr = Math.PI * (hrOffSet/6) + Math.PI * time.getMinutes()/360;
-
- for (i=0; i < s; i++){
- theSeconds[i].top = y + (i*cyx) * Math.sin(sec) + pix;
- theSeconds[i].left = x + (i*cyx) * Math.cos(sec) + pix;
- }
- for (i=0; i < m; i++){
- theMinutes[i].top = y + (i*cyx) * Math.sin(min) + pix;
- theMinutes[i].left = x + (i*cyx) * Math.cos(min) + pix;
- }
- for (i=0; i < h; i++){
- theHours[i].top = y + (i*cyx) * Math.sin(hr) + pix;
- theHours[i].left = x + (i*cyx) * Math.cos(hr) + pix;
- }
- setTimeout(clock,100);
- }
-
- function init(){
- for (i=0; i < dial.length; i++){
- theDial[i] = document.getElementById("F"+(idx+i)).style;
- theDial[i].top = y-6 + 30 * 1.4 * Math.sin(i*e*Math.PI/180) + pix;
- theDial[i].left = x-6 + 30 * 1.4 * Math.cos(i*e*Math.PI/180) + pix;
- theDots[i] = document.getElementById("D"+(idx+i)).style;
- theDots[i].top = y + 30 * Math.sin(e*i*Math.PI/180) + pix;
- theDots[i].left= x + 30 * Math.cos(e*i*Math.PI/180) + pix;
- }
- for (i=0; i < h; i++){
- theHours[i] = document.getElementById("H"+(idx+i)).style;
- }
- for (i=0; i < m; i++){
- theMinutes[i] = document.getElementById("M"+(idx+i)).style;
- }
- for (i=0; i < s; i++){
- theSeconds[i] = document.getElementById("S"+(idx+i)).style;
- }
- clock();
- }
-
- if (window.addEventListener){
- window.addEventListener("load",init,false);
- }
- else if (window.attachEvent){
- window.attachEvent("onload",init);
- }
- })();
- }
-
- </script>
- <?php
- echo '</td></tr></table>';
- echo'</td></tr></table>';
- echo'<table align="center"><tr><td>';
- echo'</body></html>';
- echo'</td></tr></table>';
- ?>