} } } if (!$found) { $errstr .= get_roomtype($rtyp) . " Room Reservation for <a href='index.php?menu=reservation&resid=" . $resid . "'>" . $guestname . "</a> cannot auto allocate room<br/>"; //print_r($details[$didx]); } } } } } // Parse the allocations foreach ($allocations as $alx => $val) { $ratesid = $allocations[$alx]['ratesid']; $agentid = 0; get_roomratetypes($ratesid, AGENTRATE, $agentid); $agentname = get_agentname_byid($agentid); $alcrmid = $allocations[$alx]['roomid']; if ($alcrmid > 0) { // echo "Found room id ".$alcrmid."<br/>"; // Specifically allocation room for rate is locked if ($result[$alcrmid][$fromdate]['status'] == LOCKED) { $errstr .= get_roomtype($rtyp) . "<a href='index.php?menu=rateSetup&id=" . $ratesid . "'>Room Rate Allocation for " . $agentname . "</a> cannot auto allocate room " . $result[$alcrmid]['roomno'] . "<br/>"; continue; } if ($result[$alcrmid][$fromdate]['status'] != VACANT && $result[$alcrmid][$fromdate]['ratesid'] != $ratesid) { $errstr .= get_roomtype($rtyp) . " Room Rate Allocation for <a href='index.php?menu=rateSetup&id=" . $ratesid . "'>" . $agentname . "</a> cannot auto allocate room " . $result[$alcrmid]['roomno'] . "<br/>"; continue; } if ($result[$alcrmid][$fromdate]['status'] == VACANT) { $result[$alcrmid][$fromdate]['ratesid'] = $ratesid;
$rateitems = array(); $rcount = get_rateitems($ratesid, $rateitems); if ($ratetype == PROMORATE || $ratetype == AGENTRATE || $ratetype == CUSTOMERRATE) { // Get the customer id associated with the rate if ($ratetype == CUSTOMERRATE) { get_roomratetypes($ratesid, CUSTOMERRATE, $customerid); // print "Customerid ".$customerid."<br/>"; } // Get the agent id associated with the rate. if ($ratetype == AGENTRATE) { // get the travel agent id associated get_roomratetypes($ratesid, AGENTRATE, $agentid); } // get any already selected rooms/roomtypes get_roomratetypes($ratesid, ROOMRATE, $rooms); get_roomratetypes($ratesid, ROOMTYPERATE, $roomtypes); } } } // initialise variables if not already set. if (!$roomexcl) { $roomexcl = ""; } if (!$roomtypeexcl) { $roomtypeexcl = ""; } if (!$minpax) { $minpax = 1; } if (!$maxpax) { $maxpax = 2;