Code Duplication    Length = 7-9 lines in 15 locations

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

@@ 41-47 (lines=7) @@
38
			redirect(base_url() . '/astpp/login');
39
	}
40
41
	function periodiccharges_add() {
42
		$data['username'] = $this->session->userdata('user_name');
43
		$data['flag'] = 'create';
44
		$data['page_title'] = 'Create Subscription';
45
		$data['form'] = $this->form->build_form($this->charges_form->get_charge_form_fields(), '');
46
		$this->load->view('view_periodiccharges_add_edit', $data);
47
	}
48
49
	function periodiccharges_edit($edit_id = '') {
50
		$data['page_title'] = 'Edit Subscription ';

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

@@ 155-163 (lines=9) @@
152
		$this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
153
			redirect(base_url() . 'accounts/customer_edit/'.$value["accountid"]);
154
	}
155
	function email_add($type = "") {
156
157
		$data['username'] = $this->session->userdata('user_name');
158
		$data['flag'] = 'create';
159
		$data['page_title'] = 'Create Commission Rate';
160
		$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), '');
161
162
		$this->load->view('view_email_add_edit', $data);
163
	}
164
	function email_save() {
165
		$add_array = $this->input->post();
166
		$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $add_array);

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

@@ 473-479 (lines=7) @@
470
		echo json_encode($json_data);
471
	}
472
473
	function fsgateway_add() {
474
		$data['username'] = $this->session->userdata('user_name');
475
		$data['flag'] = 'create';
476
		$data['page_title'] = 'Create Gateway';
477
		$data['form'] = $this->form->build_form($this->freeswitch_form->get_gateway_form_fields(), '');
478
		$this->load->view('view_fsgateway_add', $data);
479
	}
480
481
	function fsgateway_edit($edit_id = '') {
482
		$data['page_title'] = ' Edit Gateway';
@@ 953-960 (lines=8) @@
950
		echo json_encode($json_data);
951
	}
952
953
	function fsserver_add($type = "") {
954
		$data['username'] = $this->session->userdata('user_name');
955
		$data['flag'] = 'create';
956
		$data['page_title'] = 'Create Freeswich Server';
957
		$data['form'] = $this->form->build_form($this->freeswitch_form->get_form_fsserver_fields(), '');
958
959
		$this->load->view('view_fsserver_add_edit', $data);
960
	}
961
962
	function fsserver_edit($edit_id = '') {
963
		$data['page_title'] = 'Edit Freeswich Server';

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

@@ 37-43 (lines=7) @@
34
		if ($this->session->userdata('user_login') == FALSE)
35
			redirect(base_url() . '/astpp/login');
36
		 }
37
	function ipmap_add() {
38
		$data['username'] = $this->session->userdata('user_name');
39
		$data['flag'] = 'create';
40
		$data['page_title'] = 'Add IP Map';
41
		$data['form'] = $this->form->build_form($this->ipmap_form->get_ipmap_form_fields(), '');
42
		$this->load->view('ipmap_add_edit', $data);
43
	  }
44
45
	function ipmap_edit($edit_id = '') {
46
		$data['page_title'] = 'Edit IP Map ';

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

@@ 40-47 (lines=8) @@
37
			redirect(base_url() . '/astpp/login');
38
	}
39
40
	function opensips_add() {
41
  //echo 'dd';
42
		$data['username'] = $this->session->userdata('user_name');
43
		$data['flag'] = 'create';
44
		$data['page_title'] = 'Add  Opensips';
45
		$data['form'] = $this->form->build_form($this->opensips_form->get_opensips_form_fields(), '');
46
	$this->load->view('view_opensips_add_edit', $data);
47
	}
48
     
49
	function opensips_edit($edit_id = '') {
50
		$data['page_title'] = 'Edit Opensips ';
@@ 279-286 (lines=8) @@
276
	}
277
278
//    dispather List add edit delete
279
	function dispatcher_add() {
280
		$data['username'] = $this->session->userdata('user_name');
281
		$data['flag'] = 'create';
282
		$data['page_title'] = 'Dispatcher';
283
		$data['form'] = $this->form->build_form($this->opensips_form->get_dispatcher_form_fields(), '');
284
285
		$this->load->view('view_dispatcher_add_edit', $data);
286
	}
287
288
	function dispatcher_edit($edit_id = '') {
289
		$data['page_title'] = 'Dispatcher ';

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

@@ 216-222 (lines=7) @@
213
214
		echo json_encode($json_data);
215
	}
216
	function package_counter() {
217
		$data['username'] = $this->session->userdata('user_name');
218
		$data['page_title'] = 'Usage Report';
219
		$data['grid_fields'] = $this->package_form->build_package_counter_list_for_admin();
220
	$data["grid_buttons"] = $this->package_form->build_package_counter_report();
221
		$this->load->view('view_package_counter_report', $data);
222
	}
223
224
	/**
225
	 * -------Here we write code for controller accounts functions account_list------

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

@@ 39-46 (lines=8) @@
36
			redirect(base_url() . '/astpp/login');
37
	}
38
39
	function price_add($type = "") {
40
		$data['username'] = $this->session->userdata('user_name');
41
		$data['flag'] = 'Create Rate Group';
42
		$data['page_title'] = 'Create Rate Group';
43
		$data['form'] = $this->form->build_form($this->pricing_form->get_pricing_form_fields(), '');
44
45
		$this->load->view('view_price_add_edit', $data);
46
	}
47
48
	function price_edit($edit_id = '') {
49
		$data['page_title'] = 'Edit Rate Group';

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

@@ 394-402 (lines=9) @@
391
		$data = file_get_contents($full_path.$error_data);
392
		force_download("Origination_rate_error.csv", $data); 
393
	}
394
	function origination_rate_add($type = "") {
395
	
396
		$data['username'] = $this->session->userdata('user_name');
397
		$data['flag'] = 'create';
398
		$data['page_title'] = 'Create Origination Rate';
399
		$data['form'] = $this->form->build_form($this->rates_form->get_origination_rate_form_fields(), '');
400
401
		$this->load->view('view_origination_rate_add_edit', $data);
402
	}
403
404
	function origination_rate_edit($edit_id = '') {
405
		$data['page_title'] = 'Edit Origination Rate';
@@ 537-543 (lines=7) @@
534
		echo $count_all; 
535
	} 
536
/*******************/
537
	function termination_rate_add($type = "") {
538
		$data['username'] = $this->session->userdata('user_name');
539
		$data['flag'] = 'create';
540
		$data['page_title'] = 'Create Termination Rate';
541
		$data['form'] = $this->form->build_form($this->rates_form->get_termination_rate_form_fields(), '');
542
		$this->load->view('view_termination_rate_add_edit', $data);
543
	}
544
545
	function termination_rate_edit($edit_id = '') {
546
    

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

@@ 305-311 (lines=7) @@
302
		$this->session->set_userdata('country_search', "");
303
	}
304
    
305
	function country_add() {
306
	$data['username'] = $this->session->userdata('user_name');
307
		$data['flag'] = 'create';
308
		$data['page_title'] = 'Add Country';
309
		$data['form'] = $this->form->build_form($this->system_form->get_country_form_fields(), '');
310
		$this->load->view('view_country_add_edit', $data);
311
	}
312
313
	function country_list_edit($edit_id = '') {
314
 	$data['page_title'] = 'Edit Country';
@@ 417-423 (lines=7) @@
414
		$this->session->set_userdata('currency_search', "");
415
	}
416
417
	function currency_add() {
418
	$data['username'] = $this->session->userdata('user_name');
419
		$data['flag'] = 'create';
420
		$data['page_title'] = 'Add Currency';
421
		$data['form'] = $this->form->build_form($this->system_form->get_currency_form_fields(), '');
422
		$this->load->view('view_currency_add_edit', $data);
423
	}
424
425
	function currency_list_edit($edit_id = '') {
426
 	$data['page_title'] = 'Edit Currency';

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

@@ 39-46 (lines=8) @@
36
			redirect(base_url() . '/astpp/login');
37
	}
38
39
	function taxes_add() {
40
		$data['username'] = $this->session->userdata('user_name');
41
		$data['flag'] = 'create';
42
		$data['page_title'] = 'Create Tax';
43
		$data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), '');
44
45
		$this->load->view('view_taxes_add_edit', $data);
46
	}
47
48
	function taxes_edit($edit_id = '') {
49
		$data['page_title'] = 'Edit Tax ';

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

@@ 61-67 (lines=7) @@
58
		echo json_encode($json_data);
59
	}
60
61
	function trunk_add($type = "") {
62
		$data['username'] = $this->session->userdata('user_name');
63
		$data['flag'] = 'create';
64
		$data['page_title'] = 'Create Trunk';
65
		$data['form'] = $this->form->build_form($this->trunk_form->get_trunk_form_fields(), '');
66
		$this->load->view('view_trunk_add_edit', $data);
67
	}
68
69
	function trunk_edit($edit_id = '') {
70
		$data['page_title'] = 'Edit Trunk';