Code Duplication    Length = 10-13 lines in 5 locations

web_interface/astpp/application/modules/did/controllers/did.php 1 location

@@ 249-261 (lines=13) @@
246
	 * -------Here we write code for controller accounts functions account_list------
247
	 * Listing of Accounts table data through php function json_encode
248
	 */
249
	function did_list_json() {
250
		$json_data = array();
251
252
		$count_all = $this->did_model->getdid_list(false);
253
		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
254
		$json_data = $paging_data["json_paging"];
255
		$list = $this->session->userdata['userlevel_logintype'] == 1 ? $this->did_form->build_did_list_for_reseller_login() : $this->did_form->build_did_list_for_admin();
256
		$query = $this->did_model->getdid_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
257
		$grid_fields = json_decode($list);
258
		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
259
260
		echo json_encode($json_data);
261
	}
262
263
	function did_list_search() {
264
		$ajax_search = $this->input->post('ajax_search', 0);

web_interface/astpp/application/modules/refill_coupon/controllers/refill_coupon.php 1 location

@@ 175-184 (lines=10) @@
172
		$this->load->helper('csv');
173
		array_to_csv($cc_array, 'refill_coupon_' . date("Y-m-d") . '.csv');
174
	}
175
	function refill_coupon_customer_json($accountid){
176
	$json_data = array();
177
		$count_all = $this->refill_coupon_model->get_customer_refill_coupon_list(false, "", "",$accountid);
178
		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
179
		$json_data = $paging_data["json_paging"];
180
		$query = $this->refill_coupon_model->get_customer_refill_coupon_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"],$accountid);
181
		$grid_fields = json_decode($this->refill_coupon_form->build_user_refill_coupon_grid());
182
		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
183
		echo json_encode($json_data);
184
	}
185
} 
186
?>
187

web_interface/astpp/application/modules/email/controllers/email.php 1 location

@@ 386-396 (lines=11) @@
383
		$data['form_search'] = $this->form->build_serach_form($this->email_form->get_email_history_search_form());
384
	$this->load->view('view_email_list', $data);
385
	}
386
	function email_history_list_json() {
387
	$data['logintype']=$this->session->userdata('logintype');
388
		$json_data = array();
389
		$count_all = $this->email_model->get_email_list(false);
390
		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
391
		$json_data = $paging_data["json_paging"];
392
		$query = $this->email_model->get_email_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
393
	$grid_fields = json_decode($this->email_form->build_list_for_email());
394
		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
395
		echo json_encode($json_data);
396
	}
397
398
	function customer_mail_record($accountid,$accounttype){
399
		$json_data = array();

web_interface/astpp/application/modules/user/controllers/user.php 2 locations

@@ 1182-1192 (lines=11) @@
1179
		$this->load->view('view_user_ipmap_list', $data);
1180
	}
1181
    
1182
	function user_ipmap_json(){
1183
		$json_data = array();
1184
		$account_data = $this->session->userdata("accountinfo");
1185
		$count_all = $this->user_model->user_ipmap_list(false);
1186
		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
1187
		$json_data = $paging_data["json_paging"];
1188
		$query = $this->user_model->user_ipmap_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
1189
		$ipmap_grid_fields = json_decode($this->user_form->build_user_ipmap());
1190
		$json_data['rows'] = $this->form->build_grid($query, $ipmap_grid_fields);
1191
		echo json_encode($json_data);
1192
	}
1193
1194
	function user_ipmap_search(){
1195
		$ajax_search = $this->input->post('ajax_search', 0);
@@ 1656-1666 (lines=11) @@
1653
		$this->load->view('view_opensips_list', $data);
1654
	}
1655
1656
	function user_opensips_json() {
1657
		$accountinfo = $this->session->userdata("accountinfo");
1658
		$json_data = array();
1659
		$count_all = $this->user_model->get_user_opensips(false, $accountinfo['number']);
1660
		$paging_data = $this->form->load_grid_config($count_all,$_GET['rp'],$_GET['page']);
1661
		$json_data = $paging_data["json_paging"];
1662
		$query = $this->user_model->get_user_opensips(true, $accountinfo['number'], $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
1663
		$grid_fields = json_decode($this->user_form->build_user_opensips());
1664
		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
1665
		echo json_encode($json_data);
1666
	}
1667
1668
	function user_opensips_clearsearchfilter() {
1669
		$this->session->set_userdata('advance_search', 0);