if ($uploadFlag && $flag && $childAgeFlag) { $id = $commonController->insertUpdateData($data); $flagOk = false; if ($id > 0) { $commonController->insertAccommodationType($_POST['accommodation_type'], $id); $commonController->insertFacilityType($_POST['facility_type'], $id); $commonController->insertWorkingTime($_POST['txtWorkingTime'], $id); $commonController->insertEstablishmentLanguages($_POST['language_type'], $id); if (!empty($_FILES['imageGallery']['name'][0])) { $commonController->insertGalleryPhotos($_FILES['imageGallery'], $id, '../images/listings/'); } if (!empty($_POST['txtGalleryVideo'])) { $commonController->insertGalleryVideo($_POST['txtGalleryVideo'], $id); } if (!empty($_POST['txtRoomTitle']) && count($_POST['txtRoomTitle']) > 0) { $commonController->insertRooms(array('txtRoomTitle' => $_POST['txtRoomTitle'], 'ddlRoomType' => $_POST['ddlRoomType'], 'txtRoomRate' => $_POST['txtRoomRate'], 'txtRoomDescription' => $_POST['txtRoomDescription'], 'txtRoomMinimumStay' => $_POST['txtRoomMinimumStay'], 'txtRoomFacilities' => $_POST['txtRoomFacilities']), $id); } $flagOk = true; } if ($flagOk) { $msg = 'Saved successfully'; $class = 'success'; $display = 'style="display:block"'; } else { $msg = 'Something went wrong. We are looking into it'; $class = 'danger'; $display = 'style="display:block"'; } } else { $class = 'danger'; $display = 'style="display:block"';