I have the following question.
I'm doing a reservation system for hotels in PHP. in some dates the price increases and in others it decreases, now I have brought that from the DB but I want to know how to add the normal prices: $ PriceSystemArray ['price'] with the increased prices: $ price ['price']
File php:
$nameroom = Data::RoomsViewModel("rooms");
if($item['name'] == 'Habitación Doble C/D'){
$PriceSystemArray = array('in' => $dateinstr,
'out' => $dateoutstr,
'price' => $item['price']);
for($i=$PriceSystemArray['in']; $i<=$PriceSystemArray['out']; $i = date("Y-m-d", strtotime($i ."+ 1 days"))){
$price = Data::PriceSearch("price_hdcd");
$UNIX = strtotime($i);
$STR = date("d-m-Y", $UNIX);
foreach ($price as $row => $priceout) {
if ($STR >= $priceout['dateini'] && $STR <= $priceout['datefin'] ) {
echo '
<tr>
<th scope="row">'.$STR.'</th>
<td>'.$priceout['price'].'</td>
<tr>';
} else {
echo '
<tr>
<th scope="row">'.$STR.'</td>
<td>'.$PriceSystemArray['price'].'</td>
<tr>';
}
}
}
}