Changeset 17150


Ignore:
Timestamp:
09/09/13 14:36:05 (11 years ago)
Author:
Daniela Dorner
Message:
fixed choice of date depending on hour, added general contact info
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/shiftinfo.php

    r15312 r17150  
    1111
    1212
    13 <a href='https://www.fact-project.org/smartfact'>Is FACT taking data?</a><br>
     13<a href='https://www.fact-project.org/smartfact'>Is FACT taking data?</a><br><br>
    1414Who is on shift?
    1515(from <a href='https://www.fact-project.org/shift'>FACT shift plan<a>
     
    1717
    1818<?php
    19 $date=date("Ymd", mktime(0,0,date("H"-13),date("m"), date("d"), date("Y")));
    20 echo "<br> &nbsp;&nbsp;Night: ".$date." (date of sunset) <br>";
    21 $query="SELECT u FROM calendar.data WHERE CONCAT(y, LPAD(m+1, 2, 0), LPAD(d,2,0))='".$date."' AND x=0 ";
     19
     20if (date("H")>8)
     21    $today=date("Ymd", mktime(0,0,0,date("m"), date("d"), date("Y")));
     22else
     23    $today=date("Ymd",strtotime(date("Y-m-d", mktime(0,0,0,date("m"), date("d"), date("Y")))." -1 day"));
     24
     25echo "<br> &nbsp;&nbsp;Night: ".$today." (date of sunset) <br>";
     26$query="SELECT u FROM calendar.data WHERE CONCAT(y, LPAD(m+1, 2, 0), LPAD(d,2,0))='".$today."' AND x=0 ";
    2227//echo $query;
    2328include ("db.php");
    2429$db_id = mysql_connect($host, $user, $pw);
    2530$result  = mysql_query($query);
    26 echo "&nbsp;&nbsp;Contact Info: <br>\n <ul>\n";
     31echo "&nbsp;&nbsp;Contact Info Shiftcrew: <br>\n <ul>\n";
    2732while ($row = mysql_fetch_row($result))
    2833{
     
    3742    mysql_free_result($result2);
    3843}
     44echo "</ul>\n <br>\n <br>\n ";
     45mysql_free_result($result);
     46
     47echo "General Contact Info: <br>\n <ul>\n";
     48$query3="SELECT usertitle, fid8 FROM logbook.userfields LEFT JOIN logbook.users ON (uid=ufid) WHERE username='dorner'";
     49$result3  = mysql_query($query3);
     50while ($row3 = mysql_fetch_row($result3))
     51{
     52    echo "<li>".$row3[0].": ".$row3[1]."</li>\n";
     53}
     54mysql_free_result($result3);
     55
    3956echo "</ul>\n";
    40 mysql_free_result($result);
    4157
    4258?>
Note: See TracChangeset for help on using the changeset viewer.