本文整理汇总了PHP中form_upload函数的典型用法代码示例。如果您正苦于以下问题:PHP form_upload函数的具体用法?PHP form_upload怎么用?PHP form_upload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_upload函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:enderochoa,项目名称:tortuga,代码行数:12,代码来源:subedbf.php
示例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);
}
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:32,代码来源:field.file.php
示例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));
}
开发者ID:arvenzis,项目名称:EE210,代码行数:7,代码来源:ft.icon_selector.php
示例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);
}
开发者ID:gamchantoi,项目名称:sisfo-ft,代码行数:37,代码来源:field.image.php
示例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);
}
开发者ID:heruprambadi,项目名称:ci_phpexcel,代码行数:26,代码来源:Php_excel.php
示例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;
}
开发者ID:jacksun101,项目名称:PyroAddons,代码行数:34,代码来源:field.multiimage.php
示例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);
}
}
开发者ID:budhinusa,项目名称:kurcaci,代码行数:8,代码来源:form_eksternal.php
示例9: test_form_upload
public function test_form_upload()
{
$expected = <<<EOH
<input type="file" name="attachment" value="" />
EOH;
$this->assertEquals($expected, form_upload('attachment'));
}
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:8,代码来源:form_helper_test.php
示例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;
}
开发者ID:polarity,项目名称:CISSFormung,代码行数:51,代码来源:Formung.php
示例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);
}
开发者ID:namdum,项目名称:pyrocms,代码行数:21,代码来源:field.image.php
示例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);
}
开发者ID:nockout,项目名称:tshpro,代码行数:22,代码来源:field.image.php
示例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);
}
开发者ID:jacksun101,项目名称:PyroAddons,代码行数:19,代码来源:field.imagecrop.php
示例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);
}
开发者ID:enderochoa,项目名称:tortuga,代码行数:20,代码来源:subetxt.php
示例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);
}
开发者ID:gamchantoi,项目名称:sisfo-ft,代码行数:28,代码来源:field.file.php
示例16: index
public function index()
{
$this->load->helper('form');
echo form_open_multipart('/crop') . form_upload('upload_photo') . form_submit() . form_close();
if (isset($_FILES['upload_photo'])) {
$dir = $crop_view['dir'] = time();
mkdir("photos/" . $dir);
move_uploaded_file($_FILES['upload_photo']['tmp_name'], "photos/" . $dir . "/" . $_FILES['upload_photo']['name']);
$src = imagecreatefromjpeg("photos/" . $dir . "/" . $_FILES['upload_photo']['name']);
$maxpix = 800;
$width = imagesx($src);
$height = imagesy($src);
$k = 1;
if ($width <= $height and $height > $maxpix) {
$k = $height / $maxpix;
}
if ($width > $height and $width > $maxpix) {
$k = $width / $maxpix;
}
$crop_view["height"] = $thumb_height = $height / $k;
$crop_view["width"] = $thumb_width = $width / $k;
if ($width > $maxpix or $height > $maxpix) {
$thumb = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($thumb, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height);
} else {
$thumb = $src;
}
imagejpeg($thumb, "photos/" . $dir . "/thumb.jpg", 95);
$this->load->view("crop_view", $crop_view);
}
if (isset($_POST['crop'])) {
$dir = $this->input->post('dir');
$thumb = imagecreatefromjpeg("photos/" . $dir . "/thumb.jpg");
$ava = imagecreatetruecolor(100, 100);
$result = imagecopyresampled($ava, $thumb, 0, 0, $_POST['x1'], $_POST['y1'], 100, 100, $_POST['w'], $_POST['h']);
imagejpeg($ava, "photos/" . $dir . "/ava.jpg", 95);
}
}
开发者ID:alex1442,项目名称:000dn,代码行数:38,代码来源:crop.php
示例17: field
/**
* Creates a file field
*
* @param string $field_name The name of the field
* @param string $data The data stored in the file field
* e.g. {filedir_x}filename.ext
* @param string $allowed_file_dirs The allowed file directory
* Either 'all' or ONE directory ID
* @param string $content_type The content type allowed.
* Either 'all' or 'image'
* @return string Fully rendered file field
*/
public function field($field_name, $data = '', $allowed_file_dirs = 'all', $content_type = 'all', $view_type = 'list')
{
// Load necessary library, helper, model and langfile
$this->EE->load->library('filemanager');
$this->EE->load->helper(array('html', 'form'));
$this->EE->load->model(array('file_model', 'file_upload_preferences_model'));
$this->EE->lang->loadfile('fieldtypes');
$vars = array('filedir' => '', 'filename' => '', 'upload_location_id' => '');
$allowed_file_dirs = $allowed_file_dirs == 'all' ? '' : $allowed_file_dirs;
$specified_directory = $allowed_file_dirs == '' ? 'all' : $allowed_file_dirs;
// Parse field data
if (!empty($data) and ($parsed_field = $this->parse_field($data)) !== FALSE) {
$vars = $parsed_field;
$vars['filename'] = $vars['filename'] . '.' . $vars['extension'];
}
// Retrieve all directories that are both allowed for this user and
// for this field
$upload_dirs[''] = lang('directory');
$upload_dirs = $this->EE->file_upload_preferences_model->get_dropdown_array($this->EE->session->userdata('group_id'), $allowed_file_dirs, $upload_dirs);
// Get the thumbnail
$thumb_info = $this->EE->filemanager->get_thumb($vars['filename'], $vars['upload_location_id']);
$vars['thumb'] = $thumb_info['thumb'];
$vars['alt'] = $vars['filename'];
// Create the hidden fields for the file and directory
$vars['hidden'] = form_hidden($field_name . '_hidden', $vars['filename']);
$vars['hidden'] .= form_hidden($field_name . '_hidden_dir', $vars['upload_location_id']);
// Create a standard file upload field and dropdown for folks
// without javascript
$vars['upload'] = form_upload(array('name' => $field_name, 'value' => $vars['filename'], 'data-content-type' => $content_type, 'data-directory' => $specified_directory));
$vars['dropdown'] = form_dropdown($field_name . '_directory', $upload_dirs, $vars['upload_location_id']);
// Check to see if they have access to any directories to create an upload link
$vars['upload_link'] = count($upload_dirs) > 0 ? '<a href="#" class="choose_file" data-directory="' . $specified_directory . '">' . lang('add_file') . '</a>' : lang('directory_no_access');
// If we have a file, show the thumbnail, filename and remove link
$vars['set_class'] = $vars['filename'] ? '' : 'js_hide';
return $this->EE->load->ee_view('_shared/file/field', $vars, TRUE);
}
开发者ID:thomasvandoren,项目名称:teentix-site,代码行数:48,代码来源:File_field.php
示例18: form_dropdown
echo form_dropdown('category_id', $options, $post->category_id, 'id="category_id"');
?>
</div>
</li>
<li class="editor">
<label for="description">Description <span>*</span></label><br>
<div class="edit-content">
<?php
echo form_textarea(array('id' => 'description', 'name' => 'description', 'value' => $post->description, 'rows' => 30, 'class' => 'wysiwyg-simple'));
?>
</div>
</li>
<li>
<label for="image">Image <span>*</span></label>
<div class="input"><?php
echo form_upload('image');
?>
</div>
<?php
if ($this->method == 'edit' && !empty($post->thumb)) {
?>
<br /><a href="<?php
echo $post->image;
?>
" class="modal cboxElement"><img src="<?php
echo $post->thumb;
?>
" /></a>
<?php
}
开发者ID:blekedeg,项目名称:lbhpers,代码行数:31,代码来源:form.php
示例19: form_label
</div>
<div class="form-group">
<?php
echo form_label('Description', 'desc');
?>
<?php
$attrs = array('name' => 'desc', 'id' => 'desc', 'class' => 'form-control', 'placeholder' => 'Add a Description');
?>
<?php
echo form_textarea($attrs);
?>
</div>
<div class="form-group">
<?php
echo form_label('Add a Logo', 'logo');
?>
<?php
$attrs = array('name' => 'logo', 'id' => 'logo', 'class' => 'form-control', 'placeholder' => 'Brand Logo');
?>
<?php
echo form_upload($attrs);
?>
</div>
<?php
echo form_submit('', 'Add Brand', 'class="btn btn-info"');
?>
<?php
echo form_close();
?>
</div>
</div>
开发者ID:PHP-web-artisans,项目名称:ustora_backend,代码行数:31,代码来源:new_brand.php
示例20: form_format
?>
<?php
echo form_format("Username: ", $user_name);
?>
<?php
echo form_format("Email: ", form_input('user_email', $user_email, 'class="txt"'));
?>
<?php
echo form_format("OpenID: ", form_input('user_openid', $user_openid, 'class="txt"'));
?>
<?php
echo isset($avatar_image_name) ? "<br /><img src=\"./avatars/<?={$avatar_image_name};/>\"" : '';
?>
<?php
echo form_format("Avatar: ", form_upload('userfile', $user_avatar, 'class="txt"'), 'must be less then 1024 kb & 1024px768px (image will be resized)');
?>
<?php
echo isset($avatar_image_name) ? form_hidden('old_avatar', './avatars/' . $avatar_image_name) : '';
?>
<br /><br />
<?php
echo form_submit('', 'Update Profile', 'class="button"');
?>
<?php
echo form_close();
?>
</div>
<? } ?>
</div>
<? $this->load->view('view_includes/footer.php'); ?>
开发者ID:holsinger,项目名称:openfloor,代码行数:31,代码来源:view_user_profile.php
注:本文中的form_upload函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论