Esempio n. 1
0
 public static function pretreatment($parameters, $apiParams)
 {
     foreach ($apiParams['params'] as $field => $value) {
         //返回值约束字段
         if ($value['type'] == 'field_list') {
             $fieldList = $field;
         }
     }
     //处理需要返回的字段约束
     if (isset($parameters[$fieldList]) && $apiParams['extendsFields']) {
         $extendsFields = $apiParams['extendsFields'];
         $parameters[$fieldList] = format_fields($parameters[$fieldList], $extendsFields);
     }
     return $parameters;
 }
Esempio n. 2
0
    // insert a small padding
    $f .= '<p class="clear"></p>' . PHP_EOL;
    if ($isAdmin) {
        $f .= '</div><!-- end wrapper -->' . PHP_EOL;
    }
    return $f;
}
// end helper function ---------------------------------------------------------
// call this function once
$isadmin = is_admin();
if ($isadmin) {
    echo '<h1 id="create">Create new user</h1>' . PHP_EOL;
    check_notified_request("create");
    echo format_fields(null, false);
    echo '<h1 id="manage">Manage registered users</h1>' . PHP_EOL;
    check_notified_request("manage");
    $users = db_select_all(TBL_PREFIX . TBL_USERS, "*", "1");
    foreach ($users as $user) {
        echo format_fields($user, true);
    }
} else {
    // other users can edit their own account
    echo '<h1 id="manage">My account</h1>';
    check_notified_request("manage");
    $user = db_select(TBL_PREFIX . TBL_USERS, "*", "login='******'login'] . "'");
    echo format_fields($user, $isadmin);
}
?>

<?php 
include INC_DIR . 'footer.php';
$row = $ui->row()->open();
$margincol = $ui->col()->width(2)->open();
$margincol->close();
$contentcol = $ui->col()->width(8)->open();
$box = $ui->box()->title('Leave Approval/Cancel Permission Portal')->uiType('primary')->solid()->open();
$table = $ui->table()->hover()->bordered()->open();
?>
				<thead>
					<tr>
						<th><center>Feild Name</center></th>
						<th><center>Value</center></th>
					</tr>
				</thead>	
<?php 
foreach ($leave_details as $key => $value) {
    echo '<tr><td>' . format_fields($key) . '</td><td>' . $value . '</td></tr>';
}
$table->close();
$box->close();
$form = $ui->form()->action(base_url() . $ref_self)->open();
$appcol = $ui->col()->width(6)->open();
?>
<center>
<?php 
$ui->button()->value('Approve')->submit(true)->name('approve')->uiType('primary')->show();
?>
</center>
<?php 
$appcol->close();
$deccol = $ui->col()->width(6)->open();
?>
Esempio n. 4
0
function create_single_data($table_root, $data)
{
    if (empty($data)) {
        return array(null, null);
    }
    $schema = object_read("{$table_root}/schema.json");
    if (empty($schema)) {
        return array(null, null);
    }
    $new_id = get_random_id($table_root);
    if (!set_data_id($data, $new_id)) {
        return array(null, null);
    }
    $new_data = format_fields($schema, $data);
    $new_id_file = "{$table_root}/{$new_id}.json";
    wh_event_file($new_id_file, 'add');
    return array($new_id, object_save($new_id_file, $new_data));
}