Completed
Pull Request — v3.0 (#136)
by
unknown
25:07
created
astpp/application/modules/rates/views/view_import_termination_rate.php 3 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
             	<div class="w-box">
20 20
             	 <span  style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;">
21 21
                     <? if(isset($error) && !empty($error)) {
22
-                        echo $error;
23
-                    }?>
22
+						echo $error;
23
+					}?>
24 24
                  </span>
25 25
                    <h3 class="padding-t-10 padding-l-16">File must be in the following format(.csv):</h3>
26 26
                    <p>Code,Destination,Connect Cost,Included Seconds,Per Minute Cost,Initial Increment,Increment,Precedence,Strip,Prepend.</p>
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                                <label class="col-md-3">Trunk List:</label>
36 36
                                <div class="">
37 37
                                <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr",array("status " => "0")), '');
38
-                            echo $trunklist; ?></div>
38
+							echo $trunklist; ?></div>
39 39
                            </div>
40 40
                            <div class="col-md-12 no-padding">
41 41
                             <input type="hidden" name="mode" value="import_termination_rate" />
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 <?}?>    
89 89
         
90 90
 <?php
91
-    if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?>
91
+	if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?>
92 92
         
93 93
 <section class="slice color-three padding-b-20">
94 94
 	<div class="w-section inverse no-padding">
@@ -98,24 +98,24 @@  discard block
 block discarded – undo
98 98
             <form id="import_form" name="import_form" action="<?=base_url()?>rates/termination_rate_rates_import/<?= $trunkid?>/<?=$check_header?>/" method="POST">
99 99
             <table width="100%" border="1"  class="details_table table">
100 100
                 <?  $cnt =7;
101
-                    foreach($csv_tmp_data as $csv_key => $csv_value){
102
-                        if($csv_key <  15){
103
-                            echo "<tr>";
104
-                            foreach($csv_value as $field_name => $field_val){
105
-                                if($csv_key == 0){
106
-                                    echo "<th>".ucfirst($field_name)."</th>";
107
-                                }else{
108
-                                    echo "<td class='portlet-content'>".$field_val."</td>";   
109
-                                }
110
-                            }
111
-                            echo "</tr>";
112
-                        }
113
-                    }
101
+					foreach($csv_tmp_data as $csv_key => $csv_value){
102
+						if($csv_key <  15){
103
+							echo "<tr>";
104
+							foreach($csv_value as $field_name => $field_val){
105
+								if($csv_key == 0){
106
+									echo "<th>".ucfirst($field_name)."</th>";
107
+								}else{
108
+									echo "<td class='portlet-content'>".$field_val."</td>";   
109
+								}
110
+							}
111
+							echo "</tr>";
112
+						}
113
+					}
114 114
                     
115
-                    echo "<tr><td colspan='".$cnt."'>
115
+					echo "<tr><td colspan='".$cnt."'>
116 116
                         <a href='".base_url()."rates/termination_rates_list/'><input type='button' class='btn btn-line-sky pull-right  margin-x-10' value='Back'/></a>
117 117
                         <input type='submit' class='btn btn-line-parrot pull-right'' id='Process' value='Process'/></td></tr>";
118
-        ?> </table></form>  
118
+		?> </table></form>  
119 119
      </div>  
120 120
             </div>
121 121
         </div>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <? endblock() ?>
9 9
 
10 10
 <? startblock('content') ?>        
11
-   <?php if(!isset($csv_tmp_data)){ ?>
11
+   <?php if ( ! isset($csv_tmp_data)) { ?>
12 12
    
13 13
 <section class="slice color-three padding-t-20">
14 14
 	<div class="w-section inverse no-padding">
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                <div class="col-md-12">
19 19
             	<div class="w-box">
20 20
             	 <span  style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;">
21
-                    <? if(isset($error) && !empty($error)) {
21
+                    <? if (isset($error) && ! empty($error)) {
22 22
                         echo $error;
23 23
                     }?>
24 24
                  </span>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                            <div class="col-md-12 no-padding">
35 35
                                <label class="col-md-3">Trunk List:</label>
36 36
                                <div class="">
37
-                               <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr",array("status " => "0")), '');
37
+                               <? $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array("status " => "0")), '');
38 38
                             echo $trunklist; ?></div>
39 39
                            </div>
40 40
                            <div class="col-md-12 no-padding">
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 <?}?>    
89 89
         
90 90
 <?php
91
-    if(isset($csv_tmp_data) && !empty($csv_tmp_data)){ ?>
91
+    if (isset($csv_tmp_data) && ! empty($csv_tmp_data)) { ?>
92 92
         
93 93
 <section class="slice color-three padding-b-20">
94 94
 	<div class="w-section inverse no-padding">
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
                 <div class="col-md-12 margin-t-10">  
98 98
             <form id="import_form" name="import_form" action="<?=base_url()?>rates/termination_rate_rates_import/<?= $trunkid?>/<?=$check_header?>/" method="POST">
99 99
             <table width="100%" border="1"  class="details_table table">
100
-                <?  $cnt =7;
101
-                    foreach($csv_tmp_data as $csv_key => $csv_value){
102
-                        if($csv_key <  15){
100
+                <?  $cnt = 7;
101
+                    foreach ($csv_tmp_data as $csv_key => $csv_value) {
102
+                        if ($csv_key < 15) {
103 103
                             echo "<tr>";
104
-                            foreach($csv_value as $field_name => $field_val){
105
-                                if($csv_key == 0){
104
+                            foreach ($csv_value as $field_name => $field_val) {
105
+                                if ($csv_key == 0) {
106 106
                                     echo "<th>".ucfirst($field_name)."</th>";
107
-                                }else{
107
+                                } else {
108 108
                                     echo "<td class='portlet-content'>".$field_val."</td>";   
109 109
                                 }
110 110
                             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
                                 if($csv_key == 0){
102 102
 				    $cnt++;
103 103
                                     echo "<th>".ucfirst($field_name)."</th>";
104
-                                }else{
104
+                                } else{
105 105
                                     echo "<td class='portlet-content'>".$field_val."</td>";   
106 106
                                 }
107 107
                             }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/rates/views/view_import_error.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     </div> 
44 44
 <br/>
45 45
 
46
-<?php if(isset($trunkid) && $trunkid != ""){ ?>
46
+<?php if (isset($trunkid) && $trunkid != "") { ?>
47 47
 <div class="col-md-12 padding-b-10">
48 48
                    <div class="pull-right">
49 49
                         <a href="<?= base_url().'rates/termination_rates_list/'?>"><input class="btn btn-line-sky margin-x-10" id="ok" type="button" name="action" value="Back to Termination Rates List" /> </a>
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                         <a href="<?= base_url().'rates/termination_rate_error_download/'?>"><input class="btn btn-line-parrot" id="ok" type="button" name="action" value="Download Errors" /> </a>
52 52
              </div></div>       <?}?>    
53 53
 
54
-                    <?php if(isset($pricelistid) && $pricelistid != ""){ ?>
54
+                    <?php if (isset($pricelistid) && $pricelistid != "") { ?>
55 55
 <div class="col-md-12 padding-b-10">
56 56
                    <div class="pull-right">
57 57
                         <a href="<?= base_url().'rates/origination_rates_list/'?>"><input class="btn btn-line-sky margin-x-10" id="back_to_list" type="button" name="action" value="Back to Origination Rates List" /> </a>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/controllers/pricing.php 3 patches
Indentation   +183 added lines, -183 removed lines patch added patch discarded remove patch
@@ -22,213 +22,213 @@
 block discarded – undo
22 22
 ###############################################################################
23 23
 class pricing extends CI_Controller {
24 24
 
25
-    function pricing() {
26
-        parent::__construct();
27
-
28
-        $this->load->helper('template_inheritance');
29
-
30
-        $this->load->library('session');
31
-        $this->load->library("pricing_form");
32
-        $this->load->library('astpp/form');
33
-        $this->load->model('pricing_model');
34
-
35
-        if ($this->session->userdata('user_login') == FALSE)
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';
50
-        $where = array('id' => $edit_id);
51
-        $account = $this->db_model->getSelect("*", " pricelists", $where);
52
-        foreach ($account->result_array() as $key => $value) {
53
-            $edit_data = $value;
54
-        }
25
+	function pricing() {
26
+		parent::__construct();
27
+
28
+		$this->load->helper('template_inheritance');
29
+
30
+		$this->load->library('session');
31
+		$this->load->library("pricing_form");
32
+		$this->load->library('astpp/form');
33
+		$this->load->model('pricing_model');
34
+
35
+		if ($this->session->userdata('user_login') == FALSE)
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';
50
+		$where = array('id' => $edit_id);
51
+		$account = $this->db_model->getSelect("*", " pricelists", $where);
52
+		foreach ($account->result_array() as $key => $value) {
53
+			$edit_data = $value;
54
+		}
55 55
 	$routing_data = $this->db_model->getSelect("trunk_id", "routing",array("pricelist_id"=>$edit_id));
56 56
 	if($routing_data->num_rows > 0){
57 57
 	  foreach($routing_data->result_array() as $trunkid){
58
-	    $edit_data["trunk_id"][] = $trunkid["trunk_id"];
58
+		$edit_data["trunk_id"][] = $trunkid["trunk_id"];
59 59
 	  }
60 60
 	}
61
-        $data['form'] = $this->form->build_form($this->pricing_form->get_pricing_form_fields(), $edit_data);
62
-        $this->load->view('view_price_add_edit', $data);
63
-    }
64
-
65
-    function price_save() {
66
-        $add_array = $this->input->post();
67
-
68
-        $data['form'] = $this->form->build_form($this->pricing_form->get_pricing_form_fields(), $add_array);
69
-        if ($add_array['id'] != '') {
70
-            $data['page_title'] = 'Edit Price Details';
71
-            if ($this->form_validation->run() == FALSE) {
72
-                $data['validation_errors'] = validation_errors();
73
-                echo $data['validation_errors'];
74
-                exit;
75
-            } else {
61
+		$data['form'] = $this->form->build_form($this->pricing_form->get_pricing_form_fields(), $edit_data);
62
+		$this->load->view('view_price_add_edit', $data);
63
+	}
64
+
65
+	function price_save() {
66
+		$add_array = $this->input->post();
67
+
68
+		$data['form'] = $this->form->build_form($this->pricing_form->get_pricing_form_fields(), $add_array);
69
+		if ($add_array['id'] != '') {
70
+			$data['page_title'] = 'Edit Price Details';
71
+			if ($this->form_validation->run() == FALSE) {
72
+				$data['validation_errors'] = validation_errors();
73
+				echo $data['validation_errors'];
74
+				exit;
75
+			} else {
76 76
 	  	  $where = array("pricelist_id"=>$add_array['id']);
77 77
 	  	  $this->db->delete("routing",$where);
78 78
 		if(isset($add_array['trunk_id']) && $add_array['trunk_id'] != ''){
79 79
 		  $this->set_force_routing($add_array['id'],$add_array['trunk_id']);
80 80
 		  unset($add_array['trunk_id']);
81 81
 		}
82
-                $this->pricing_model->edit_price($add_array, $add_array['id']);
83
-                echo json_encode(array("SUCCESS"=> $add_array["name"]." rate group updated successfully!"));
84
-                exit;
85
-            }
86
-            $this->load->view('view_price_add_edit', $data);
87
-       }else {
88
-            $data['page_title'] = 'Create Price Details';
89
-            if ($this->form_validation->run() == FALSE) {
90
-                $data['validation_errors'] = validation_errors();
91
-                echo $data['validation_errors'];
92
-                exit;
93
-            } else {
82
+				$this->pricing_model->edit_price($add_array, $add_array['id']);
83
+				echo json_encode(array("SUCCESS"=> $add_array["name"]." rate group updated successfully!"));
84
+				exit;
85
+			}
86
+			$this->load->view('view_price_add_edit', $data);
87
+	   }else {
88
+			$data['page_title'] = 'Create Price Details';
89
+			if ($this->form_validation->run() == FALSE) {
90
+				$data['validation_errors'] = validation_errors();
91
+				echo $data['validation_errors'];
92
+				exit;
93
+			} else {
94 94
 		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id']))
95
-                $trunk_id=$add_array['trunk_id'];
96
-                unset($add_array['trunk_id']);
97
-                $priceid=$this->pricing_model->add_price($add_array);
95
+				$trunk_id=$add_array['trunk_id'];
96
+				unset($add_array['trunk_id']);
97
+				$priceid=$this->pricing_model->add_price($add_array);
98 98
 		if(isset($trunk_id) && $trunk_id != ''){
99 99
 		  $this->set_force_routing($priceid,$trunk_id);
100 100
 		}
101
-                echo json_encode(array("SUCCESS"=> $add_array["name"]." rate group added successfully!"));
102
-                exit;
103
-            }
104
-        }
105
-    }
106
-    function set_force_routing($priceid,$trunkid){
101
+				echo json_encode(array("SUCCESS"=> $add_array["name"]." rate group added successfully!"));
102
+				exit;
103
+			}
104
+		}
105
+	}
106
+	function set_force_routing($priceid,$trunkid){
107 107
 // 	echo "<pre>".$priceid; print_r($trunkid);
108 108
 	foreach($trunkid as $id){
109 109
 	  $routing_arr = array("trunk_id" => $id, "pricelist_id"=>$priceid);
110 110
 	  $this->db->insert("routing",$routing_arr);
111 111
 	}
112
-    }
113
-    function price_list_search() {
114
-        $ajax_search = $this->input->post('ajax_search', 0);
115
-
116
-        if ($this->input->post('advance_search', TRUE) == 1) {
117
-            $this->session->set_userdata('advance_search', $this->input->post('advance_search'));
118
-            $action = $this->input->post();
119
-            unset($action['action']);
120
-            unset($action['advance_search']);
121
-            $this->session->set_userdata('price_list_search', $action);
122
-        }
123
-        if (@$ajax_search != 1) {
124
-            redirect(base_url() . 'accounts/customer_list/');
125
-        }
126
-    }
127
-
128
-    function price_list_clearsearchfilter() {
129
-        $this->session->set_userdata('advance_search', 0);
130
-        $this->session->set_userdata('account_search', "");
131
-    }
132
-
133
-    function price_list() {
134
-        $data['username'] = $this->session->userdata('user_name');
135
-        $data['page_title'] = 'Rate Groups';
112
+	}
113
+	function price_list_search() {
114
+		$ajax_search = $this->input->post('ajax_search', 0);
115
+
116
+		if ($this->input->post('advance_search', TRUE) == 1) {
117
+			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
118
+			$action = $this->input->post();
119
+			unset($action['action']);
120
+			unset($action['advance_search']);
121
+			$this->session->set_userdata('price_list_search', $action);
122
+		}
123
+		if (@$ajax_search != 1) {
124
+			redirect(base_url() . 'accounts/customer_list/');
125
+		}
126
+	}
127
+
128
+	function price_list_clearsearchfilter() {
129
+		$this->session->set_userdata('advance_search', 0);
130
+		$this->session->set_userdata('account_search', "");
131
+	}
132
+
133
+	function price_list() {
134
+		$data['username'] = $this->session->userdata('user_name');
135
+		$data['page_title'] = 'Rate Groups';
136 136
 		$data['search_flag'] = true;
137
-        $this->session->set_userdata('advance_search', 0);
138
-        $data['grid_fields'] = $this->pricing_form->build_pricing_list_for_admin();
139
-        $data["grid_buttons"] = $this->pricing_form->build_grid_buttons();
140
-        $data['form_search'] = $this->form->build_serach_form($this->pricing_form->get_pricing_search_form());
141
-        $this->load->view('view_price_list', $data);
142
-    }
143
-
144
-    /**
145
-     * -------Here we write code for controller accounts functions account_list------
146
-     * Listing of Accounts table data through php function json_encode
147
-     */
148
-    function price_list_json() {
149
-        $json_data = array();
150
-        $count_all = $this->pricing_model->getpricing_list(false);
151
-        $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
152
-        $json_data = $paging_data["json_paging"];
153
-
154
-        $query = $this->pricing_model->getpricing_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
155
-        $grid_fields = json_decode($this->pricing_form->build_pricing_list_for_admin());
156
-        $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
157
-
158
-        echo json_encode($json_data);
159
-    }
160
-
161
-    function price_delete($pricelist_id) {
162
-        $where = array("id" => $pricelist_id);
163
-        $this->db_model->update("pricelists", array("status" => "2"), $where);
137
+		$this->session->set_userdata('advance_search', 0);
138
+		$data['grid_fields'] = $this->pricing_form->build_pricing_list_for_admin();
139
+		$data["grid_buttons"] = $this->pricing_form->build_grid_buttons();
140
+		$data['form_search'] = $this->form->build_serach_form($this->pricing_form->get_pricing_search_form());
141
+		$this->load->view('view_price_list', $data);
142
+	}
143
+
144
+	/**
145
+	 * -------Here we write code for controller accounts functions account_list------
146
+	 * Listing of Accounts table data through php function json_encode
147
+	 */
148
+	function price_list_json() {
149
+		$json_data = array();
150
+		$count_all = $this->pricing_model->getpricing_list(false);
151
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
152
+		$json_data = $paging_data["json_paging"];
153
+
154
+		$query = $this->pricing_model->getpricing_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
155
+		$grid_fields = json_decode($this->pricing_form->build_pricing_list_for_admin());
156
+		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
157
+
158
+		echo json_encode($json_data);
159
+	}
160
+
161
+	function price_delete($pricelist_id) {
162
+		$where = array("id" => $pricelist_id);
163
+		$this->db_model->update("pricelists", array("status" => "2"), $where);
164 164
 	$this->db->delete("routing",array("pricelist_id"=>$pricelist_id));
165
-        $this->session->set_flashdata('astpp_notification', 'Rate group removed successfully!');
166
-        redirect(base_url() . 'pricing/price_list/');
167
-    }
165
+		$this->session->set_flashdata('astpp_notification', 'Rate group removed successfully!');
166
+		redirect(base_url() . 'pricing/price_list/');
167
+	}
168 168
 
169 169
  function price_delete_multiple() {
170
-        $add_array = $this->input->post();
171
-        $where = 'IN ('.$add_array['selected_ids'].')';
172
-        if (isset($add_array['flag'])) {            
173
-            $update_data = array('status' => '2');
174
-            $this->db->where('pricelist_id '.$where);
175
-            $this->db->delete('routes');            
176
-            $this->db->delete("routing",array("pricelist_id"=>$where));
177
-            $this->db->where('id '.$where);
178
-            echo $this->db->update('pricelists', $update_data);
179
-        } else {
180
-            $pricelist_arr=array();
181
-            //Get selected Rategroup Name from database.
182
-            $this->db->select('id,name');
183
-            $this->db->where('id '.$where);
184
-            $pricelist_res=$this->db->get('pricelists');
185
-            $pricelist_res=$pricelist_res->result_array();
186
-            foreach($pricelist_res as $value){
187
-                $pricelist_arr[$value['id']]['name']=$value['name'];
188
-            }
189
-            //Get count of accounts which are using selected rategroups.
190
-            $this->db->where('pricelist_id '.$where);
191
-            $this->db->where('deleted',0);
192
-            $this->db->select('count(id) as cnt,pricelist_id');
193
-            $this->db->group_by('pricelist_id');
194
-            $account_res=$this->db->get('accounts');
195
-            if($account_res->num_rows() > 0){
196
-             $account_res=$account_res->result_array();
197
-             foreach($account_res as $key=>$value){
198
-                $pricelist_arr[$value['pricelist_id']]['account']=$value['cnt'];
199
-             }
200
-            }
201
-            //Get count of routes which are using selected rategroups.
202
-            $this->db->where('pricelist_id '.$where);
203
-            $this->db->select('count(id) as cnt,pricelist_id');
204
-            $this->db->group_by('pricelist_id');
205
-            $routes_res=$this->db->get('routes');
206
-            if($routes_res->num_rows() > 0){
207
-             $routes_res=$routes_res->result_array();
208
-             foreach($routes_res as $key=>$value){
209
-                $pricelist_arr[$value['pricelist_id']]['routes']=$value['cnt'];
210
-             }
211
-            }
212
-            $str=null;
213
-            foreach($pricelist_arr as $key=>$value){
214
-               $custom_str=null;
215
-               if(isset($value['account']) || isset($value['routes'])){
216
-                 if(isset($value['account'])){
217
-                     $custom_str.= $value['account']." accounts and ";
218
-                 }
219
-                 if(isset($value['routes'])){
220
-                     $custom_str.= $value['routes']." origination rates and ";
221
-                 }
222
-                 $str.=" Rate group Name : ".$value['name']." using by ".rtrim($custom_str," and ")."\n";
223
-               }
224
-            }
225
-            if(!empty($str)){
226
-                $data['str']=$str;
227
-            }    
228
-            $data['selected_ids']=$add_array['selected_ids'];
229
-            echo json_encode($data);
230
-        }
231
-    }
170
+		$add_array = $this->input->post();
171
+		$where = 'IN ('.$add_array['selected_ids'].')';
172
+		if (isset($add_array['flag'])) {            
173
+			$update_data = array('status' => '2');
174
+			$this->db->where('pricelist_id '.$where);
175
+			$this->db->delete('routes');            
176
+			$this->db->delete("routing",array("pricelist_id"=>$where));
177
+			$this->db->where('id '.$where);
178
+			echo $this->db->update('pricelists', $update_data);
179
+		} else {
180
+			$pricelist_arr=array();
181
+			//Get selected Rategroup Name from database.
182
+			$this->db->select('id,name');
183
+			$this->db->where('id '.$where);
184
+			$pricelist_res=$this->db->get('pricelists');
185
+			$pricelist_res=$pricelist_res->result_array();
186
+			foreach($pricelist_res as $value){
187
+				$pricelist_arr[$value['id']]['name']=$value['name'];
188
+			}
189
+			//Get count of accounts which are using selected rategroups.
190
+			$this->db->where('pricelist_id '.$where);
191
+			$this->db->where('deleted',0);
192
+			$this->db->select('count(id) as cnt,pricelist_id');
193
+			$this->db->group_by('pricelist_id');
194
+			$account_res=$this->db->get('accounts');
195
+			if($account_res->num_rows() > 0){
196
+			 $account_res=$account_res->result_array();
197
+			 foreach($account_res as $key=>$value){
198
+				$pricelist_arr[$value['pricelist_id']]['account']=$value['cnt'];
199
+			 }
200
+			}
201
+			//Get count of routes which are using selected rategroups.
202
+			$this->db->where('pricelist_id '.$where);
203
+			$this->db->select('count(id) as cnt,pricelist_id');
204
+			$this->db->group_by('pricelist_id');
205
+			$routes_res=$this->db->get('routes');
206
+			if($routes_res->num_rows() > 0){
207
+			 $routes_res=$routes_res->result_array();
208
+			 foreach($routes_res as $key=>$value){
209
+				$pricelist_arr[$value['pricelist_id']]['routes']=$value['cnt'];
210
+			 }
211
+			}
212
+			$str=null;
213
+			foreach($pricelist_arr as $key=>$value){
214
+			   $custom_str=null;
215
+			   if(isset($value['account']) || isset($value['routes'])){
216
+				 if(isset($value['account'])){
217
+					 $custom_str.= $value['account']." accounts and ";
218
+				 }
219
+				 if(isset($value['routes'])){
220
+					 $custom_str.= $value['routes']." origination rates and ";
221
+				 }
222
+				 $str.=" Rate group Name : ".$value['name']." using by ".rtrim($custom_str," and ")."\n";
223
+			   }
224
+			}
225
+			if(!empty($str)){
226
+				$data['str']=$str;
227
+			}    
228
+			$data['selected_ids']=$add_array['selected_ids'];
229
+			echo json_encode($data);
230
+		}
231
+	}
232 232
 /***********************************************************/
233 233
     
234 234
 }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $this->load->model('pricing_model');
34 34
 
35 35
         if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
36
+            redirect(base_url().'/astpp/login');
37 37
     }
38 38
 
39 39
     function price_add($type = "") {
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         foreach ($account->result_array() as $key => $value) {
53 53
             $edit_data = $value;
54 54
         }
55
-	$routing_data = $this->db_model->getSelect("trunk_id", "routing",array("pricelist_id"=>$edit_id));
56
-	if($routing_data->num_rows > 0){
57
-	  foreach($routing_data->result_array() as $trunkid){
55
+	$routing_data = $this->db_model->getSelect("trunk_id", "routing", array("pricelist_id"=>$edit_id));
56
+	if ($routing_data->num_rows > 0) {
57
+	  foreach ($routing_data->result_array() as $trunkid) {
58 58
 	    $edit_data["trunk_id"][] = $trunkid["trunk_id"];
59 59
 	  }
60 60
 	}
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
                 exit;
75 75
             } else {
76 76
 	  	  $where = array("pricelist_id"=>$add_array['id']);
77
-	  	  $this->db->delete("routing",$where);
78
-		if(isset($add_array['trunk_id']) && $add_array['trunk_id'] != ''){
79
-		  $this->set_force_routing($add_array['id'],$add_array['trunk_id']);
77
+	  	  $this->db->delete("routing", $where);
78
+		if (isset($add_array['trunk_id']) && $add_array['trunk_id'] != '') {
79
+		  $this->set_force_routing($add_array['id'], $add_array['trunk_id']);
80 80
 		  unset($add_array['trunk_id']);
81 81
 		}
82 82
                 $this->pricing_model->edit_price($add_array, $add_array['id']);
@@ -84,30 +84,30 @@  discard block
 block discarded – undo
84 84
                 exit;
85 85
             }
86 86
             $this->load->view('view_price_add_edit', $data);
87
-       }else {
87
+       } else {
88 88
             $data['page_title'] = 'Create Price Details';
89 89
             if ($this->form_validation->run() == FALSE) {
90 90
                 $data['validation_errors'] = validation_errors();
91 91
                 echo $data['validation_errors'];
92 92
                 exit;
93 93
             } else {
94
-		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id']))
95
-                $trunk_id=$add_array['trunk_id'];
94
+		if (isset($add_array['trunk_id']) && ! empty($add_array['trunk_id']))
95
+                $trunk_id = $add_array['trunk_id'];
96 96
                 unset($add_array['trunk_id']);
97
-                $priceid=$this->pricing_model->add_price($add_array);
98
-		if(isset($trunk_id) && $trunk_id != ''){
99
-		  $this->set_force_routing($priceid,$trunk_id);
97
+                $priceid = $this->pricing_model->add_price($add_array);
98
+		if (isset($trunk_id) && $trunk_id != '') {
99
+		  $this->set_force_routing($priceid, $trunk_id);
100 100
 		}
101 101
                 echo json_encode(array("SUCCESS"=> $add_array["name"]." rate group added successfully!"));
102 102
                 exit;
103 103
             }
104 104
         }
105 105
     }
106
-    function set_force_routing($priceid,$trunkid){
106
+    function set_force_routing($priceid, $trunkid) {
107 107
 // 	echo "<pre>".$priceid; print_r($trunkid);
108
-	foreach($trunkid as $id){
108
+	foreach ($trunkid as $id) {
109 109
 	  $routing_arr = array("trunk_id" => $id, "pricelist_id"=>$priceid);
110
-	  $this->db->insert("routing",$routing_arr);
110
+	  $this->db->insert("routing", $routing_arr);
111 111
 	}
112 112
     }
113 113
     function price_list_search() {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $this->session->set_userdata('price_list_search', $action);
122 122
         }
123 123
         if (@$ajax_search != 1) {
124
-            redirect(base_url() . 'accounts/customer_list/');
124
+            redirect(base_url().'accounts/customer_list/');
125 125
         }
126 126
     }
127 127
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
     function price_delete($pricelist_id) {
162 162
         $where = array("id" => $pricelist_id);
163 163
         $this->db_model->update("pricelists", array("status" => "2"), $where);
164
-	$this->db->delete("routing",array("pricelist_id"=>$pricelist_id));
164
+	$this->db->delete("routing", array("pricelist_id"=>$pricelist_id));
165 165
         $this->session->set_flashdata('astpp_notification', 'Rate group removed successfully!');
166
-        redirect(base_url() . 'pricing/price_list/');
166
+        redirect(base_url().'pricing/price_list/');
167 167
     }
168 168
 
169 169
  function price_delete_multiple() {
@@ -173,59 +173,59 @@  discard block
 block discarded – undo
173 173
             $update_data = array('status' => '2');
174 174
             $this->db->where('pricelist_id '.$where);
175 175
             $this->db->delete('routes');            
176
-            $this->db->delete("routing",array("pricelist_id"=>$where));
176
+            $this->db->delete("routing", array("pricelist_id"=>$where));
177 177
             $this->db->where('id '.$where);
178 178
             echo $this->db->update('pricelists', $update_data);
179 179
         } else {
180
-            $pricelist_arr=array();
180
+            $pricelist_arr = array();
181 181
             //Get selected Rategroup Name from database.
182 182
             $this->db->select('id,name');
183 183
             $this->db->where('id '.$where);
184
-            $pricelist_res=$this->db->get('pricelists');
185
-            $pricelist_res=$pricelist_res->result_array();
186
-            foreach($pricelist_res as $value){
187
-                $pricelist_arr[$value['id']]['name']=$value['name'];
184
+            $pricelist_res = $this->db->get('pricelists');
185
+            $pricelist_res = $pricelist_res->result_array();
186
+            foreach ($pricelist_res as $value) {
187
+                $pricelist_arr[$value['id']]['name'] = $value['name'];
188 188
             }
189 189
             //Get count of accounts which are using selected rategroups.
190 190
             $this->db->where('pricelist_id '.$where);
191
-            $this->db->where('deleted',0);
191
+            $this->db->where('deleted', 0);
192 192
             $this->db->select('count(id) as cnt,pricelist_id');
193 193
             $this->db->group_by('pricelist_id');
194
-            $account_res=$this->db->get('accounts');
195
-            if($account_res->num_rows() > 0){
196
-             $account_res=$account_res->result_array();
197
-             foreach($account_res as $key=>$value){
198
-                $pricelist_arr[$value['pricelist_id']]['account']=$value['cnt'];
194
+            $account_res = $this->db->get('accounts');
195
+            if ($account_res->num_rows() > 0) {
196
+             $account_res = $account_res->result_array();
197
+             foreach ($account_res as $key=>$value) {
198
+                $pricelist_arr[$value['pricelist_id']]['account'] = $value['cnt'];
199 199
              }
200 200
             }
201 201
             //Get count of routes which are using selected rategroups.
202 202
             $this->db->where('pricelist_id '.$where);
203 203
             $this->db->select('count(id) as cnt,pricelist_id');
204 204
             $this->db->group_by('pricelist_id');
205
-            $routes_res=$this->db->get('routes');
206
-            if($routes_res->num_rows() > 0){
207
-             $routes_res=$routes_res->result_array();
208
-             foreach($routes_res as $key=>$value){
209
-                $pricelist_arr[$value['pricelist_id']]['routes']=$value['cnt'];
205
+            $routes_res = $this->db->get('routes');
206
+            if ($routes_res->num_rows() > 0) {
207
+             $routes_res = $routes_res->result_array();
208
+             foreach ($routes_res as $key=>$value) {
209
+                $pricelist_arr[$value['pricelist_id']]['routes'] = $value['cnt'];
210 210
              }
211 211
             }
212
-            $str=null;
213
-            foreach($pricelist_arr as $key=>$value){
214
-               $custom_str=null;
215
-               if(isset($value['account']) || isset($value['routes'])){
216
-                 if(isset($value['account'])){
217
-                     $custom_str.= $value['account']." accounts and ";
212
+            $str = null;
213
+            foreach ($pricelist_arr as $key=>$value) {
214
+               $custom_str = null;
215
+               if (isset($value['account']) || isset($value['routes'])) {
216
+                 if (isset($value['account'])) {
217
+                     $custom_str .= $value['account']." accounts and ";
218 218
                  }
219
-                 if(isset($value['routes'])){
220
-                     $custom_str.= $value['routes']." origination rates and ";
219
+                 if (isset($value['routes'])) {
220
+                     $custom_str .= $value['routes']." origination rates and ";
221 221
                  }
222
-                 $str.=" Rate group Name : ".$value['name']." using by ".rtrim($custom_str," and ")."\n";
222
+                 $str .= " Rate group Name : ".$value['name']." using by ".rtrim($custom_str, " and ")."\n";
223 223
                }
224 224
             }
225
-            if(!empty($str)){
226
-                $data['str']=$str;
225
+            if ( ! empty($str)) {
226
+                $data['str'] = $str;
227 227
             }    
228
-            $data['selected_ids']=$add_array['selected_ids'];
228
+            $data['selected_ids'] = $add_array['selected_ids'];
229 229
             echo json_encode($data);
230 230
         }
231 231
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
         $this->load->library('astpp/form');
33 33
         $this->load->model('pricing_model');
34 34
 
35
-        if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
35
+        if ($this->session->userdata('user_login') == FALSE) {
36
+                    redirect(base_url() . '/astpp/login');
37
+        }
37 38
     }
38 39
 
39 40
     function price_add($type = "") {
@@ -84,15 +85,16 @@  discard block
 block discarded – undo
84 85
                 exit;
85 86
             }
86 87
             $this->load->view('view_price_add_edit', $data);
87
-       }else {
88
+       } else {
88 89
             $data['page_title'] = 'Create Price Details';
89 90
             if ($this->form_validation->run() == FALSE) {
90 91
                 $data['validation_errors'] = validation_errors();
91 92
                 echo $data['validation_errors'];
92 93
                 exit;
93 94
             } else {
94
-		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id']))
95
-                $trunk_id=$add_array['trunk_id'];
95
+		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id'])) {
96
+		                $trunk_id=$add_array['trunk_id'];
97
+		}
96 98
                 unset($add_array['trunk_id']);
97 99
                 $priceid=$this->pricing_model->add_price($add_array);
98 100
 		if(isset($trunk_id) && $trunk_id != ''){
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/libraries/pricing_form.php 3 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 ###############################################################################
23 23
 
24 24
 if (!defined('BASEPATH'))
25
-    exit('No direct script access allowed');
25
+	exit('No direct script access allowed');
26 26
 
27 27
 class pricing_form {
28
-    function __construct($library_name = '') {
29
-        $this->CI = & get_instance();
30
-    }
31
-    function get_pricing_form_fields() {
28
+	function __construct($library_name = '') {
29
+		$this->CI = & get_instance();
30
+	}
31
+	function get_pricing_form_fields() {
32 32
 	$form['forms'] = array(base_url() . 'pricing/price_save/', array('id' => 'pricing_form', 'method' => 'POST', 'name' => 'pricing_form'));
33
-        if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) {
34
-	    $form['Rate Group Information'] = array(
33
+		if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) {
34
+		$form['Rate Group Information'] = array(
35 35
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
36 36
 		array('', 'HIDDEN', array('name' => 'status', 'value' => '1'), '', '', ''),
37 37
 		array('Name', 'INPUT', array('name' => 'name', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		array('Default Increment', 'INPUT', array('name' => 'inc', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
41 41
 		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0" ,  'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
42 42
 		array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
43
-	    );
43
+		);
44 44
 	}
45 45
 	else{
46 46
 	  $form['Rate Group Information'] = array(
@@ -57,64 +57,64 @@  discard block
 block discarded – undo
57 57
 	}
58 58
         
59 59
 
60
-        $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
61
-        $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
60
+		$form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
61
+		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
62 62
 
63
-        return $form;
64
-    }
63
+		return $form;
64
+	}
65 65
 
66
-    function get_pricing_search_form() {
67
-        $form['forms'] = array("", array('id' => "price_search"));
68
-        $form['Search'] = array(
69
-            array('Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''),
70
-            array('Routing Type', 'routing_type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_routetype_status', '', ''),
71
-            array('Initial Increment ', 'INPUT', array('name' => 'initially_increment[initially_increment]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'initially_increment[initially_increment-string]', '', '', '', 'search_string_type', ''),
72
-            array('Default Increment ', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'inc[inc-string]', '', '', '', 'search_string_type', ''),
66
+	function get_pricing_search_form() {
67
+		$form['forms'] = array("", array('id' => "price_search"));
68
+		$form['Search'] = array(
69
+			array('Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''),
70
+			array('Routing Type', 'routing_type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_routetype_status', '', ''),
71
+			array('Initial Increment ', 'INPUT', array('name' => 'initially_increment[initially_increment]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'initially_increment[initially_increment-string]', '', '', '', 'search_string_type', ''),
72
+			array('Default Increment ', 'INPUT', array('name' => 'inc[inc]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'inc[inc-string]', '', '', '', 'search_string_type', ''),
73 73
             
74 74
 			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),
75
-            array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
76
-            array('', 'HIDDEN', 'advance_search', '1', '', '', ''),
75
+			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
76
+			array('', 'HIDDEN', 'advance_search', '1', '', '', ''),
77 77
 
78
-        );
79
-        $form['button_search'] = array('name' => 'action', 'id' => "price_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => "btn btn-line-parrot pull-right");
80
-        $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => "btn btn-line-sky pull-right margin-x-10");
78
+		);
79
+		$form['button_search'] = array('name' => 'action', 'id' => "price_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => "btn btn-line-parrot pull-right");
80
+		$form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => "btn btn-line-sky pull-right margin-x-10");
81 81
 
82
-        return $form;
83
-    }
82
+		return $form;
83
+	}
84 84
 
85 85
 	   /*
86 86
             ASTPP  3.0  Changes in grid size
87 87
             */
88
-    function build_pricing_list_for_admin() {
89
-        // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
90
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
88
+	function build_pricing_list_for_admin() {
89
+		// array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
90
+		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
91 91
 /**
92 92
 ASTPP  3.0 
93 93
 For Rategroup edit on Name
94 94
 **/
95
-            array(gettext("Name"), "110", "name", "", "", "","EDITABLE","true","center"),
95
+			array(gettext("Name"), "110", "name", "", "", "","EDITABLE","true","center"),
96 96
 /***************************************/
97
-            array(gettext("Routing Type"), "120", "routing_type", "routing_type", "routing_type", "get_routetype"),
98
-	    array(gettext("Initial Increment"), "140", "initially_increment", "", "", "","","true","center"),
99
-            array("Default Increment", "140", "inc", "", "", "","","true","center"),
100
-            array(gettext("Markup(%)"), "100", "markup", "", "", "","","true","center"),
101
-	    array(gettext("Rate Count"), "100", "id", "pricelist_id", "routes", "get_field_count","","true","center"),
102
-            array(gettext("Status"), "110", "status", "id", "pricelists", "get_status","","true","center"),
103
-            array(gettext("Created Date"), "120", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
104
-            array(gettext("Modified Date"), "140", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
105
-            array("Action", "150", "", "", "", array("EDIT" => array("url" => "pricing/price_edit/", "mode" => "popup"),
97
+			array(gettext("Routing Type"), "120", "routing_type", "routing_type", "routing_type", "get_routetype"),
98
+		array(gettext("Initial Increment"), "140", "initially_increment", "", "", "","","true","center"),
99
+			array("Default Increment", "140", "inc", "", "", "","","true","center"),
100
+			array(gettext("Markup(%)"), "100", "markup", "", "", "","","true","center"),
101
+		array(gettext("Rate Count"), "100", "id", "pricelist_id", "routes", "get_field_count","","true","center"),
102
+			array(gettext("Status"), "110", "status", "id", "pricelists", "get_status","","true","center"),
103
+			array(gettext("Created Date"), "120", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
104
+			array(gettext("Modified Date"), "140", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
105
+			array("Action", "150", "", "", "", array("EDIT" => array("url" => "pricing/price_edit/", "mode" => "popup"),
106 106
 
107
-                    "DELETE" => array("url" => "pricing/price_delete/", "mode" => "single")))
108
-                ));
109
-        return $grid_field_arr;
110
-    }
107
+					"DELETE" => array("url" => "pricing/price_delete/", "mode" => "single")))
108
+				));
109
+		return $grid_field_arr;
110
+	}
111 111
 
112
-    function build_grid_buttons() {
113
-        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn" ,"fa fa-plus-circle fa-lg", "button_action", "/pricing/price_add/", "popup"),
114
-            array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/pricing/price_delete_multiple/")
115
-            ));
116
-        return $buttons_json;
117
-    }
112
+	function build_grid_buttons() {
113
+		$buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn" ,"fa fa-plus-circle fa-lg", "button_action", "/pricing/price_add/", "popup"),
114
+			array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/pricing/price_delete_multiple/")
115
+			));
116
+		return $buttons_json;
117
+	}
118 118
 
119 119
 }
120 120
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
24
+if ( ! defined('BASEPATH'))
25 25
     exit('No direct script access allowed');
26 26
 
27 27
 class pricing_form {
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
         $this->CI = & get_instance();
30 30
     }
31 31
     function get_pricing_form_fields() {
32
-	$form['forms'] = array(base_url() . 'pricing/price_save/', array('id' => 'pricing_form', 'method' => 'POST', 'name' => 'pricing_form'));
32
+	$form['forms'] = array(base_url().'pricing/price_save/', array('id' => 'pricing_form', 'method' => 'POST', 'name' => 'pricing_form'));
33 33
         if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) {
34 34
 	    $form['Rate Group Information'] = array(
35 35
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
36 36
 		array('', 'HIDDEN', array('name' => 'status', 'value' => '1'), '', '', ''),
37
-		array('Name', 'INPUT', array('name' => 'name', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
37
+		array('Name', 'INPUT', array('name' => 'name', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
38 38
 		array('Routing Type', 'routing_type', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_routetype'),
39 39
 		array('Initial Increment', 'INPUT', array('name' => 'initially_increment', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
40
-		array('Default Increment', 'INPUT', array('name' => 'inc', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
41
-		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0" ,  'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
40
+		array('Default Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
41
+		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0", 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
42 42
 		array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
43 43
 	    );
44 44
 	}
45
-	else{
45
+	else {
46 46
 	  $form['Rate Group Information'] = array(
47 47
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
48 48
 		array('', 'HIDDEN', array('name' => 'status', 'value' => '1'), '', '', ''),
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 		array('Routing Type', 'routing_type', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_routetype'),
51 51
 		array('Initial Increment', 'INPUT', array('name' => 'initially_increment', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
52 52
 		array('Default Increment', 'INPUT', array('name' => 'inc', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
53
-		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0" , 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
54
-		array('Trunks','trunk_id', 'SELECT', '','', 'tOOL TIP', 'Please Select Trunks', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status <" => "2"), 'multi'),
53
+		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0", 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
54
+		array('Trunks', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Select Trunks', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status <" => "2"), 'multi'),
55 55
 		array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
56 56
 		  );
57 57
 	}
@@ -87,21 +87,21 @@  discard block
 block discarded – undo
87 87
             */
88 88
     function build_pricing_list_for_admin() {
89 89
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
90
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
90
+        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
91 91
 /**
92 92
 ASTPP  3.0 
93 93
 For Rategroup edit on Name
94 94
 **/
95
-            array(gettext("Name"), "110", "name", "", "", "","EDITABLE","true","center"),
95
+            array(gettext("Name"), "110", "name", "", "", "", "EDITABLE", "true", "center"),
96 96
 /***************************************/
97 97
             array(gettext("Routing Type"), "120", "routing_type", "routing_type", "routing_type", "get_routetype"),
98
-	    array(gettext("Initial Increment"), "140", "initially_increment", "", "", "","","true","center"),
99
-            array("Default Increment", "140", "inc", "", "", "","","true","center"),
100
-            array(gettext("Markup(%)"), "100", "markup", "", "", "","","true","center"),
101
-	    array(gettext("Rate Count"), "100", "id", "pricelist_id", "routes", "get_field_count","","true","center"),
102
-            array(gettext("Status"), "110", "status", "id", "pricelists", "get_status","","true","center"),
103
-            array(gettext("Created Date"), "120", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
104
-            array(gettext("Modified Date"), "140", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
98
+	    array(gettext("Initial Increment"), "140", "initially_increment", "", "", "", "", "true", "center"),
99
+            array("Default Increment", "140", "inc", "", "", "", "", "true", "center"),
100
+            array(gettext("Markup(%)"), "100", "markup", "", "", "", "", "true", "center"),
101
+	    array(gettext("Rate Count"), "100", "id", "pricelist_id", "routes", "get_field_count", "", "true", "center"),
102
+            array(gettext("Status"), "110", "status", "id", "pricelists", "get_status", "", "true", "center"),
103
+            array(gettext("Created Date"), "120", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
104
+            array(gettext("Modified Date"), "140", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
105 105
             array("Action", "150", "", "", "", array("EDIT" => array("url" => "pricing/price_edit/", "mode" => "popup"),
106 106
 
107 107
                     "DELETE" => array("url" => "pricing/price_delete/", "mode" => "single")))
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
     }
111 111
 
112 112
     function build_grid_buttons() {
113
-        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn" ,"fa fa-plus-circle fa-lg", "button_action", "/pricing/price_add/", "popup"),
114
-            array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/pricing/price_delete_multiple/")
113
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/pricing/price_add/", "popup"),
114
+            array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/pricing/price_delete_multiple/")
115 115
             ));
116 116
         return $buttons_json;
117 117
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
25
-    exit('No direct script access allowed');
24
+if (!defined('BASEPATH')) {
25
+    exit('No direct script access allowed');
26
+}
26 27
 
27 28
 class pricing_form {
28 29
     function __construct($library_name = '') {
@@ -41,8 +42,7 @@  discard block
 block discarded – undo
41 42
 		array('Markup(%)', 'INPUT', array('name' => 'markup', 'value' => "0" ,  'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
42 43
 		array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
43 44
 	    );
44
-	}
45
-	else{
45
+	} else{
46 46
 	  $form['Rate Group Information'] = array(
47 47
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
48 48
 		array('', 'HIDDEN', array('name' => 'status', 'value' => '1'), '', '', ''),
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/models/pricing_model.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -22,73 +22,73 @@
 block discarded – undo
22 22
 ###############################################################################
23 23
 class pricing_model extends CI_Model {
24 24
 
25
-    function pricing_model() {
26
-        parent::__construct();
27
-    }
25
+	function pricing_model() {
26
+		parent::__construct();
27
+	}
28 28
 
29
-    function getpricing_list($flag, $start = 0, $limit = 0) {
30
-        $this->db_model->build_search('price_list_search');
31
-        if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32
-            $account_data = $this->session->userdata("accountinfo");
33
-            $reseller = $account_data['id'];
34
-           //$where = array("reseller_id" => $reseller, "status" => "0");
29
+	function getpricing_list($flag, $start = 0, $limit = 0) {
30
+		$this->db_model->build_search('price_list_search');
31
+		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32
+			$account_data = $this->session->userdata("accountinfo");
33
+			$reseller = $account_data['id'];
34
+		   //$where = array("reseller_id" => $reseller, "status" => "0");
35 35
 	$where = array("reseller_id" => $reseller, "status != " => "2");
36
-        } else {
37
-            $where = array("reseller_id" => "0", "status != " => "2");
38
-        }
39
-        if ($flag) {
40
-            $query = $this->db_model->Select("*", "pricelists", $where, "id", "ASC", $limit, $start);
41
-        } else {
42
-            $query = $this->db_model->countQuery("*", "pricelists", $where);
43
-        }
44
-        return $query;
45
-    }
36
+		} else {
37
+			$where = array("reseller_id" => "0", "status != " => "2");
38
+		}
39
+		if ($flag) {
40
+			$query = $this->db_model->Select("*", "pricelists", $where, "id", "ASC", $limit, $start);
41
+		} else {
42
+			$query = $this->db_model->countQuery("*", "pricelists", $where);
43
+		}
44
+		return $query;
45
+	}
46 46
 
47
-    function add_price($add_array) {
48
-        unset($add_array["action"]);
49
-        /*
47
+	function add_price($add_array) {
48
+		unset($add_array["action"]);
49
+		/*
50 50
         ASTPP  3.0  Add Rategroup add creation date.
51 51
         */
52
-        $add_array['creation_date']=gmdate("Y-m-d H:i:s");
53
-        /************************************/
54
-        if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
55
-            $account_data = $this->session->userdata("accountinfo");
56
-            $add_array["reseller_id"] = $account_data['id'];
57
-        } else {
58
-            $add_array["reseller_id"] = "0";
59
-        }
60
-        $this->db->insert("pricelists", $add_array);
52
+		$add_array['creation_date']=gmdate("Y-m-d H:i:s");
53
+		/************************************/
54
+		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
55
+			$account_data = $this->session->userdata("accountinfo");
56
+			$add_array["reseller_id"] = $account_data['id'];
57
+		} else {
58
+			$add_array["reseller_id"] = "0";
59
+		}
60
+		$this->db->insert("pricelists", $add_array);
61 61
         
62
-        return $this->db->insert_id();
63
-    }
62
+		return $this->db->insert_id();
63
+	}
64 64
 
65
-    function edit_price($data, $id) {
66
-        unset($data["action"]);
67
-        /*
65
+	function edit_price($data, $id) {
66
+		unset($data["action"]);
67
+		/*
68 68
         ASTPP  3.0  Edit Rategroup time update last mofied date.
69 69
         */
70
-        $data['last_modified_date']=gmdate("Y-m-d H:i:s");
71
-        /*********************************************************/
72
-        $this->db->where("id", $id);
73
-        $this->db->update("pricelists", $data);
74
-        return true;
75
-    }
70
+		$data['last_modified_date']=gmdate("Y-m-d H:i:s");
71
+		/*********************************************************/
72
+		$this->db->where("id", $id);
73
+		$this->db->update("pricelists", $data);
74
+		return true;
75
+	}
76 76
 
77
-    function get_price_list_for_cdrs() {
78
-        if ($this->session->userdata('username') != "" && $this->session->userdata('logintype') != 2) {
79
-            $this->db->where('reseller', $this->session->userdata('username'));
80
-        } else {
81
-            $this->db->where(array('reseller' => "0"));
82
-        }
83
-        $this->db->where('status <', 2);
84
-        $this->db->order_by('name', 'desc');
85
-        $query = $this->db->get("pricelists");
86
-        $price_list = array();
87
-        $result = $query->result_array();
88
-        foreach ($result as $row) {
89
-            $price_list[$row['name']] = $row['name'];
90
-        }
91
-        return $price_list;
92
-    }
77
+	function get_price_list_for_cdrs() {
78
+		if ($this->session->userdata('username') != "" && $this->session->userdata('logintype') != 2) {
79
+			$this->db->where('reseller', $this->session->userdata('username'));
80
+		} else {
81
+			$this->db->where(array('reseller' => "0"));
82
+		}
83
+		$this->db->where('status <', 2);
84
+		$this->db->order_by('name', 'desc');
85
+		$query = $this->db->get("pricelists");
86
+		$price_list = array();
87
+		$result = $query->result_array();
88
+		foreach ($result as $row) {
89
+			$price_list[$row['name']] = $row['name'];
90
+		}
91
+		return $price_list;
92
+	}
93 93
 
94 94
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         /*
50 50
         ASTPP  3.0  Add Rategroup add creation date.
51 51
         */
52
-        $add_array['creation_date']=gmdate("Y-m-d H:i:s");
52
+        $add_array['creation_date'] = gmdate("Y-m-d H:i:s");
53 53
         /************************************/
54 54
         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
55 55
             $account_data = $this->session->userdata("accountinfo");
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         /*
68 68
         ASTPP  3.0  Edit Rategroup time update last mofied date.
69 69
         */
70
-        $data['last_modified_date']=gmdate("Y-m-d H:i:s");
70
+        $data['last_modified_date'] = gmdate("Y-m-d H:i:s");
71 71
         /*********************************************************/
72 72
         $this->db->where("id", $id);
73 73
         $this->db->update("pricelists", $data);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/login/views/view_login.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@
 block discarded – undo
39 39
                         <?php if (isset($astpp_notification)){ ?>
40 40
                         Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active.
41 41
                     <?php }else{
42
-                         echo "&nbsp;";
43
-                    } ?>
42
+						 echo "&nbsp;";
43
+					} ?>
44 44
                     </span></div> <br/>
45 45
                     <br/>
46 46
                     <br/>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
     <link href="<?= base_url() ?>assets/css/global-style.css" rel="stylesheet" type="text/css">
12 12
     
13 13
      <!-- IE -->
14
-    <script type="text/javascript" src="<?php echo base_url();?>assets/js/respond.js"></script>
15
-    <script type="text/javascript" src="<?php echo base_url();?>assets/js/respond.src.js"></script>
14
+    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/respond.js"></script>
15
+    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/respond.src.js"></script>
16 16
     <noscript>
17 17
 	 <div id="noscript-warning">
18 18
 	  ASTPP work best with JavaScript enabled
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
             <div class="row">
37 37
                    
38 38
                         <div class="col-md-4 col-md-offset-4">&nbsp;<span class="login_error">
39
-                        <?php if (isset($astpp_notification)){ ?>
39
+                        <?php if (isset($astpp_notification)) { ?>
40 40
                         Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active.
41
-                    <?php }else{
41
+                    <?php } else {
42 42
                          echo "&nbsp;";
43 43
                     } ?>
44 44
                     </span></div> <br/>
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
                         <div class="col-md-4 col-md-offset-4">&nbsp;<span class="login_error">
39 39
                         <?php if (isset($astpp_notification)){ ?>
40 40
                         Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active.
41
-                    <?php }else{
41
+                    <?php } else{
42 42
                          echo "&nbsp;";
43 43
                     } ?>
44 44
                     </span></div> <br/>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/controllers/animap.php 3 patches
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -22,132 +22,132 @@
 block discarded – undo
22 22
 ###############################################################################
23 23
 class Animap extends MX_Controller {
24 24
 
25
-    function Animap() {
26
-        parent::__construct();
27
-
28
-        $this->load->helper('template_inheritance');
29
-
30
-        $this->load->library('session');
31
-        $this->load->library("animap_form");
32
-        $this->load->library('astpp/form');
33
-        $this->load->model('animap_model');
34
-
35
-        if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
37
-    }
38
-
39
-    function animap_add() {
40
-        $data['username'] = $this->session->userdata('user_name');
41
-        $data['flag'] = 'create';
42
-        $data['page_title'] = 'Add Caller ID';
43
-        $edit_id='';
44
-        $data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), '');
45
-
46
-        $this->load->view('animap_add_edit', $data);
47
-    }
48
-
49
-    function animap_edit($edit_id = '') {
50
-        $data['page_title'] = 'Edit Caller ID ';
51
-        $where = array('id' => $edit_id);
52
-        $account = $this->db_model->getSelect("*", "ani_map", $where);
53
-        foreach ($account->result_array() as $key => $value) {
54
-            $edit_data = $value;
55
-        }
25
+	function Animap() {
26
+		parent::__construct();
27
+
28
+		$this->load->helper('template_inheritance');
29
+
30
+		$this->load->library('session');
31
+		$this->load->library("animap_form");
32
+		$this->load->library('astpp/form');
33
+		$this->load->model('animap_model');
34
+
35
+		if ($this->session->userdata('user_login') == FALSE)
36
+			redirect(base_url() . '/astpp/login');
37
+	}
38
+
39
+	function animap_add() {
40
+		$data['username'] = $this->session->userdata('user_name');
41
+		$data['flag'] = 'create';
42
+		$data['page_title'] = 'Add Caller ID';
43
+		$edit_id='';
44
+		$data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), '');
45
+
46
+		$this->load->view('animap_add_edit', $data);
47
+	}
48
+
49
+	function animap_edit($edit_id = '') {
50
+		$data['page_title'] = 'Edit Caller ID ';
51
+		$where = array('id' => $edit_id);
52
+		$account = $this->db_model->getSelect("*", "ani_map", $where);
53
+		foreach ($account->result_array() as $key => $value) {
54
+			$edit_data = $value;
55
+		}
56 56
     
57
-        $data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $edit_data);
58
-        $this->load->view('animap_add_edit', $data);
59
-    }
60
-
61
-    function animap_save() {
62
-        $add_array = $this->input->post();
63
-
64
-      $edit_id=$add_array['id'];
65
-        $data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $add_array);
66
-        if ($add_array['id'] != '') {
67
-            $data['page_title'] = 'Add Caller ID';
68
-            if ($this->form_validation->run() == FALSE) {
69
-                $data['validation_errors'] = validation_errors();
70
-                echo $data['validation_errors'];
71
-                exit;
72
-            } else {
57
+		$data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $edit_data);
58
+		$this->load->view('animap_add_edit', $data);
59
+	}
60
+
61
+	function animap_save() {
62
+		$add_array = $this->input->post();
63
+
64
+	  $edit_id=$add_array['id'];
65
+		$data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $add_array);
66
+		if ($add_array['id'] != '') {
67
+			$data['page_title'] = 'Add Caller ID';
68
+			if ($this->form_validation->run() == FALSE) {
69
+				$data['validation_errors'] = validation_errors();
70
+				echo $data['validation_errors'];
71
+				exit;
72
+			} else {
73 73
                 
74
-                $this->animap_model->edit_animap($add_array, $add_array['id']);
75
-                echo json_encode(array("SUCCESS"=> " Caller ID updated successfully!"));
76
-                exit;
77
-            }
78
-        } else {
74
+				$this->animap_model->edit_animap($add_array, $add_array['id']);
75
+				echo json_encode(array("SUCCESS"=> " Caller ID updated successfully!"));
76
+				exit;
77
+			}
78
+		} else {
79 79
          
80
-            if ($this->form_validation->run() == FALSE) {
81
-                $data['validation_errors'] = validation_errors();
82
-                echo $data['validation_errors'];
83
-                exit;
84
-            } else {
80
+			if ($this->form_validation->run() == FALSE) {
81
+				$data['validation_errors'] = validation_errors();
82
+				echo $data['validation_errors'];
83
+				exit;
84
+			} else {
85 85
               
86
-                $ip_id = $this->animap_model->add_animap($add_array);
86
+				$ip_id = $this->animap_model->add_animap($add_array);
87 87
                                
88
-                echo json_encode(array("SUCCESS"=> " Caller ID added successfully!"));
89
-                exit;
90
-            }
91
-        }
92
-    }
93
-
94
-
95
-
96
-    function animap_delete($id) {
97
-        $this->animap_model-> remove_animap($id);
98
-        $this->session->set_flashdata('astpp_notification', 'Caller ID removed successfully!');
99
-        redirect(base_url() . 'animap/animap_detail/');
100
-    }
101
-
102
-    function  animap_detail_search() {
103
-        $ajax_search = $this->input->post('ajax_search', 0);
104
-        if ($this->input->post('advance_search', TRUE) == 1) {
105
-            $this->session->set_userdata('advance_search', $this->input->post('advance_search'));
106
-            $action = $this->input->post();
107
-            unset($action['action']);
108
-            unset($action['advance_search']);
109
-            $this->session->set_userdata('animap_list_search', $action);
110
-        }
111
-        if (@$ajax_search != 1) {
112
-            redirect(base_url() . 'animap/animap_list/');
113
-        }
114
-    }
115
-
116
-    function animap_detail_clearsearchfilter() {
117
-        $this->session->set_userdata('advance_search', 0);
118
-        $this->session->set_userdata('animap_list_search', "");
119
-    }
120
-
121
-    function animap_detail() {
122
-        $data['username'] = $this->session->userdata('user_name');
123
-        $data['page_title'] = 'Caller ID';
124
-        $data['search_flag'] = true;
125
-        $this->session->set_userdata('advance_search', 0);
126
-        $data['grid_fields'] = $this->animap_form->build_animap_list_for_admin();
127
-        $data["grid_buttons"] = $this->animap_form->build_grid_buttons();
128
-        $data['form_search'] = $this->form->build_serach_form($this->animap_form->get_animap_search_form());
129
-
130
-        $this->load->view('animap_view', $data);
131
-    }
132
-
133
-    function animap_detail_json() {
134
-        $json_data = array();
135
-        $count_all = $this->animap_model->animap_list(false);
136
-        $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
137
-        $json_data = $paging_data["json_paging"];
138
-        $query = $this->animap_model->animap_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
139
-        $grid_fields = json_decode($this->animap_form->build_animap_list_for_admin());
140
-        $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
141
-
142
-        echo json_encode($json_data);
143
-    }
144
-
145
-    function animap_delete_multiple() {
146
-        $ids = $this->input->post("selected_ids", true);
147
-        $where = "id IN ($ids)";
148
-        $this->db->where($where);
149
-        echo $this->db->delete("ani_map");
150
-    }
88
+				echo json_encode(array("SUCCESS"=> " Caller ID added successfully!"));
89
+				exit;
90
+			}
91
+		}
92
+	}
93
+
94
+
95
+
96
+	function animap_delete($id) {
97
+		$this->animap_model-> remove_animap($id);
98
+		$this->session->set_flashdata('astpp_notification', 'Caller ID removed successfully!');
99
+		redirect(base_url() . 'animap/animap_detail/');
100
+	}
101
+
102
+	function  animap_detail_search() {
103
+		$ajax_search = $this->input->post('ajax_search', 0);
104
+		if ($this->input->post('advance_search', TRUE) == 1) {
105
+			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
106
+			$action = $this->input->post();
107
+			unset($action['action']);
108
+			unset($action['advance_search']);
109
+			$this->session->set_userdata('animap_list_search', $action);
110
+		}
111
+		if (@$ajax_search != 1) {
112
+			redirect(base_url() . 'animap/animap_list/');
113
+		}
114
+	}
115
+
116
+	function animap_detail_clearsearchfilter() {
117
+		$this->session->set_userdata('advance_search', 0);
118
+		$this->session->set_userdata('animap_list_search', "");
119
+	}
120
+
121
+	function animap_detail() {
122
+		$data['username'] = $this->session->userdata('user_name');
123
+		$data['page_title'] = 'Caller ID';
124
+		$data['search_flag'] = true;
125
+		$this->session->set_userdata('advance_search', 0);
126
+		$data['grid_fields'] = $this->animap_form->build_animap_list_for_admin();
127
+		$data["grid_buttons"] = $this->animap_form->build_grid_buttons();
128
+		$data['form_search'] = $this->form->build_serach_form($this->animap_form->get_animap_search_form());
129
+
130
+		$this->load->view('animap_view', $data);
131
+	}
132
+
133
+	function animap_detail_json() {
134
+		$json_data = array();
135
+		$count_all = $this->animap_model->animap_list(false);
136
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
137
+		$json_data = $paging_data["json_paging"];
138
+		$query = $this->animap_model->animap_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
139
+		$grid_fields = json_decode($this->animap_form->build_animap_list_for_admin());
140
+		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
141
+
142
+		echo json_encode($json_data);
143
+	}
144
+
145
+	function animap_delete_multiple() {
146
+		$ids = $this->input->post("selected_ids", true);
147
+		$where = "id IN ($ids)";
148
+		$this->db->where($where);
149
+		echo $this->db->delete("ani_map");
150
+	}
151 151
    
152 152
 
153 153
     
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
         $this->load->model('animap_model');
34 34
 
35 35
         if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
36
+            redirect(base_url().'/astpp/login');
37 37
     }
38 38
 
39 39
     function animap_add() {
40 40
         $data['username'] = $this->session->userdata('user_name');
41 41
         $data['flag'] = 'create';
42 42
         $data['page_title'] = 'Add Caller ID';
43
-        $edit_id='';
43
+        $edit_id = '';
44 44
         $data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), '');
45 45
 
46 46
         $this->load->view('animap_add_edit', $data);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     function animap_save() {
62 62
         $add_array = $this->input->post();
63 63
 
64
-      $edit_id=$add_array['id'];
64
+      $edit_id = $add_array['id'];
65 65
         $data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $add_array);
66 66
         if ($add_array['id'] != '') {
67 67
             $data['page_title'] = 'Add Caller ID';
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     function animap_delete($id) {
97 97
         $this->animap_model-> remove_animap($id);
98 98
         $this->session->set_flashdata('astpp_notification', 'Caller ID removed successfully!');
99
-        redirect(base_url() . 'animap/animap_detail/');
99
+        redirect(base_url().'animap/animap_detail/');
100 100
     }
101 101
 
102 102
     function  animap_detail_search() {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             $this->session->set_userdata('animap_list_search', $action);
110 110
         }
111 111
         if (@$ajax_search != 1) {
112
-            redirect(base_url() . 'animap/animap_list/');
112
+            redirect(base_url().'animap/animap_list/');
113 113
         }
114 114
     }
115 115
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@
 block discarded – undo
32 32
         $this->load->library('astpp/form');
33 33
         $this->load->model('animap_model');
34 34
 
35
-        if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
35
+        if ($this->session->userdata('user_login') == FALSE) {
36
+                    redirect(base_url() . '/astpp/login');
37
+        }
37 38
     }
38 39
 
39 40
     function animap_add() {
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/libraries/animap_form.php 3 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -23,74 +23,74 @@
 block discarded – undo
23 23
 ###############################################################################
24 24
 
25 25
 if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
26
+	exit('No direct script access allowed');
27 27
 
28 28
 class Animap_form {
29
-      	function __construct($library_name = '') {
30
-        $this->CI = & get_instance();
31
-    }
29
+	  	function __construct($library_name = '') {
30
+		$this->CI = & get_instance();
31
+	}
32 32
    
33
-    function get_animap_form_fields($edit_id) {
33
+	function get_animap_form_fields($edit_id) {
34 34
    $id=$edit_id;
35
-        $form['forms'] = array(base_url() . 'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
35
+		$form['forms'] = array(base_url() . 'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
36 36
   $val=$id > 0 ? 'ani_map.number.'.$id : 'ani_map.number';   
37
-        $form['Caller ID'] = array(
38
-            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
39
-            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0","status" => "0")),
40
-            array('Caller ID', 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|numeric|xss_clean', 'tOOL TIP', 'Please Enter ANI number'),
41
-            array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
37
+		$form['Caller ID'] = array(
38
+			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
39
+			array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0","status" => "0")),
40
+			array('Caller ID', 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|numeric|xss_clean', 'tOOL TIP', 'Please Enter ANI number'),
41
+			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
42 42
             
43
-        );
44
-        $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
45
-        $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
46
-        return $form;
47
-    }
43
+		);
44
+		$form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
45
+		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
46
+		return $form;
47
+	}
48 48
 
49
-    function get_animap_search_form() {
50
-    $logintype = $this->CI->session->userdata('logintype');
49
+	function get_animap_search_form() {
50
+	$logintype = $this->CI->session->userdata('logintype');
51 51
      
52
-        $form['forms'] = array("", array('id' => "animap_search"));
53
-        $form['Search'] = array(
54
-             array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
55
-       array('Caller ID', 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
56
-       array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),
52
+		$form['forms'] = array("", array('id' => "animap_search"));
53
+		$form['Search'] = array(
54
+			 array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
55
+	   array('Caller ID', 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
56
+	   array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),
57 57
 		array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
58 58
        
59
-            array('', 'HIDDEN', 'advance_search', '1', '', '', '')
60
-        );
61
-        $form['button_search'] = array('name' => 'action', 'id' => "animap_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
62
-        $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
59
+			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
60
+		);
61
+		$form['button_search'] = array('name' => 'action', 'id' => "animap_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
62
+		$form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
63 63
 
64
-        return $form;
65
-    }
64
+		return $form;
65
+	}
66 66
 
67 67
 
68
-    function build_animap_list_for_admin() {
69
-        // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
70
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
68
+	function build_animap_list_for_admin() {
69
+		// array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
70
+		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
71 71
 	   array("Account", "250", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
72
-            array("Caller ID", "250", "number", "", "", "","","true","center"),
73
-             /*
72
+			array("Caller ID", "250", "number", "", "", "","","true","center"),
73
+			 /*
74 74
             ASTPP  3.0 
75 75
             creation field show in grid
76 76
             */
77
-            array("Status", "180", "status", "status", "ani_map", "get_status","","true","center"),
78
-            array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
79
-            array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
77
+			array("Status", "180", "status", "status", "ani_map", "get_status","","true","center"),
78
+			array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
79
+			array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
80 80
            
81
-            /********************************************************************/
82
-            array("Action", "100", "", "", "", array("EDIT" => array("url" => "animap/animap_edit/", "mode" => "popup", 'popup'),
83
-                    "DELETE" => array("url" => "/animap/animap_delete/", "mode" => "single")))
84
-                ));
85
-        return $grid_field_arr;
86
-    }
81
+			/********************************************************************/
82
+			array("Action", "100", "", "", "", array("EDIT" => array("url" => "animap/animap_edit/", "mode" => "popup", 'popup'),
83
+					"DELETE" => array("url" => "/animap/animap_delete/", "mode" => "single")))
84
+				));
85
+		return $grid_field_arr;
86
+	}
87 87
 
88
-    function build_grid_buttons() {
89
-        $buttons_json = json_encode(array(array("Add" , "btn btn-line-warning btn" , "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
-            array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/animap/animap_delete_multiple/")
91
-            ));
92
-        return $buttons_json;
93
-    }
88
+	function build_grid_buttons() {
89
+		$buttons_json = json_encode(array(array("Add" , "btn btn-line-warning btn" , "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
+			array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/animap/animap_delete_multiple/")
91
+			));
92
+		return $buttons_json;
93
+	}
94 94
    
95 95
    
96 96
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
25
+if ( ! defined('BASEPATH'))
26 26
     exit('No direct script access allowed');
27 27
 
28 28
 class Animap_form {
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
     }
32 32
    
33 33
     function get_animap_form_fields($edit_id) {
34
-   $id=$edit_id;
35
-        $form['forms'] = array(base_url() . 'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
36
-  $val=$id > 0 ? 'ani_map.number.'.$id : 'ani_map.number';   
34
+   $id = $edit_id;
35
+        $form['forms'] = array(base_url().'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
36
+  $val = $id > 0 ? 'ani_map.number.'.$id : 'ani_map.number';   
37 37
         $form['Caller ID'] = array(
38 38
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
39
-            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0","status" => "0")),
39
+            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0", "status" => "0")),
40 40
             array('Caller ID', 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|numeric|xss_clean', 'tOOL TIP', 'Please Enter ANI number'),
41 41
             array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
42 42
             
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      
52 52
         $form['forms'] = array("", array('id' => "animap_search"));
53 53
         $form['Search'] = array(
54
-             array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
54
+             array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"0", "deleted" => "0")),
55 55
        array('Caller ID', 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
56 56
        array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),
57 57
 		array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 
68 68
     function build_animap_list_for_admin() {
69 69
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
70
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
71
-	   array("Account", "250", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
72
-            array("Caller ID", "250", "number", "", "", "","","true","center"),
70
+        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
71
+	   array("Account", "250", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new", "", "true", "center"),
72
+            array("Caller ID", "250", "number", "", "", "", "", "true", "center"),
73 73
              /*
74 74
             ASTPP  3.0 
75 75
             creation field show in grid
76 76
             */
77
-            array("Status", "180", "status", "status", "ani_map", "get_status","","true","center"),
78
-            array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
79
-            array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
77
+            array("Status", "180", "status", "status", "ani_map", "get_status", "", "true", "center"),
78
+            array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
79
+            array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
80 80
            
81 81
             /********************************************************************/
82 82
             array("Action", "100", "", "", "", array("EDIT" => array("url" => "animap/animap_edit/", "mode" => "popup", 'popup'),
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     }
87 87
 
88 88
     function build_grid_buttons() {
89
-        $buttons_json = json_encode(array(array("Add" , "btn btn-line-warning btn" , "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
-            array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/animap/animap_delete_multiple/")
89
+        $buttons_json = json_encode(array(array("Add", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
+            array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/animap/animap_delete_multiple/")
91 91
             ));
92 92
         return $buttons_json;
93 93
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
25
+if (!defined('BASEPATH')) {
26
+    exit('No direct script access allowed');
27
+}
27 28
 
28 29
 class Package_form {
29 30
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/models/animap_model.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -24,68 +24,68 @@
 block discarded – undo
24 24
 
25 25
 class ANIMAP_model extends CI_Model {
26 26
 
27
-    function ANIMAP_model() {
28
-        parent::__construct();
29
-    }
27
+	function ANIMAP_model() {
28
+		parent::__construct();
29
+	}
30 30
 
31
-    function animap_list($flag, $start = 0, $limit = 0) {
31
+	function animap_list($flag, $start = 0, $limit = 0) {
32 32
    
33 33
  $accountinfo = $this->session->userdata('accountinfo');
34 34
      
35
-        if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
36
-            $qry = $this->db_model->getselect('id', 'accounts', array('reseller_id' => $accountinfo['id']));
37
-            $result = $qry->result_array();
35
+		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
36
+			$qry = $this->db_model->getselect('id', 'accounts', array('reseller_id' => $accountinfo['id']));
37
+			$result = $qry->result_array();
38 38
 
39
-            foreach ($result as $value1) {
40
-                $value[] = $value1['id'];
39
+			foreach ($result as $value1) {
40
+				$value[] = $value1['id'];
41 41
 
42 42
             
43
-            }
44
-            $this->db->where_in('accountid', $value);
45
-        } else {
46
-              $qry = $this->db_model->getselect('id', 'accounts', array('reseller_id' => 0));
47
-            $result = $qry->result_array();
43
+			}
44
+			$this->db->where_in('accountid', $value);
45
+		} else {
46
+			  $qry = $this->db_model->getselect('id', 'accounts', array('reseller_id' => 0));
47
+			$result = $qry->result_array();
48 48
 
49
-            foreach ($result as $value1) {
50
-                $value[] = $value1['id'];
51
-            }
52
-            $this->db->where_in('accountid', $value);
53
-        }
54
-           $this->db_model->build_search('animap_list_search');
55
-        if ($flag) {
56
-            $query = $this->db_model->select("*", "ani_map",  "", "id", "ASC", $limit, $start);
57
-        } else {
58
-            $query = $this->db_model->countQuery("*", "ani_map", "");
59
-        }
60
-        return $query;
61
-    }
49
+			foreach ($result as $value1) {
50
+				$value[] = $value1['id'];
51
+			}
52
+			$this->db->where_in('accountid', $value);
53
+		}
54
+		   $this->db_model->build_search('animap_list_search');
55
+		if ($flag) {
56
+			$query = $this->db_model->select("*", "ani_map",  "", "id", "ASC", $limit, $start);
57
+		} else {
58
+			$query = $this->db_model->countQuery("*", "ani_map", "");
59
+		}
60
+		return $query;
61
+	}
62 62
 
63
-    function add_animap($add_array) {
64
-        /*
63
+	function add_animap($add_array) {
64
+		/*
65 65
         ASTPP  3.0 
66 66
         Add creation date
67 67
         */
68
-        $data=array('creation_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
69
-        $this->db->insert("ani_map", $data);
70
-        return $this->db->insert_id();
71
-    }
68
+		$data=array('creation_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
69
+		$this->db->insert("ani_map", $data);
70
+		return $this->db->insert_id();
71
+	}
72 72
 
73
-    function edit_animap($add_array, $id) {
74
-         /*
73
+	function edit_animap($add_array, $id) {
74
+		 /*
75 75
          ASTPP  3.0 
76 76
          last modify date update
77 77
          */
78
-         $data=array('last_modified_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
79
-         /*********************************************************/
80
-        $this->db->where("id", $id);
81
-        return  $this->db->update("ani_map", $data);
82
-    }
78
+		 $data=array('last_modified_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
79
+		 /*********************************************************/
80
+		$this->db->where("id", $id);
81
+		return  $this->db->update("ani_map", $data);
82
+	}
83 83
 
84
-    function remove_animap($id) {
85
-        $this->db->where("id", $id);
86
-        $this->db->delete("ani_map");
87
-        return true;
88
-    }
84
+	function remove_animap($id) {
85
+		$this->db->where("id", $id);
86
+		$this->db->delete("ani_map");
87
+		return true;
88
+	}
89 89
     
90 90
    
91 91
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         }
54 54
            $this->db_model->build_search('animap_list_search');
55 55
         if ($flag) {
56
-            $query = $this->db_model->select("*", "ani_map",  "", "id", "ASC", $limit, $start);
56
+            $query = $this->db_model->select("*", "ani_map", "", "id", "ASC", $limit, $start);
57 57
         } else {
58 58
             $query = $this->db_model->countQuery("*", "ani_map", "");
59 59
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         ASTPP  3.0 
66 66
         Add creation date
67 67
         */
68
-        $data=array('creation_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
68
+        $data = array('creation_date'=>gmdate('Y-m-d H:i:s'), 'number'=>$add_array['number'], 'accountid'=>$add_array['accountid'], 'status'=>$add_array['status'], 'context'=>'default');
69 69
         $this->db->insert("ani_map", $data);
70 70
         return $this->db->insert_id();
71 71
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
          ASTPP  3.0 
76 76
          last modify date update
77 77
          */
78
-         $data=array('last_modified_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
78
+         $data = array('last_modified_date'=>gmdate('Y-m-d H:i:s'), 'number'=>$add_array['number'], 'accountid'=>$add_array['accountid'], 'status'=>$add_array['status'], 'context'=>'default');
79 79
          /*********************************************************/
80 80
         $this->db->where("id", $id);
81 81
         return  $this->db->update("ani_map", $data);
Please login to merge, or discard this patch.