i need programmer for calender script

Discussion in 'PHP' started by dewouter, Jan 31, 2007.

  1. #1
    who can write me a script that looks like this calendar

    It's for a holidayhome that is for rent so it has to be very easy to insert weekends or weeks that are occupied or in option

    pl pm for more details

    http://www.jcon.be/jcon2/admin/showcal.php

    thanks
    wouter
     
    dewouter, Jan 31, 2007 IP
  2. Louis11

    Louis11 Active Member

    Messages:
    783
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #2
    I can do it. Are you looking for a free service, or a paid service? Should be rather simple none the less.
     
    Louis11, Jan 31, 2007 IP
  3. sharpweb

    sharpweb Guest

    Messages:
    246
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I've done something like this before. Please PM with details.
     
    sharpweb, Feb 1, 2007 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    This should do it:

    
    <?php
    //Showing year
    if($_GET['year'] != NULL){$this_year = $_GET['year'];}else{$this_year = date("Y");}
    
    //Next Year
    $next_year = $this_year+1;
    
    //Last year
    $last_year = $this_year-1;
    ?>
    <table width="100%"  border="0" cellspacing="0" cellpadding="3">
      <tr>
        <td><a href="?year=<?=$last_year;?>">&lt;</a> <?=$this_year;?> <a href="?year=<?=$next_year;?>">&gt;</a> </td>
        <td width="3%"><div align="center">1</div></td>
        <td width="3%"><div align="center">2</div></td>
        <td width="3%"><div align="center">3</div></td>
        <td width="3%"><div align="center">4</div></td>
        <td width="3%"><div align="center">5</div></td>
        <td width="3%"><div align="center">6</div></td>
        <td width="3%"><div align="center">7</div></td>
        <td width="3%"><div align="center">8</div></td>
        <td width="3%"><div align="center">9</div></td>
        <td width="3%"><div align="center">10</div></td>
        <td width="3%"><div align="center">11</div></td>
        <td width="3%"><div align="center">12</div></td>
        <td width="3%"><div align="center">13</div></td>
        <td width="3%"><div align="center">14</div></td>
        <td width="3%"><div align="center">15</div></td>
        <td width="3%"><div align="center">16</div></td>
        <td width="3%"><div align="center">17</div></td>
        <td width="3%"><div align="center">18</div></td>
        <td width="3%"><div align="center">19</div></td>
        <td width="3%"><div align="center">20</div></td>
        <td width="3%"><div align="center">21</div></td>
        <td width="3%"><div align="center">22</div></td>
        <td width="3%"><div align="center">23</div></td>
        <td width="3%"><div align="center">24</div></td>
        <td width="3%"><div align="center">25</div></td>
        <td width="3%"><div align="center">26</div></td>
        <td width="3%"><div align="center">27</div></td>
        <td width="3%"><div align="center">28</div></td>
        <td width="3%"><div align="center">29</div></td>
        <td width="3%"><div align="center">30</div></td>
        <td width="3%"><div align="center">31</div></td>
      </tr>
    </table>
    <?php
    
    //This function gets called if the month is feb.
    function days_in_feb_new($year){
        if ($year < 0) $year++;
            $year += 4800;
            if ( ($year % 4) == 0) {
                if (($year % 100) == 0) {
                    if (($year % 400) == 0) {
                        return(29);
                    } else {
                        return(28);
                    }
                 } else {
                    return(29);
                 }
            } else {
                 return(28);
               }
    }
    
    //This is the actual function to call
    function days_in_month($_month, $_year){
        if($_month == 02){
              return days_in_feb_new($_year);
        } else {
            if($_month == 01 || $_month == 03 || $_month == 05 || $_month == 07 || $_month == 08 || $_month == 10 || $_month == 12){
                return(31);
            } else {
                return(30);
            }
         }
    } 
    
    //Show months
    for($x=1;$x<=12;$x++){
    	$this_month = $x;
    	$total_days = days_in_month($this_month,$this_year);
    	$show_month = date("M", mktime(0, 0, 0, $this_month, 1, $this_year));
    	
    	?><table width="100%"  border="0" cellspacing="0" cellpadding="3"><tr><td><div align="center"><?=$show_month;?></div></td><?php
    	for($y=1;$y<=$total_days;$y++){
    		?>
        	<td width="3%"><div align="center"><?=$y;?></div></td>
    		<?php
    		for($z=$total_days;$z<31;$z++){ echo '<td width="3%"><div align="center"&nbsp;</div></td>';?}>
    	}
    	?></tr></table><?php
    
    }
    ?>
    
    PHP:
    Peace,
     
    Barti1987, Feb 2, 2007 IP