示例#1
0
 public function roomBooking()
 {
     if (formtoken::validateToken($_POST)) {
         if ($_POST['booking_type'] == 2) {
             $_POST['from_date'] = date('d-m-Y', strtotime($_POST['from_date']) - 86400);
             // reduce one day as room will be blocked before one day
         } else {
             $_POST['from_date'] = date('d-m-Y', strtotime($_POST['from_date']));
             $_POST['advance_amount'] = 0;
             // if current booking, advance amount is 0
         }
         $date_fields_array = array('from_date', 'to_date');
         $time = date('H:i:s', time());
         foreach ($date_fields_array as $val) {
             if (isset($_POST[$val])) {
                 $_POST[$val] = date('Y-m-d ' . $time, strtotime($_POST[$val]));
             }
         }
         $_POST['checkout_date'] = $_POST['to_date'];
         $_POST['created_by'] = $this->user_details->id;
         $_POST['created_date'] = date("Y-m-d H:i:s");
         $_POST['modified_by'] = $this->user_details->id;
         $_POST['modified_date'] = date("Y-m-d H:i:s");
         $_POST['ipaddress'] = ipaddress();
         $_POST['received_by'] = $this->user_details->id;
         $_POST['received_date'] = date("Y-m-d H:i:s");
         $_POST['total_amount_paid'] = $_POST['deposit_amt'] + $_POST['rent_amount'] + $_POST['advance_amount'];
         $app_id = $this->booking_model->save_booking($_POST);
         redirect("booking/ticket/{$app_id}");
         //$this->ticket($app_id);
     } else {
         die('The form is not valid or has expired.');
     }
 }
示例#2
0
         }
         //todo: lang support when deleted
     }
     $key++;
 }
 if (!$db_connection->connect_errno) {
     if ($login->isUserLoggedIn() == true) {
         if ($_SESSION['multiDB'] && isset($_POST['dbid']) && isset($_POST['type'])) {
             $_SESSION['server_type'] = $_POST['type'];
             $_SESSION['dbid'] = $_POST['dbid'];
         }
         if (!isset($_SESSION['formtoken'])) {
             formtoken::generateToken();
         }
         if ($_SESSION['formtoken'][1] < time() - 600) {
             formtoken::generateToken();
         }
         $_SESSION['formtoken'][1] = time();
         if (isset($_GET['items'])) {
             if (in_array($_GET['items'], $settings['item'])) {
                 $sql = "UPDATE `users` SET `items` = " . $_GET['items'] . " WHERE `user_id` = '" . $_SESSION['user_id'] . "' ";
                 $db_connection->query($sql);
                 $_SESSION['items'] = intval($_GET['items']);
             }
         }
         $err = errorMessage(4, $lang);
         $page = "views/templates/error.php";
         if ($currentPage == '' || $currentPage == 'index' || $currentPage == 'dashboard') {
             if (isset($_SESSION['server_type'])) {
                 if ($_SESSION['server_type'] == 'life') {
                     if ($_SESSION['steamsignon'] || $_SESSION['user_level'] == 1) {
示例#3
0
													<option value="0" selected>No</option>
												</select>
											</div>
											<?php 
            }
            ?>
										</div>
									</li>
									<?php 
        }
        ?>
								</ul>
							</div>
							<center><input class='btn btn-lg btn-primary'  type='submit'  name='edit' value='<?php 
        echo $lang['subChange'];
        ?>
'>
							<?php 
        echo formtoken::getField();
        ?>
						</div>
					</div>
                </form>
            </div>
        </div>
    </div>
    <?php 
    }
} else {
    echo errorMessage(3, $lang);
}