function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label);
     $config["value"] = "<p>" . form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p><p>Field to match: " . NBS . form_dropdown($field_name . "_relationship_field", $data["all_fields"], (isset($data["default_settings"]["cf"][$field_name . "_relationship_field"]) ? $data["default_settings"]["cf"][$field_name . "_relationship_field"] : '') . "</p>");
     return $config;
 }
Esempio n. 2
0
 function revenueForm()
 {
     $revenueForm = array();
     $this->load->model('revenue_model');
     $economic = $this->expenditure_model->exp_economic();
     $donor = $this->agreement_model->getDonor();
     $source = $this->expenditure_model->getsource_Ndese();
     $budget = $this->agreement_model->getBudget();
     //REVENUE MASTER-------------------------------------------------------------------------------------
     $revenueForm['VOUCHER_NUM'] = array(form_label('भौचर नम्बर :', 'VOUCHER_NUM'), form_input(array('name' => 'VOUCHER_NUM', 'class' => 'number')));
     $revenueForm['VOUCHER_EDATE'] = array(form_label('भौचर मिति :', 'VOUCHER_EDATE'), form_input(array('name' => 'VOUCHER_EDATE', 'class' => 'number', 'id' => 'rvoucherEdate')));
     $revenueForm['VOUCHER_NDATE'] = array(form_input(array('name' => 'VOUCHER_NDATE', 'class' => 'number', 'id' => 'rvoucherNdate')));
     $revenueForm['ACC_CODE'] = array(form_label('बुद्गेत सिर्सक ', 'ACC_CODE'), form_input(array('name' => 'ACC_CODE', 'id' => 'typeauto', 'class' => 'number')), form_input(array('name' => 'ACC_CODE', 'id' => 'autocomplete', 'width' => '500px')));
     //form_dropdown('ACC_CODE', $budget, '', 'class="dropdown"'));
     $revenueForm['CREATED_BY'] = array(form_label(' प्रतिपादन BY:', 'CREATED_BY'), form_input(array('name' => 'CREATED_BY')));
     $revenueForm['CREATED_DATE'] = array(form_label('प्रतिपादन मिति :', 'CREATED_DATE'), form_input(array('name' => 'CREATED_DATE')));
     $revenueForm['AGREEMENET_ID'] = array(form_label(' agreement id :', 'AGREEMENET_ID'), form_input(array('name' => 'AGREEMENET_ID')));
     //  REVENUE DETAIL--------------------------------------------------------------------------------------
     // $revenueForm['INFO_ID'] = array(form_label('राजस्व कोड :', 'INFO_ID'), form_input(array('name' => 'INFO_ID[]', 'class' => 'number')));
     $revenueForm['AMOUNT_EDESC'] = array(form_label('मूल्य EDESC :', 'AMOUNT_EDESC'), form_input(array('name' => 'AMOUNT_EDESC[]', 'class' => 'number')));
     $revenueForm['AMOUNT_NDESC'] = array(form_input(array('name' => 'AMOUNT_NDESC[]', 'class' => 'number')));
     $revenueForm['BANK_VOUCHER_NUM'] = array(form_label('बैंक भौचर नम्बर :', 'BANK_VOUCHER_NUM'), form_input(array('name' => 'BANK_VOUCHER_NUM[]', 'class' => 'number')));
     $revenueForm['BANK_VOUCHER_DATE'] = array(form_label('बैंक भौचर मिति :', 'BANK_VOUCHER_DATE'), form_input(array('name' => 'BANK_VOUCHER_DATE[]', 'class' => 'number')));
     $revenueForm['BANK_CODE'] = array(form_label('बैंक कोड :', 'BANK_CODE'), form_input(array('name' => 'BANK_CODE[]')));
     // $revenueForm['REVENUE_DETAIL'] = array(form_label('revenu detail :', 'REVENUE_DETAIL'), form_input(array('name' => 'REVENUE_DETAIL', 'class' => 'REVENUE_DETAIL')));
     // REVENUE DETAIL DROPDOWNS----------------------------------------------------------------------
     $revenueForm['AMOUNT'] = array(form_label('मुल्य :', 'AMOUNT'), form_input(array('name' => 'AMOUNT[]', 'class' => 'AMOUNT')));
     $revenueForm['ECONOMIC_CODE5'] = array(form_dropdown('ECONOMIC_CODE5[]', $economic, '', ' class="dropdown"', 'id="reve_economic"'));
     $revenueForm['AMOUNT_TYPE'] = array(form_dropdown('AMOUNT_TYPE[]', array('d' => 'डेबिट ', 'c' => 'क्रेडिट ')));
     $revenueForm['SOURCE_TYPE_CODE'] = array(form_dropdown('SOURCE_TYPE_CODE[]', $source, '', 'class="source"'));
     $revenueForm['DONOR_CODE'] = array(form_dropdown('DONOR_CODE[]', $donor, '', 'class="donor"'));
     $revenueForm['TRANSIT'] = array(form_dropdown('TRANSIT', array('कोलेनिका ', 'बा . ख '), '', 'class="transit"'));
     $revenueForm['SUBMIT'] = array(form_submit('SUBMIT', 'Submit'));
     return $revenueForm;
 }
 /**
  * global settings for the field instance set by installer
  */
 function display_global_settings()
 {
     $val = array_merge($this->settings, $_POST);
     $form = '<p>' . form_label('API Key', 'api_key') . form_input('api_key', $val['api_key']) . '</p>';
     $form .= '<p>' . form_label('Stats cache expire time (hours)', 'cache_expire_hours') . form_input('cache_expire_hours', $val['cache_expire_hours']) . '</p>';
     return $form;
 }
Esempio n. 4
0
 public function index()
 {
     $this->load->helper('form');
     $this->load->helper('url');
     $aOptions = array('none' => '', 'hourly' => 'hourly', 'daily' => 'daily');
     $sAttributes = 'id="select_type"';
     $data['select_type'] = form_label("Select either hourly or daily predictions:", 'select_type') . form_dropdown('select_type', $aOptions, '', $sAttributes);
     for ($i = 0; $i < 36; $i++) {
         $aOptionsHour[$i] = $i;
         if ($i < 10) {
             $aOptionsDay[$i] = $i;
             // Get at days while I'm at it.
             $aOptionsPop[$i * 10] = $i * 10;
         }
     }
     $sAttributesPop = 'id = "select_pop"';
     $sAttributesDay = 'id="select_day"';
     $sAttributesHour = 'id="select_hour"';
     $data['sel_hour'] = form_label("Select how many hours ahead:", 'select_hour') . form_dropdown('sel_hour', $aOptionsHour, '', $sAttributesHour);
     $data['sel_day'] = form_label("Select how many days ahead:", 'select_day') . form_dropdown('sel_day', $aOptionsDay, '', $sAttributesDay);
     $data['sel_pop'] = form_label("Select percent of percipitation:", 'select_pop') . form_dropdown('sel_pop', $aOptionsPop, '', $sAttributesPop);
     $sAttributesData = 'id="select_data"';
     $aOptionsData = array('Temperature' => 'temp', 'Precipitation' => 'pop');
     $data['sel_data'] = form_label("Select details on either POP or Temperature:", 'select_data') . form_dropdown('sel_data', $aOptionsData, '', $sAttributesData);
     $this->load->view('header_view');
     $this->load->view('weather_view', $data);
     $this->load->view('footer_view');
 }
Esempio n. 5
0
function tag_field($value = '')
{
    $string = form_label('Tags', 'tags');
    $input = array('name' => 'tags', 'id' => 'tags', 'size' => 40, 'value' => $value);
    $string = form_input($input);
    echo $string;
}
Esempio n. 6
0
 /**
  * Generate the form elements to configure this field
  *
  * @param string $field_name the field's name
  * @param string $field_label the field's label
  * @param string $field_type the field's type
  * @param string $data array of data that can be used to select from
  * @return array containing form's label and elements
  * @author Andrew Weaver
  */
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label);
     $config["value"] = form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '');
     return $config;
 }
Esempio n. 7
0
 public function index($type = null)
 {
     switch ($type) {
         case null:
             $this->load->library('form_validation');
             $this->form_validation->set_rules('verify', 'Verification Code', 'required|xss_clean|max_length[111]');
             if ($this->form_validation->run() !== false) {
                 redirect('verify/code/' . $this->input->post('verify'));
             }
             $this->load->view('header');
             echo form_open('verify');
             echo form_label('Verify:', 'verify');
             echo form_input('verify', '', 'id="verify_input"');
             echo form_submit('submit', 'Verify');
             echo form_close();
             $this->load->view('footer');
             break;
         case 'newAccount':
             echo "<h1>Verify New Account</h1>";
             echo anchor('verify/send/newAccount', 'Send Confirmation Email', 'title="Send Confirmation Email"');
             break;
         case 'connectAccounts':
             echo "<h1>Connect Accounts</h1><h2>An account with that email already exists.</h2>";
             echo anchor('verify/send/connectAccounts', 'Connect Accounts', 'title="Connect Accounts"');
             break;
     }
 }
Esempio n. 8
0
 public function editar()
 {
     if (!($this->dados['infos'] = $this->curso_model->listar($this->id))) {
         redirect('../cursos/listar');
     }
     $dadosCurso = $this->dados['infos'][0];
     $form = form_open('#', array('class' => 'niceform'));
     $form .= '<table class="cadForm">';
     $form .= '<tr>';
     $form .= '<td>';
     $form .= form_label('Nome:', '', array('for' => 'email'));
     $form .= form_input('curso_nome', $dadosCurso['curso_nome'], array('size' => 30));
     $form .= form_hidden('curso_id', $dadosCurso['curso_id']);
     $form .= form_hidden('lixeira', $dadosCurso['lixeira']);
     $form .= '</td>';
     $form .= '<td>';
     $form .= form_label('Quantidade de aulas:', '', array('for' => 'email'));
     $form .= form_input('curso_qtd_aulas', $dadosCurso['curso_qtd_aulas'], array('size' => 20));
     $form .= '</td>';
     $form .= '</tr>';
     $form .= '<tr>';
     $form .= '<td></td>';
     $form .= '<td>';
     $form .= form_submit('cadastrar', 'Enviar', 'id="submit"');
     $form .= '</td>';
     $form .= '</tr>';
     $form .= '</table>';
     $form .= form_close();
     $form .= '<span class="obs">Todos os campos são obrigatórios.</span>';
     $this->dados['form'] = $form;
     $this->load->view('editar', $this->dados);
 }
Esempio n. 9
0
/**
 * Text Input Field With Enable/Disable Checkbox
 *
 * @access	public
 * @param	mixed
 * @param	string
 * @param	string
 * @param	string
 * @param	string
 * @param	bool
 * @return	string
 */
function fpbx_form_input_check($data = '', $value = '', $extra = '', $label = 'Enable', $disabled_value = 'DEFAULT', $check_enables = true)
{
    if (!is_array($data)) {
        $data['name'] = $data['id'] = $data;
    }
    if (!isset($data['id'])) {
        $data['id'] = $data['name'];
    }
    if (!isset($data['value'])) {
        $data['value'] = $value;
    }
    if (!empty($data['disabled'])) {
        $data['value'] = $disabled_value;
    }
    $cbdata['name'] = $data['name'] . '_cb';
    $cbdata['id'] = $data['id'] . '_cb';
    $cbdata['checked'] = isset($data['disabled']) ? !$data['disabled'] : true;
    $cbdata['data-disabled'] = $disabled_value;
    if ($check_enables) {
        $cbdata['class'] = "input_checkbox_toggle_false";
    } else {
        $cbdata['class'] = "input_checkbox_toggle_true";
        $cbdata['checked'] = !$cbdata['checked'];
    }
    return form_input($data) . form_checkbox($cbdata) . form_label($label, $cbdata['id']);
}
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label) . NBS . anchor("http://brandnewbox.co.uk/support/details/importing_into_playa_fields_with_datagrab", "(?)", 'class="help"');
     $config["value"] = "<p>" . form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p><p>Field to match: " . NBS . form_dropdown($field_name . "_playa_field", $data["all_fields"], (isset($data["default_settings"]["cf"][$field_name . "_playa_field"]) ? $data["default_settings"]["cf"][$field_name . "_playa_field"] : '') . "</p>");
     return $config;
 }
Esempio n. 11
0
        public function getLoginForm()
        {
			$this->CI->lang->load('basic', 'english');
            $this->CI->load->helper('form');

			$form = '<div id="LoginForm">';
			$form.= '<p>'.$this->CI->lang->line('login_text').'</p>';
			$form.= form_open(site_url('login'), array(
				'id' => 'Login'
			));
			$form.= form_fieldset();
			$form.= form_label('username');
			$form.= form_input(array(
				'maxlength' => 20,
				'name' => 'username'
			));
			$form.= form_label('password');
			$form.= form_input(array(
				'maxlength' => 20,
				'name' => 'password',
				'type' => 'password'
			));
			$form.= form_submit('login_submit', $this->CI->lang->line('login_button'));
			$form.= form_fieldset_close();
			$form.= form_close();
			$form.= '</div>';

			return $form;
        }
Esempio n. 12
0
function bt_password($n, $name, $i = 12, $a = FALSE)
{
    if ($a) {
        return '<div class="form-group col-md-' . $i . '">' . "\n" . form_label($n) . "\n" . form_password(array('name' => $name, 'class' => 'form-control'), set_value($name), 'autofocus') . "\n" . '</div>' . "\n";
    } else {
        return '<div class="form-group col-md-' . $i . '">' . "\n" . form_label($n) . "\n" . form_password(array('name' => $name, 'class' => 'form-control'), set_value($name)) . "\n" . '</div>' . "\n";
    }
}
Esempio n. 13
0
 /**
  * Create the form elements to map matrix fields
  *
  * @param string $field_name 
  * @param string $field_label 
  * @param string $field_type 
  * @param string $data 
  * @return void
  * @author Andrew Weaver
  */
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label) . BR . anchor("http://brandnewbox.co.uk/support/details/datagrab_and_matrix_fields", "Matrix notes", 'class="help"');
     // Get list of matrix columns and map column id to label
     $this->EE->db->select("col_id, col_label,col_type");
     $query = $this->EE->db->get("exp_matrix_cols");
     $matrix_columns = array();
     $matrix_column_types = array();
     foreach ($query->result_array() as $row) {
         $matrix_columns[$row["col_id"]] = $row["col_label"];
         $matrix_column_types[$row["col_id"]] = $row["col_type"];
     }
     $cells = form_hidden($field_name, "1");
     // Loop over all columns
     foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) {
         // Get current settings if this is a saved import
         if (isset($data["default_settings"]["cf"][$field_name . "_columns"])) {
             $default_cells = $data["default_settings"]["cf"][$field_name . "_columns"];
         } else {
             $default_cells = array();
         }
         // Build configuration interface
         $cells .= "<p>" . $matrix_columns[$col_id] . NBS . ":" . NBS;
         $cells .= form_dropdown($field_name . "_columns[" . $col_id . "]", $data["data_fields"], isset($default_cells[$col_id]) ? $default_cells[$col_id] : '');
         if ($matrix_column_types[$col_id] == "file") {
             $cells .= NBS . NBS . "Upload folder: " . NBS;
             // Get upload folders
             if (!isset($folders)) {
                 $this->EE->db->select("id, name");
                 $this->EE->db->from("exp_upload_prefs");
                 $this->EE->db->order_by("id");
                 $query = $this->EE->db->get();
                 $folders = array();
                 foreach ($query->result_array() as $row) {
                     $folders[$row["id"]] = $row["name"];
                 }
             }
             $cells .= form_dropdown($field_name . "_extra1[" . $col_id . "]", $folders, isset($data["default_settings"]["cf"][$field_name . "_extra1"][$col_id]) ? $data["default_settings"]["cf"][$field_name . "_extra1"][$col_id] : '');
             $cells .= NBS . NBS . "Fetch?: " . NBS;
             $cells .= form_dropdown($field_name . "_extra2[" . $col_id . "]", array("No", "Yes"), isset($data["default_settings"]["cf"][$field_name . "_extra2"][$col_id]) ? $data["default_settings"]["cf"][$field_name . "_extra2"][$col_id] : '');
         }
         $cells .= "</p>";
     }
     // Pulldown menu to determin what to do for updates
     $column_options = array();
     $column_options["-1"] = "Delete all existing rows";
     $column_options["0"] = "Keep existing rows and append new";
     $sub_options = array();
     foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) {
         $sub_options[$col_id] = $matrix_columns[$col_id];
     }
     $column_options["Update the row if this column matches:"] = $sub_options;
     $cells .= "<p>" . "Action to take when an entry is updated: " . form_dropdown($field_name . "_unique", $column_options, isset($data["default_settings"]["cf"][$field_name . "_unique"]) ? $data["default_settings"]["cf"][$field_name . "_unique"] : '') . "</p>";
     // return config interface
     $config["value"] = $cells;
     return $config;
 }
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = "<p>" . form_label($field_label);
     /*  . NBS .
     		anchor("http://brandnewbox.co.uk/support/details/importing_into_playa_fields_with_datagrab", "(?)", 'class="help"');
     		*/
     $config["value"] = "Price: " . NBS . form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p><p>" . "SKU: " . NBS . form_dropdown($field_name . "_store_sku", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_store_sku"]) ? $data["default_settings"]["cf"][$field_name . "_store_sku"] : '') . "</p><p>" . "Sale Price: " . NBS . form_dropdown($field_name . "_store_sale_price", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_store_sale_price"]) ? $data["default_settings"]["cf"][$field_name . "_store_sale_price"] : '') . "</p><p>" . "Sale Price Enabled?: " . NBS . form_dropdown($field_name . "_store_sale_price_enabled", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_store_sale_price_enabled"]) ? $data["default_settings"]["cf"][$field_name . "_store_sale_price_enabled"] : '') . "</p><p>" . "Weight: " . NBS . form_dropdown($field_name . "_store_weight", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_store_weight"]) ? $data["default_settings"]["cf"][$field_name . "_store_weight"] : '') . "</p><p>" . "Free shipping: " . NBS . form_dropdown($field_name . "_store_free_shipping", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_store_free_shipping"]) ? $data["default_settings"]["cf"][$field_name . "_store_free_shipping"] : '') . "</p>";
     return $config;
 }
Esempio n. 15
0
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = "<p>" . form_label($field_label);
     /*  . NBS .
     		anchor("http://brandnewbox.co.uk/support/details/importing_into_playa_fields_with_datagrab", "(?)", 'class="help"');
     		*/
     $config["value"] = "Start date: " . NBS . form_hidden($field_name, "y") . form_dropdown($field_name . "_low_events_start_date", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_low_events_start_date"]) ? $data["default_settings"]["cf"][$field_name . "_low_events_start_date"] : '') . "</p><p>" . "Start time: " . NBS . form_dropdown($field_name . "_low_events_start_time", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_low_events_start_time"]) ? $data["default_settings"]["cf"][$field_name . "_low_events_start_time"] : '') . "</p><p>" . "End date: " . NBS . form_dropdown($field_name . "_low_events_end_date", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_low_events_end_date"]) ? $data["default_settings"]["cf"][$field_name . "_low_events_end_date"] : '') . "</p><p>" . "End time: " . NBS . form_dropdown($field_name . "_low_events_end_time", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_low_events_end_time"]) ? $data["default_settings"]["cf"][$field_name . "_low_events_end_time"] : '') . "</p><p>" . "All day?: " . NBS . form_dropdown($field_name . "_low_events_all_day", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_low_events_all_day"]) ? $data["default_settings"]["cf"][$field_name . "_low_events_all_day"] : '') . "</p>";
     return $config;
 }
function print_label($label)
{
    $html = (isset($label['hint']) && $label['hint'] != '' ? '<a href="#" class="hint"><span>' . $label['hint'] . '</span></a>' : '') . $label['label'] . (isset($label['mandatory']) && $label['mandatory'] ? ' <span class="mandatory">*</span>' : '');
    $attributes = array();
    $attributes['class'] = 'clearfix';
    if (isset($label['labelClass'])) {
        $attributes['class'] .= ' ' . $label['labelClass'];
    }
    return form_label($html, isset($label['labelFor']) ? $label['labelFor'] : '', $attributes);
}
Esempio n. 17
0
 function rateEditForm()
 {
     $rateEditForm = array();
     $this->load->library('table');
     $rateEditForm['ACTUAL_RATE'] = array(form_label('ब्याज दर:', 'ACTUAL_RATE'), form_input(array('name' => 'ACTUAL_RATE', 'class' => 'number', 'maxlength' => 9)));
     $rateEditForm['NEW_RATE'] = array(form_label('new ब्याज दर:', 'NEW_RATE'), form_input(array('name' => 'NEW_RATE', 'class' => 'number')));
     $rateEditForm['ALTERED_RATE'] = array(form_label('ब्याज दर difference:', 'ALTERED_RATE'), form_input(array('name' => 'ALTERED_RATE', 'class' => 'number')));
     $rateEditForm['INTEREST_CHANGE'] = array(form_label('किस्ता रकम change:', 'INTEREST_CHANGE'), form_input(array('name' => 'INTEREST_CHANGE', 'class' => 'number')));
     return $rateEditForm;
 }
Esempio n. 18
0
 public function output($submit)
 {
     foreach ($this->inputs as $i->{$input}) {
         $this->output .= form_label($this->labels[$i]);
         $this->output .= form_input($input);
     }
     $this->output .= form_submit($submit);
     $this->output .= form_close();
     return $this->output;
 }
Esempio n. 19
0
 /**
  * Show form to user select table
  **/
 private function _showForm($tables)
 {
     $CI =& get_instance();
     $CI->load->helper('form');
     echo form_open($CI->uri->uri_string(), array("method" => "post"));
     echo form_label('Table: ', 'table');
     echo form_dropdown('table', $this->_tablesAsOptions($tables), array(), 'id="table"');
     echo form_submit('', 'Submit');
     echo form_close();
 }
Esempio n. 20
0
 /**
  * Create the form elements to map matrix fields
  *
  * @param string $field_name 
  * @param string $field_label 
  * @param string $field_type 
  * @param string $data 
  * @return void
  * @author Andrew Weaver
  */
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label) . BR . anchor("http://brandnewbox.co.uk/support/", "Grid notes", 'class="help"');
     $config["value"] = "";
     $config["value"] .= form_hidden($field_name, "1");
     // Get current saved setting
     if (isset($data["default_settings"]["cf"][$field_name . "_columns"])) {
         $default = $data["default_settings"]["cf"][$field_name . "_columns"];
     } else {
         $default = array();
     }
     // Find columns for this grid
     $this->EE->db->select("col_id, col_type, col_label");
     $this->EE->db->from("exp_grid_columns g");
     $this->EE->db->join("exp_channel_fields c", "g.field_id = c.field_id");
     $this->EE->db->where("c.field_name", $field_name);
     $this->EE->db->order_by("col_order ASC");
     $query = $this->EE->db->get();
     // Build ui
     $grid_columns = $query->result_array();
     foreach ($query->result_array() as $row) {
         $config["value"] .= "<p>" . $row["col_label"] . NBS . ":" . NBS;
         $config["value"] .= form_dropdown($field_name . "_columns[" . $row["col_id"] . "]", $data["data_fields"], isset($default[$row["col_id"]]) ? $default[$row["col_id"]] : '');
         if ($row["col_type"] == "file") {
             $config["value"] .= NBS . NBS . "Upload folder: " . NBS;
             // Get upload folders
             if (!isset($folders)) {
                 $this->EE->db->select("id, name");
                 $this->EE->db->from("exp_upload_prefs");
                 $this->EE->db->order_by("id");
                 $query = $this->EE->db->get();
                 $folders = array();
                 foreach ($query->result_array() as $folder) {
                     $folders[$folder["id"]] = $folder["name"];
                 }
             }
             $config["value"] .= form_dropdown($field_name . "_extra1[" . $row["col_id"] . "]", $folders, isset($data["default_settings"]["cf"][$field_name . "_extra1"][$row["col_id"]]) ? $data["default_settings"]["cf"][$field_name . "_extra1"][$row["col_id"]] : '');
             $config["value"] .= NBS . NBS . "Fetch?: " . NBS;
             $config["value"] .= form_dropdown($field_name . "_extra2[" . $row["col_id"] . "]", array("No", "Yes"), isset($data["default_settings"]["cf"][$field_name . "_extra2"][$row["col_id"]]) ? $data["default_settings"]["cf"][$field_name . "_extra2"][$row["col_id"]] : '');
         }
         $config["value"] .= "</p>";
     }
     $column_options = array();
     $column_options["-1"] = "Delete all existing rows";
     $column_options["0"] = "Keep existing rows and append new";
     $sub_options = array();
     foreach ($grid_columns as $row) {
         $sub_options[$row["col_id"]] = $row["col_label"];
     }
     $column_options["Update the row if this column matches:"] = $sub_options;
     $config["value"] .= "<p>" . "Action to take when an entry is updated: " . form_dropdown($field_name . "_unique", $column_options, isset($data["default_settings"]["cf"][$field_name . "_unique"]) ? $data["default_settings"]["cf"][$field_name . "_unique"] : '') . "</p>";
     return $config;
 }
Esempio n. 21
0
File: Gui.php Progetto: sigit/vunsy
 /**
  * a form maker 
  * @param $action: target page of the form
  * @param $data: array of key( label text )=>value(corresponding input HTML ), values can be generated with functions like textbox,color,file,folder,app.etc
  * @param $attributes: array or object of key(attribute)=>value(value of the attribute)
  * @param $hidden: array of hiden fields and values as key=>value
  */
 function form($action = '', $data = array(), $attributes = array(), $hidden = array())
 {
     add_dojo("dijit.form.Form");
     $attributes = $this->attribute($attributes, 'dojoType', 'dijit.form.Form');
     $attributes = $this->_attributes_to_string($attributes);
     $text = form_open($action, $attributes, $hidden) . "\n\t<table>";
     foreach ($data as $key => $value) {
         $text .= "\n\t<tr>" . "\n\t<td width=\"1%\" >" . form_label($key) . "</td>" . "\n\t<td>" . $value . "</td>" . "\n\t</tr>";
     }
     $text .= "\n\t</table>" . form_close();
     return $text;
 }
Esempio n. 22
0
    public function settings_form($settings)
    {
        return form_open('', array('class' => 'dashForm')) . '<p>' . form_label(lang('wgt_cp_analytics_chart_title')) . form_input('title', $settings->title) . '</p>

			<p>' . form_label(lang('wgt_cp_analytics_chart_days')) . form_radio('days', '30', $settings->days == '30' ? TRUE : FALSE) . NBS . '30 days' . NBS . NBS . form_radio('days', '14', $settings->days == '14' ? TRUE : FALSE) . NBS . '14 days' . '</p>
			
			<p>' . form_label(lang('wgt_cp_analytics_chart_labels')) . form_radio('labels', 'y', $settings->labels == 'y' ? TRUE : FALSE) . NBS . 'Yes' . NBS . NBS . form_radio('labels', 'n', $settings->labels == 'n' ? TRUE : FALSE) . NBS . 'No' . '</p>
			
			<p>' . form_submit('save', lang('save')) . '</p>
			
			' . form_close();
    }
Esempio n. 23
0
 function showForm()
 {
     $this->output = form_open_multipart($this->data['segment'] . $this->data['id']);
     if (isset($this->data['id']) and $this->data['id'] != 0) {
         $this->output .= form_hidden('id', $this->data['id']);
     }
     foreach ($this->data['fields'] as $key => $value) {
         $this->output .= "\n" . '<div id="ssForm_' . $key . '">';
         switch ($value['type']) {
             case 'hidden':
                 $this->output .= "\n\t" . form_hidden($key, $value['value']);
                 break;
             case 'text':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_input($key, $value['value']);
                 $this->output .= "\n" . form_error($key);
                 break;
             case 'date':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_input($key, $value['value'], 'class="ssDate"');
                 $this->output .= "\n" . form_error($key);
                 break;
             case 'textarea':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_textarea($key, $value['value']);
                 $this->output .= "\n" . form_error($key);
                 break;
             case 'dropdown':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_dropdown($key, $value['options'], $value['value']);
                 $this->output .= "\n" . form_error($key);
                 break;
             case 'checkbox':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_checkbox($key, $value['value'], $value['checked']);
                 $this->output .= "\n" . form_error($key);
                 break;
             case 'upload':
                 $this->output .= "\n\t" . form_label($value['desc'], $key);
                 $this->output .= "\n\t" . form_upload($key, $value['value']);
                 $this->output .= "\n" . is_array($this->upload_error) ? '<p>Err:' . $this->upload_error[$key] . '</p>' : '<p></p>';
                 break;
             default:
                 break;
         }
         $this->output .= '</div>';
     }
     $this->output .= "\n" . '<div>' . "\n\t" . form_submit('submit', $this->button, 'class="submit"') . "\n" . '</div>';
     $this->output .= "\n" . form_close();
     return $this->output;
 }
Esempio n. 24
0
 private function _partialEtapa1()
 {
     $listaSexo = array(WeLearn_Usuarios_Sexo::NAO_EXIBIR => WeLearn_Usuarios_Sexo::getDescricao(WeLearn_Usuarios_Sexo::NAO_EXIBIR), WeLearn_Usuarios_Sexo::MASCULINO => WeLearn_Usuarios_Sexo::getDescricao(WeLearn_Usuarios_Sexo::MASCULINO), WeLearn_Usuarios_Sexo::FEMININO => WeLearn_Usuarios_Sexo::getDescricao(WeLearn_Usuarios_Sexo::FEMININO));
     $paisEstadoDao = WeLearn_DAO_DAOFactory::create('PaisEstadoDAO', null, false);
     $listaPais = array(0 => 'Selecione um país');
     $listaPais = array_merge($listaPais, $paisEstadoDao->recuperarTodosPaisesSimplificado());
     $listaEstado = array(0 => 'Selecione um país acima');
     $listaDeRS = array();
     $listaDeRS[] = array('rs' => form_label('Rede Social', 'txt-rs-0') . form_input('rsId[]', '', 'id="txt-rs-0"'), 'rsUsuario' => form_label('Usuario na Rede Social', 'txt-rs-usuario-0') . form_input('rsUsuario[]', '', 'id="txt-rs-usuario-0"'));
     $listaDeIM = array();
     $listaDeIM[] = array('im' => form_label('Mensageiro Instantâneo (IM)', 'txt-im-0') . form_input('imId[]', '', 'id="txt-im-0"'), 'imUsuario' => form_label('Usuario no Mensageiro Instantâneo (IM)', 'txt-im-usuario-0') . form_input('imUsuario[]', '', 'id="txt-im-usuario-0"'));
     $dadosEtapa1 = array('formAction' => '/usuario/salvar_dados_pessoais', 'extraOpenForm' => 'id="form-etapa-1" class="quickstart-form"', 'listaSexo' => $listaSexo, 'sexoAtual' => WeLearn_Usuarios_Sexo::NAO_EXIBIR, 'dataNascimentoAtual' => '', 'listaPais' => $listaPais, 'paisAtual' => '0', 'listaEstado' => $listaEstado, 'estadoAtual' => '0', 'cidadeAtual' => '', 'enderecoAtual' => '', 'descricaoPessoalAtual' => '', 'telAtual' => '', 'telAlternativoAtual' => '', 'listaDeIM' => $listaDeIM, 'listaDeRS' => $listaDeRS, 'homePageAtual' => '');
     return $this->template->loadPartial('form_dados_pessoais', $dadosEtapa1, 'usuario');
 }
Esempio n. 25
0
 function currencyForm()
 {
     $currencydata = array();
     $this->load->model('currency_model');
     //  $org[] = $this->agreement_model->getOrg();
     $currencydata['CURR_CD'] = array(form_label('मुद्रा कोड :', 'CURR_CD'), form_input(array('name' => 'CURR_CD', 'class' => 'CURR_CD')));
     $currencydata['CURR_ENAME'] = array(form_label('मुद्रा अंग्रेजीमा :', 'CURR_ENAME'), form_input(array('name' => 'CURR_ENAME', 'class' => 'CURR_ENAME')));
     $currencydata['CURR_NNAME'] = array(form_label('मुद्रा नेपालीमा :', 'CURR_NNAME'), form_input(array('name' => 'CURR_NNAME', 'class' => 'CURR_NNAME')));
     $currencydata['SYMBOL'] = array(form_label('मुद्रा संकेत : :', 'SYMBOL'), form_dropdown('SYMBOL', array('$', '/Rs', '£')));
     $currencydata['CREATED_BY'] = array(form_label('क्रिएट मुद्रा(created by):', 'CREATED_BY'), form_input(array('name' => 'CREATED_BY', 'class' => 'CREATED_BY')));
     $currencydata['DATETIME'] = array(form_label('मिति :', 'DATETIME'), form_input(array('name' => 'DATETIME', 'class' => 'DATETIME')));
     $currencydata['SUBMIT'] = array(form_submit('SUBMIT', 'Submit'));
     return $currencydata;
 }
Esempio n. 26
0
/**
 *
 * @param string $id
 * @param string $label
 * @param string $type
 * @param array $attributes
 * @return string
 */
function form_item($id, $label, $type = 'input', $attributes = array())
{
    $attributes = array_merge(array('name' => $id, 'id' => str_replace(array('[', ']'), '', $id), 'value' => set_value($id), 'class' => 'xxlarge'), $attributes);
    $error = form_error($attributes['id'], '<span class="help-inline">', '</span>');
    $class = $error == '' ? '' : ' error';
    $retval = '<div class="clearfix' . $class . '">';
    $retval .= form_label($label, $attributes['id']);
    $retval .= '<div class="input">';
    $retval .= call_user_func('form_' . $type, $attributes);
    $retval .= $error;
    $retval .= '</div>';
    $retval .= '</div>';
    return $retval;
}
Esempio n. 27
0
 function formelement($label, $input, $help = '')
 {
     ?>
         <div class="control-group">
         <?php 
     echo form_label($label, '', array('class' => 'control-label'));
     echo '<div class="controls">' . $input;
     if (!empty($help)) {
         echo '<p class="help-block">' . $help . '</p>';
     }
     echo '</div>';
     ?>
         </div>
     <?php 
 }
Esempio n. 28
0
 /**
  * rights_get function.
  * 
  * @access public
  * @return void
  */
 public function rights_get()
 {
     if (!$this->auth->loggedin()) {
         redirect('user/login');
     }
     $uid = intval($this->auth->userid());
     $role_id = $this->get('role');
     if (!$role_id) {
         show_error('Invalid request.', 500);
     } else {
         $role_rights = $this->rights_model->get_for_role($role_id);
         $rights_html = ul(array(form_label(form_checkbox(array('name' => 'use_system', 'id' => 'use_system', 'value' => $role_id, 'checked' => $role_rights['use_system'] ? true : false)) . nbs() . ucfirst(lang('use_system')), 'use_system'), form_label(form_checkbox(array('name' => 'add_members', 'id' => 'add_members', 'value' => $role_id, 'checked' => $role_rights['add_members'] ? true : false)) . nbs() . ucfirst(lang('add_members')), 'add_members'), form_label(form_checkbox(array('name' => 'add_users', 'id' => 'add_users', 'value' => $role_id, 'checked' => $role_rights['add_users'] ? true : false)) . nbs() . ucfirst(lang('add_users')), 'add_users')), array('class' => 'no-bullet'));
         $this->output->set_output($rights_html);
     }
 }
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $this->EE->db->select("calendar_id, title");
     $this->EE->db->from("exp_channel_titles");
     $this->EE->db->join("exp_calendar_calendars", "exp_channel_titles.entry_id = exp_calendar_calendars.calendar_id");
     $query = $this->EE->db->get();
     $calendars = array();
     foreach ($query->result_array() as $row) {
         $calendars[$row["calendar_id"]] = $row["title"];
     }
     $config["label"] = form_label($field_label) . NBS . anchor("http://brandnewbox.co.uk/support/details/importing_into_calendar_fields_with_datagrab", "(?)", 'class="help"');
     $config["value"] = "<p>Start time: " . NBS . form_dropdown($field_name . "_calendar_start_time", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_calendar_start_time"]) ? $data["default_settings"]["cf"][$field_name . "_calendar_start_time"] : '') . NBS . "</p>" . "<p>End time: " . NBS . form_dropdown($field_name . "_calendar_end_time", $data["data_fields"], isset($data["default_settings"]["cf"][$field_name . "_calendar_end_time"]) ? $data["default_settings"]["cf"][$field_name . "_calendar_end_time"] : '') . "</p><p>Add to calendar: " . NBS . form_dropdown($field_name, $calendars, isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p>";
     return $config;
 }
 /**
  * Create the form elements to map matrix fields
  *
  * @param string $field_name 
  * @param string $field_label 
  * @param string $field_type 
  * @param string $data 
  * @return void
  * @author Andrew Weaver
  */
 function display_configuration($field_name, $field_label, $field_type, $data)
 {
     $config = array();
     $config["label"] = form_label($field_label) . BR . anchor("http://brandnewbox.co.uk/support/details/datagrab_and_matrix_fields", "(&#946;eta notes)", 'class="help"');
     $this->EE->db->select("col_id, col_label");
     $query = $this->EE->db->get("exp_matrix_cols");
     $matrix_columns = array();
     foreach ($query->result_array() as $row) {
         $matrix_columns[$row["col_id"]] = $row["col_label"];
     }
     $cells = form_hidden($field_name, "1");
     foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) {
         if (isset($data["default_settings"]["cf"][$field_name . "_columns"])) {
             $default_cells = $data["default_settings"]["cf"][$field_name . "_columns"];
         } else {
             $default_cells = array();
         }
         $cells .= "<p>" . $matrix_columns[$col_id] . NBS . ":" . NBS . form_dropdown($field_name . "_columns[" . $col_id . "]", $data["data_fields"], isset($default_cells[$col_id]) ? $default_cells[$col_id] : '') . "</p>";
     }
     $column_options = array();
     $column_options["-1"] = "Delete all existing rows";
     $column_options["0"] = "Keep existing rows and append new";
     $sub_options = array();
     foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) {
         $sub_options[$col_id] = $matrix_columns[$col_id];
     }
     $column_options["Update the row if this column matches:"] = $sub_options;
     $cells .= "<p>" . "Action to take when an entry is updated: " . form_dropdown($field_name . "_unique", $column_options, isset($data["default_settings"]["cf"][$field_name . "_unique"]) ? $data["default_settings"]["cf"][$field_name . "_unique"] : '') . "</p>";
     $config["value"] = $cells;
     return $config;
 }