本文整理汇总了PHP中form_upload函数的典型用法代码示例。如果您正苦于以下问题:PHP form_upload函数的具体用法?PHP form_upload怎么用?PHP form_upload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_upload函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: carga
function carga()
{
$salida = '';
//ini_set('upload_max_filesize','2000M');
$salida .= form_open_multipart($this->url . 'guarda');
$salida .= form_upload("archivo", "archivo");
$salida .= form_submit('subir', 'Subir Archivos');
$salida .= form_close();
$data['content'] = $salida;
$data['title'] = 'subedbfr Archivos .dbf Archivos dbf.';
$this->load->view('view_ventanas_sola', $data);
}
示例2: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($params)
{
$this->CI->load->config('files/files');
// Get the file
if ($params['value']) {
$current_file = $this->CI->db->where('id', $params['value'])->limit(1)->get('files')->row();
} else {
$current_file = null;
}
$out = '';
if ($current_file) {
$out .= '<div class="file_info"><span href="#" class="file_remove">X</span><a href="' . base_url('files/download/' . $current_file->id) . '">' . $current_file->name . '</a></div>';
}
// Output the actual used value
if ($params['value']) {
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], 'dummy');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
$this->CI->type->add_js('file', 'filefield.js');
$this->CI->type->add_css('file', 'filefield.css');
return $out .= form_upload($options);
}
示例3: print_input_file_upload
function print_input_file_upload($input)
{
$html = '';
$data = array('name' => $input['name'], 'id' => isset($input['id']) ? $input['id'] : $input['name'], 'tabindex' => isset($input['tabindex']) ? $input['tabindex'] : '', 'value' => $input['value']);
$html .= form_upload($data) . form_hidden($input['name'], $input['value']);
return $html;
}
开发者ID:VeronaFabLabRepo,项目名称:comune-grezzana-app-backend,代码行数:7,代码来源:print_input_file_upload_helper.php
示例4: display_settings
function display_settings()
{
$icon = isset($data['icon']) ? $data['icon'] : $this->settings['icon'];
$retina_icon = isset($data['retina_icon']) ? $data['retina_icon'] : $this->settings['retina_icon'];
ee()->table->add_row(lang('Icon', 'icon'), form_upload('icon', $icon));
ee()->table->add_row(lang('Retina icon', 'retina_icon'), form_upload('retina_icon', $retina_icon));
}
示例5: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($params)
{
$this->CI->load->config('files/files');
// Get the file
$this->CI->db->limit(1);
$this->CI->db->where('id', $params['value']);
$db_obj = $this->CI->db->get('files');
$out = '';
if ($db_obj->num_rows() != 0) {
// Div for the PyroCMS admin
/*if( $this->CI->uri->segment(1) == 'admin' ):
$out .= '<div style="float: left;">';
endif;*/
$out .= $this->_output_thumb($db_obj->row(), true) . br();
} else {
$out .= '';
}
// Output the actual used value
if (is_numeric($params['value'])) {
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], 'dummy');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
//if( $this->CI->uri->segment(1) == 'admin' ): $out .= '</div>'; endif;
return $out .= form_upload($options);
}
示例6: import
public function import($success = "")
{
$data['judul_besar'] = 'PHPExcel';
$data['judul_kecil'] = 'Import';
$data['output'] = "<h4>Sebelum mengupload, pastikan file anda berformat <strong>.xls/.xlsx</strong></h4>";
$data['output'] .= form_open_multipart('php_excel/do_upload');
$form = array('name' => 'userfile', 'style' => 'position:absolute;z-index:2;top:0;left:0;filter: alpha(opacity=0);-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;background-color:transparent;color:transparent;', 'onchange' => "\$('#upload-file-info').html(\$(this).val());");
$data['output'] .= "<div style='position:relative;'>";
$data['output'] .= "<a class='btn btn-primary' href='javascript:;'>";
$data['output'] .= "Browse… " . form_upload($form);
$data['output'] .= "</a>";
$data['output'] .= " ";
$data['output'] .= "<span class='label label-info' id='upload-file-info'></span>";
$data['output'] .= "</div>";
$data['output'] .= "<br>";
$data['output'] .= form_submit('name', 'Go !', 'class = "btn btn-default"');
$data['output'] .= form_close();
if ($success) {
$data['pesan'] = '<div class="alert alert-success alert-dismissible">';
$data['pesan'] .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>';
$data['pesan'] .= '<h4><i class="icon fa fa-check"></i> Alert!</h4>';
$data['pesan'] .= 'Success alert preview. This alert is dismissable.';
$data['pesan'] .= '</div>';
}
$this->load->view('welcome_message', $data, FALSE);
}
示例7: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($params)
{
$count = isset($params['custom']['limit']) ? $params['custom']['limit'] : 1;
$this->CI->load->config('files/files');
$value = !empty($params['value']) ? explode('|', $params['value']) : null;
$out = '';
if ($value and count($value) > 0) {
$out .= '<ul class="list-group">';
foreach ($value as $file) {
$out .= '<li class="list-group-item">';
$out .= '<span class="image_remove" data-file="' . $file . '">X</span>
<a class="image_link" href="' . site_url('files/large/' . $file) . '" target="_break">
<img src="' . site_url('files/thumb/' . $file) . '" height="100" />
</a><br />';
$out .= '</li>';
}
$out .= '</ul>';
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], null);
}
$options['name'] = $params['form_slug'] . '_file[]';
$options['multiple'] = 'multiple';
$out .= form_upload($options);
//}
return $out;
}
示例8: form_upload
function form_upload($data = '', $value = '', $extra = '', $kunci = TRUE)
{
if ($kunci == true) {
return form_upload($data, $value, $extra);
} else {
return $this->form_input($data, $value, $extra, $kunci);
}
}
示例9: test_form_upload
public function test_form_upload()
{
$expected = <<<EOH
<input type="file" name="attachment" value="" />
EOH;
$this->assertEquals($expected, form_upload('attachment'));
}
示例10: showForm
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;
}
示例11: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($params)
{
$this->CI->load->config('files/files');
$out = '';
if (is_numeric($params['value'])) {
$out .= '<img src="' . site_url('files/thumb/' . $params['value']) . '" /><br />';
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], 'dummy');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
return $out .= form_upload($options);
}
示例12: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($params)
{
$this->CI->load->config('files/files');
$out = '';
// if there is content and it is not dummy or cleared
if ($params['value'] and $params['value'] != 'dummy') {
$out .= '<span class="image_remove">X</span><a class="image_link" href="' . site_url('files/large/' . $params['value']) . '" target="_break"><img src="' . site_url('files/thumb/' . $params['value']) . '" /></a><br />';
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], 'dummy');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
return $out .= form_upload($options);
}
示例13: form_output
public function form_output($params)
{
$this->CI->load->config('files/files');
$out = '';
if ($params['value']) {
$value = unserialize($params['value']);
// form
$out .= '<div class="crop_field"><span class="crop_image_remove" data-remove="' . $params['form_slug'] . '">X</span><div id="' . $params['form_slug'] . '_crop_pool" class="crop_pool"><img id="' . $params['form_slug'] . '_crop_img" class="crop_img" data-name="' . $params['form_slug'] . '" src="' . site_url('files/large/' . $value["id"]) . '" /></div></div><br />' . form_hidden($params['form_slug'], $value["id"]) . form_hidden($params['form_slug'] . "_x", $value["x"]) . form_hidden($params['form_slug'] . "_y", $value["y"]) . form_hidden($params['form_slug'] . "_x2", $value["x2"]) . form_hidden($params['form_slug'] . "_y2", $value["y2"]);
} else {
$out .= form_hidden($params['form_slug'], '');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
$this->CI->type->add_js('imagecrop', 'imagecrop.js');
$this->CI->type->add_js('imagecrop', 'jquery.Jcrop.min.js');
$this->CI->type->add_css('imagecrop', 'imagecrop.css');
$this->CI->type->add_css('imagecrop', 'jquery.Jcrop.min.css');
return $out .= form_upload($options);
}
示例14: carga
function carga()
{
$mBANC = array('tabla' => 'banc', 'columnas' => array('codbanc' => 'Cóodigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta', 'saldo' => 'Saldo'), 'filtro' => array('codbanc' => 'Cóodigo', 'banco' => 'Banco', 'saldo' => 'Saldo', 'numcuent' => 'Cuenta'), 'retornar' => array('codbanc' => 'codbanc'), 'titulo' => 'Buscar Bancos');
$bBANC = $this->datasis->modbus($mBANC);
$btn = '<img src="/tortuga/assets/default/images/system-search.png" alt="Busqueda de Bancos" title="Busqueda de Bancos" border="0" />';
$salida = '';
//ini_set('upload_max_filesize','2000M');
$salida .= form_open_multipart($this->url . 'guarda');
$salida .= "<strong>Banco </strong>";
$salida .= form_dropdown('codbanc', $this->datasis->consularray("SELECT codbanc,CONCAT(codbanc,' ',banco,' ||| ',b.nomb_banc,' ',MID(a.numcuent,-4)) a,numcuent FROM banc a JOIN tban b ON a.tbanco=b.cod_banc"));
$salida .= $btn . br();
$salida .= "<strong>Archivo</strong>";
$salida .= form_upload("archivo", "archivo");
$salida .= form_submit('subir', 'Subir Archivos');
$salida .= form_close();
$data['content'] = $salida;
$data["head"] = script('jquery.js');
$data['title'] = 'Importar Archivos de Texto, Archivos txt, csv';
$this->load->view('view_ventanas', $data);
}
示例15: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
function form_output($params)
{
$this->CI->load->config('files/files');
// Get the file
$db_obj = $this->CI->db->where('id', $params['value'])->limit(1)->get('files');
$out = '';
if ($db_obj->num_rows() != 0) {
$out .= $this->_output_link($db_obj->row()) . '<br />';
} else {
$out .= '';
}
// Output the actual used value
if (is_numeric($params['value'])) {
$out .= form_hidden($params['form_slug'], $params['value']);
} else {
$out .= form_hidden($params['form_slug'], 'dummy');
}
$options['name'] = $params['form_slug'];
$options['name'] = $params['form_slug'] . '_file';
return $out .= form_upload($options);
}