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


PHP core::insert方法代码示例

本文整理汇总了PHP中core::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP core::insert方法的具体用法?PHP core::insert怎么用?PHP core::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core的用法示例。


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

示例1: create

 function create()
 {
     $this->load->library('form_validation');
     $this->form_validation->CI =& $this;
     $this->form_validation->set_error_delimiters(' <ul class="help-block"><li class="text-error">', '</li></ul> ');
     if ($this->form_validation->run('create') == FALSE) {
         $data['include'] = $this->load->view('/create/include', '', TRUE);
         $data['content'] = $this->load->view('/create/content', $data, TRUE);
         $this->load->view("admin/main", $data);
     } else {
         core::insert('pbk_groups', 'gammu', array('Name' => $this->input->post('Name')));
         redirect('pbk_group');
     }
 }
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:14,代码来源:pbk_group.php

示例2: create

 function create()
 {
     $this->load->library('form_validation');
     $this->form_validation->CI =& $this;
     $this->form_validation->set_error_delimiters(' <ul class="help-block"><li class="text-error">', '</li></ul> ');
     if ($this->form_validation->run('create') == FALSE) {
         $data['include'] = $this->load->view('/create/include', '', TRUE);
         $data['content'] = $this->load->view('/create/content', $data, TRUE);
         $this->load->view("admin/main", $data);
     } else {
         core::insert('admin', 'gammu', array('username' => $this->input->post('username'), 'email' => $this->input->post('email'), 'password' => sha1(md5($this->input->post('password'))), 'created' => date('Y-m-d H:i:s')));
         redirect('admin');
     }
 }
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:14,代码来源:admin.php

示例3: send_by_number

 function send_by_number()
 {
     $this->load->library('form_validation');
     $this->form_validation->CI =& $this;
     $this->form_validation->set_error_delimiters('<p class="text-alert">', '</p> ');
     $this->form_validation->set_rules('phone', 'Phone', 'required|xss_clean|htmlspecialchars|numeric|trim');
     $this->form_validation->set_rules('message', 'Message', 'required|xss_clean|htmlspecialchars|trim');
     if ($this->form_validation->run() == FALSE) {
         $data['content'] = $this->load->view('send_by_number', '', TRUE);
         $this->load->view('/admin/main', $data);
     } else {
         for ($i = 1; $i <= $this->input->post('total'); $i++) {
             core::insert('outbox', 'gammu', array('DestinationNumber' => $this->input->post('phone'), 'TextDecoded' => $this->input->post('message')));
         }
         $this->session->set_flashdata('success', 'success');
         $this->session->set_flashdata('TotalSend', $t);
         redirect('send_message/send_by_number');
     }
 }
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:19,代码来源:send_message.php

示例4: create

 function create()
 {
     $this->load->library('form_validation');
     $this->form_validation->CI =& $this;
     $this->form_validation->set_error_delimiters('<p class="text-error">', '</p> ');
     if (!empty($_POST['x'])) {
         foreach ($_POST['x'] as $row => $val) {
             $this->form_validation->set_rules("x[{$row}][name]", 'Name', 'required|trim');
             $this->form_validation->set_rules("x[{$row}][phone]", 'Phone', 'required|trim');
         }
     }
     if ($this->form_validation->run() == FALSE) {
         $data['content'] = $this->load->view('/create/content', '', TRUE);
         $this->load->view('/admin/main', $data);
     } else {
         foreach ($_POST['x'] as $row) {
             core::insert('pbk', 'gammu', array('Name' => $row['name'], 'Number' => $row['phone'], 'GroupID' => $row['group']));
         }
         redirect('pbk');
     }
 }
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:21,代码来源:pbk.php

示例5: start

	static function start() /// Launches whole the action after configuration read
	{
		error_reporting(core::$config['error-reporting-lo']);

		foreach ($_COOKIE as $var=>$val) core::$req[$var]= $val;
		if (isset(core::$config['cookie-vars'])) foreach (core::$config['cookie-vars'] as $var=>$config)
		{
			core::$req[$var]= core::filter(core::req($var),$config);
		}

		foreach ($_GET as $var=>$val) if ($var!==session_name()) core::$req[$var]= core::$reqUrl[$var]= $val;
		unset(core::$reqUrl[core::config('module-var')]);
		foreach ($_POST as $var=>$val) if ($var!==session_name()) core::$req[$var]= $val;
		foreach ($_FILES as $var=>$val)
		{
			if (is_string($val['name'])) core::$req[$var]= $val;  // <input type=file name=xxx ...>
			else  // <input type=file name=xxx[yyy] ...>
			{
				foreach ($val['name'] as $key=>$void)
				{
		 			core::$req[$var][$key]= array(
						'name'=>$val['name'][$key],
						'type'=>$val['type'][$key],
						'tmp_name'=>$val['tmp_name'][$key],
						'error'=>$val['error'][$key],
						'size'=>$val['size'][$key]
					);
				}
			}
		}

		if (isset(core::$config['cookie-vars'])) foreach (core::$config['cookie-vars'] as $name=>$config) 
		{
			if (isset(core::$req[$name]))
			{
				core::$req[$name]= core::filter(core::$req[$name], $config);
				if (!isset($_COOKIE[$name]) || $_COOKIE[$name]!=core::$req[$name])
				{
					setcookie($name, core::$req[$name], $config['expire']);
				}
				unset(core::$reqUrl[$name]);
			}
		}
		
		// apply required vars
		if (isset(core::$config['required'])) foreach (core::$config['required'] as $name=>$config)
		{
			core::$req[$name]=  core::filter(core::$req[$name],$comfig);
			core::$reqUrl[$name]= core::$req[$name];
		}
		
		if (!core::moduleName())
		{
			if (is_array(core::$config['default-module']))
			{
				$args= href::processArgs(core::$config['default-module']);
				core::$req[core::$config['module-var']]= $args['template'];
				array_merge(core::$reques,$args['req']);
			}
		}
		core::$req[core::$config['module-var']]= str_replace('..','(dot)(dot)',core::moduleName()); //secure upper directories
		core::$req[core::$config['module-var']]= str_replace("\0",'(0)',core::moduleName()); //secure
		core::$req[core::$config['module-var']]= str_replace('<','(lt)',core::moduleName()); //secure
		core::$req[core::$config['module-var']]= str_replace('>','(gt)',core::moduleName()); //secure

		// set session var
		if (core::req(session_name()) || isset(core::$config['session-vars']))
		{
			if (!session_id()) session_start();
			foreach ($_SESSION as $name=>$val) core::$req[$name]= $val;
			if (isset(core::$config['session-vars'])) foreach (core::$config['session-vars'] as $name=>$config)
			{
				core::$req[$name]= core::filter(core::req($name),$config);
				unset(core::$reqUrl[$name]);
			}
		}

		if (core::req('cms-oper')) cms::perform();
		elseif (core::req('core-module')=='cms-resource') cmsGui::forward(core::req('file'));

		ob_start();
		if (isset(core::$config['pre-models'])) foreach(core::$config['pre-models'] as $model) core::model($model);
		core::insert(core::moduleName());
		$buffer= ob_get_contents();
		ob_end_clean();

		// Process pre- and post-templates
		if (!core::reg('run-naked'))
		{
			ob_start();
			if (isset(core::$config['pre-module'])) core::insert(core::$config['pre-module']);
			echo $buffer;
			if (isset(core::$config['post-module'])) core::insert(core::$config['post-module']);
			if (isset(core::$config['post-models'])) foreach(core::$config['post-models'] as $model) core::model($model);
			$buffer= ob_get_contents();
			ob_end_clean();
		}
		
		// Output
		echo $buffer;
//.........这里部分代码省略.........
开发者ID:Emperor359,项目名称:conkit,代码行数:101,代码来源:core.php


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