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);
     if ($details && count($details)) {
         foreach ($details as $nok) {
             switch (strtolower(trim($how))) {
                 case 'sms':
                     if ($nok->mobile_number) {
                         $returnvalue[] = $nok->mobile_number;
                     }
                     break;
                 case 'email':
                     $returnvalue[] = '"' . $nok->firstname . ' ' . $nok->lastname . '" <' . $nok->email . '>';
                     break;
                 default:
                     throw new ATCExceptionBadData('Unknown "how" URL variable.');
             }
         }
Example #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;
    }
}
$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;
        ?>