Ejemplo n.º 1
0
        $page_error_message = "You could not be logged in. Please try again.";
    }
} elseif (wrap_session_is_registered("valid_user")) {
    // logged in
    $display_login_form = false;
} else {
    // they are not logged in, show login page output
    $display_login_form = true;
    if ($_REQUEST['orgin'] != FILENAME_LOGOUT && $_REQUEST['orgin'] != FILENAME_LOGIN && $_REQUEST['orgin'] != "") {
        $page_error_message = "You are not logged in. You must login to use this page.";
    }
}
// redirect back to "origin" page
if (!$display_login_form && $_REQUEST['origin'] != '' && $_SESSION['valid_user'] != '') {
    if (@wrap_session_is_registered('valid_user')) {
        header('Location: ' . href_link($_REQUEST['origin'], make_hidden_fields_workstring(), 'NONSSL'));
        wrap_exit();
    }
}
$page_title = "Booking Calendar - User Login";
$page_title_bar = "User Login:"******"header.php";
if ($display_login_form) {
    ?>
<p align="center">
<form method="post" action="<?php 
    echo FILENAME_LOGIN;
    ?>
">
<table border="0" align="center" cellpadding="2" cellspacing="0">
<tr><td align="right">Username: </td><td><input type="text" name="username" value="<?php 
Ejemplo n.º 2
0
                    if (DEFINE_AM_PM) {
                        $start_time = format_time_to_ampm($start_time);
                        $end_time = format_time_to_ampm($end_time);
                    }
                    // Use the $db_row_id to data seek to the data for this event.
                    $rv = wrap_db_data_seek($event_data, $db_row_id);
                    $this_event = wrap_db_fetch_array($event_data);
                    //is this user allowed to see the booking details?
                    if (!$_SESSION['SHOW_USER_DETAILS'] && $this_event['user_id'] != $currentUsersID) {
                        //user not allowed to see these details, overwrite the subject string
                        $this_event['subject'] = 'Booking Confirmed';
                    } else {
                        //add the booking option data into the event array
                        $this_event['booking_options'] = get_booking_options($this_event['event_id']);
                    }
                    $event_url = href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $this_event['event_id'] . '&' . make_hidden_fields_workstring(array('date', 'view', 'loc')), 'NONSSL');
                    $over_text = 'Event ID#: ' . $this_event['event_id'] . '<br />Subject: ' . $this_event['subject'];
                    $numBookingOptions = count($this_event['booking_options']);
                    if ($numBookingOptions > 0) {
                        $over_text .= '<br />Options: ';
                        for ($o = 0; $o < $numBookingOptions; $o++) {
                            //handle commas to separate the list
                            if ($o != 0) {
                                $over_text .= ', ';
                            }
                            $over_text .= htmlspecialchars(stripslashes($this_event['booking_options'][$o]['desc']));
                        }
                    }
                    ?>
					<span class="FontSoftSmall">&nbsp;<a href="<?php 
                    echo $event_url;
Ejemplo n.º 3
0
		<tr>
<?php 
    }
    if (SELECTED_DATE_MONTH == $i) {
        ?>
		<td align="center" valign="middle" class="BgcolorDull"><span class="FontSoftSmall"><b><?php 
        echo $mon_str;
        ?>
</b></span></td>
<?php 
    } else {
        $date = SELECTED_DATE_YEAR . '-' . sprintf("%02d", $i) . '-' . SELECTED_DATE_DAY;
        ?>
		<td align="center" valign="middle" class="BgcolorNormal"><span class="FontSoftSmall"><a 
			href="<?php 
        echo href_link(NAV_SCRIPT_NAME, 'date=' . $date . '&' . make_hidden_fields_workstring(array('view', 'loc')), 'NONSSL');
        ?>
"><?php 
        echo $mon_str;
        ?>
</a></span></td>
<?php 
    }
    if ($i % $cols == 0) {
        ?>
		</tr>
<?php 
    }
}
// end of for loop
if (12 % $cols != 0) {
Ejemplo n.º 4
0
<?php

// set a variable that will be picked up by the user widget to say that it is the buy credits page, therefore
// the number of credits bought by the user may have changed
$buyCreditsPage = true;
include_once "./includes/application_top.php";
if (REQUIRE_AUTH_FOR_ADDING_FLAG) {
    if (!@wrap_session_is_registered('valid_user')) {
        header('Location: ' . href_link(FILENAME_LOGIN, 'origin=' . FILENAME_BUY_CREDITS . '&' . make_hidden_fields_workstring(), 'NONSSL'));
        wrap_exit();
    }
}
$page_title = 'Buy Credits';
$page_title_bar = "Buy Credits";
include_once "header.php";
// Show the number of credits the user has
echo "<p><strong>Booking credits remaining:</strong>&nbsp;" . $user_info['booking_credits'] . "&nbsp;credit";
if ($user_info['booking_credits'] != 1) {
    echo "s";
}
echo "</p>";
?>
<table width="550" border="0" cellpadding="2" cellspacing="4">
    <tr>
      <td width="530">NOTE: Once payment has been made via Paypal, your account will be updated automatically with the additional credits once you have received a confirmation email. <font color="red">Please note this can take up to 20 minutes.</font></td>
    </tr>
  </table>
<?php 
//Load the user info
$user_info = get_user(get_user_id($_SESSION['valid_user']));
// Check we have permissions to buy credits
Ejemplo n.º 5
0
                if (strlen($mailVars['options']) < 1) {
                    $mailVars['options'] = 'none';
                }
                //send buddy email
                $mailSubject = str_replace($mailTags, $mailVars, $_SESSION['BUDDY_LIST_EMAILS_SUBJECT']);
                $mailBody = str_replace($mailTags, $mailVars, $_SESSION['BUDDY_LIST_EMAILS_BODY']);
                // Added by BenH 03/12/06 - we only want to send if we have users
                if ($my_users) {
                    foreach ($my_users as $d => $buddy_details) {
                        send_mail($_SESSION['BUDDY_LIST_EMAILS_FROM_NAME'], $_SESSION['BUDDY_LIST_EMAILS_FROM'], $buddy_details['firstname'] . ' ' . $buddy_details['lastname'], $buddy_details['email'], $mailSubject, $mailBody);
                    }
                }
            }
            // end if user has no buddies
            // Redirect to display page for user options (edit/delete).
            header('Location: ' . href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $add_event_id . '&origin=' . FILENAME_ADD_EVENT . '&' . 'date=' . $starting_date . '&' . make_hidden_fields_workstring() . '&page_info_message=' . urlencode($page_info_message), 'NONSSL'));
            wrap_exit();
        } else {
            $page_error_message = "We could not add your event. Please check your information and try again.";
        }
    }
    // end of if ($page_error_message == '')
    //add a BACK link for non admin users if there has been any kind of error.
    if ($page_error_message != '' && !$is_admin) {
        $page_error_message .= '<br><br><a href="javascript:history.go(-2);">Go back</a>';
    }
}
// end of if ($_POST['add_want'] != "" || $_POST['check_event'] != "")
$page_title = "Booking Calendar - Add Booking Event";
$page_title_bar = "Add Booking Event:";
include_once "header.php";
Ejemplo n.º 6
0
        ?>
-<?php 
        echo $end_time;
        ?>
</a>&nbsp; - 
		Subject: <?php 
        echo $this_event['subject'];
        ?>
</span></td>
<?php 
    } elseif ($event_row_data[$display_time] == '0') {
        // This is where the cell is already taken from the prev row.
    } else {
        ?>
		<td align="right" rowspan="1" class="BgcolorNormal"><span 
		class="FontSoftSmall"><a href="<?php 
        echo href_link(FILENAME_ADD_EVENT, 'start_time=' . $std_time_str . '&' . make_hidden_fields_workstring(array('date', 'view', 'loc')), 'NONSSL');
        ?>
">(+)</a></span></td>
<?php 
    }
    // end of if/elseif/else
    ?>
  </tr>
<?php 
}
// end of foreach
?>
</table>

Ejemplo n.º 7
0
		class="BgcolorDull2" nowrap="nowrap"><b>Time Slot</b></td>
	<td class="BgcolorBright" align="center" valign="middle">
		<a href="<?php 
echo href_link(FILENAME_DAY_VIEW, 'date=' . PREVIOUS_DAY_DATE . '&print_view=1&' . make_hidden_fields_workstring(array('view', 'loc')), 'NONSSL');
?>
"><img
		src="<?php 
echo DIR_WS_IMAGES;
?>
/prev.gif"
		alt="Previous Day" /></a><b><?php 
echo SELECTED_DATE_LONGSTR;
?>
</b><a
		href="<?php 
echo href_link(FILENAME_DAY_VIEW, 'date=' . NEXT_DAY_DATE . '&print_view=1&' . make_hidden_fields_workstring(array('view', 'loc')), 'NONSSL');
?>
"><img
		src="<?php 
echo DIR_WS_IMAGES;
?>
/next.gif" alt="Next Day" /></a></td>
  </tr>


<?php 
$count = 0;
$width_length = 5;
$data_display_times = array();
$data_display_times = get_times_in_range(MIN_BOOKING_HOUR, MAX_BOOKING_HOUR, BOOKING_TIME_INTERVAL);
array_pop($data_display_times);
Ejemplo n.º 8
0
		<tr>
<?php 
    }
    if (SELECTED_DATE_MONTH == $i) {
        ?>
		<td align="center" valign="middle" class="BgcolorDull"><span class="FontSoftSmall"><b><?php 
        echo $mon_str;
        ?>
</b></span></td>
<?php 
    } else {
        $date = SELECTED_DATE_YEAR . '-' . sprintf("%02d", $i) . '-' . SELECTED_DATE_DAY;
        ?>
		<td align="center" valign="middle" class="BgcolorNormal"><span class="FontSoftSmall"><a 
			href="<?php 
        echo href_link(FILENAME_MONTH_VIEW, 'date=' . $date . '&' . make_hidden_fields_workstring(array('view', 'loc')), 'NONSSL');
        ?>
"><?php 
        echo $mon_str;
        ?>
</a></span></td>
<?php 
    }
    if ($i % $cols == 0) {
        ?>
		</tr>
<?php 
    }
}
// end of for loop
if (12 % $cols != 0) {
Ejemplo n.º 9
0
        }
        if ($display_delete_trigger) {
            ?>
| <a href="<?php 
            echo href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $event['event_id'] . '&action=delete_event&' . make_hidden_fields_workstring(), 'NONSSL');
            ?>
" onClick="return confirm('Are you sure you want to delete this entire event?');"><strong>Delete Event</strong></a>
<?php 
            if (wrap_session_is_registered("admin_user")) {
                ?>
| <a href="<?php 
                echo href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $event['event_id'] . '&action=delete&' . make_hidden_fields_workstring(), 'NONSSL');
                ?>
"><strong>Delete Time Slots</strong></a>
| <a href="<?php 
                echo href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $event['event_id'] . '&print_view=1&action=view&' . make_hidden_fields_workstring(), 'NONSSL');
                ?>
" target="_blank"><strong>Print Ticket</strong></a>

<?php 
            }
        }
        ?>
</span></td></tr>
<?php 
    }
    ?>
</table>

<?php 
    if ($_REQUEST['action'] == 'modify') {
Ejemplo n.º 10
0
<?php 
} else {
    ?>
<table cellspacing="1" cellpadding="1" width="100%" border="0">
  <tr>
	<td nowrap="nowrap" align="center" valign="middle" class="BgcolorDull2">
	<img src="<?php 
    echo DIR_WS_IMAGES;
    ?>
/spacer.gif" width="15" height="15" />
	Add New Event: 
	<img src="<?php 
    echo DIR_WS_IMAGES;
    ?>
/spacer.gif" width="15" height="15" />
	</td>
  </tr>
</table>

<table cellspacing="1" cellpadding="1" width="100%" border="0">
  <tr>
	<td nowrap="nowrap" align="center" valign="middle" class="BgcolorNormal"><a href="<?php 
    echo href_link(FILENAME_WEEK_VIEW, 'view=week&' . make_hidden_fields_workstring(array('date', 'loc')), 'NONSSL');
    ?>
">Select date from calendar</a></td>
  </tr>
</table>
</form>
<?php 
}
Ejemplo n.º 11
0
			onmouseout="nd();"><?php 
            echo $start_time;
            ?>
-<?php 
            echo $end_time;
            ?>
</a>&nbsp;</span></td>
<?php 
        } elseif ($event_row_data[$display_time][$week_date] == '0') {
            // This is where the cell is already taken from the prev row.
        } else {
            //generate the link to be used for making/preventing bookings. Store for possible re-use later in this table row:
            $make_booking_link = '';
            list($year, $month, $day) = explode("-", $week_date);
            if (wrap_session_is_registered("admin_user") || mktime($hour, $min, $sec, $month, $day, $year) < $booking_limited_time) {
                $make_booking_link = href_link(FILENAME_ADD_EVENT, 'date=' . $week_date . '&start_time=' . $std_time_str . '&' . make_hidden_fields_workstring(array('view', 'loc')), 'NONSSL');
            } else {
                $make_booking_link = '#" onclick="return outsideBookingLimit();"';
            }
            ?>
			<td align="right" rowspan="1" class="BgcolorNormal" width="14%"><span
			class="FontSoftSmall"><a href="<?php 
            echo $make_booking_link;
            ?>
">(+)</a></span></td>
<?php 
        }
        // end of if/elseif/else
    }
    // end of foreach $week_date
    ?>
Ejemplo n.º 12
0
echo DIR_WS_IMAGES;
?>
/spacer.gif" width="15" height="15" />
      </td>
  </tr>
</table>

<table cellspacing="1" cellpadding="1" width="100%" border="0">
  <tr>
	<td nowrap="nowrap" align="center" valign="middle" class="BgcolorNormal"><span class="FontSoftSmall">
<?php 
reset($location_display);
while (list($location_id, $location_display_name) = each($location_display)) {
    ?>
		<a href="<?php 
    echo href_link(NAV_SCRIPT_NAME, 'loc=' . $location_id . '&' . make_hidden_fields_workstring(array('date', 'view')), 'NONSSL');
    ?>
" 
		<?php 
    echo $_REQUEST['loc'] == $location_id ? $highlight_style : '';
    ?>
><b><?php 
    echo $location_display[$location_id];
    ?>
</b></a><br />
<?php 
}
?>
	</span></td>
  </tr>
</table>
Ejemplo n.º 13
0
		<a href="<?php 
echo href_link(FILENAME_DAY_VIEW, 'view=day&' . make_hidden_fields_workstring(array('date', 'loc')), 'NONSSL');
?>
" 
		<?php 
echo NAV_SCRIPT_NAME == FILENAME_DAY_VIEW ? $highlight_style : '';
?>
><b>Day</b></a>
&nbsp;
		<a href="<?php 
echo href_link(FILENAME_WEEK_VIEW, 'view=week&' . make_hidden_fields_workstring(array('date', 'loc')), 'NONSSL');
?>
" 
		<?php 
echo NAV_SCRIPT_NAME == FILENAME_WEEK_VIEW ? $highlight_style : '';
?>
><b>Week</b></a>
&nbsp;
		<a href="<?php 
echo href_link(FILENAME_MONTH_VIEW, 'view=month&' . make_hidden_fields_workstring(array('date', 'loc')), 'NONSSL');
?>
" 
		<?php 
echo NAV_SCRIPT_NAME == FILENAME_MONTH_VIEW ? $highlight_style : '';
?>
><b>Month</b></a>
	</span></td>
  </tr>
</table>

Ejemplo n.º 14
0
            }
        } else {
            $available_date_time_data = $scheduled_date_time_data;
        }
    }
    // IF ALL IS WELL WITH THE SCHEDULE DATA AVAILABILITY - ADD EVENT DATA
    echo "valid user: "******"<br />user_id: " . get_user_id($_SESSION['valid_user']) . "<br />";
    if ($page_error_message == '' && !empty($_POST['add_event'])) {
        // Attempt to Add the Event to the Database
        $add_event_id = add_event($_SESSION['valid_user'], $scheduled_date_time_data, $_REQUEST['subject'], $_REQUEST['location'], $starting_date . ' ' . $_REQUEST['start_time'], $ending_date . ' ' . $_REQUEST['end_time'], $_REQUEST['recur_interval'], $_REQUEST['recur_freq'], $recur_date, $_REQUEST['desc']);
        echo "<pre>";
        var_dump($_SESSION['valid_user'], $scheduled_date_time_data, $_REQUEST['subject'], $_REQUEST['location'], $starting_date . ' ' . $_REQUEST['start_time'], $ending_date . ' ' . $_REQUEST['end_time'], $_REQUEST['recur_interval'], $_REQUEST['recur_freq'], $recur_date, $_REQUEST['desc']);
        echo "</pre>";
        if (!empty($add_event_id)) {
            // Redirect to display page for user options (edit/delete).
            header('Location: ' . href_link(FILENAME_DETAILS_VIEW, 'event_id=' . $add_event_id . '&origin=' . FILENAME_ADD_EVENT . '&' . make_hidden_fields_workstring() . '&page_info_message=' . urlencode("Event added successfully!"), 'NONSSL'));
            wrap_exit();
        } else {
            $page_error_message = "We could not add your event. Please check your information and try again.";
        }
    }
    // end of if ($page_error_message == '')
}
// end of if ($_POST['add_want'] != "" || $_POST['check_event'] != "")
$page_title = "Booking Calendar - Add Booking Event";
$page_title_bar = "Add Booking Event:";
include_once "header.php";
// Define some arrays for the Input Form below.
// Valid booking times in 24 hour format; includes max and min hours.
$valid_booking_times = get_times_in_range(MIN_BOOKING_HOUR, MAX_BOOKING_HOUR, BOOKING_TIME_INTERVAL, true);
// display the form, new want or problem