synted Posted March 2, 2008 Share Posted March 2, 2008 Hello again. I want to make a calendar that has each day of the month next to the other. For example, in the first row i want to have the 3 letter name of the day Sun Mon etc, in the second row i want to have the number of the day 1 2 3 etc, and in the third i want to add the holidays. How can i make the calendar in that way? I have made the row with the days numbers but i can't loop the days names. Can anyone help? Quote Link to comment Share on other sites More sharing options...
soycharliente Posted March 2, 2008 Share Posted March 2, 2008 I found this page very helpful when making one for my site. http://keithdevens.com/software/php_calendar Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 I have seen this site. But it doesn't give me any clues about the one i want to make. I have written the following <?php $ndays = date ("t", mktime (0,0,0,$d,1,$y)); for ($i = 1; $i <= $ndays; $i++) { print "<td>$i</td>"; } ?> But this is for the days. I need to make something like that, that will print in another row the name of the day. Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 I have come up with the following code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>March</TITLE> <link href="css/ros.css" rel="stylesheet" type="text/css"> </HEAD> <BODY onLoad="init();"> <div class=navigationseparator> </div> <form class=action method="post" action="" name="form"> <table width=100%> <!--DWLayoutTable--> <tr> <td> </td> <td id="revertTd"><a href="/rooster/enindex.php3?action=pla.mon&functionId=4938&yearMonth=200803">undo</a></td> <td class=off>fill Month</td> <td><button type="submit">save March</button></td> </tr> </table> <TABLE class=rooster cellspacing=0 onKeyUp="setShift(event);" onMouseUp="focusOnField(event);"> <!--DWLayoutTable--> <TR> <th class=time rowspan=2 colspan=2> </th> <th height="14" colspan=3 class=week><a href="/rooster/enindex.php3?action=pla.wee&date=20080301&functionId=4938">week 9</a></th> <td></td> <th class=week colspan=8><a href="/rooster/enindex.php3?action=pla.wee&date=20080303&functionId=4938">week 10</a></th> <td></td> <th class=week colspan=8><a href="/rooster/enindex.php3?action=pla.wee&date=20080310&functionId=4938">week 11</a></th> <td></td> <th class=week colspan=8><a href="/rooster/enindex.php3?action=pla.wee&date=20080317&functionId=4938">week 12</a></th> <td></td> <th class=week colspan=8><a href="/rooster/enindex.php3?action=pla.wee&date=20080324&functionId=4938">week 13</a></th> <td></td> <th class=week colspan=1><a href="/rooster/enindex.php3?action=pla.wee&date=20080331&functionId=4938">w14</a></th> <th width="49"></th> <th class=sunrise rowspan=3>m</th> <th class=blanchedAlmond rowspan=3>a</th> <th class=khaki rowspan=3>n</th> </tr> <tr> <td height="26"></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080301&functionId=4938">Sa<br> 1</a></th> <th class=weekdayToday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080302&functionId=4938">Su<br> 2</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080303&functionId=4938">Mo<br> 3</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080304&functionId=4938">Tu<br> 4</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080305&functionId=4938">We<br> 5</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080306&functionId=4938">Th<br> 6</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080307&functionId=4938">Fr<br> 7</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080308&functionId=4938">Sa<br> 8</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080309&functionId=4938">Su<br> 9</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080310&functionId=4938">Mo<br> 10</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080311&functionId=4938">Tu<br> 11</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080312&functionId=4938">We<br> 12</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080313&functionId=4938">Th<br> 13</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080314&functionId=4938">Fr<br> 14</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080315&functionId=4938">Sa<br> 15</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080316&functionId=4938">Su<br> 16</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080317&functionId=4938">Mo<br> 17</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080318&functionId=4938">Tu<br> 18</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080319&functionId=4938">We<br> 19</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080320&functionId=4938">Th<br> 20</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080321&functionId=4938">Fr<br> 21</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080322&functionId=4938">Sa<br> 22</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080323&functionId=4938">Su<br> 23</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080324&functionId=4938">Mo<br> 24</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080325&functionId=4938">Tu<br> 25</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080326&functionId=4938">We<br> 26</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080327&functionId=4938">Th<br> 27</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080328&functionId=4938">Fr<br> 28</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080329&functionId=4938">Sa<br> 29</a></th> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080330&functionId=4938">Su<br> 30</a></th> <td></td> <th class=weekday><a href="/rooster/enindex.php3?action=pla.day.emp&date=20080331&functionId=4938">Mo<br> 31</a></th> <th> </th> </TR> <tr class=strength title="Yellow: shortage. Green: OK. Dark green: surplus."> <td class=prompt colspan=2></td> <td></td> <th> </th> <th class=Today> </th> <td></td> <th> </th> <th> </th> <th> </th> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <th> </th> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <th> </th> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <th> </th> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> <td></td> <th> </th> <th> </th> </tr> <tr class=input title="John Doe"> <TD class=prompt colspan=2><a href="/rooster/enindex.php3?action=pla.emp.mon&yearMonth=200803&empid=20732">John Doe</a> </TD> <td></td> <TD class=" "><input class="blanchedAlmond" name="1_20732" id=1 value="a" size=1 maxlength=2></td> <TD class=" Today"><input name="2_20732" id=2 size=1 maxlength=2></td> <td></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="3_20732" id=3 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="4_20732" id=4 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="5_20732" id=5 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="6_20732" id=6 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="7_20732" id=7 value="a" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="8_20732" id=8 size=1 maxlength=2></td> <TD class=" "><input name="9_20732" id=9 size=1 maxlength=2></td> <td></td> <TD class="sunrise "><input class="sunrise" name="10_20732" id=10 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="11_20732" id=11 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="12_20732" id=12 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="13_20732" id=13 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="14_20732" id=14 value="m" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="15_20732" id=15 size=1 maxlength=2></td> <TD class=" "><input name="16_20732" id=16 size=1 maxlength=2></td> <td></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="17_20732" id=17 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="18_20732" id=18 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="19_20732" id=19 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="20_20732" id=20 value="a" size=1 maxlength=2></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="21_20732" id=21 value="a" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="22_20732" id=22 size=1 maxlength=2></td> <TD class=" "><input name="23_20732" id=23 size=1 maxlength=2></td> <td></td> <TD class="sunrise "><input class="sunrise" name="24_20732" id=24 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="25_20732" id=25 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="26_20732" id=26 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="27_20732" id=27 value="m" size=1 maxlength=2></td> <TD class="sunrise "><input class="sunrise" name="28_20732" id=28 value="m" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="29_20732" id=29 size=1 maxlength=2></td> <TD class=" "><input name="30_20732" id=30 size=1 maxlength=2></td> <td></td> <TD class="blanchedAlmond "><input class="blanchedAlmond" name="31_20732" id=31 value="a" size=1 maxlength=2></td> <td> </td> <TD class=sunriseTotal>10</TD> <TD class=blanchedAlmondTotal>12</TD> <TD class=khakiTotal>-</TD> </tr> <tr class=input title="Don Corleone"> <TD class=prompt colspan=2><a href="/rooster/enindex.php3?action=pla.emp.mon&yearMonth=200803&empid=20731">Don Corleone</a></TD> <td></td> <TD class=" "><input class="blanchedAlmond" name="1_20731" id=32 value="a" size=1 maxlength=2></td> <TD class=" Today"><input name="2_20731" id=33 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="sunrise" name="3_20731" id=34 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="4_20731" id=35 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="5_20731" id=36 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="6_20731" id=37 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="7_20731" id=38 value="m" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="8_20731" id=39 size=1 maxlength=2></td> <TD class=" "><input name="9_20731" id=40 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="blanchedAlmond" name="10_20731" id=41 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="11_20731" id=42 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="12_20731" id=43 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="13_20731" id=44 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="14_20731" id=45 value="a" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="15_20731" id=46 size=1 maxlength=2></td> <TD class=" "><input name="16_20731" id=47 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="sunrise" name="17_20731" id=48 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="18_20731" id=49 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="19_20731" id=50 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="20_20731" id=51 value="m" size=1 maxlength=2></td> <TD class=" "><input class="sunrise" name="21_20731" id=52 value="m" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="22_20731" id=53 size=1 maxlength=2></td> <TD class=" "><input name="23_20731" id=54 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="blanchedAlmond" name="24_20731" id=55 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="25_20731" id=56 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="26_20731" id=57 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="27_20731" id=58 value="a" size=1 maxlength=2></td> <TD class=" "><input class="blanchedAlmond" name="28_20731" id=59 value="a" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="29_20731" id=60 size=1 maxlength=2></td> <TD class=" "><input name="30_20731" id=61 size=1 maxlength=2></td> <td></td> <TD class=" "><input name="31_20731" id=62 size=1 maxlength=2></td> <td> </td> <TD class=sunriseTotal>10</TD> <TD class=blanchedAlmondTotal>11</TD> <TD class=khakiTotal>-</TD> </tr> <tr class=input title="sdafasdf"> <TD class=prompt colspan=2><a href="/rooster/enindex.php3?action=pla.emp.mon&yearMonth=200803&empid=20754">sdafasdf</a> </TD> <td></td> <TD class=" "><input name="1_20754" id=63 size=1 maxlength=2></td> <TD class=" Today"><input name="2_20754" id=64 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="khaki" name="3_20754" id=65 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="4_20754" id=66 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="5_20754" id=67 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="6_20754" id=68 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="7_20754" id=69 value="n" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="8_20754" id=70 size=1 maxlength=2></td> <TD class=" "><input name="9_20754" id=71 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="khaki" name="10_20754" id=72 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="11_20754" id=73 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="12_20754" id=74 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="13_20754" id=75 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="14_20754" id=76 value="n" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="15_20754" id=77 size=1 maxlength=2></td> <TD class=" "><input name="16_20754" id=78 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="khaki" name="17_20754" id=79 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="18_20754" id=80 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="19_20754" id=81 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="20_20754" id=82 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="21_20754" id=83 value="n" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="22_20754" id=84 size=1 maxlength=2></td> <TD class=" "><input name="23_20754" id=85 size=1 maxlength=2></td> <td></td> <TD class=" "><input class="khaki" name="24_20754" id=86 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="25_20754" id=87 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="26_20754" id=88 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="27_20754" id=89 value="n" size=1 maxlength=2></td> <TD class=" "><input class="khaki" name="28_20754" id=90 value="n" size=1 maxlength=2></td> <td></td> <TD class=" "><input name="29_20754" id=91 size=1 maxlength=2></td> <TD class=" "><input name="30_20754" id=92 size=1 maxlength=2></td> <td></td> <TD class=" "><input name="31_20754" id=93 size=1 maxlength=2></td> <td> </td> <TD class=sunriseTotal>-</TD> <TD class=blanchedAlmondTotal>-</TD> <TD class=khakiTotal>20</TD> </tr> <tr> <th colspan=2></th> <td></td> <th class=weekday>1</th> <th class=weekdayToday>2</th> <td></td> <th class=weekday>Mo<br> 3</th> <th class=weekday>Tu<br> 4</th> <th class=weekday>We<br> 5</th> <th class=weekday>Th<br> 6</th> <th class=weekday>Fr<br> 7</th> <td></td> <th class=weekday>8</th> <th class=weekday>9</th> <td></td> <th class=weekday>Mo<br> 10</th> <th class=weekday>Tu<br> 11</th> <th class=weekday>We<br> 12</th> <th class=weekday>Th<br> 13</th> <th class=weekday>Fr<br> 14</th> <td></td> <th class=weekday>15</th> <th class=weekday>16</th> <td></td> <th class=weekday>Mo<br> 17</th> <th class=weekday>Tu<br> 18</th> <th class=weekday>We<br> 19</th> <th class=weekday>Th<br> 20</th> <th class=weekday>Fr<br> 21</th> <td></td> <th class=weekday>22</th> <th class=weekday>23</th> <td></td> <th class=weekday>Mo<br> 24</th> <th class=weekday>Tu<br> 25</th> <th class=weekday>We<br> 26</th> <th class=weekday>Th<br> 27</th> <th class=weekday>Fr<br> 28</th> <td></td> <th class=weekday>29</th> <th class=weekday>30</th> <td></td> <th class=weekday>Mo<br> 31</th> <th> </th> <th class=sunrise>m</th> <th class=blanchedAlmond>a</th> <th class=khaki>n</th> </tr> <tr class=total> <td class=sunrise></td> <td class=sunrise><span class=detail>6<sup>:00</sup>-14<sup>:30</sup></span> m</td> <td></td> <td class="sunrise">-</td> <td class="sunrise Today">-</td> <td></td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td></td> <td class="sunrise">-</td> <td class="sunrise">-</td> <td></td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td></td> <td class="sunrise">-</td> <td class="sunrise">-</td> <td></td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td></td> <td class="sunrise">-</td> <td class="sunrise">-</td> <td></td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td class="sunrise">1</td> <td></td> <td class="sunrise">-</td> <td class="sunrise">-</td> <td></td> <td class="sunrise warning" title="Minimum 1 Assigned 0">-</td> <td colspan=2 class=sunrise>morning</td> <td class=blanchedAlmond> </td> <td class=khaki> </td> </tr> <tr class=total> <td class=blanchedAlmond></td> <td class=blanchedAlmond><span class=detail>14<sup>:00</sup>-22<sup>:30</sup></span> a</td> <td></td> <td class="blanchedAlmond">2</td> <td class="blanchedAlmond Today">-</td> <td></td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td></td> <td class="blanchedAlmond">-</td> <td class="blanchedAlmond">-</td> <td></td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td></td> <td class="blanchedAlmond">-</td> <td class="blanchedAlmond">-</td> <td></td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td></td> <td class="blanchedAlmond">-</td> <td class="blanchedAlmond">-</td> <td></td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td class="blanchedAlmond">1</td> <td></td> <td class="blanchedAlmond">-</td> <td class="blanchedAlmond">-</td> <td></td> <td class="blanchedAlmond">1</td> <td colspan=3 class=blanchedAlmond>afternoon</td> <td class=khaki> </td> </tr> <tr class=total> <td class=khaki></td> <td class=khaki><span class=detail>22<sup>:00</sup>-+6<sup>:30</sup></span> n</td> <td></td> <td class="khaki">-</td> <td class="khaki Today">-</td> <td></td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td></td> <td class="khaki">-</td> <td class="khaki">-</td> <td></td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td></td> <td class="khaki">-</td> <td class="khaki">-</td> <td></td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td></td> <td class="khaki">-</td> <td class="khaki">-</td> <td></td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td class="khaki">1</td> <td></td> <td class="khaki">-</td> <td class="khaki">-</td> <td></td> <td class="khaki">-</td> <td colspan=4 class=khaki>night</td> </tr> </TABLE> </form> </BODY> </HTML> The problem is that i don't know how to put the days like that and the second problem i have is that i don't know how to submit the query. It involves 3 people in my example which should update different things in the database. Can anyone help? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 days and date <?php $month = 3; $first = mktime (0,0,0,$month,1,date('Y')); echo '<table border="1">'; /** * day names */ $d = $first; echo '<tr>'; while (date('n', $d)==$month) { echo '<td>', date('D', $d), '</td>'; $d = strtotime ('+1 days', $d); } echo '</tr>'; /** * dates */ $d = $first; echo '<tr>'; while (date('n', $d)==$month) { echo '<td>', date('j', $d), '</td>'; $d = strtotime ('+1 days', $d); } echo '</tr>'; echo '</table>'; ?> Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 Thank you that worked perfectly. Now i have to figure out the query. Any clues anyone? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 How are you storing the holiday data? Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 I was thinking to put them in a db table and check them on the creation of the calendar. Do you have another idea i can use? The thing is that i can't figure out how to do the query with the multiple persons. One by one i can make it. It's easy but i can't find a way out if i put them together. I can't do it one by one as there will be more than 200 persons in the database. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted March 2, 2008 Share Posted March 2, 2008 Make a field that has year, month, and day, and check if those 3 values are correspondent to the current month day and year, and if it is, print the holiday. Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 I was thinking to do that as i want to color the holidays so it can be visible. Can anyone please help with the form? I have some serious problems with it. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 I'd store holidays as [pre] id | personID | hol_start | hol_end ----+-------------+--------------+------------ 1 | 123 | 2008-03-15 | 2008-03-21 2 | 306 | 2008-03-01 | 2008-03-07 Quote Link to comment Share on other sites More sharing options...
phpSensei Posted March 2, 2008 Share Posted March 2, 2008 I'd store holidays as [pre] id | personID | hol_start | hol_end ----+-------------+--------------+------------ 1 | 123 | 2008-03-15 | 2008-03-21 2 | 306 | 2008-03-01 | 2008-03-07 you wouldnt really need the years right? I mean holidays dont depend on which year it is... i think You would find yourself repeating the years for countless amount of times. The month and day is all you need. EXAMPLE: Christmas - 1990 1991 1992 ..etc See what i mean? X-Mas is every year Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 I thought we were talking about employees booking leave. As for the year, it makes life a lot easier if you use DATE type fields (yyyy-mm-dd). And if you need a historical record, you need years. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 See what i mean? X-Mas is every year Yes, but the first Sunday after the fourth full moon after christmas changes every year (That's Easter, BTW) Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 No i don't want the employees leave. I have a shift that is Day off for them. I will only put the usual holidays in. I was thinking of puting tha date and how many days it will last. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 2, 2008 Share Posted March 2, 2008 The problem with doing it that way is when you come to dates near the end of a month. 2008-02-29 | 2 days It isn't as easy to pick that up in the March calendar Quote Link to comment Share on other sites More sharing options...
synted Posted March 2, 2008 Author Share Posted March 2, 2008 Haven't thought of that. You are right. I will then put start and end date in. I just want that so i can colour the calendar with another colour than the default. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 3, 2008 Share Posted March 3, 2008 I'm still not sure what data you will be holding in the database for the 200 persons Quote Link to comment Share on other sites More sharing options...
synted Posted March 3, 2008 Author Share Posted March 3, 2008 Name Surname ID Department Team What shifts the can work The Departments The teams and the shifts. That's it i think Quote Link to comment Share on other sites More sharing options...
Barand Posted March 3, 2008 Share Posted March 3, 2008 Standard hols apply to all employees so can be stored separately. How are the shift patterns/days off stored - I assume these are what you want to show in the calendar for each person (plus the standatd hol dates) and for which you want the db query Quote Link to comment Share on other sites More sharing options...
synted Posted March 3, 2008 Author Share Posted March 3, 2008 The holidays will be in only for printing another color. There will be shifts in the holiday. Quote Link to comment Share on other sites More sharing options...
synted Posted March 3, 2008 Author Share Posted March 3, 2008 The shifts are in the way of M for morning N for Nightshift and like that for the other, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.