Esempio n. 1
0
	if ($form->validate()) {
		$values = $form->exportValues();
		if ($values['timepicker'] == 0) {
			$result = Rsys :: add_subscription($_GET['rid'], api_get_user_id(),$values['accepted']);
			switch ($result) {
				case 0 :
					Display :: display_normal_message(Rsys :: get_return_msg2(get_lang('ReservationAdded'), "javascript:history.go(-2)", get_lang('BookingView')),false);
					break;
				case 1 :
					Display :: display_normal_message(Rsys :: get_return_msg2(str_replace('#END#', "<b>".$GLOBALS['end_date']."</b>",str_replace('#START#', "<b>".$GLOBALS['start_date']."</b>",get_lang('ReservationAlready'))),"reservation.php?cat=".$item[1]."&item=".$item[0]."", get_lang('BookingView')),false);
					break;
			}

		} else {
			$result = Rsys :: add_subscription_timepicker($_GET['rid'], api_get_user_id(), $values['startpicker'], $values['endpicker'],$values['accepted'],$values['min'],$values['max']);
			switch ($result) {
				case 0 :
					Display :: display_normal_message(Rsys :: get_return_msg2(get_lang('ReservationAdded'), "reservation.php?cat=".$item[1]."&item=".$item[0]."&date=".date( 'Y-m-d',Rsys :: mysql_datetime_to_timestamp($values['startpicker']))."&changemonth=yes", get_lang('BookingView')),false);
					break;
				case 1 :
					Display :: display_normal_message(str_replace('#END#', "<b>".$GLOBALS['end_date']."</b>",str_replace('#START#', "<b>".$GLOBALS['start_date']."</b>",get_lang('ReservationOutOfDate'))),false);
					$form->display();
					echo $buffer;
					break;
				case 2 :
					Display :: display_normal_message(get_lang('BookingPeriodTooSmall'),false);
					$form->display();
					//echo $buffer;
					break;
				case 3 :