';
+
+ $this->pagination->initialize ( $config );
+ $page = $config ['per_page'];
+ $segment = $this->uri->segment ( $segment );
+
+ return array (
+ "page" => $page,
+ "segment" => $segment
+ );
+ }
+}
\ No newline at end of file
diff --git a/application/models/Dashboard_Model.php b/application/models/Dashboard_Model.php
new file mode 100644
index 0000000..69adc5d
--- /dev/null
+++ b/application/models/Dashboard_Model.php
@@ -0,0 +1,69 @@
+db->insert('Tab_CountryMaster',$CountryMasterDatas);
+ $CountryMaster = $this->db->affected_rows();
+
+ return $CountryMaster;
+ }
+
+ /**
+ * To store City Related details into 'Tab_CityMaster' table
+ * @param array $CityMasterDatas : Its have all the City master datas
+ * @return $CityMaster : This will return how many value are inserted (return as count)
+ */
+ function Add_CityMaster($CityMasterDatas)
+ {
+
+ $this->db->insert('Tab_CityMaster',$CityMasterDatas);
+ $CityMaster = $this->db->affected_rows();
+
+ return $CityMaster;
+ }
+
+
+ /**
+ * To store VisaType Related details into 'Tab_VisaTypeMaster' table
+ * @param array $VisaTypeMasterDatas : Its have all the City master datas
+ * @return $CityMaster : This will return how many value are inserted (return as count)
+ */
+ function Add_VisaType($VisaTypeMasterDatas)
+ {
+ $this->db->insert('Tab_VisaTypeMaster',$VisaTypeMasterDatas);
+ $VisaTypeMaster = $this->db->affected_rows();
+
+ return $VisaTypeMaster;
+ }
+
+ /**
+ * To store Document Related details into 'Tab_Documents' table
+ * @param array $DocumentMasterDatas : Its have all the document master datas
+ * @return $Documents : This will return how many value are inserted (return as count)
+ */
+ function Add_Document($DocumentMasterDatas)
+ {
+ $this->db->insert('Tab_Documents',$DocumentMasterDatas);
+ $Documents = $this->db->affected_rows();
+
+ return $Documents;
+ }
+
+ function Get_CountryMaster()
+ {
+ $this->db->select('*');
+ $this->db->from('Tab_CountryMaster');
+ $query = $this->db->get();
+ $CountryMasterDatas = $query->result();
+ return $CountryMasterDatas;
+ }
+
+}
\ No newline at end of file
diff --git a/application/models/Home_Model.php b/application/models/Home_Model.php
deleted file mode 100755
index d325b88..0000000
--- a/application/models/Home_Model.php
+++ /dev/null
@@ -1,20 +0,0 @@
-load->database();
-
- }
-
- function NewListing()
- {
- $this->db->from('actor');
- $query = $this->db->get();
- $result = $query->result();
- return $result;
- }
-
-}
-?>
\ No newline at end of file
diff --git a/application/models/Login_Model.php b/application/models/Login_Model.php
new file mode 100644
index 0000000..9024770
--- /dev/null
+++ b/application/models/Login_Model.php
@@ -0,0 +1,137 @@
+db->select('BaseTbl.userId, BaseTbl.password, BaseTbl.name, BaseTbl.roleId, Roles.role');
+ $this->db->from('Tab_Users as BaseTbl');
+ $this->db->join('Tab_Roles as Roles','Roles.roleId = BaseTbl.roleId');
+ $this->db->where('BaseTbl.email', $email);
+ $this->db->where('BaseTbl.isDeleted', 0);
+ $query = $this->db->get();
+
+ $user = $query->row();
+
+ if(!empty($user)){
+ if(verifyHashedPassword($password, $user->password)){
+ return $user;
+ } else {
+ return array();
+ }
+ } else {
+ return array();
+ }
+ }
+
+ /**
+ * This function used to check email exists or not
+ * @param {string} $email : This is users email id
+ * @return {boolean} $result : TRUE/FALSE
+ */
+ function checkEmailExist($email)
+ {
+ $this->db->select('userId');
+ $this->db->where('email', $email);
+ $this->db->where('isDeleted', 0);
+ $query = $this->db->get('Tab_Users');
+
+ if ($query->num_rows() > 0){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * This function used to insert reset password data
+ * @param {array} $data : This is reset password data
+ * @return {boolean} $result : TRUE/FALSE
+ */
+ function resetPasswordUser($data)
+ {
+ $result = $this->db->insert('Tab_ResetPassword', $data);
+
+ if($result) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+ }
+
+ /**
+ * This function is used to get customer information by email-id for forget password email
+ * @param string $email : Email id of customer
+ * @return object $result : Information of customer
+ */
+ function getCustomerInfoByEmail($email)
+ {
+ $this->db->select('userId, email, name');
+ $this->db->from('Tab_Users');
+ $this->db->where('isDeleted', 0);
+ $this->db->where('email', $email);
+ $query = $this->db->get();
+
+ return $query->result();
+ }
+
+ /**
+ * This function used to check correct activation deatails for forget password.
+ * @param string $email : Email id of user
+ * @param string $activation_id : This is activation string
+ */
+ function checkActivationDetails($email, $activation_id)
+ {
+ $this->db->select('id');
+ $this->db->from('Tab_ResetPassword');
+ $this->db->where('email', $email);
+ $this->db->where('activation_id', $activation_id);
+ $query = $this->db->get();
+ return $query->num_rows();
+ }
+
+ // This function used to create new password by reset link
+ function createPasswordUser($email, $password)
+ {
+ $this->db->where('email', $email);
+ $this->db->where('isDeleted', 0);
+ $this->db->update('Tab_Users', array('password'=>getHashedPassword($password)));
+ $this->db->delete('Tab_ResetPassword', array('email'=>$email));
+ }
+
+ /**
+ * This function used to save login information of user
+ * @param array $loginInfo : This is users login information
+ */
+ function lastLogin($loginInfo)
+ {
+ $this->db->trans_start();
+ $this->db->insert('Tab_LastLogin', $loginInfo);
+ $this->db->trans_complete();
+ }
+
+ /**
+ * This function is used to get last login info by user id
+ * @param number $userId : This is user id
+ * @return number $result : This is query result
+ */
+ function lastLoginInfo($userId)
+ {
+ $this->db->select('BaseTbl.createdDtm');
+ $this->db->where('BaseTbl.userId', $userId);
+ $this->db->order_by('BaseTbl.id', 'DESC');
+ $this->db->limit(1);
+ $query = $this->db->get('Tab_LastLogin as BaseTbl');
+
+ return $query->row();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/application/models/Login_model.php b/application/models/Login_model.php
deleted file mode 100755
index 6778a2f..0000000
--- a/application/models/Login_model.php
+++ /dev/null
@@ -1,124 +0,0 @@
-db->select('BaseTbl.userId, BaseTbl.password, Emp.EmpID,Emp.FirstName,Emp.Designation, BaseTbl.roleId, Roles.role,DEPT.DEPCode,DEPT.DepartmentName,DEPT.HeadDept');
- $this->db->from('tbl_users as BaseTbl');
- $this->db->join('tbl_roles as Roles','Roles.roleId = BaseTbl.roleId');
- $this->db->join('T_Employee_Details as Emp','BaseTbl.EmpID = Emp.EmpID');
- $this->db->join('T_DepartmentDetails as DEPT','Emp.Departmentcode = DEPT.DEPCode');
- $this->db->where('BaseTbl.isDeleted !=',1);
- $this->db->where('BaseTbl.email', $email);
- $this->db->or_where('Emp.ContactNumber', $email);
- $this->db->where('BaseTbl.isDeleted !=',1);
-
- $query = $this->db->get();
-
-
- $user = $query->result();
- print_r($user);die;
- if(!empty($user)){
- if(verifyHashedPassword($password, $user[0]->password)){
- return $user;
- } else {
- return array();
- }
- } else {
- return array();
- }
- }
-
- function Accessdep($EmpID)
- {
-
- $this->db->select('Departmentcode as AssDep');
- $this->db->from('T_AccessDepartments');
- $this->db->where('EmpID', $EmpID);
-
-
- $query = $this->db->get();
- // print_r( $this->db->last_query());
- return $query->result();
- }
- /**
- * get the user dtl
- */
- function getuserid($mobileno,$emailid)
- {
- $this->db->select('UsrTbl.userId,UsrTbl.email,EmpTbl.ContactNumber,EmpTbl.FirstName');
- $this->db->from('tbl_users as UsrTbl');
- $this->db->join('T_Employee_Details as EmpTbl','UsrTbl.EmpID = EmpTbl.EmpID');
- $this->db->where('EmpTbl.ContactNumber', $mobileno);
- $this->db->where('UsrTbl.email',$emailid);
- $this->db->where('UsrTbl.isDeleted', 0);
- $res = $this->db->get();
- return $res->result();
-
- }
-
- /**
- * To update opt in our database
- **/
- function temp2($userId,$otp){
- $this->db->set('OTP',$otp);
- $this->db->where('userId',$userId);
- $this->db->update('tbl_users');
- $count = $this->db->affected_rows();
-
- if($count > 0)
- {
- $subQuery = "select OTP from tbl_users where userId = '".$userId."'";
- $query = $this->db->query($subQuery);
- return $query->result();
- }
- }
-
- /**
- * To get user id
- **/
- function getuserdtl($phno){
- $this->db->select('BaseTbl.userId');
- $this->db->from('tbl_users as BaseTbl');
- $this->db->join('T_Employee_Details as Emp','BaseTbl.EmpID = Emp.EmpID');
- $this->db->where('Emp.ContactNumber', $phno);
- $query = $this->db->get();
- $result = $query->result();
- return $result;
- }
-
- /**
- * To update password and otp
- **/
- function resetpassword($Array,$userid){
-
- $this->db->where('userId',$userid);
- $this->db->update('tbl_users',$Array);
- $count = $this->db->affected_rows();
- return $count;
-
- }
-
- /**
- * To update password only
- **/
- function updatepassword($userid,$password){
-
- $this->db->set('password',$password);
- $this->db->where('userId',$userid);
- $this->db->update('tbl_users');
- $count = $this->db->affected_rows();
- return $count;
-
- }
-
-}
-
-?>
diff --git a/application/models/NewModel.php b/application/models/NewModel.php
deleted file mode 100755
index bacee09..0000000
--- a/application/models/NewModel.php
+++ /dev/null
@@ -1,25 +0,0 @@
-load->database();
-
- }
-
- function NewListing()
- {
- $this->db->from('actor');
- $query = $this->db->get();
- $result = $query->result();
- return $result;
- }
-
-}
-?>
\ No newline at end of file
diff --git a/application/models/User_Model.php b/application/models/User_Model.php
new file mode 100644
index 0000000..48f7f6d
--- /dev/null
+++ b/application/models/User_Model.php
@@ -0,0 +1,268 @@
+db->select('BaseTbl.userId, BaseTbl.email, BaseTbl.name, BaseTbl.mobile, Role.role');
+ $this->db->from('Tab_Users as BaseTbl');
+ $this->db->join('Tab_Roles as Role', 'Role.roleId = BaseTbl.roleId','left');
+ if(!empty($searchText)) {
+ $likeCriteria = "(BaseTbl.email LIKE '%".$searchText."%'
+ OR BaseTbl.name LIKE '%".$searchText."%'
+ OR BaseTbl.mobile LIKE '%".$searchText."%')";
+ $this->db->where($likeCriteria);
+ }
+ $this->db->where('BaseTbl.isDeleted', 0);
+ $this->db->where('BaseTbl.roleId !=', 1);
+ $query = $this->db->get();
+
+ return $query->num_rows();
+ }
+
+ /**
+ * This function is used to get the user listing count
+ * @param string $searchText : This is optional search text
+ * @param number $page : This is pagination offset
+ * @param number $segment : This is pagination limit
+ * @return array $result : This is result
+ */
+ function userListing($searchText = '', $page, $segment)
+ {
+ $this->db->select('BaseTbl.userId, BaseTbl.email, BaseTbl.name, BaseTbl.mobile, Role.role');
+ $this->db->from('Tab_Users as BaseTbl');
+ $this->db->join('Tab_Roles as Role', 'Role.roleId = BaseTbl.roleId','left');
+ if(!empty($searchText)) {
+ $likeCriteria = "(BaseTbl.email LIKE '%".$searchText."%'
+ OR BaseTbl.name LIKE '%".$searchText."%'
+ OR BaseTbl.mobile LIKE '%".$searchText."%')";
+ $this->db->where($likeCriteria);
+ }
+ $this->db->where('BaseTbl.isDeleted', 0);
+ $this->db->where('BaseTbl.roleId !=', 1);
+ $this->db->limit($page, $segment);
+ $query = $this->db->get();
+
+ $result = $query->result();
+ return $result;
+ }
+
+ /**
+ * This function is used to get the user roles information
+ * @return array $result : This is result of the query
+ */
+ function getUserRoles()
+ {
+ $this->db->select('roleId, role');
+ $this->db->from('Tab_Roles');
+ $this->db->where('roleId !=', 1);
+ $query = $this->db->get();
+
+ return $query->result();
+ }
+
+ /**
+ * This function is used to check whether email id is already exist or not
+ * @param {string} $email : This is email id
+ * @param {number} $userId : This is user id
+ * @return {mixed} $result : This is searched result
+ */
+ function checkEmailExists($email, $userId = 0)
+ {
+ $this->db->select("email");
+ $this->db->from("Tab_Users");
+ $this->db->where("email", $email);
+ $this->db->where("isDeleted", 0);
+ if($userId != 0){
+ $this->db->where("userId !=", $userId);
+ }
+ $query = $this->db->get();
+
+ return $query->result();
+ }
+
+
+ /**
+ * This function is used to add new user to system
+ * @return number $insert_id : This is last inserted id
+ */
+ function addNewUser($userInfo)
+ {
+ $this->db->trans_start();
+ $this->db->insert('Tab_Users', $userInfo);
+
+ $insert_id = $this->db->insert_id();
+
+ $this->db->trans_complete();
+
+ return $insert_id;
+ }
+
+ /**
+ * This function used to get user information by id
+ * @param number $userId : This is user id
+ * @return array $result : This is user information
+ */
+ function getUserInfo($userId)
+ {
+ $this->db->select('userId, name, email, mobile, roleId');
+ $this->db->from('Tab_Users');
+ $this->db->where('isDeleted', 0);
+ $this->db->where('roleId !=', 1);
+ $this->db->where('userId', $userId);
+ $query = $this->db->get();
+
+ return $query->result();
+ }
+
+
+ /**
+ * This function is used to update the user information
+ * @param array $userInfo : This is users updated information
+ * @param number $userId : This is user id
+ */
+ function editUser($userInfo, $userId)
+ {
+ $this->db->where('userId', $userId);
+ $this->db->update('Tab_Users', $userInfo);
+
+ return TRUE;
+ }
+
+
+
+ /**
+ * This function is used to delete the user information
+ * @param number $userId : This is user id
+ * @return boolean $result : TRUE / FALSE
+ */
+ function deleteUser($userId, $userInfo)
+ {
+ $this->db->where('userId', $userId);
+ $this->db->update('Tab_Users', $userInfo);
+
+ return $this->db->affected_rows();
+ }
+
+
+ /**
+ * This function is used to match users password for change password
+ * @param number $userId : This is user id
+ */
+ function matchOldPassword($userId, $oldPassword)
+ {
+ $this->db->select('userId, password');
+ $this->db->where('userId', $userId);
+ $this->db->where('isDeleted', 0);
+ $query = $this->db->get('Tab_Users');
+
+ $user = $query->result();
+
+ if(!empty($user)){
+ if(verifyHashedPassword($oldPassword, $user[0]->password)){
+ return $user;
+ } else {
+ return array();
+ }
+ } else {
+ return array();
+ }
+ }
+
+ /**
+ * This function is used to change users password
+ * @param number $userId : This is user id
+ * @param array $userInfo : This is user updation info
+ */
+ function changePassword($userId, $userInfo)
+ {
+ $this->db->where('userId', $userId);
+ $this->db->where('isDeleted', 0);
+ $this->db->update('Tab_Users', $userInfo);
+
+ return $this->db->affected_rows();
+ }
+
+
+ /**
+ * This function is used to get user login history
+ * @param number $userId : This is user id
+ */
+ function loginHistoryCount($userId, $searchText, $fromDate, $toDate)
+ {
+ $this->db->select('BaseTbl.userId, BaseTbl.sessionData, BaseTbl.machineIp, BaseTbl.userAgent, BaseTbl.agentString, BaseTbl.platform, BaseTbl.createdDtm');
+ if(!empty($searchText)) {
+ $likeCriteria = "(BaseTbl.email LIKE '%".$searchText."%')";
+ $this->db->where($likeCriteria);
+ }
+ if(!empty($fromDate)) {
+ $likeCriteria = "DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) >= '".date('Y-m-d', strtotime($fromDate))."'";
+ $this->db->where($likeCriteria);
+ }
+ if(!empty($toDate)) {
+ $likeCriteria = "DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) <= '".date('Y-m-d', strtotime($toDate))."'";
+ $this->db->where($likeCriteria);
+ }
+ $this->db->where('BaseTbl.userId', $userId);
+ $this->db->from('Tab_LastLogin as BaseTbl');
+ $query = $this->db->get();
+
+ return $query->num_rows();
+ }
+
+ /**
+ * This function is used to get user login history
+ * @param number $userId : This is user id
+ * @param number $page : This is pagination offset
+ * @param number $segment : This is pagination limit
+ * @return array $result : This is result
+ */
+ function loginHistory($userId, $searchText, $fromDate, $toDate, $page, $segment)
+ {
+ $this->db->select('BaseTbl.userId, BaseTbl.sessionData, BaseTbl.machineIp, BaseTbl.userAgent, BaseTbl.agentString, BaseTbl.platform, BaseTbl.createdDtm');
+ $this->db->from('Tab_LastLogin as BaseTbl');
+ if(!empty($searchText)) {
+ $likeCriteria = "(BaseTbl.email LIKE '%".$searchText."%')";
+ $this->db->where($likeCriteria);
+ }
+ if(!empty($fromDate)) {
+ $likeCriteria = "DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) >= '".date('Y-m-d', strtotime($fromDate))."'";
+ $this->db->where($likeCriteria);
+ }
+ if(!empty($toDate)) {
+ $likeCriteria = "DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) <= '".date('Y-m-d', strtotime($toDate))."'";
+ $this->db->where($likeCriteria);
+ }
+ $this->db->where('BaseTbl.userId', $userId);
+ $this->db->order_by('BaseTbl.id', 'DESC');
+ $this->db->limit($page, $segment);
+ $query = $this->db->get();
+
+ $result = $query->result();
+ return $result;
+ }
+
+ /**
+ * This function used to get user information by id
+ * @param number $userId : This is user id
+ * @return array $result : This is user information
+ */
+ function getUserInfoById($userId)
+ {
+ $this->db->select('userId, name, email, mobile, roleId');
+ $this->db->from('Tab_Users');
+ $this->db->where('isDeleted', 0);
+ $this->db->where('userId', $userId);
+ $query = $this->db->get();
+
+ return $query->row();
+ }
+
+}
+
+
\ No newline at end of file
diff --git a/application/models/user_model.php b/application/models/user_model.php
deleted file mode 100755
index 0f5850c..0000000
--- a/application/models/user_model.php
+++ /dev/null
@@ -1,315 +0,0 @@
-db->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,
- DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId');
- $this->db->from('T_Employee_Details EMP');
- $this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode');
- $this->db->join('tbl_users user', 'user.EmpID = EMP.EmpID');
- $this->db->join('tbl_roles role', 'user.roleId = role.roleId');
-
-
- $this->db->where('user.isDeleted !=', 1);
-
- $query = $this->db->get();
-
- $result = $query->result();
- return $result;
- }
-
- function GetRoleNameByUserID($UserId)
- {
- $subQuery = 'select roleId, role from tbl_roles
- where roleId = (select roleId from tbl_users where userId=?)';
-
- $query = $this->db->query($subQuery, array($UserId));
-
-
- return $query->result();
-
- }
- /**
- * This function is used to get the user roles information
- * @return array $result : This is result of the query
- */
- function getUserRoles()
- {
- $this->db->select('roleId, role');
- $this->db->from('tbl_roles');
- $this->db->where("roleid <", 4);
- $query = $this->db->get();
-
- return $query->result();
- }
-
- /**
- * This function is used to check whether email id is already exist or not
- * @param {string} $email : This is email id
- * @param {number} $userId : This is user id
- * @return {mixed} $result : This is searched result
- */
- function checkEmailExists($email, $userId = 0)
- {
- $this->db->select("email");
- $this->db->from("tbl_users");
- $this->db->where("email", $email);
- $this->db->where("isDeleted", 0);
- if($userId != 0){
- $this->db->where("userId !=", $userId);
- }
- $query = $this->db->get();
-
- return $query->result();
- }
-
-
- /**
- * This function is used to add new user to system
- * @return number $insert_id : This is last inserted id
- */
- function addNewUser($userInfo)
- {
-
- $this->db->trans_start();
- $this->db->insert('tbl_users', $userInfo);
-
- $insert_id = $this->db->affected_rows();
-
- $this->db->trans_complete();
-
- return $insert_id;
- }
-
- /**
- * This function used to get user information by id
- * @param number $userId : This is user id
- * @return array $result : This is user information
- */
- function getUserInfo($userId)
- {
- $this->db->select('userId, name, email, mobile, roleId,isDeleted');
- $this->db->from('tbl_users');
- $this->db->where('isDeleted', 0);
- $this->db->where('roleId !=', 1);
- $this->db->where('userId', $userId);
- $query = $this->db->get();
-
- return $query->result();
- }
-
-
- /**
- * This function is used to update the user information
- * @param array $userInfo : This is users updated information
- * @param number $userId : This is user id
- */
- function editUser($userInfo, $userId)
- {
- $this->db->where('EmpID', $userId);
- $this->db->update('tbl_users', $userInfo);
- //print_r($this->db->last_query());
- return TRUE;
- }
-
-
-
- /**
- * This function is used to delete the user information
- * @param number $userId : This is user id
- * @return boolean $result : TRUE / FALSE
- */
- function deleteUser($userId, $userInfo)
- {
- $this->db->where('userId', $userId);
- $this->db->update('tbl_users', $userInfo);
-
- return $this->db->affected_rows();
- }
-
-
- /**
- * This function is used to match users password for change password
- * @param number $userId : This is user id
- */
- function matchOldPassword($userId, $oldPassword)
- {
- $this->db->select('userId, password');
- $this->db->where('userId', $userId);
- $this->db->where('isDeleted', 0);
- $query = $this->db->get('tbl_users');
-
- $user = $query->result();
-
- if(!empty($user)){
- if(verifyHashedPassword($oldPassword, $user[0]->password)){
- return $user;
- } else {
- return array();
- }
- } else {
- return array();
- }
- }
-
- /**
- * This function is used to change users password
- * @param number $userId : This is user id
- * @param array $userInfo : This is user updation info
- */
- function changePassword($userId, $userInfo)
- {
- $this->db->where('userId', $userId);
- $this->db->where('isDeleted', 0);
- $this->db->update('tbl_users', $userInfo);
-
- return $this->db->affected_rows();
- }
- /**
- * This function is used to get Employee details based on Employee ID Selection
- * @return array $result : This is result of the query
- */
- function GetEmployeeDetails($UserId)
- {
- //echo $UserId;
- $subQuery = 'select EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,DEPT.DEPCode,DEPT.DepartmentName from
- T_Employee_Details EMP join T_DepartmentDetails DEPT on
- EMP.Departmentcode = DEPT.DEPCode where EMP.EmpID= (select EmpID from tbl_users where userId=?)';
-
- $query = $this->db->query($subQuery, array($UserId));
-
-
-
- return $query->result();
- }
- /**
- * This function is used to get the All employees
- * @return array $result : This is result of the query
- */
- function getAllEmployees()
- {
- /*$this->db->select('EmpID,FirstName,LastName');
- $this->db->from('T_Employee_Details');
- $query = $this->db->get();
-
- return $query->result(); */
- $this->db->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,DEPT.DEPCode,DEPT.DepartmentName');
- $this->db->from('T_Employee_Details EMP');
- $this->db->join('T_DepartmentDetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode');
- $this->db->where('EMP.IsActive ',1 );
- $query = $this->db->get();
- return $query->result();
- }
-
-
- function addAccess($userdept)
- {
- $this->db->trans_start();
- $this->db->insert('T_AccessDepartments', $userdept);
-
- $insert_id = $this->db->affected_rows();
-
- $this->db->trans_complete();
-
- return $insert_id;
- }
-
-
- function DeleteAccess($empid,$Depcode)
- {
- $this->db->where("Departmentcode",$Depcode);
- $this->db->where("EmpID",$empid);
- $this->db->delete('T_AccessDepartments');
-
- return TRUE;
- }
-
-
- //this function used to delivery performances
-
- function deliver_perform($fa,$aa,$m)
-{
-
-
-
- $sql="select ip_invoices.*,ip_invoice_items.item_quantity as qty,
- ip_clients.* from ip_invoices
- join ip_clients on ip_clients.client_id=ip_invoices.client_id
-join ip_invoice_items on ip_invoice_items .invoice_id =ip_invoices.invoice_id
- join ip_invoice_custom icf on icf.invoice_id = ip_invoices.invoice_id
- where icf.invoice_custom_fieldid = 8 and ip_invoices.invoice_status_id != 1";
-
-
-
- if ($fa and $aa != ''){
-
- $sql.=" and (ip_invoices.invoice_date_created >= '".$fa."-04-01' and ip_invoices.invoice_date_created <= '".$aa."-03-31')";
-
- }
-
-
-
-
- if ($m!= ''){
-
- $sql.=" and monthname(ip_invoices.invoice_date_created) = '".$m."'";
-
- }
-
- $sql .= " ORDER BY ip_invoices.invoice_date_created DESC";
- $query = $this->db->query($sql);
- return $query->result();
-}
-
- function fincalYear()
- {
- $sql="SELECT
- CASE WHEN MONTH(invoice_date_created)>=4 THEN
- concat(YEAR(invoice_date_created), '-',YEAR(invoice_date_created)+1)
- ELSE concat(YEAR(invoice_date_created)-1,'-', YEAR(invoice_date_created)) END AS financial_year
- FROM ip_invoices
-GROUP BY financial_year ";
-
- $query = $this->db->query($sql);
- //print_r($query->result());
- return $query->result();
- }
-
- /*
- *fav model
- */
- function favouriteadd($favourite)
-
- { //echo $favourite['Menu_ID'];die;
- if($favourite['Menu_ID'] !=''){
- //echo "if";
-
- // $this->db->where('id', $id);
- // return $this->db->delete('employee');
- $this->db->where('Menu_ID',$favourite['Menu_ID']);
- $this->db->delete('T_fav_add');
-
- }else{
- //echo "else";
-
- $this->db->insert('T_fav_add',$favourite);
- $r = $this->db->affected_rows();
- return $r;
- }
- }
-
-
-}
-
-
\ No newline at end of file
diff --git a/application/views/404.php b/application/views/404.php
index 19faf45..0b3e739 100755
--- a/application/views/404.php
+++ b/application/views/404.php
@@ -1,15 +1,46 @@
-
+
+
+
- 404
- This is not the page you are looking for
+ 404 Error Page
+
+
+
-
-
-
+
+
404
+
+
+
Oops! Page not found.
+
+
+ We could not find the page you were looking for.
+ Meanwhile, you may return to dashboard or try using the search form.
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/views/500.php b/application/views/500.php
new file mode 100755
index 0000000..e7bcc1a
--- /dev/null
+++ b/application/views/500.php
@@ -0,0 +1,47 @@
+
+
+ We will work on fixing that right away.
+ Meanwhile, you may return to dashboard or try using the search form.
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/UsersListing.php b/application/views/UsersListing.php
new file mode 100644
index 0000000..fbe281c
--- /dev/null
+++ b/application/views/UsersListing.php
@@ -0,0 +1,87 @@
+
- Access Denied
- You are not authorize user to use this
+ Access Denied
+
+
+
-
-
-
+
+
Access Denied
+
+
+
Oops! Page not found.
+
+
+ You are not authorize user to use this
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/application/views/addUser.php b/application/views/addUser.php
new file mode 100644
index 0000000..9245bd7
--- /dev/null
+++ b/application/views/addUser.php
@@ -0,0 +1,125 @@
+