当前位置: 首页>>代码示例>>PHP>>正文


PHP form_decode函数代码示例

本文整理汇总了PHP中form_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP form_decode函数的具体用法?PHP form_decode怎么用?PHP form_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了form_decode函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: company_form

 function company_form($id = false)
 {
     $data['activemenu'] = $this->activemenu;
     $data['id'] = $id;
     $data['user_id'] = '';
     $data['email'] = '';
     $data['company_name'] = '';
     $data['fax'] = '';
     $data['phone'] = '';
     $data['address'] = '';
     $data['gps'] = '';
     $data['company_details'] = '';
     $data['website'] = '';
     $data['logo'] = '';
     $data['gst'] = '';
     $data['ssm'] = '';
     $data['active'] = '';
     $data['page_title'] = lang('company_form');
     if ($id) {
         $company = $this->Company_model->get_company_by_id($id);
         //fully escape the address
         form_decode($company);
         //merge the array
         $data = array_merge($data, $company);
     }
     $this->load->library('form_validation');
     $this->form_validation->set_rules('company_name', 'lang:firstname', 'trim|required|max_length[255]');
     $this->form_validation->set_rules('phone', 'lang:phone', 'trim|required|max_length[32]');
     $this->form_validation->set_rules('address', 'lang:address', 'trim|required|max_length[255]');
     $this->form_validation->set_rules('gps', 'lang:gps', 'trim|required|max_length[255]');
     $this->form_validation->set_rules('email', 'lang:email', 'trim|valid_email|max_length[255]');
     $this->form_validation->set_rules('fax', 'lang:fax', 'trim');
     $this->form_validation->set_rules('company_details', 'lang:company_details', 'trim');
     $this->form_validation->set_rules('website', 'lang:website', 'trim');
     $this->form_validation->set_rules('logo', 'lang:logo', 'trim');
     $this->form_validation->set_rules('gst', 'lang:gst', 'trim');
     $this->form_validation->set_rules('ssm', 'lang:ssm', 'trim');
     $this->form_validation->set_rules('active', 'lang:active', 'trim');
     if ($this->form_validation->run() == FALSE) {
         $this->view($this->config->item('admin_folder') . '/company_form', $data);
     } else {
         $a['user_id'] = 0;
         $a['id'] = empty($id) ? '' : $id;
         $a['email'] = $this->input->post('email');
         $a['company_name'] = $this->input->post('company_name');
         $a['fax'] = $this->input->post('fax');
         $a['phone'] = $this->input->post('phone');
         $a['address'] = $this->input->post('address');
         $a['gps'] = $this->input->post('gps');
         $a['company_details'] = $this->input->post('company_details');
         $a['website'] = $this->input->post('website');
         $a['logo'] = $this->input->post('logo');
         $a['gst'] = $this->input->post('gst');
         $a['ssm'] = $this->input->post('ssm');
         $a['active'] = 1;
         $this->Company_model->save_company($a);
         $this->session->set_flashdata('message', lang('message_saved_company'));
         redirect($this->config->item('admin_folder') . '/company/');
     }
 }
开发者ID:beebee1987,项目名称:sunhope,代码行数:60,代码来源:company.php

示例2: branch_form

 function branch_form($id = false)
 {
     $data['activemenu'] = $this->activemenu;
     $data['id'] = $id;
     $data['name'] = '';
     $data['active'] = '';
     $data['page_title'] = lang('branch_form');
     if ($id) {
         $branch = $this->Branch_model->get_branch_by_id($id);
         //fully escape the address
         form_decode($branch);
         //merge the array
         $data = array_merge($data, $branch);
     }
     $this->load->library('form_validation');
     $this->form_validation->set_rules('name', 'lang:name', 'trim|required|max_length[255]');
     $this->form_validation->set_rules('address', 'lang:address', 'trim');
     $this->form_validation->set_rules('phone', 'lang:phone', 'trim');
     $this->form_validation->set_rules('active', 'lang:active', 'trim');
     if ($this->form_validation->run() == FALSE) {
         $this->view($this->config->item('admin_folder') . '/branch_form', $data);
     } else {
         $a['id'] = empty($id) ? '' : $id;
         $a['name'] = $this->input->post('name');
         $a['address'] = $this->input->post('address');
         $a['phone'] = $this->input->post('phone');
         $a['active'] = 1;
         $this->Branch_model->save_branch($a);
         $this->session->set_flashdata('message', lang('message_saved_branch'));
         redirect($this->config->item('admin_folder') . '/branch/');
     }
 }
开发者ID:beebee1987,项目名称:sunhope,代码行数:32,代码来源:branch.php

示例3: form_decode

function form_decode(&$x)
{
    //loop through objects or arrays
    if (is_array($x) || is_object($x)) {
        foreach ($x as &$y) {
            $y = form_decode($y);
        }
    }
    if (is_string($x)) {
        $x = full_decode($x);
    }
    return $x;
}
开发者ID:Joncg,项目名称:eelly_cps_fx,代码行数:13,代码来源:MY_string_helper.php

示例4: count

			</tr>
		</thead>
		<tbody>
		<?php 
echo count($products) < 1 ? '<tr><td style="text-align:center;" colspan="7">' . lang('no_products') . '</td></tr>' : '';
?>
	<?php 
foreach ($products as $product) {
    ?>
			<tr>
				<td><?php 
    echo form_input(array('name' => 'product[' . $product->id . '][sku]', 'value' => form_decode($product->sku), 'class' => 'span1'));
    ?>
</td>
				<td><?php 
    echo form_input(array('name' => 'product[' . $product->id . '][name]', 'value' => form_decode($product->name), 'class' => 'span2'));
    ?>
</td>
				<td><?php 
    echo form_input(array('name' => 'product[' . $product->id . '][price]', 'value' => set_value('price', $product->price), 'class' => 'span1'));
    ?>
</td>
				<td><?php 
    echo form_input(array('name' => 'product[' . $product->id . '][saleprice]', 'value' => set_value('saleprice', $product->saleprice), 'class' => 'span1'));
    ?>
</td>
				<td><?php 
    echo (bool) $product->track_stock ? form_input(array('name' => 'product[' . $product->id . '][quantity]', 'value' => set_value('quantity', $product->quantity), 'class' => 'span1')) : 'N/A';
    ?>
</td>
				<td>
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:31,代码来源:products.php

示例5: address_form

 function address_form($customer_id, $id = false)
 {
     $data['id'] = $id;
     $data['company'] = '';
     $data['firstname'] = '';
     $data['lastname'] = '';
     $data['email'] = '';
     $data['phone'] = '';
     $data['address1'] = '';
     $data['address2'] = '';
     $data['city'] = '';
     $data['country_id'] = '';
     $data['zone_id'] = '';
     $data['zip'] = '';
     $data['customer_id'] = $customer_id;
     $data['page_title'] = lang('address_form');
     //get the countries list for the dropdown
     $data['countries_menu'] = $this->Location_model->get_countries_menu();
     if ($id) {
         $address = $this->Customer_model->get_address($id);
         //fully escape the address
         form_decode($address);
         //merge the array
         $data = array_merge($data, $address);
         $data['zones_menu'] = $this->Location_model->get_zones_menu($data['country_id']);
     } else {
         //if there is no set ID, the get the zones of the first country in the countries menu
         $data['zones_menu'] = $this->Location_model->get_zones_menu(array_shift(array_keys($data['countries_menu'])));
     }
     $this->load->library('form_validation');
     $this->form_validation->set_rules('company', 'lang:company', 'trim|max_length[128]');
     $this->form_validation->set_rules('firstname', 'lang:firstname', 'trim|required|max_length[32]');
     $this->form_validation->set_rules('lastname', 'lang:lastname', 'trim|required|max_length[32]');
     $this->form_validation->set_rules('email', 'lang:email', 'trim|required|valid_email|max_length[128]');
     $this->form_validation->set_rules('phone', 'lang:phone', 'trim|required|max_length[32]');
     $this->form_validation->set_rules('address1', 'lang:address', 'trim|required|max_length[128]');
     $this->form_validation->set_rules('address2', 'lang:address', 'trim|max_length[128]');
     $this->form_validation->set_rules('city', 'lang:city', 'trim|required');
     $this->form_validation->set_rules('country_id', 'lang:country', 'trim|required');
     $this->form_validation->set_rules('zone_id', 'lang:state', 'trim|required');
     $this->form_validation->set_rules('zip', 'lang:postcode', 'trim|required|max_length[32]');
     if ($this->form_validation->run() == FALSE) {
         $this->load->view($this->config->item('admin_folder') . '/customer_address_form', $data);
     } else {
         $a['customer_id'] = $customer_id;
         // this is needed for new records
         $a['id'] = empty($id) ? '' : $id;
         $a['field_data']['company'] = $this->input->post('company');
         $a['field_data']['firstname'] = $this->input->post('firstname');
         $a['field_data']['lastname'] = $this->input->post('lastname');
         $a['field_data']['email'] = $this->input->post('email');
         $a['field_data']['phone'] = $this->input->post('phone');
         $a['field_data']['address1'] = $this->input->post('address1');
         $a['field_data']['address2'] = $this->input->post('address2');
         $a['field_data']['city'] = $this->input->post('city');
         $a['field_data']['zip'] = $this->input->post('zip');
         $a['field_data']['zone_id'] = $this->input->post('zone_id');
         $a['field_data']['country_id'] = $this->input->post('country_id');
         $country = $this->Location_model->get_country($this->input->post('country_id'));
         $zone = $this->Location_model->get_zone($this->input->post('zone_id'));
         $a['field_data']['zone'] = $zone->code;
         // save the state for output formatted addresses
         $a['field_data']['country'] = $country->name;
         // some shipping libraries require country name
         $a['field_data']['country_code'] = $country->iso_code_2;
         // some shipping libraries require the code
         $this->Customer_model->save_address($a);
         $this->session->set_flashdata('message', lang('message_saved_address'));
         redirect($this->config->item('admin_folder') . '/customers/addresses/' . $customer_id);
     }
 }
开发者ID:Joncg,项目名称:eelly_cps_fx,代码行数:71,代码来源:customers.php

示例6: form_decode

    ?>
</td>
                                        <td><?php 
    echo form_decode($she->start_time);
    ?>
</td>
                                        <td><?php 
    echo form_decode($she->finish_time);
    ?>
</td>
                                        <td><?php 
    echo form_decode($she->price);
    ?>
</td>
                                        <td><?php 
    echo form_decode($she->saleprice);
    ?>
</td>
                                        <td><a class="btn btn-danger" onclick="delete_schedule_admin(<?php 
    echo $she->id;
    ?>
);"><i class="icon-trash icon-white"></i> <?php 
    echo lang('delete');
    ?>
</a></td>
                                    </tr>    
                                    <?php 
}
?>
                                </tbody>
                            </table>    
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:31,代码来源:my_account.php

示例7: form_decode

    ?>
">
                                                        <td><?php 
    echo form_decode($pkg->type_package) . " Months";
    ?>
</td>
                                                        <td><?php 
    echo form_decode($pkg->weekly_session);
    ?>
</td>
                                                        <td><?php 
    echo form_decode($pkg->price);
    ?>
</td>
                                                        <td><?php 
    echo form_decode($pkg->description1);
    ?>
</td>
                                                         
                                                    </tr>    
                                            <?php 
}
?>
                                            </tbody>
                                        </table>    
                                </div>  
                            </div>
		</div>			
	</div>
</div>
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:30,代码来源:reports.php

示例8: count

			</tr>
		</thead>
		<tbody>
		<?php 
echo count($courses) < 1 ? '<tr><td style="text-align:center;" colspan="7">' . lang('no_courses') . '</td></tr>' : '';
?>
	<?php 
foreach ($courses as $course) {
    ?>
			<tr>
				<td><?php 
    echo form_input(array('name' => 'course[' . $course->id . '][name]', 'value' => form_decode($course->name), 'class' => 'span2'));
    ?>
</td>
				<td><?php 
    echo form_input(array('name' => 'course[' . $course->id . '][trainer]', 'value' => form_decode($course->id_trainner), 'class' => 'span2'));
    ?>
</td>
				<td>
					<?php 
    $options = array('1' => lang('enabled'), '0' => lang('disabled'));
    echo form_dropdown('course[' . $course->id . '][enabled]', $options, set_value('enabled', $course->enabled), 'class="span2"');
    ?>
				</td>
				<td>
					<span class="btn-group pull-right">
						<a class="btn" href="<?php 
    echo site_url($this->config->item('admin_folder') . '/courses/form/' . $course->id);
    ?>
"><i class="icon-pencil"></i>  <?php 
    echo lang('edit');
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:31,代码来源:courses.php


注:本文中的form_decode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。