Пример #1
0
$table = new StdClass();
$table->width = '100%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->data = array();
$incident_reporter_options[0] = __('Disabled');
$incident_reporter_options[1] = __('Enabled');
$language_config = get_db_value('value', 'tconfig', 'token', 'language_code');
$table->data[0][0] = print_select_from_sql('SELECT id_language, name FROM tlanguage ORDER BY name', 'language_code', $language_config, '', '', '', true, false, false, __('Language'));
$table->data[0][1] = print_input_text("sitename", $config["sitename"], '', 30, 50, true, __('Sitename'));
$error_log_options[0] = __('Disabled');
$error_log_options[1] = __('Enabled');
$table->data[1][0] = print_checkbox("error_log", $error_log_options, $config["error_log"], true, __('Enable error log') . print_help_tip(__("This errorlog is on /integria.log"), true));
$table->data[1][1] = print_input_text("timezone", $config["timezone"], '', 15, 30, true, __('Timezone for integria'));
$table->data[2][0] = print_textarea("api_acl", 2, 1, $config["api_acl"], 'style="max-width: 280px;"', true, __('List of IP with access to API') . print_help_tip(__("List of IP (separated with commas which can access to the integria API. Use * for any address (INSECURE!)"), true), false);
$table->data[2][1] = print_input_password("api_password", $config["api_password"], '', 30, 255, true, __('API password'));
$days_of_week = get_days_of_week();
$table->data[4][0] = print_select($days_of_week, "first_day_week", $config["first_day_week"], '', '', '', true, 0, false, __('First day of the week'));
$table->data[4][1] = print_input_text("url_updatemanager", $config["url_updatemanager"], '', 35, 255, true, __('URL update manager'));
$table->data[5][0] = print_input_text("loginhash_pwd", $config["loginhash_pwd"], '', 30, 255, true, __('Loginhash password'));
$table->data[5][1] = print_checkbox("access_protocol", 1, $config["access_protocol"], true, __('Enable HTTPS access'));
$table->data[6][0] = print_input_text("access_port", $config["access_port"], '', 10, 255, true, __('Access port') . print_help_tip(__("Leave blank to use default port (80)"), true));
$table->data[6][1] = print_input_text("access_public", $config["access_public"], '', 30, 50, true, __('Public access to server') . print_help_tip(__("Public IP or name for the server, for example (23.45.67.3 or mydomain.com)"), true));
$csv_standard_encoding = !isset($config['csv_standard_encoding']) ? false : (bool) $config['csv_standard_encoding'];
$table->data[7][0] = print_label(__('CSV encoding type'), '', '', true);
$table->data[7][0] .= __('Excel') . ' ' . print_radio_button('csv_standard_encoding', 0, '', $csv_standard_encoding, true);
$table->data[7][0] .= print_help_tip(__("The Excel type may not be compatible with other applications"), true);
$table->data[7][0] .= '  ' . __('Other') . ' ' . print_radio_button('csv_standard_encoding', 1, '', $csv_standard_encoding, true);
$table->data[7][1] = print_checkbox("enable_update_manager", 1, $config["enable_update_manager"], true, __('Enable update manager updates'));
$table->data[8][0] = print_input_text("max_direct_download", $config["max_direct_download"], '', 10, 255, true, __('Maximum direct download size (MB)'));
$table->data[8][1] = print_input_text("max_file_size", $config["max_file_size"], '', 10, 255, true, __('Max. Upload file size'));
	<form method="POST" action="">

		<div class="content">

			<a href="#" class="fb_login"><img src="/img/fb_login_button.jpg" alt="Facebook login"></a>

			<span class="or">OR</span>

<?php 
// Email Address
$email = array('name' => 'email', 'id' => 'email', 'mandatory' => TRUE, 'label' => 'Email Address', 'tabindex' => 1);
echo print_input_text($email, $loginOldValues, $loginErrors);
// Password
$password = array('name' => 'password', 'id' => 'password', 'mandatory' => TRUE, 'label' => 'Password', 'tabindex' => 5);
echo print_input_password($password, $loginOldValues, $loginErrors);
// Remeber me
$sendOffer = array('name' => 'remember', 'id' => 'remember', 'mandatory' => FALSE, 'label' => 'Remember me next time', 'value' => 1, 'tabindex' => 10);
echo print_checkbox($sendOffer, $loginOldValues, $loginErrors);
?>

			<div class="field forgot_password">
				<a href="/forgot-password" class="forgot_password">Forgot password?</a>
			</div>

		</div>

		<div class="submit_container">
			<span class="arrow medium_green"><input type="submit" name="login" value="Sign In"></span>
		</div>
function print_field($field)
{
    // Container
    $html = "\t" . '<div class="field clearfix' . (isset($field['class']) ? ' ' . $field['class'] : ' ' . $field['name']) . (isset($field['error']) && $field['error'] != '' ? ' error' : '') . '">' . "\n";
    $labelHTML = '';
    $inputHTML = '';
    $errorHTML = '';
    // Label
    if (isset($field['label']) && $field['label'] != '') {
        $label = array();
        $label['label'] = $field['label'];
        if (isset($field['labelFor'])) {
            $label['labelFor'] = $field['labelFor'];
        } else {
            if (isset($field['id'])) {
                $label['labelFor'] = $field['id'];
            }
        }
        $label['labelClass'] = $field['type'] . '_label';
        if (isset($field['labelClass'])) {
            $label['labelClass'] .= ' ' . $field['labelClass'];
        }
        if (isset($field['hint'])) {
            $label['hint'] = $field['hint'];
        }
        if (isset($field['mandatory'])) {
            $label['mandatory'] = $field['mandatory'];
        }
        $labelHTML .= print_label($label);
    }
    if (isset($field['mandatory']) && $field['mandatory']) {
        if (isset($field['placeholder'])) {
            $field['placeholder'] .= ' *';
        }
        if (isset($field['label'])) {
            $field['label'] .= ' *';
        }
    }
    // Input element
    switch ($field['type']) {
        case 'hidden':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '');
            $inputHTML = print_input_hidden($input);
            break;
        case 'text':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_text($input);
            break;
        case 'textarea':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_textarea($input);
            break;
        case 'xhtml_textarea':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_xhtml_textarea($input);
            break;
        case 'select':
            if (!$field['mandatory']) {
                $field['options'] = array('' => 'Select from the list') + $field['options'];
            }
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_select($input);
            break;
        case 'multiselect':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_multiselect($input);
            break;
        case 'checkbox':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'checked' => isset($field['checked']) && $field['checked'] ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML = print_input_checkbox($input);
            }
            break;
        case 'multicheckbox':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'] . '[]', 'id' => (isset($field['id']) ? $field['id'] : '') . '_' . $option, 'label' => $label, 'checked' => isset($field['value']) && $field['value'] != '' && in_array($option, $field['value']) ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML .= print_input_multicheckbox($input);
            }
            break;
        case 'radio':
            foreach ($field['options'] as $option => $label) {
                $input = array('name' => $field['name'], 'id' => (isset($field['id']) ? $field['id'] : '') . '_' . $option, 'label' => $label, 'checked' => isset($field['value']) && $field['value'] == $option ? TRUE : FALSE, 'value' => $option, 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
                $inputHTML .= print_input_radio($input);
            }
            break;
        case 'image_upload':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_image_upload($input);
            break;
        case 'file_upload':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_file_upload($input);
            break;
        case 'gallery':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'attachs' => $field['attachs']);
            $inputHTML = print_input_gallery($input);
            break;
        case 'password':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '');
            $inputHTML = print_input_password($input);
            break;
        case 'linked_content':
            if (!$field['mandatory']) {
                $field['options'] = array('' => 'Select from the list') + $field['options'];
            }
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_select($input);
            break;
        case 'multiple_linked_content':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'label' => $label, 'value' => isset($field['value']) ? $field['value'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'options' => $field['options']);
            $inputHTML = print_input_multiselect($input);
            break;
        case 'date':
        case 'datetime':
            $input = array('name' => $field['name'], 'id' => isset($field['id']) ? $field['id'] : '', 'value' => isset($field['value']) ? $field['value'] : '', 'placeholder' => isset($field['placeholder']) ? $field['placeholder'] : '', 'tabindex' => isset($field['tabindex']) ? $field['tabindex'] : '', 'class' => (isset($field['class']) ? $field['class'] : '') . ' ' . $field['type'] . 'picker');
            $inputHTML = print_input_text($input);
            break;
    }
    // Error
    if (isset($field['showError']) && $field['showError'] && isset($field['error']) && $field['error']) {
        $errorHTML = print_error($field['error']);
    }
    switch ($field['type']) {
        case 'text':
        case 'textarea':
        case 'xhtml_textarea':
        case 'select':
        case 'multiselect':
        case 'radio':
        case 'password':
        case 'date':
        case 'datetime':
        case 'multicheckbox':
        case 'linked_content':
        case 'multiple_linked_content':
            $html .= "\t\t" . $labelHTML . "\n\t\t" . $inputHTML . "\n\t" . $errorHTML;
            break;
        case 'checkbox':
            $html .= "\t\t" . $inputHTML . "\n\t\t" . $labelHTML . "\n\t" . $errorHTML;
            break;
        case 'file_upload':
            $html .= '<div class="file_upload">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_file_preview($field['attach'], $field['name']);
            break;
        case 'image_upload':
            $html .= '<div class="image_upload">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_image_preview($field['attach'], $field['name']);
            break;
        case 'gallery':
            $html .= '<div class="clearfix">' . '<div class="image_upload gallery">' . $labelHTML . $inputHTML . $errorHTML . '</div>' . print_gallery_preview($field['attachs'], $field['name']) . '</div>';
            break;
        case 'hidden':
            $html .= "\t\t" . $inputHTML . "\n\t";
            break;
    }
    $html .= '</div>' . "\n";
    return $html;
}
Пример #4
0
		$table->data[3][0] = print_label (__('Comments'), '', '', true, $comments);
}

if ($has_permission) {
	echo '<form id="form-user_edit" method="post" action="index.php?sec=users&sec2=operation/users/user_edit" enctype="multipart/form-data">';
	
	print_table ($table);
	echo "<div class='button-form' >";
		$data = print_submit_button (__('Update'), 'upd_btn', false, 'class="upd sub"', true);
		$data .= print_input_hidden ('update_user', 1, true);
		echo $data;
	echo "</div>";
	
	$table->data = array ();
	$table->data[0][0] = print_input_password ('password', '', '', 20, 20, true, __('Password'));
	$table->data[0][1] = print_input_password ('password_confirmation', '', '', 20, 20, true, __('Password confirmation'));
	
	echo '<h1>'.__('Change password').'</h1>';
	
	$data = "<div class='button-form' >" . print_submit_button (__('Update'), 'pass_upd_btn', false, 'class="upd sub"', true);
	$data .= print_input_hidden ('update_user', 1, true);
	$data .= print_input_hidden ('id', $user["id_usuario"], true) . "</div>";
	
	$table->data[0][3] = $data;
	
	print_table ($table);

	echo '</form>';
} else {
	print_table ($table);
}
Пример #5
0
<form name="myform" id="myform" class="form-horizontal" role="form" action="<?php 
echo WEB_PATH;
echo $form_action;
?>
" method="post">
	<div class="form-group">
		<label for="user_name" class="col-sm-3 control-label">ชื่อผู้ใช้ : &nbsp;</label>
		<div class="col-sm-8"><?php 
print_input_text("user_name");
?>
</div>
	</div>
	<div class="form-group">
		<label for="user_pwd" class="col-sm-3 control-label">รหัสผ่าน  : &nbsp;</label>
		<div class="col-sm-8"><?php 
print_input_password("user_pwd");
?>
</div>
	</div>
	<div class="form-group">
		<label for="user_pwd" class="col-sm-3 control-label">ยืนยันรหัสผ่าน  : &nbsp;</label>
		<div class="col-sm-8"><input type="password" class="form-control" name="confirm_pwd" id="confirm_pwd" value=""/></div>
	</div>
	<div class="form-group">
		<label for="user_pwd" class="col-sm-3 control-label">ชื่อผู้ดูแลระบบ  : &nbsp;</label>
		<div class="col-sm-8"><?php 
print_input_text("user_full_name");
?>
</div>
	</div>
	<div class="form-group">