Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion application/models/complaint_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ public function get_app_by_department_for_super($limit=null,$length=null,$search
"created_datetime"
);
// $query = $this->db->get_where('app', array('is_deleted' => '0'));
$this->db->select("a.id id,a.type,a.module_name, d.id department_id,a.icon, a.name name, a.created_datetime created_datetime, d.name department_name, CONCAT_WS(' ',u.first_name ,u.last_name) as user_name",FALSE);
$this->db->select("a.id id,a.type,a.module_name, d.id department_id,a.icon,
a.name name, a.created_datetime created_datetime, d.name department_name,
CONCAT_WS(' ',u.first_name ,u.last_name) as user_name",FALSE);
$this->db->from('app a');
$this->db->join('department d', 'a.department_id = d.id');
$this->db->join('users u', 'a.user_id = u.id','left');
Expand Down
10 changes: 7 additions & 3 deletions application/models/form_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public function get_form($slug = FALSE, $view_id = null) {



$this->db->select('form.*,fv.description as fv_description, fv.full_description as fv_full_description, fv.id as fvid, fv.post_url as fv_post_url');
$this->db->select('form.*,fv.description as fv_description,
fv.full_description as fv_full_description,fv.id as fvid, fv.post_url as fv_post_url');
$this->db->from('form');
if ($view_id) {
$this->db->join('form_views fv', 'fv.form_id = form.id AND fv.view_id="' . $view_id . '"', 'left');
Expand Down Expand Up @@ -103,7 +104,9 @@ public function get_form_list($app_id) {
* @author Zahid Nadeem <zahidiubb@yahoo.com>
*/
public function get_form_by_app_view($app_id, $view_id) {
$this->db->select('app.id as app_id, app.name as app_name, form.id as form_id, form.name as form_name,form.icon as form_icon, fv.description,fv.full_description,form.next,form.icon,fv.id as fvid');
$this->db->select('app.id as app_id, app.name as app_name, form.id as form_id,
form.name as form_name,form.icon as form_icon, fv.description,fv.full_description,
form.next,form.icon,fv.id as fvid');
$this->db->from('form');
$this->db->join('app', 'app.id = form.app_id');
$this->db->where('form.is_deleted', '0');
Expand All @@ -122,7 +125,8 @@ public function get_form_by_app_view($app_id, $view_id) {
* @author Zahid Nadeem <zahidiubb@yahoo.com>
*/
public function get_empty_app_form($app_id) {
$this->db->select('app.id as app_id, app.name as app_name, form.id as form_id, form.name as form_name, form.description,form.full_description,form.next');
$this->db->select('app.id as app_id, app.name as app_name, form.id as form_id,
form.name as form_name, form.description,form.full_description,form.next');
$this->db->from('form');
$this->db->join('app', 'app.id = form.app_id', 'left outer');
$this->db->where('form.app_id', $app_id);
Expand Down
23 changes: 20 additions & 3 deletions application/models/form_results_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,12 @@ public function return_total_record_for_graph($form_id = Null,$select_value='')
}

//new isntanct
public function get_result_paginated_posted($table_name = FALSE, $to_date, $from_date, $category_name = array(), $filter_attribute_search = Null, $town_filter = '', $posted_filters = array(), $search_text, $district = '', $sent_by = '', $per_page, $selected_dc, $selected_uc, $selected_pp, $selected_na, $dynamic_filters) {
public function get_result_paginated_posted($table_name = FALSE,
$to_date, $from_date, $category_name = array(),
$filter_attribute_search = Null, $town_filter = '',
$posted_filters = array(), $search_text, $district = '',
$sent_by = '', $per_page, $selected_dc, $selected_uc,
$selected_pp, $selected_na, $dynamic_filters) {

$table_array = explode('_', $table_name);
$form_id = $table_array[count($table_array) - 1];
Expand Down Expand Up @@ -702,7 +707,16 @@ public function get_result_paginated_posted($table_name = FALSE, $to_date, $from

//new instance

public function return_total_record_posted($form_list, $to_date, $from_date, $category_name = array(), $filter_attribute_search, $town_filter = '', $posted_filters = array(), $search_text = '', $district = '', $sent_by = '', $selected_dc, $dynamic_filters) {
public function return_total_record_posted($form_list, $to_date, $from_date,
$category_name = array(),
$filter_attribute_search,
$town_filter = '',
$posted_filters = array(),
$search_text = '',
$district = '',
$sent_by = '',
$selected_dc, $dynamic_filters) {

$dynamic_cond = '';
$lists = '';
$join_cond = "";
Expand All @@ -721,7 +735,10 @@ public function return_total_record_posted($form_list, $to_date, $from_date, $ca
$table_headers_array = array();
$heading_counter_array = array();
$table_header_text = '';
$exclude_array = array('id', 'uc_name', 'created_datetime', 'district_name', 'town_name', 'location', 'form_id', 'img1', 'img2', 'img3', 'img4', 'img5', 'img1_title', 'img2_title', 'img3_title', 'img4_title', 'img5_title', 'is_deleted');
$exclude_array = array('id', 'uc_name', 'created_datetime', 'district_name',
'town_name', 'location', 'form_id', 'img1', 'img2', 'img3', 'img4', 'img5',
'img1_title', 'img2_title', 'img3_title', 'img4_title', 'img5_title',
'is_deleted');
$heading_query = $this->getTableHeadingsFromSchema($table_name);
foreach ($heading_query as $key => $value) {
$header_value = $value['COLUMN_NAME'];
Expand Down
3 changes: 2 additions & 1 deletion application/models/form_settings_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function add_new_field($form_id,$field_name) {
$data=array(
"form_id"=>$form_id,
"field_name"=>$field_name,
"field_show_name"=>trim(preg_replace('/[^A-Za-z0-9\-]/', ' ', urldecode($field_name)))
"field_show_name"=>trim(preg_replace('/[^A-Za-z0-9\-]/', ' ',
urldecode($field_name)))
);
$this->db->insert('form_field_settings', $data);
return $this->db->insert_id();
Expand Down
4 changes: 3 additions & 1 deletion application/models/site_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public function get_all_log($limit, $start) {
return $query->result_array();
}

public function get_all_log_ajax($limit=null,$length=null,$search0=null,$search1=null,$search2=null,$search3=null,$search6=null,$search7=null,$search10=null,$sort_column=null,$sort_order=null) {
public function get_all_log_ajax($limit=null,$length=null,$search0=null,
$search1=null,$search2=null,$search3=null,$search6=null,$search7=null,
$search10=null,$sort_column=null,$sort_order=null) {
$allColumns=array("changed_by_name",
"department_name",
"action_type",
Expand Down
49 changes: 34 additions & 15 deletions application/models/users_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
* @author Zahid Nadeem <zahidiubb@yahoo.com>
*/
function login($username, $password) {
$this->db->select('u.id id, u.email, u.username,u.first_name,u.last_name, u.password,d.id department_id,d.name department_name, u.parent_id, u.group_id, u.is_deleted, u.status,u.verification_code,u.default_url, u.district');
$this->db->select('u.id id, u.email, u.username,u.first_name,u.last_name,
u.password,d.id department_id,d.name department_name, u.parent_id,
u.group_id, u.is_deleted, u.status,u.verification_code,u.default_url,
u.district');
$this->db->from('users u');
$this->db->join('users_group ug', 'u.group_id = ug.id', 'left');
$this->db->join('department d', 'u.department_id = d.id', 'left');
Expand All @@ -37,7 +40,9 @@ function login($username, $password) {
*/
function get_users($parent_id) {

$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,d.id department_id,d.name department_name, u.parent_id, u.group_id,ug.type group_name,u.status');
$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,
d.id department_id,d.name department_name, u.parent_id, u.group_id,
ug.type group_name,u.status');
$this->db->from('users u');
$this->db->join('users_group ug', 'u.group_id = ug.id', 'left');
$this->db->join('department d', 'u.department_id = d.id');
Expand All @@ -59,7 +64,8 @@ function get_users($parent_id) {
*/
function get_all_users() {

$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,u.department_id, u.parent_id, u.group_id,u.status');
$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,
u.department_id, u.parent_id, u.group_id,u.status');
$this->db->from('users u');

$this->db->where('u.is_deleted', 0);
Expand All @@ -74,7 +80,8 @@ function get_all_users() {
*/
function get_super_admin() {

$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,u.parent_id, u.group_id');
$this->db->select('u.id id, u.username,u.email,u.first_name,u.last_name,
u.parent_id, u.group_id');
$this->db->from('users u');
$this->db->where('u.department_id !=', 0);
$this->db->where('u.is_deleted', 0);
Expand All @@ -90,7 +97,9 @@ function get_super_admin() {
*/
function get_user_by_id($user_id) {

$this->db->select('u.id id, u.username, u.email,u.first_name,u.last_name,d.id department_id,d.name department_name, u.parent_id, u.group_id,ug.type group_name, u.default_url, u.district');
$this->db->select('u.id id, u.username, u.email,u.first_name,u.last_name,
d.id department_id,d.name department_name, u.parent_id, u.group_id,
ug.type group_name, u.default_url, u.district');
$this->db->from('users u');
$this->db->join('users_group ug', 'u.group_id = ug.id', 'left');
$this->db->join('department d', 'u.department_id = d.id', 'left');
Expand All @@ -110,7 +119,8 @@ function get_user_by_id($user_id) {
*/
public function username_already_exist($user_name) {

$query = $this->db->get_where('users', array('username' => $user_name, 'is_deleted' => '0'));
$query = $this->db->get_where('users',
array('username' => $user_name, 'is_deleted' => '0'));
$exist = $query->result_array();
if ($exist) {
return true;
Expand Down Expand Up @@ -151,7 +161,8 @@ public function email_already_exist($email) {
*/
public function get_user_by_username($user_name) {

$query = $this->db->get_where('users', array('username' => $user_name, 'is_deleted' => '0'));
$query = $this->db->get_where('users',
array('username' => $user_name, 'is_deleted' => '0'));
$exist = $query->row_array();
if ($exist) {
return $exist;
Expand Down Expand Up @@ -186,7 +197,8 @@ public function get_user_by_email($email) {
*/
public function user_name_already_exist($user_name, $user_id) {

$query = $this->db->get_where('users', array('username' => $user_name, 'is_deleted' => '0', 'id !=' => $user_id));
$query = $this->db->get_where('users',
array('username' => $user_name, 'is_deleted' => '0', 'id !=' => $user_id));
$exist = $query->result_array();
if ($exist) {
return true;
Expand All @@ -204,7 +216,8 @@ public function user_name_already_exist($user_name, $user_id) {
*/
public function email_already_exist_edit($email, $user_id) {

$query = $this->db->get_where('users', array('email' => $email, 'is_deleted' => '0', 'id !=' => $user_id));
$query = $this->db->get_where('users',
array('email' => $email, 'is_deleted' => '0', 'id !=' => $user_id));
$exist = $query->result_array();
if ($exist) {
return true;
Expand All @@ -222,7 +235,8 @@ public function email_already_exist_edit($email, $user_id) {
*/
public function current_password_check($password, $user_id) {

$query = $this->db->get_where('users', array('password' => md5($password), 'is_deleted' => '0', 'id' => $user_id));
$query = $this->db->get_where('users',
array('password' => md5($password), 'is_deleted' => '0', 'id' => $user_id));
$exist = $query->result_array();
if ($exist) {
return true;
Expand Down Expand Up @@ -409,7 +423,8 @@ function get_group_permissions($group_id) {
*/
public function group_already_exist($group_name, $department_id) {

$query = $this->db->get_where('users_group', array('type' => $group_name, 'department_id' => $department_id));
$query = $this->db->get_where('users_group',
array('type' => $group_name, 'department_id' => $department_id));
$exist = $query->result_array();
if ($exist) {
return true;
Expand All @@ -426,7 +441,8 @@ public function group_already_exist($group_name, $department_id) {
*/
public function get_parent_user($department_id) {

$query = $this->db->get_where('users', array('parent_id' => '0', 'department_id' => $department_id,'is_deleted'=>'0'));
$query = $this->db->get_where('users',
array('parent_id' => '0', 'department_id' => $department_id,'is_deleted'=>'0'));
return $query->row_array();
}

Expand All @@ -440,7 +456,8 @@ function get_groups($department_id) {

$session_data = $this->session->userdata('logged_in');
$group_id = $session_data['login_group_id'];
$query = $this->db->get_where('users_group', array('department_id' => $department_id, 'id !=' => $group_id));
$query = $this->db->get_where('users_group',
array('department_id' => $department_id, 'id !=' => $group_id));

$groups = array();

Expand Down Expand Up @@ -485,7 +502,8 @@ function map_full_permissions($group_id, $modules, $roles, $skip) {
*/
function get_app_users($department_id) {

$this->db->select('au.id id, u.name,u.town,u.imei_no,d.id department_id,d.name department_name, u.parent_id, u.group_id,ug.type group_name,u.status');
$this->db->select('au.id id, u.name,u.town,u.imei_no,d.id department_id,
d.name department_name, u.parent_id, u.group_id,ug.type group_name,u.status');
$this->db->from('app_users au');
$this->db->join('users_group ug', 'u.group_id = ug.id', 'left');
$this->db->join('department d', 'u.department_id = d.id');
Expand All @@ -508,7 +526,8 @@ function get_app_users($department_id) {
*/
function get_user_by_department_id($department_id) {

$this->db->select('u.id id, u.username, u.email,u.first_name,u.last_name, u.parent_id, u.group_id, u.default_url, u.district');
$this->db->select('u.id id, u.username, u.email,u.first_name,u.last_name,
u.parent_id, u.group_id, u.default_url, u.district');
$this->db->from('users u');
//$this->db->join('users_group ug', 'u.group_id = ug.id', 'left');
//$this->db->join('department d', 'u.department_id = d.id', 'left');
Expand Down
17 changes: 13 additions & 4 deletions application/views/apimaker/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@
?>
</td>
<td class="Links" style="width: 70px; border-bottom: 1px solid #D5D5D5;">
<a href="<?php echo base_url(); ?>createapiurl/<?php echo $api['id']; ?>"><img src="<?= base_url() ?>assets/images/settings-ico.png" alt="" title="Create Url" width="28px"/></a>
<a class="edit_api" api_id="<?= $api['id'] ?>"><img src="<?= base_url() ?>assets/images/tableLink1.png" alt="" title="Edit"/></a>
<a href="javascript:void(0)"><img src="<?= base_url() ?>assets/images/tableLink3.png" alt="" title="Delete" id ="delete_api" title="Delete Api" api_id ="<?= $api['id'] ?>"/></a>
<a href="<?php echo base_url(); ?>assets/data/<?php echo $api['file_name']; ?>"><img src="<?= base_url() ?>assets/images/tableLink6.png" alt="" title="Download"/></a>
<a href="<?php echo base_url(); ?>createapiurl/<?php echo $api['id'];
?>"><img src="<?= base_url() ?>assets/images/settings-ico.png"
alt="" title="Create Url" width="28px"/></a>

<a class="edit_api" api_id="<?= $api['id'] ?>"><img src="<?= base_url() ?>
assets/images/tableLink1.png" alt="" title="Edit"/></a>

<a href="javascript:void(0)"><img src="<?= base_url() ?>
assets/images/tableLink3.png" alt="" title="Delete" id ="delete_api"
title="Delete Api" api_id ="<?= $api['id'] ?>"/></a>

<a href="<?php echo base_url(); ?>assets/data/<?php echo $api['file_name'];
?>"><img src="<?= base_url() ?>assets/images/tableLink6.png" alt="" title="Download"/></a>
<br clear="all" />
</td>
</tr>
Expand Down
12 changes: 8 additions & 4 deletions application/views/form/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@
<strong>Form Name</strong>
</label>
<div>
<input class="required" type="text" name="form_name" id="form_name" value="" onKeyPress="$('#addformbtn').show();"/>
<input type="hidden" name="app_id" id="d1_textfield" value="<?php echo $app_id; ?>" />
<input class="required" type="text" name="form_name"
id="form_name" value="" onKeyPress="$('#addformbtn').show();"/>
<input type="hidden" name="app_id" id="d1_textfield"
value="<?php echo $app_id; ?>" />
</div>
</div>
<div class="row">
<label for="d1_textfield">
<strong>Form Icon (.png only)</strong>
</label>
<div style="float: left;">
<input type="file" name="userfile_addform" id="userfile_addform" accept="*.png" onchange="check_file()"/>
<input type="file" name="userfile_addform" id="userfile_addform"
accept="*.png" onchange="check_file()"/>
</div>
</div>
<div class="actions">
<div class="right">
<button class="submit genericBtn" id="addformbtn" onclick="$(this).hide();">Add Form</button>
<button class="submit genericBtn" id="addformbtn"
onclick="$(this).hide();">Add Form</button>
</div>

</div>
Expand Down
Loading