コード例 #1
0
 } else {
     $ignoreWarning = FALSE;
 }
 if (!$ignoreWarning) {
     /* ## Checking for warnings ## */
     // Checking title
     if (!$entry_name_set) {
         $warnings[] = __('No title for the entry was made. Please spesify either a title, a customer or a bookingtype.');
     }
     // Trigger customer_name but not customer_id error?
     if (!isset($customer_name_ok) || !$customer_name_ok) {
         $warnings[] = __('Please be advised: You have set a customer name but no customer in the database where selected. The result of this is that no customer is selected.');
     }
     // Checking room, if some conditions are met
     if ($entry_add || $entry['time_start'] != $time_start || $entry['time_end'] != $time_end || splittalize($entry['room_id']) != splittalize($room_id)) {
         $checkroom = checkTime_Room($time_start, $time_end, $area_id, $room_id);
         // $array[roomid][entryid] = entryid;
         if (count($checkroom)) {
             // Removing this event if we are editing
             if (!$entry_add) {
                 $checkroom2 = $checkroom;
                 $checkroom = array();
                 foreach ($checkroom2 as $rid => $entries) {
                     foreach ($entries as $thisentry) {
                         if ($thisentry != $entry_id) {
                             $checkroom[$rid][$thisentry] = $thisentry;
                         }
                     }
                 }
             }
             foreach ($checkroom as $rid => $entries) {
コード例 #2
0
ファイル: functions.inc.php プロジェクト: HNygard/JM-booking
function drawTimeTableColum($room, $capacity, $time)
{
    global $resolution, $showSingleEntrysAsBlock;
    $wday = date("d", $time);
    $wmonth = date("m", $time);
    $wyear = date("Y", $time);
    $hour = date("H", $time);
    $minute = date("i", $time);
    $time2 = $time + $resolution;
    $start = $time;
    $end = $time2;
    $area_id = 4;
    $roomentries = checkTime_Room($start, $end, $area_id, $room);
    if (count($roomentries)) {
        print_r($roomentries);
        $num_entry = count($roomentries[$room]);
    } else {
        $num_entry = '';
    }
    if ($num_entry > 0) {
        tdcell("nofreeslots");
    } else {
        tdcell("white");
    }
    echo "<center>";
    echo $num_entry;
    echo '<input type="radio" name="starttime" value="' . $wyear . ';' . $wmonth . ';' . $wday . ';' . $hour . ';' . $minute . ';' . $room . ';day">' . chr(10);
    echo '<input type="radio" name="endtime" value="' . $wyear . ';' . $wmonth . ';' . $wday . ';' . $hour . ';' . $minute . ';' . $room . ';day">' . chr(10);
    //if(!$showSingleEntrysAsBlock&&$available==1&&$capacity==1)
    //{
    //do nothing
    echo "<a href=\"edit_entry2.php?view=week&room={$room}" . "&hour={$hour}&minute={$minute}&year={$wyear}&month={$wmonth}" . "&day={$wday}\"><img src=img/new.gif width=10 height=10 border=0></a>";
    /*} 
    	elseif ($available > 0)
    	{
    		echo "<a href=\"edit_entry2.php?view=week&room=$room"
    		. "&hour=$hour&minute=$minute&year=$wyear&month=$wmonth"
    		. "&day=$wday\"> ( $available / $capacity ) <img src=img/new.gif width=10 height=10 border=0></a>";
    		
    	}
    	elseif ($showSingleEntrysAsBlock) {
    		echo " ( $available / $capacity )";
    	}*/
    echo "</center>";
    #begin table for entry list boxes
    #if there is only one entry, show this as text instead of box
    /*
    	if($reserviert==1&&!$showSingleEntrysAsBlock){
    		$type		= mysql_result($entries, 0 , 0);
    		$id			= mysql_result($entries, 0 , 1 );
    		$thetitle	= mysql_result($entries, 0 , 2);
    		
    		$links="view_entry.php?view=week&id=".$id."&day=$wday&month=$wmonth&year=$wyear";
    		echo "<a href=\"$links\">",substr($thetitle,0,20),"</a>";
    	}
    	else {
    		echo "<table cellspacing=3 cellpadding=0 border=0><tr>";
    		for ($i = 0 ; $i < $reserviert ; $i++){
    			$type		= mysql_result($entries, $i , 0);
    			$id			= mysql_result($entries, $i , 1 );
    			$thetitle	= mysql_result($entries, $i , 2);
    			
    			$links="view_entry.php?view=week&id=".$id."&day=$wday&month=$wmonth&year=$wyear";
    			echo "<td class=$type><a onmouseover=\"return overlib('<b>",addslashes($thetitle),"</b><br>", _("from"), " ", strftime('%d.%b.%Y %H:%M',mysql_result($entries,$i,3)),"<br>", _("till"), " ",strftime('%d.%b.%Y %H:%M',mysql_result($entries,$i,4)),"');\" onmouseout=\"return nd();\" href=\"$links\" ><img src=img/pixel.gif width=10 height=10 border=0></a></td>";
    		}
    		echo "</tr></table>";
    	}*/
    echo "</td>";
}