[svn r17974] Minor - Lang variables changed, added Database:: functions, UI improvements... FS#821

skala
Julio Montoya 17 years ago
parent 334315b8d0
commit c8da657b03
  1. 13
      main/reservation/m_item.php
  2. 24
      main/reservation/m_reservation.php
  3. 4
      main/reservation/reservation.php
  4. 107
      main/reservation/rsys.php
  5. 19
      main/reservation/subscribe.php

@ -29,7 +29,6 @@
--------------------------------------------------------------------- ---------------------------------------------------------------------
*/ */
require_once ('rsys.php'); require_once ('rsys.php');
Rsys :: protect_script('m_item'); Rsys :: protect_script('m_item');
$tool_name = get_lang('ResourceList'); $tool_name = get_lang('ResourceList');
//$interbreadcrumb[] = array ("url" => "../admin/index.php", "name" => get_lang('PlatformAdmin')); //$interbreadcrumb[] = array ("url" => "../admin/index.php", "name" => get_lang('PlatformAdmin'));
@ -265,7 +264,7 @@ switch ($_GET['action']) {
api_display_tool_title(get_lang('EditRight')); api_display_tool_title(get_lang('EditRight'));
$form = new FormValidator('itemright', 'post', "m_item.php?id=".$item['id']."&action=m_rights&subaction=edit"); $form = new FormValidator('itemright', 'post', "m_item.php?id=".$item['id']."&action=m_rights&subaction=edit");
$form->add_textfield('classn', get_lang('LangClass'), true, array ('readonly' => 'readonly')); $form->add_textfield('classn', get_lang('Class'), true, array ('readonly' => 'readonly'));
$form->addElement('checkbox', 'edit_right', get_lang('EditRight')); $form->addElement('checkbox', 'edit_right', get_lang('EditRight'));
$form->addElement('checkbox', 'delete_right', get_lang('DeleteRight')); $form->addElement('checkbox', 'delete_right', get_lang('DeleteRight'));
@ -315,7 +314,7 @@ switch ($_GET['action']) {
$interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking')); $interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking'));
$interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageItems')); $interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageResources'));
Display :: display_header(str_replace('#ITEM#', $item['name'], get_lang('MItemRights'))); Display :: display_header(str_replace('#ITEM#', $item['name'], get_lang('MItemRights')));
api_display_tool_title(get_lang('MItemRights2')); api_display_tool_title(get_lang('MItemRights2'));
@ -329,7 +328,7 @@ switch ($_GET['action']) {
$table = new SortableTable('itemrights', array ('Rsys', 'get_num_itemrights'), array ('Rsys', 'get_table_itemrights'), 1); $table = new SortableTable('itemrights', array ('Rsys', 'get_num_itemrights'), array ('Rsys', 'get_table_itemrights'), 1);
$table->set_header(0, '', false, array ('style' => 'width:10px')); $table->set_header(0, '', false, array ('style' => 'width:10px'));
$table->set_additional_parameters(array('action'=>'m_rights','item_id'=>$_GET['item_id'])); $table->set_additional_parameters(array('action'=>'m_rights','item_id'=>$_GET['item_id']));
$table->set_header(1, get_lang('LangClass'), false); $table->set_header(1, get_lang('Class'), false);
$table->set_header(2, get_lang('EditItemRight'), false); $table->set_header(2, get_lang('EditItemRight'), false);
$table->set_header(3, get_lang('DeleteItemRight'), false); $table->set_header(3, get_lang('DeleteItemRight'), false);
$table->set_header(4, get_lang('MBookingPeriodsRight'), false); $table->set_header(4, get_lang('MBookingPeriodsRight'), false);
@ -356,7 +355,7 @@ switch ($_GET['action']) {
$interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking')); $interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking'));
$interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageItems')); $interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageResources'));
//$interbreadcrumb[] = array ("url" => "m_item.php", "name" => $tool_name); //$interbreadcrumb[] = array ("url" => "m_item.php", "name" => $tool_name);
Display :: display_header(get_lang('AddNewResource')); Display :: display_header(get_lang('AddNewResource'));
@ -429,9 +428,9 @@ switch ($_GET['action']) {
default : default :
$NoSearchResults = get_lang('NoItems'); $NoSearchResults = get_lang('NoItems');
$interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking')); $interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking'));
//$interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageItems')); //$interbreadcrumb[] = array ("url" => "m_item.php", "name" => get_lang('ManageResources'));
Display :: display_header(get_lang('ManageItems')); Display :: display_header(get_lang('ManageResources'));
api_display_tool_title(get_lang('ResourceList')); api_display_tool_title(get_lang('ResourceList'));
echo $msg; echo $msg;

@ -43,9 +43,10 @@ $tool_name = get_lang('BookingPeriodList');
* @param - int $id The reservation-id * @param - int $id The reservation-id
*/ */
function modify_filter($id) { function modify_filter($id) {
$out = '<a href="m_reservation.php?action=edit&amp;id='.$id.'" title="'.get_lang("EditBookingPeriod").'"><img alt="" src="../img/edit.gif" /></a>'; $out = ' <a href="m_reservation.php?action=accept&amp;rid='.$id.'" alt="'.get_lang('AutoAccept').'"><img title="'.get_lang('AutoAccept').'" alt="'.get_lang('AutoAccept').'" src="../img/students.gif" /></a>';
$out .= ' <a href="m_reservation.php?action=delete&amp;id='.$id.'" title="'.get_lang("DeleteBookingPeriod").'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmDeleteBookingPeriod")))."'".')) return false;"><img alt="" src="../img/delete.gif" /></a>'; $out .= '<a href="m_reservation.php?action=edit&amp;id='.$id.'" alt="'.get_lang('EditBookingPeriod').'"><img title="'.get_lang('EditBookingPeriod').'" alt="'.get_lang('EditBookingPeriod').'" src="../img/edit.gif" /></a>';
$out .= ' <a href="m_reservation.php?action=accept&amp;rid='.$id.'" title="'.get_lang("AutoAccept").'"><img alt="" src="../img/visible.gif" /></a>'; $out .= ' <a href="m_reservation.php?action=delete&amp;id='.$id.'" alt="'.get_lang('DeleteBookingPeriod').'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmDeleteBookingPeriod")))."'".')) return false;"><img title="'.get_lang('DeleteBookingPeriod').'" alt="'.get_lang('DeleteBookingPeriod').'" src="../img/delete.gif" /></a>';
return $out; return $out;
} }
@ -93,12 +94,12 @@ if (isset ($_POST['action'])) {
switch ($_GET['action']) { switch ($_GET['action']) {
case 'overviewsubscriptions' : case 'overviewsubscriptions' :
$interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking')); $interbreadcrumb[] = array ("url" => "mysubscriptions.php", "name" => get_lang('Booking'));
$interbreadcrumb[] = array ("url" => "m_reservation.php", "name" => get_lang('ManageBookingPeriods')); $interbreadcrumb[] = array ("url" => "m_reservation.php", "name" => get_lang('ManageBookingPeriods'));
Display :: display_header(get_lang('OverviewSubscriptions')); Display :: display_header(get_lang('OverviewSubscriptions'));
api_display_tool_title(get_lang('Overview')); api_display_tool_title(get_lang('Overview'));
echo '<div class="actions">'; echo '<div class="actions">';
echo '<form id="cat_form" action="m_reservation.php" method="get">'; echo '<form id="cat_form" action="m_reservation.php" method="get">';
echo '<input type="hidden" name="action" value="overviewsubscriptions"/>'; echo '<input type="hidden" name="action" value="overviewsubscriptions"/>';
@ -119,6 +120,7 @@ switch ($_GET['action']) {
break; break;
case 'accept' : case 'accept' :
$NoSearchResults = get_lang('NoReservation'); $NoSearchResults = get_lang('NoReservation');
if (empty ($_GET['rid'])) { if (empty ($_GET['rid'])) {
$_GET['rid'] = $_POST['rid']; $_GET['rid'] = $_POST['rid'];
} }
@ -141,10 +143,10 @@ switch ($_GET['action']) {
$table->set_header(0, '', false, array ('style' => 'width:10px')); $table->set_header(0, '', false, array ('style' => 'width:10px'));
$table->set_header(1, get_lang('SubscribedPerson'), true); $table->set_header(1, get_lang('SubscribedPerson'), true);
$table->set_header(2, get_lang('Class'), true); $table->set_header(2, get_lang('Class'), true);
$table->set_header(3, get_lang('SubscribedStartDate'), true); $table->set_header(3, get_lang('SubscribedStartDate'), false);
$table->set_header(4, get_lang('SubscribedEndDate'), true); $table->set_header(4, get_lang('SubscribedEndDate'), false);
$table->set_header(5, get_lang('Accept'), true, array ('style' => 'width:30px;')); $table->set_header(5, get_lang('Accept'), false, array ('style' => 'width:30px;'));
$table->set_header(6, get_lang('Delete'), true, array ('style' => 'width:30px;')); $table->set_header(6, get_lang('Delete'), false, array ('style' => 'width:30px;'));
$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers'), 'delete_subscriptions' => get_lang('Delete_subscriptions')), 'accepting'); $table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers'), 'delete_subscriptions' => get_lang('Delete_subscriptions')), 'accepting');
//$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers')), 'accepting'); //$table->set_form_actions(array ('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers')), 'accepting');
$table->display(); $table->display();
@ -292,9 +294,6 @@ switch ($_GET['action']) {
'i' => '00' 'i' => '00'
); );
$defaultvalues['start'] = $date_defaults_start; $defaultvalues['start'] = $date_defaults_start;
$defaultvalues['end'] = $date_defaults_end; $defaultvalues['end'] = $date_defaults_end;
$defaultvalues['subscribe_from'] = $date_defaults_start_sub; $defaultvalues['subscribe_from'] = $date_defaults_start_sub;
@ -311,8 +310,7 @@ switch ($_GET['action']) {
$form->setDefaults($defaultvalues); $form->setDefaults($defaultvalues);
$form->Display(); $form->Display();
} } else {
else {
if ($_GET['cat_id'] != 0) if ($_GET['cat_id'] != 0)
Display :: display_normal_message(get_lang('NoItems'),false); Display :: display_normal_message(get_lang('NoItems'),false);
} }

@ -75,7 +75,7 @@ elseif((empty($_SESSION['swidth']))) {
else else
$gogogo=true; $gogogo=true;
echo '<div style="float: left;"><form id="cat_form" action="reservation.php" method="get"><input type="hidden" name="cat" value="'.$_GET['cat'].'" /><div style="float: left;">'.get_lang('ResourceType').': <select name="cat" onchange="this.form.submit();"><option value="0">'.get_lang('NONE').'</option>'; echo '<div style="float: left;"><form id="cat_form" action="reservation.php" method="get"><input type="hidden" name="cat" value="'.$_GET['cat'].'" /><div style="float: left;">'.get_lang('ResourceType').': <select name="cat" onchange="this.form.submit();"><option value="0">'.get_lang('Select').'</option>';
$cats = Rsys :: get_category_with_items(); $cats = Rsys :: get_category_with_items();
if(count($cats)>0){ if(count($cats)>0){
@ -89,7 +89,7 @@ if ($gogogo&&!empty($_GET['cat'])) {
$itemlist = Rsys :: get_cat_items($_GET['cat']); $itemlist = Rsys :: get_cat_items($_GET['cat']);
echo '<div style="float: left;">'; echo '<div style="float: left;">';
if (count($itemlist) != 0) { if (count($itemlist) != 0) {
echo '<form id="item_form" action="reservation.php?cat='.$_GET['cat'].'&amp;item=" method="get">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" name="cat" value="'.$_GET['cat'].'" />'.get_lang('Resource').': <select name="item" onchange="this.form.submit();"><option value="0">'.get_lang('NONE').'</option>'; echo '<form id="item_form" action="reservation.php?cat='.$_GET['cat'].'&amp;item=" method="get">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" name="cat" value="'.$_GET['cat'].'" />'.get_lang('Resource').': <select name="item" onchange="this.form.submit();"><option value="0">'.get_lang('Select').'</option>';
foreach ($itemlist as $id => $item) foreach ($itemlist as $id => $item)
echo '<option value="'.$id.'"'. ($id == $_GET['item'] ? ' selected="selected"' : '').'>'.$item.'</option>'; echo '<option value="'.$id.'"'. ($id == $_GET['item'] ? ' selected="selected"' : '').'>'.$item.'</option>';
echo '</select></form>'; echo '</select></form>';

@ -583,33 +583,33 @@ class Rsys {
if ($lijn2[1] == $lijn[0]) { if ($lijn2[1] == $lijn[0]) {
if ($lijn2[2] == 0) { if ($lijn2[2] == 0) {
$tabel[$count][2] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=1\'" />'; $tabel[$count][2] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=1\'" />';
} else { } else {
$tabel[$count][2] = '<img src="../img/setting_true.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=0\'" />'; $tabel[$count][2] = '<img src="../img/right.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=0\'" />';
} }
if ($lijn2[3] == 0) { if ($lijn2[3] == 0) {
$tabel[$count][3] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=1\'" />'; $tabel[$count][3] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=1\'" />';
} else { } else {
$tabel[$count][3] = '<img src="../img/setting_true.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=0\'" />'; $tabel[$count][3] = '<img src="../img/right.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=0\'" />';
} }
if ($lijn2[4] == 0) { if ($lijn2[4] == 0) {
$tabel[$count][4] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=1\'" />'; $tabel[$count][4] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=1\'" />';
} else { } else {
$tabel[$count][4] = '<img src="../img/setting_true.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=0\'" />'; $tabel[$count][4] = '<img src="../img/right.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=0\'" />';
} }
if ($lijn2[5] == 0) { if ($lijn2[5] == 0) {
$tabel[$count][5] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=1\'" />'; $tabel[$count][5] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=1\'" />';
} else { } else {
$tabel[$count][5] = '<img src="../img/setting_true.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=0\'" />'; $tabel[$count][5] = '<img src="../img/right.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=0\'" />';
} }
$controle = true; $controle = true;
} }
} }
if (!$controle) { if (!$controle) {
$tabel[$count][2] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=1\'" />'; $tabel[$count][2] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=edit&set=1\'" />';
$tabel[$count][3] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=1\'" />'; $tabel[$count][3] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=delete&set=1\'" />';
$tabel[$count][4] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=1\'" />'; $tabel[$count][4] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=manage&set=1\'" />';
$tabel[$count][5] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=1\'" />'; $tabel[$count][5] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_item.php?action=m_rights&subaction=switch&class_id='.$lijn[0].'&item_id='.$itemid.'&switch=view&set=1\'" />';
} }
$tabel[$count][6] = $itemid."-".$lijn[0]; $tabel[$count][6] = $itemid."-".$lijn[0];
} }
@ -762,11 +762,18 @@ class Rsys {
$begindatum = $item['start_at']; $begindatum = $item['start_at'];
$einddatum = $item['end_at']; $einddatum = $item['end_at'];
$inhoud = str_replace('#NAME#', $item_name, get_lang("BlackoutMessage".$value)); if ($value==1) {
$inhoud = str_replace('#BEGINDATUM#', $begindatum, $inhoud); $inhoud = str_replace('#NAME#', $item_name, get_lang('ReservationActive'));
$inhoud = str_replace('#EINDDATUM#', $einddatum, $inhoud); $inhoud = str_replace('#BEGIN#', $begindatum, $inhoud);
$inhoud = str_replace('#BEGIN#', $einddatum, $inhoud);
$titel = str_replace('#NAME#', $item_name, get_lang('ReservationAvailable'));
} else {
$inhoud = str_replace('#NAME#', $item_name, get_lang('ReservationCancelled'));
$inhoud = str_replace('#BEGIN#', $begindatum, $inhoud);
$inhoud = str_replace('#BEGIN#', $einddatum, $inhoud);
$titel = str_replace('#NAME#', $item_name, get_lang('ReservationUnavailable'));
}
$titel = str_replace('#NAME#', $item_name, get_lang("BlackoutTitle".$value));
api_send_mail($user_info['mail'], $titel, $inhoud); api_send_mail($user_info['mail'], $titel, $inhoud);
} }
@ -1243,7 +1250,7 @@ class Rsys {
} }
$sql .= " ORDER BY col".$column." ".$direction." LIMIT ".$from.",".$per_page;*/ $sql .= " ORDER BY col".$column." ".$direction." LIMIT ".$from.",".$per_page;*/
$sql = "SELECT dummy AS col0, CONCAT(u.lastname,' ',u.firstname) AS col1, s.user_id AS col2, accepted AS col3, r.start_at, r.end_at, s.start_at, s.end_at $sql = "SELECT dummy AS col0, CONCAT(u.lastname,' ',u.firstname) AS col1, s.user_id AS col2, accepted AS col3, r.start_at, r.end_at, s.start_at, s.end_at
FROM ".Rsys :: getTable('subscription')." s,".Database :: get_main_table(TABLE_MAIN_USER)." u,".Rsys :: getTable('reservation')." r FROM ".Rsys :: getTable('subscription')." s,".Database :: get_main_table(TABLE_MAIN_USER)." u,".Database :: get_main_table(TABLE_MAIN_RESERVATION_RESERVATION)." r
where u.user_id = s.user_id where u.user_id = s.user_id
and s.reservation_id = r.id"; and s.reservation_id = r.id";
@ -1258,10 +1265,10 @@ class Rsys {
$count = 0; $count = 0;
$x = count($arr); $x = count($arr);
while ($count < $x) { while ($count < $x) {
$sql = "SELECT `name` $sql = "SELECT name
FROM ".Database :: get_main_table(TABLE_MAIN_CLASS)." cl FROM ".Database :: get_main_table(TABLE_MAIN_CLASS)." cl
INNER JOIN ".Database :: get_main_table(TABLE_MAIN_CLASS_USER)." cu ON cu.class_id = cl.id INNER JOIN ".Database :: get_main_table(TABLE_MAIN_CLASS_USER)." cu ON cu.class_id = cl.id
WHERE cu.user_id='".$arr[$count][2]."' LIMIT 1"; WHERE cu.user_id=".$arr[$count][2]." LIMIT 1";
$result = api_sql_query($sql, __FILE__, __LINE__); $result = api_sql_query($sql, __FILE__, __LINE__);
while ($array = Database::fetch_array($result, 'NUM')) { while ($array = Database::fetch_array($result, 'NUM')) {
$arr2[] = $array; $arr2[] = $array;
@ -1270,28 +1277,30 @@ class Rsys {
$count ++; $count ++;
} }
$count = -1; $count = -1;
foreach ($arr as $lijn) { if (is_array($arr)) {
$count ++; foreach ($arr as $lijn) {
$controle = false; $count ++;
$tabel[$count][0] = $lijn[0]; $controle = false;
$tabel[$count][1] = $lijn[1]; $tabel[$count][0] = $lijn[0];
if ($lijn[3] == 0) { $tabel[$count][1] = $lijn[1];
$tabel[$count][5] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=edit&set=1\'" />'; if ($lijn[3] == 0) {
} else { $tabel[$count][5] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=edit&set=1\'" />';
$tabel[$count][5] = '<img src="../img/setting_true.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=edit&set=0\'" />'; } else {
} $tabel[$count][5] = '<img src="../img/right.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=edit&set=0\'" />';
$tabel[$count][2] = $lijn[2]; }
if ($lijn[6] == '0000-00-00 00:00:00' && $lijn[7] == '0000-00-00 00:00:00') $tabel[$count][2] = $lijn[2];
{ if ($lijn[6] == '0000-00-00 00:00:00' && $lijn[7] == '0000-00-00 00:00:00')
$tabel[$count][3] = $lijn[4]; {
$tabel[$count][4] = $lijn[5]; $tabel[$count][3] = $lijn[4];
} $tabel[$count][4] = $lijn[5];
else }
{ else
$tabel[$count][3] = $lijn[6]; {
$tabel[$count][4] = $lijn[7]; $tabel[$count][3] = $lijn[6];
$tabel[$count][4] = $lijn[7];
}
$tabel[$count][6] = '<img src="../img/wrong.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=delete\'" />';
} }
$tabel[$count][6] = '<img src="../img/setting_false.gif" onclick="document.location.href=\'m_reservation.php?action=accept&rid='.$_GET['rid'].'&amp;dummy='.$lijn[0].'&switch=delete\'" />';
} }
return $tabel; return $tabel;
} }
@ -1327,10 +1336,16 @@ class Rsys {
$begin_datum = $item['start_at']; $begin_datum = $item['start_at'];
$eind_datum = $item['end_at']; $eind_datum = $item['end_at'];
$titel = str_replace('#ITEM#', $item_name, get_lang("AcceptedUserTitle".$value)); if ($value==1) {
$inhoud = str_replace('#ITEM#', $item_name, get_lang("AcceptedUserMessage".$value)); $titel = str_replace('#ITEM#', $item_name, get_lang('ReservationAccepted'));
$inhoud = str_replace('#BEGINDATUM', $begin_datum, $inhoud); $inhoud = str_replace('#ITEM#', $item_name, get_lang('ReservationForItemAccepted'));
$inhoud = str_replace('#EINDDATUM', $eind_datum, $inhoud); } else {
$titel = str_replace('#ITEM#', $item_name, get_lang('ReservationDenied'));
$inhoud = str_replace('#ITEM#', $item_name, get_lang('ReservationForDenied'));
}
$inhoud = str_replace('#BEGIN', $begin_datum, $inhoud);
$inhoud = str_replace('#END', $eind_datum, $inhoud);
api_send_mail($user_info['mail'], $titel, $inhoud); api_send_mail($user_info['mail'], $titel, $inhoud);
} }

@ -119,18 +119,12 @@ if ($reservation[0][9] < $reservation[0][4]) {
$start_end .= "<li>".$end_time_last_block." en ".$res_end_at."</li>"; $start_end .= "<li>".$end_time_last_block." en ".$res_end_at."</li>";
} }
$start_end .= "</ul>"; $start_end .= "</ul>";
} } else {
else
{
$start_end = " ".Rsys :: timestamp_to_datetime($time_start)." en ".$res_end_at; $start_end = " ".Rsys :: timestamp_to_datetime($time_start)." en ".$res_end_at;
} }
//$form->addElement('html', "timestart:".$time_start."-".Rsys :: mysql_datetime_to_timestamp($res_start_at)); //$form->addElement('html', "timestart:".$time_start."-".Rsys :: mysql_datetime_to_timestamp($res_start_at));
$form->addElement('html', "<p>".str_replace('#start_end',$start_end,str_replace('#from_till', $from_till,str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang("SubscribeTimePickerInformation"))))))." </p>");
$form->addElement('html', "<p> **** ".str_replace('#start_end',$start_end,str_replace('#from_till', $from_till,str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang("SubscribeTimePickerInformation"))))))." ****</p>");
$form->add_timewindow('startpicker', 'endpicker', get_lang('StartDate'), get_lang('EndDate')); $form->add_timewindow('startpicker', 'endpicker', get_lang('StartDate'), get_lang('EndDate'));
$form->addElement('hidden', 'min', $reservation[0][12]); $form->addElement('hidden', 'min', $reservation[0][12]);
$form->addElement('hidden', 'max', $reservation[0][13]); $form->addElement('hidden', 'max', $reservation[0][13]);
@ -139,8 +133,7 @@ if ($reservation[0][9] < $reservation[0][4]) {
//$defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +900); //$defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +900);
$defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +($min_timepicker*60)); $defaultvalues['endpicker'] = Rsys :: timestamp_to_datetime($datum +($min_timepicker*60));
$form->setDefaults($defaultvalues); $form->setDefaults($defaultvalues);
} } else {
else {
$form->addElement('html', "<p> * ".str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang('SubscribeInformation'))))." *</p>"); $form->addElement('html', "<p> * ".str_replace('#name#', "<b>".$item[3]."</b>",str_replace('#start#', "<b>".$reservation[0][5]."</b>", str_replace('#end#', "<b>".$reservation[0][6]."</b>", get_lang('SubscribeInformation'))))." *</p>");
} }
$buttons[] = $form->createElement('submit', 'submit', get_lang('Ok')); $buttons[] = $form->createElement('submit', 'submit', get_lang('Ok'));
@ -186,14 +179,12 @@ if ($reservation[0][9] < $reservation[0][4]) {
break; break;
} }
} }
} } else
else
$form->display(); $form->display();
}else { } else {
Display :: display_normal_message(Rsys :: get_return_msg2(get_lang('ReservationTresspassing'), "javascript:history.go(-2)", get_lang('BookingView')),false); Display :: display_normal_message(Rsys :: get_return_msg2(get_lang('ReservationTresspassing'), "javascript:history.go(-2)", get_lang('BookingView')),false);
} }
Display :: display_footer(); Display :: display_footer();
?> ?>

Loading…
Cancel
Save