Пример #1
0
                echo "</tr>";
            }
            ?>
			</table>
			<?php 
        } else {
            echo "(none found)";
        }
        break;
        //display expression type list for admin screen - needs its own display because of note type
    //display expression type list for admin screen - needs its own display because of note type
    case 'getCalendarSettingsList':
        $instanceArray = array();
        $calendarSettings = new CalendarSettings();
        $tempArray = array();
        foreach ($calendarSettings->allAsArray() as $tempArray) {
            array_push($instanceArray, $tempArray);
        }
        if (count($instanceArray) > 0) {
            ?>
			<table class='dataTable' style='width:400px'>
				<tr>
				<th>Setting</th>
				<th>Value</th>
				<th>&nbsp;</th>

				<?php 
            foreach ($instanceArray as $instance) {
                echo "<tr>";
                echo "<td>" . $instance['shortName'] . "</td>";
                echo "<td>";
Пример #2
0
//below includes search options in left pane only - the results are refreshed through ajax and placed in div searchResults
//print header
$pageTitle = _('Calendar');
$config = new Configuration();
$host = $config->database->host;
$username = $config->database->username;
$password = $config->database->password;
$license_databaseName = $config->database->name;
$resource_databaseName = $config->settings->resourcesDatabaseName;
$link = mysqli_connect($host, $username, $password) or die(_("Could not connect to host."));
mysqli_select_db($link, $license_databaseName) or die(_("Could not find License database."));
mysqli_select_db($link, $resource_databaseName) or die(_("Could not find Resource database."));
$display = array();
$calendarSettings = new CalendarSettings();
try {
    $calendarSettingsArray = $calendarSettings->allAsArray();
} catch (Exception $e) {
    echo "<span style='color:red'>" . _("There was an error with the CalendarSettings Table please verify the table has been created.") . "</span>";
    exit;
}
// Check for earlier version of Resource Module.  With update of 1.3 the table definition changed.
$query = "Select subscriptionStartDate from `{$resource_databaseName}`.`Resource`";
$result = mysqli_query($link, $query);
if ($result) {
    // Previous tabel definition before Resources version 1.3
    $startDateName = "subscriptionStartDate";
    $endDateName = "subscriptionEndDate";
} else {
    $startDateName = "currentStartDate";
    $endDateName = "currentEndDate";
}