Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #5496: default mininum year for a date question different…
… in dropdown and popup version git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11197 b72ed6b6-b9f8-46b5-92b4-906544132732
- Loading branch information
Showing
2 changed files
with
92 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,103 @@ | ||
<?php if ( ! defined('BASEPATH')) die('No direct script access allowed'); | ||
|
||
class Users_model extends CI_Model { | ||
|
||
function getAllRecords($condition=FALSE) | ||
{ | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->where($condition); | ||
} | ||
|
||
$data = $this->db->get('users'); | ||
|
||
return $data; | ||
} | ||
|
||
function getSomeRecords($fields,$condition=FALSE) | ||
{ | ||
foreach ($fields as $field) | ||
{ | ||
$this->db->select($field); | ||
} | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->where($condition); | ||
} | ||
|
||
$data = $this->db->get('users'); | ||
return $data; | ||
} | ||
function getAllRecords($condition=FALSE) | ||
{ | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->where($condition); | ||
} | ||
|
||
$data = $this->db->get('users'); | ||
|
||
function getOTPwd($user) | ||
{ | ||
$this->db->select('uid, users_name, password, one_time_pw, dateformat, full_name, htmleditormode'); | ||
$this->db->where('users_name',$user); | ||
$data = $this->db->get('users',1); | ||
|
||
return $data; | ||
} | ||
return $data; | ||
} | ||
|
||
function deleteOTPwd($user) | ||
{ | ||
$data = array( | ||
'one_time_pw' => '' | ||
); | ||
$this->db->where('users_name',$user); | ||
$this->db->update('users',$data); | ||
} | ||
|
||
function insert($new_user, $new_pass,$new_full_name,$parent_user,$new_email) | ||
{ | ||
$this->load->library('admin/sha256','sha256'); | ||
$data=array($new_user, $this->sha256->hashing($new_pass),$new_full_name,$parent_user,$new_email); | ||
$uquery = "INSERT INTO ".$this->db->dbprefix("users")." (users_name, password,full_name,parent_id,lang,email,create_survey,create_user,delete_user,superadmin,configurator,manage_template,manage_label) | ||
VALUES (?, ?, ?, ?, 'auto', ?,0,0,0,0,0,0,0)"; | ||
return $this->db->query($uquery,$data); | ||
} | ||
|
||
function update($uid,$data) | ||
{ | ||
$this->db->where(array("uid"=>$uid)); | ||
return $this->db->update('users',$data); | ||
} | ||
|
||
function updateLang($uid,$postloginlang) | ||
{ | ||
$data = array( | ||
'lang' => $postloginlang | ||
); | ||
$this->db->where(array("uid"=>$uid)); | ||
$this->db->update('users',$data); | ||
} | ||
function getShareSetting() | ||
{ | ||
$this->db->where(array("uid"=>$this->session->userdata('loginID'))); | ||
$result= $this->db->get('users'); | ||
return $result->row(); | ||
} | ||
// Resturns the full name of the user | ||
function getName($userid) | ||
function getSomeRecords($fields,$condition=FALSE) | ||
{ | ||
foreach ($fields as $field) | ||
{ | ||
$this->db->select('full_name'); | ||
$this->db->from('users'); | ||
$this->db->where(array("uid"=>$userid)); | ||
$result = $this->db->get(); | ||
return $result->row(); | ||
$this->db->select($field); | ||
} | ||
function getID($fullname) | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->select('uid'); | ||
$this->db->from('users'); | ||
$this->db->where(array("full_name"=>$fullname)); | ||
$result = $this->db->get(); | ||
return $result->row(); | ||
$this->db->where($condition); | ||
} | ||
function updatePassword($uid,$password) | ||
{ | ||
$data = array('password' => $password); | ||
$this->db->where(array("uid"=>$uid)); | ||
$this->db->update('users',$data); | ||
} | ||
|
||
$data = $this->db->get('users'); | ||
return $data; | ||
} | ||
|
||
function getOTPwd($user) | ||
{ | ||
$this->db->select('uid, users_name, password, one_time_pw, dateformat, full_name, htmleditormode'); | ||
$this->db->where('users_name',$user); | ||
$data = $this->db->get('users',1); | ||
|
||
return $data; | ||
} | ||
|
||
function deleteOTPwd($user) | ||
{ | ||
$data = array( | ||
'one_time_pw' => '' | ||
); | ||
$this->db->where('users_name',$user); | ||
$this->db->update('users',$data); | ||
} | ||
|
||
function insert($new_user, $new_pass,$new_full_name,$parent_user,$new_email) | ||
{ | ||
$this->load->library('admin/sha256','sha256'); | ||
$data=array($new_user, $this->sha256->hashing($new_pass),$new_full_name,$parent_user,$new_email); | ||
$uquery = "INSERT INTO ".$this->db->dbprefix("users")." (users_name, password,full_name,parent_id,lang,email,create_survey,create_user,delete_user,superadmin,configurator,manage_template,manage_label) | ||
VALUES (?, ?, ?, ?, 'auto', ?,0,0,0,0,0,0,0)"; | ||
return $this->db->query($uquery,$data); | ||
} | ||
|
||
function update($uid,$data) | ||
{ | ||
$this->db->where(array("uid"=>$uid)); | ||
return $this->db->update('users',$data); | ||
} | ||
|
||
function updateLang($uid,$postloginlang) | ||
{ | ||
$data = array( | ||
'lang' => $postloginlang | ||
); | ||
$this->db->where(array("uid"=>$uid)); | ||
$this->db->update('users',$data); | ||
} | ||
function getShareSetting() | ||
{ | ||
$this->db->where(array("uid"=>$this->session->userdata('loginID'))); | ||
$result= $this->db->get('users'); | ||
return $result->row(); | ||
} | ||
// Resturns the full name of the user | ||
function getName($userid) | ||
{ | ||
$this->db->select('full_name'); | ||
$this->db->from('users'); | ||
$this->db->where(array("uid"=>$userid)); | ||
$result = $this->db->get(); | ||
return $result->row(); | ||
} | ||
function getID($fullname) | ||
{ | ||
$this->db->select('uid'); | ||
$this->db->from('users'); | ||
$this->db->where(array("full_name"=>$fullname)); | ||
$result = $this->db->get(); | ||
return $result->row(); | ||
} | ||
function updatePassword($uid,$password) | ||
{ | ||
$data = array('password' => $password); | ||
$this->db->where(array("uid"=>$uid)); | ||
$this->db->update('users',$data); | ||
} | ||
|
||
} |