Skip to content

Instantly share code, notes, and snippets.

@srinathweb
Created November 15, 2014 09:00
Show Gist options
  • Save srinathweb/0299e40c8aef520a9906 to your computer and use it in GitHub Desktop.
Save srinathweb/0299e40c8aef520a9906 to your computer and use it in GitHub Desktop.
java
<?php
/**
*
*/
class Registration_model extends CI_Model {
/**
* [__construct description]
*/
function __construct()
{
parent::__construct();
}
/**
* [index description]
* @return [type] [description]
*/
function index()
{
$data['page_title'] = 'Registration';
$this->load->view('client/general/head',$data);
$this->load->view('client/general/header');
$this->load->view('registration');
$this->load->view('client/general/footer');
}
/**
* [busregister description]
* @return [type] [description]
*/
function busregister()
{
$data['page_title'] = 'Registration';
$this->load->view('business/registration1');
}
/**
* ggggggggg
* @param [type] $un [description]
* @param [type] $email [description]
* @param [type] $pwd [description]
* @param [type] $utype [description]
* @return [type] [description]
*/
public function save_registration($un,$email,$pwd,$utype)
{
try
{
$data = array(
'username' => $un,
'password' => $pwd,
'email' => $email
);
//print_r($data);
//die();
$this->load->database();
$this->db->reconnect();
if($utype=='buss')
{
$dbRet=$this->db->insert('business', $data);
}
else
{
$dbRet-$this->db->insert('user', $data);
}
if (!$dbRet) {
$ret['ErrorMessage'] = $this->db->_error_message();
$ret['ErrorNumber'] = $this->db->_error_number();
log_message('error', "DB Error: (".$ret['ErrorNumber'].") ".$ret['ErrorMessage']);
$this->db->close();
return $ret['ErrorNumber'];
}
else{
$rid=$this->db->insert_id();
$this->db->close();
return $rid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment