Exemplo n.º 1
0
		</script>

<?php 
} elseif (is_array($user)) {
    ?>
	<table class="tablesorter" style="float:left; margin-right:1em;">
		<thead>
			<tr>
				<th> Flight </th>
				<th> Rank </th>
				<th> Name </th>
				<th> Contact N&ordm; </th>
				<th> Access rights </th>
				<th> Selected </th>
				<td> <?php 
    echo $ATC->user_has_permission(ATC_PERMISSION_PERSONNEL_EDIT) ? '<a href="?id=0" class="button new"> New </a>' : '';
    ?>
 </td>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<th colspan="5"> <form><label for="showall">Show all personnel?</label><input type="checkbox" name="showall" id="showall" value="1" <?php 
    echo $_GET['showall'] ? ' checked="checked"' : '';
    ?>
 onchange="$(this).parent().submit();" /></form></th>
				
			</tr>
		</tfoot>
		<tbody>
			<form id="personnellist">
Exemplo n.º 2
0
            exit;
        } catch (ATCExceptionDBConn $e) {
            header("HTTP/1.0 500 Internal Server Error");
            echo 'Caught exception: ', $e->getMessage(), "\n";
            exit;
        } catch (ATCException $e) {
            header("HTTP/1.0 400 Bad Request");
            echo 'Caught exception: ', $e->getMessage(), "\n";
            exit;
        } catch (Exception $e) {
            header("HTTP/1.0 500 Internal Server Error");
            echo 'Caught exception: ', $e->getMessage(), "\n";
            exit;
        }
    }
    if (is_object($user) && $ATC->user_has_permission(ATC_PERMISSION_PERSONNEL_VIEW, $id)) {
        ?>

		<form id="personalform" method="post" action="personal.php?id=<?php 
        echo $user->personnel_id;
        ?>
#personalform">
			<input type="hidden" name="personnel_id" id="personnel_id" value="" />
			<div style="float:right">
				<label for="created">Date created</label>
				<input type="datetime-local" name="created" id="created" value="" maxlength="50" readonly="readonly" disabled="disabled" style="width:16em;" />
			</div>
			<fieldset style="clear:right;">
				<legend> Personal details </legend>
			
				<label for="firstname">First name</label>
Exemplo n.º 3
0
    } catch (ATCExceptionDBConn $e) {
        header("HTTP/1.0 500 Internal Server Error");
        echo 'Caught exception: ', $e->getMessage(), "\n";
        exit;
    } catch (ATCException $e) {
        header("HTTP/1.0 400 Bad Request");
        echo 'Caught exception: ', $e->getMessage(), "\n";
        exit;
    } catch (Exception $e) {
        header("HTTP/1.0 500 Internal Server Error");
        echo 'Caught exception: ', $e->getMessage(), "\n";
        exit;
    }
}
$nok = $ATC->get_nok($id);
if (is_array($nok) && $ATC->user_has_permission(ATC_PERMISSION_PERSONNEL_VIEW, $id)) {
    echo '<form id="nokform" method="post" action="nok.php?id=' . (int) $_GET['id'] . '#nokform">';
    foreach ($nok as $user) {
        ?>
		<fieldset>
			<legend><?php 
        echo $user->firstname;
        ?>
 <?php 
        echo $user->lastname;
        ?>
 </legend>
			<input type="hidden" name="nok_id[]" value="<?php 
        echo $user->kin_id;
        ?>
" />
<?php

require_once "atc.class.php";
$ATC = new ATC();
$id = isset($_GET['id']) ? $_GET['id'] : null;
$what = isset($_GET['what']) && trim(strtolower($_GET['what'])) == 'personal' ? 'personal' : 'nok';
$how = isset($_GET['how']) && trim(strtolower($_GET['how'])) == 'email' ? 'email' : 'sms';
$returnvalue = array();
if (is_array($id)) {
    foreach ($id as $personnel) {
        if ($ATC->user_has_permission(ATC_PERMISSION_PERSONNEL_VIEW, $personnel)) {
            switch (strtolower(trim($what))) {
                case 'personal':
                    $details = $ATC->get_personnel($personnel, 'ASC', null);
                    if ($details && isset($details->display_name)) {
                        switch (strtolower(trim($how))) {
                            case 'sms':
                                if ($details->mobile_phone) {
                                    $returnvalue[] = $details->mobile_phone;
                                }
                                break;
                            case 'email':
                                $returnvalue[] = '"' . $details->rank . ' ' . $details->display_name . '" <' . $details->email . '>';
                                break;
                            default:
                                throw new ATCExceptionBadData('Unknown "how" URL variable.');
                        }
                    }
                    break;
                case 'nok':
                    $details = $ATC->get_nok($personnel);
Exemplo n.º 5
0
    $y = 0;
    $t = 0;
    foreach ($terms as $term) {
        if ($y != date('Y', $term->startdate)) {
            $y = date('Y', $term->startdate);
            $t = 0;
        }
        $t++;
        echo '<option value="' . date('Y-m-d', $term->startdate) . '" ' . ($termstart == date('Y-m-d', $term->startdate) ? ' selected="selected"' : '') . '>';
        echo 'Term ' . $t . ' ' . $y . ' (' . date(ATC_SETTING_DATE_OUTPUT, $term->startdate) . '&mdash;' . date(ATC_SETTING_DATE_OUTPUT, $term->enddate) . ')';
        echo '</option>';
    }
    ?>
				</select>
				<?php 
    echo $ATC->user_has_permission(ATC_PERMISSION_ATTENDANCE_EDIT) ? '<a href="?id=0" class="button term new"> New </a>' : '';
    ?>
				<button type="submit" class="update">Update</button>			
			</fieldset>
		</form>
		<br />
<?php 
}
?>
	
	<form name="attendanceregister" id="attendanceregister" method="POST">
		<input type="hidden" name="attendance_register" value="1" />
		<table class="tablesorter">
			<thead>
				<tr>
					<th>Flight</th>