@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
23 | +if ( ! defined('BASEPATH')) |
|
24 | 24 | exit('No direct script access allowed'); |
25 | 25 | |
26 | 26 | class Reports_form { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | function get_customer_cdr_form() { |
31 | 31 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
32 | - if($logintype != 1){ |
|
32 | + if ($logintype != 1) { |
|
33 | 33 | if ($this->CI->session->userdata('logintype') == 1 || $this->CI->session->userdata('logintype') == 5) { |
34 | 34 | $accountinfo = $this->CI->session->userdata['accountinfo']; |
35 | 35 | $reseller_id = $accountinfo["id"]; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
49 | 49 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
50 | 50 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
51 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
51 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
52 | 52 | |
53 | 53 | array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
72 | 72 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
73 | 73 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
74 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
74 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
75 | 75 | |
76 | 76 | //array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")), |
77 | 77 | |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
110 | 110 | |
111 | 111 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
112 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
112 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"1")), |
|
113 | 113 | array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'pricelists', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0")), |
114 | 114 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
115 | 115 | |
116 | 116 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
117 | 117 | array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
118 | 118 | if ($this->CI->session->userdata('logintype') != 1 && $this->CI->session->userdata('logintype') != 5) { |
119 | - $new_Array=array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "1")); |
|
119 | + $new_Array = array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "1")); |
|
120 | 120 | } |
121 | 121 | |
122 | - $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in ",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;text-align:right;","dropdown_style"=>"background: #ddd; width: 23% !important;"); |
|
122 | + $form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>"Display records in ", 'label_class' => "search_label col-md-3 no-padding", "dropdown_class"=>"form-control", "label_style"=>"font-size:13px;text-align:right;", "dropdown_style"=>"background: #ddd; width: 23% !important;"); |
|
123 | 123 | |
124 | 124 | /****************************************/ |
125 | 125 | $form['button_search'] = array('name' => 'action', 'id' => "reseller_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | array('Cost ', 'INPUT', array('name' => 'provider_call_cost[provider_call_cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'provider_call_cost[provider_call_cost-integer]', '', '', '', 'search_int_type', ''), |
142 | 142 | // array('Cost ', 'INPUT', array('name' => 'cost[cost]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'cost[cost-integer]', '', '', '', 'search_int_type', ''), |
143 | 143 | array('Disposition', 'disposition', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_despostion'), |
144 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
145 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
144 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"3")), |
|
145 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
146 | 146 | |
147 | 147 | // array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', '', ''), |
148 | 148 | |
149 | 149 | |
150 | 150 | ); |
151 | - $form['display_in']=array('name' => 'search_in',"id"=>"search_in","function"=>"search_report_in", "content"=>"Display records in",'label_class' => "search_label col-md-3 no-padding","dropdown_class"=>"form-control","label_style"=>"font-size:13px;","dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
151 | + $form['display_in'] = array('name' => 'search_in', "id"=>"search_in", "function"=>"search_report_in", "content"=>"Display records in", 'label_class' => "search_label col-md-3 no-padding", "dropdown_class"=>"form-control", "label_style"=>"font-size:13px;", "dropdown_style"=>"background: #ddd; width: 21% !important;"); |
|
152 | 152 | |
153 | 153 | /****************************************/ |
154 | 154 | $form['button_search'] = array('name' => 'action', 'id' => "provider_cdr_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -163,52 +163,52 @@ discard block |
||
163 | 163 | ******/ |
164 | 164 | function build_report_list_for_customer() { |
165 | 165 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
166 | - if($logintype != 1){ |
|
166 | + if ($logintype != 1) { |
|
167 | 167 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
168 | - $currency_id=$account_info['currency_id']; |
|
169 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
168 | + $currency_id = $account_info['currency_id']; |
|
169 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
170 | 170 | |
171 | - $recording=array(); |
|
171 | + $recording = array(); |
|
172 | 172 | $account_data = $this->CI->session->userdata("accountinfo"); |
173 | - if($account_data['type'] == 1){ |
|
174 | - $recording=array("Recording", "127", "recording", "", "", ""); |
|
173 | + if ($account_data['type'] == 1) { |
|
174 | + $recording = array("Recording", "127", "recording", "", "", ""); |
|
175 | 175 | } |
176 | 176 | $grid_field_arr = json_encode(array( |
177 | - array(gettext("Date"), "100", "callstart","callstart", "callstart", "convert_GMT_to","","true","center"), |
|
178 | - array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
|
179 | - array("Called Number", "103", "callednum", "", "", "","","true","center"), |
|
180 | - array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
181 | - array("Destination", "90", "notes", "", "", "","","true","center"), |
|
182 | - array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
183 | - array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
184 | - array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
185 | - array("Disposition", "150", "disposition", "", "", "","","true","center"), |
|
186 | - array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
187 | - array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
|
188 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
177 | + array(gettext("Date"), "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
178 | + array("Caller ID", "120", "callerid", "", "", "", "", "true", "center"), |
|
179 | + array("Called Number", "103", "callednum", "", "", "", "", "true", "center"), |
|
180 | + array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
181 | + array("Destination", "90", "notes", "", "", "", "", "true", "center"), |
|
182 | + array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
183 | + array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
184 | + array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
185 | + array("Disposition", "150", "disposition", "", "", "", "", "true", "center"), |
|
186 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
187 | + array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name", "", "true", "center"), |
|
188 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
189 | 189 | array("Call Type", "112", "calltype", "", "", ""), |
190 | 190 | $recording, |
191 | 191 | )); |
192 | 192 | |
193 | 193 | } |
194 | - else{ |
|
194 | + else { |
|
195 | 195 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
196 | - $currency_id=$account_info['currency_id']; |
|
197 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
198 | - $recording=array("Recording", "127", "recording", "", "", ""); |
|
196 | + $currency_id = $account_info['currency_id']; |
|
197 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
198 | + $recording = array("Recording", "127", "recording", "", "", ""); |
|
199 | 199 | $grid_field_arr = json_encode(array( |
200 | - array("Date", "100", "callstart","callstart", "callstart", "convert_GMT_to","","true","center"), |
|
201 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
202 | - array("Called Number", "103", "callednum", "", "", "","","true","center"), |
|
203 | - array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
204 | - array("Destination", "90", "notes", "", "", "","","true","center"), |
|
205 | - array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
206 | - array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
207 | - array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
208 | - array("Disposition", "130", "disposition", "", "", "","","true","center"), |
|
209 | - array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
200 | + array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
201 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
202 | + array("Called Number", "103", "callednum", "", "", "", "", "true", "center"), |
|
203 | + array("Code", "71", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
204 | + array("Destination", "90", "notes", "", "", "", "", "true", "center"), |
|
205 | + array("Duration", "80", "billseconds", "customer_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
206 | + array("Debit($currency)", "75", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
207 | + array("Cost($currency)", "75", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
208 | + array("Disposition", "130", "disposition", "", "", "", "", "true", "center"), |
|
209 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
210 | 210 | //array("Trunk", "90", "trunk_id", "name", "trunks", "get_field_name","","true","center"), |
211 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
211 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
212 | 212 | array("Call Type", "112", "calltype", "", "", ""), |
213 | 213 | $recording, |
214 | 214 | )); |
@@ -222,23 +222,23 @@ discard block |
||
222 | 222 | function build_report_list_for_reseller() { |
223 | 223 | |
224 | 224 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
225 | -$currency_id=$account_info['currency_id']; |
|
226 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
225 | +$currency_id = $account_info['currency_id']; |
|
226 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
227 | 227 | |
228 | 228 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
229 | 229 | $grid_field_arr = json_encode(array( |
230 | - array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
231 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
232 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
233 | - array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
234 | - array("Destination", "120", "notes", "", "", "","","true","center"), |
|
235 | - array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
236 | - array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
237 | - array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency","","true","right"), |
|
238 | - array("Disposition", "100", "disposition", "", "", "","","true","center"), |
|
239 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
240 | - array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
241 | - array("Call Type", "120", "calltype", "", "", "","","true","center"), |
|
230 | + array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
231 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
232 | + array("Called Number", "120", "callednum", "", "", "", "", "true", "center"), |
|
233 | + array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
234 | + array("Destination", "120", "notes", "", "", "", "", "true", "center"), |
|
235 | + array("Duration", "107", "billseconds", "reseller_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
236 | + array("Debit($currency)", "105", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
237 | + array("Cost($currency)", "104", "cost", "cost", "cost", "convert_to_currency", "", "true", "right"), |
|
238 | + array("Disposition", "100", "disposition", "", "", "", "", "true", "center"), |
|
239 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
240 | + array("Rate Group", "90", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
241 | + array("Call Type", "120", "calltype", "", "", "", "", "true", "center"), |
|
242 | 242 | |
243 | 243 | )); |
244 | 244 | return $grid_field_arr; |
@@ -247,25 +247,25 @@ discard block |
||
247 | 247 | function build_report_list_for_provider() { |
248 | 248 | |
249 | 249 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
250 | -$currency_id=$account_info['currency_id']; |
|
251 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
250 | +$currency_id = $account_info['currency_id']; |
|
251 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
252 | 252 | |
253 | 253 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
254 | - $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
255 | - array("Caller ID", "120", "callerid", "", "", "","","true","center"), |
|
256 | - array("Called Number", "160", "callednum", "", "", "","","true","center"), |
|
257 | - array("Code", "117", "pattern", "pattern", "", "get_only_numeric_val","","true","center"), |
|
258 | - array("Destination", "130", "notes", "", "", "","","true","center"), |
|
259 | - array("Duration", "110", "billseconds", "provider_cdr_list_search", "billseconds", "convert_to_show_in","","true","center"), |
|
260 | - array("Cost($currency)", "150", "provider_call_cost", "provider_cost", "provider_cost", "convert_to_currency","","true","right"), |
|
261 | - array("Disposition", "200", "disposition", "", "", "","","true","center"), |
|
262 | - array("Account", "181", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
254 | + $grid_field_arr = json_encode(array(array("Date", "100", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
255 | + array("Caller ID", "120", "callerid", "", "", "", "", "true", "center"), |
|
256 | + array("Called Number", "160", "callednum", "", "", "", "", "true", "center"), |
|
257 | + array("Code", "117", "pattern", "pattern", "", "get_only_numeric_val", "", "true", "center"), |
|
258 | + array("Destination", "130", "notes", "", "", "", "", "true", "center"), |
|
259 | + array("Duration", "110", "billseconds", "provider_cdr_list_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
260 | + array("Cost($currency)", "150", "provider_call_cost", "provider_cost", "provider_cost", "convert_to_currency", "", "true", "right"), |
|
261 | + array("Disposition", "200", "disposition", "", "", "", "", "true", "center"), |
|
262 | + array("Account", "181", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
263 | 263 | )); |
264 | 264 | return $grid_field_arr; |
265 | 265 | } |
266 | 266 | |
267 | 267 | function build_grid_customer() { |
268 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
268 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/customerReport_export/", 'single'))); |
|
269 | 269 | return $buttons_json; |
270 | 270 | } |
271 | 271 | /** |
@@ -274,43 +274,43 @@ discard block |
||
274 | 274 | **/ |
275 | 275 | |
276 | 276 | function build_grid_buttons_user() { |
277 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
277 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/user/user_report_export/", 'single'))); |
|
278 | 278 | return $buttons_json; |
279 | 279 | } |
280 | 280 | /*****************************************************************/ |
281 | 281 | function build_grid_buttons_reseller() { |
282 | - $buttons_json = json_encode(array( array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
282 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/resellerReport_export/", 'single'))); |
|
283 | 283 | return $buttons_json; |
284 | 284 | } |
285 | 285 | function build_grid_buttons_provider() { |
286 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
286 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/providerReport_export/", 'single'))); |
|
287 | 287 | return $buttons_json; |
288 | 288 | } |
289 | 289 | |
290 | 290 | function build_report_list_for_user($accounttype = 'customer') { |
291 | 291 | |
292 | 292 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
293 | - $currency_id=$account_info['currency_id']; |
|
294 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
293 | + $currency_id = $account_info['currency_id']; |
|
294 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
295 | 295 | |
296 | 296 | |
297 | - if($accounttype == 'customer' || $accounttype =='reseller'){ |
|
298 | - $cost_array=array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency","","true","right"); |
|
297 | + if ($accounttype == 'customer' || $accounttype == 'reseller') { |
|
298 | + $cost_array = array("Debit($currency)", "100", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"); |
|
299 | 299 | } |
300 | - if(strtolower($accounttype)=='provider'){ |
|
301 | - $cost_array=array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
300 | + if (strtolower($accounttype) == 'provider') { |
|
301 | + $cost_array = array("Debit($currency)", "140", "cost", "cost", "cost", "convert_to_currency"); |
|
302 | 302 | } |
303 | 303 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
304 | 304 | $grid_field_arr = json_encode(array( |
305 | - array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to","","true","center"), |
|
306 | - array("Caller ID", "100", "callerid", "", "", "","","true","center"), |
|
307 | - array("Called Number", "120", "callednum", "", "", "","","true","center"), |
|
308 | - array("Destination", "135", "notes", "", "", "","","true","center"), |
|
305 | + array("Date", "130", "callstart", "callstart", "callstart", "convert_GMT_to", "", "true", "center"), |
|
306 | + array("Caller ID", "100", "callerid", "", "", "", "", "true", "center"), |
|
307 | + array("Called Number", "120", "callednum", "", "", "", "", "true", "center"), |
|
308 | + array("Destination", "135", "notes", "", "", "", "", "true", "center"), |
|
309 | 309 | // array("Account Number", "120", "accountid", "number", "accounts", "get_field_name"), |
310 | - array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in","","true","center"), |
|
310 | + array("Duration", "120", "billseconds", "user_cdrs_report_search", "billseconds", "convert_to_show_in", "", "true", "center"), |
|
311 | 311 | $cost_array, |
312 | - array("Disposition", "160", "disposition", "", "", "","","true","center"), |
|
313 | - array("Call Type", "140", "calltype", "", "", "","","true","center"), |
|
312 | + array("Disposition", "160", "disposition", "", "", "", "", "true", "center"), |
|
313 | + array("Call Type", "140", "calltype", "", "", "", "", "true", "center"), |
|
314 | 314 | )); |
315 | 315 | return $grid_field_arr; |
316 | 316 | } |
@@ -322,37 +322,37 @@ discard block |
||
322 | 322 | function build_refill_report_for_admin() { |
323 | 323 | |
324 | 324 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
325 | - $currency_id=$account_info['currency_id']; |
|
326 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
325 | + $currency_id = $account_info['currency_id']; |
|
326 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
327 | 327 | $grid_field_arr = json_encode(array( |
328 | - array(gettext("Date"), "225", "payment_date", "", "", "","","true","center"), |
|
329 | - array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
330 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
331 | - array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
332 | - array(gettext("Note"), "327", "notes", "", "", "","","true","center") |
|
328 | + array(gettext("Date"), "225", "payment_date", "", "", "", "", "true", "center"), |
|
329 | + array(gettext("Account"), "240", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
330 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
331 | + array(gettext("Refill By"), "230", "payment_by", "payment_by", "payment_by", "get_refill_by", "", "true", "center"), |
|
332 | + array(gettext("Note"), "327", "notes", "", "", "", "", "true", "center") |
|
333 | 333 | )); |
334 | 334 | return $grid_field_arr; |
335 | 335 | } |
336 | 336 | function build_refillreport_buttons() { |
337 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
337 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/refillreport_export/", 'single'))); |
|
338 | 338 | return $buttons_json; |
339 | 339 | } |
340 | 340 | function build_search_refill_report_for_admin() { |
341 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
342 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0 ; |
|
341 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
342 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
343 | 343 | $form['forms'] = array("", array('id' => "cdr_refill_search")); |
344 | 344 | $account_data = $this->CI->session->userdata("accountinfo"); |
345 | - $acc_arr= array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"0,1,3")); |
|
345 | + $acc_arr = array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"0,1,3")); |
|
346 | 346 | $logintype = $this->CI->session->userdata('logintype'); |
347 | 347 | if ($logintype == 1 || $logintype == 5) { |
348 | 348 | $account_data = $this->CI->session->userdata("accountinfo"); |
349 | 349 | $loginid = $account_data['id']; |
350 | 350 | |
351 | - }else{ |
|
351 | + } else { |
|
352 | 352 | $loginid = "0"; |
353 | 353 | } |
354 | - if($logintype==0 || $logintype==3){ |
|
355 | - $acc_arr=null; |
|
354 | + if ($logintype == 0 || $logintype == 3) { |
|
355 | + $acc_arr = null; |
|
356 | 356 | } |
357 | 357 | $form['Search'] = array( |
358 | 358 | array('From Date', 'INPUT', array('name' => 'payment_date[]', 'id' => 'refill_from_date', 'size' => '20', |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | // 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")), |
363 | 363 | array('Amount ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
364 | 364 | // array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
365 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
365 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
366 | 366 | |
367 | 367 | $form['button_search'] = array('name' => 'action', 'id' => "cusotmer_cdr_refill_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
368 | 368 | $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'); |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
393 | 393 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
394 | 394 | array('From Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
395 | - array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | - 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"=>"1", "deleted" => "0")), |
|
397 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
395 | + array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'commission_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
|
396 | + 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"=>"1", "deleted" => "0")), |
|
397 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
398 | 398 | ); |
399 | 399 | |
400 | 400 | $form['button_search'] = array('name' => 'action', 'id' => "commission_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'ui-state-default float-right ui-corner-all ui-button'); |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | $form['Search'] = array( |
408 | 408 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
409 | 409 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
410 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")), |
|
411 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
410 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"3")), |
|
411 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
412 | 412 | |
413 | 413 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
414 | 414 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"3", "deleted" => "0")), |
@@ -419,99 +419,99 @@ discard block |
||
419 | 419 | |
420 | 420 | return $form; |
421 | 421 | } |
422 | - function build_providersummary(){ |
|
422 | + function build_providersummary() { |
|
423 | 423 | $grid_field_arr = json_encode(array( |
424 | 424 | array("Provider", "220", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string"), |
425 | 425 | array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
426 | 426 | array("Destination", "150", "notes", "", "", ""), |
427 | 427 | array("Attempted Calls", "130", "attempted_calls", "", "", ""), |
428 | 428 | array("Completed Calls", "150", "description", "", "", ""), |
429 | - array("ASR","95","asr",'','',''), |
|
430 | - array("ACD","95","acd ",'','',''), |
|
431 | - array("MCD","95","mcd",'','',''), |
|
432 | - array("Bilable","100","billable",'','',''), |
|
433 | - array("Cost","115","cost",'','',''), |
|
429 | + array("ASR", "95", "asr", '', '', ''), |
|
430 | + array("ACD", "95", "acd ", '', '', ''), |
|
431 | + array("MCD", "95", "mcd", '', '', ''), |
|
432 | + array("Bilable", "100", "billable", '', '', ''), |
|
433 | + array("Cost", "115", "cost", '', '', ''), |
|
434 | 434 | // array("Profit", "95", "profit", "", "", ""), |
435 | 435 | )); |
436 | 436 | return $grid_field_arr; |
437 | 437 | } |
438 | 438 | function build_grid_buttons_providersummary() { |
439 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
439 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/providersummary_export_cdr_xls", 'single'))); |
|
440 | 440 | return $buttons_json; |
441 | 441 | } |
442 | 442 | function get_resellersummary_search_form() { |
443 | - $form['forms'] = array("",array('id' => "resellersummary_search")); |
|
443 | + $form['forms'] = array("", array('id' => "resellersummary_search")); |
|
444 | 444 | $form['Search'] = array( |
445 | 445 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
446 | 446 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
447 | - array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")), |
|
448 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
447 | + array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"1")), |
|
448 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
|
449 | 449 | |
450 | 450 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
451 | 451 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"1", "deleted" => "0")), |
452 | -array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
452 | +array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
453 | 453 | $form['button_search'] = array('name' => 'action', 'id' => "resellersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
454 | 454 | $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'); |
455 | 455 | |
456 | 456 | return $form; |
457 | 457 | } |
458 | - function build_resellersummary(){ |
|
458 | + function build_resellersummary() { |
|
459 | 459 | $grid_field_arr = json_encode(array( |
460 | 460 | array("Account", "148", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
461 | 461 | array("Code", "120", "pattern", "pattern", "", "get_only_numeric_val"), |
462 | 462 | array("Destination", "150", "notes", "", "", ""), |
463 | 463 | array("Attempted Calls", "120", "attempted_calls", "", "", ""), |
464 | 464 | array("Completed Calls", "120", "description", "", "", ""), |
465 | - array("ASR","80","asr",'','',''), |
|
466 | - array("ACD","80","acd ",'','',''), |
|
467 | - array("MCD","80","mcd",'','',''), |
|
468 | - array("Bilable","90","billable",'','',''), |
|
469 | - array("Price","90","price",'','',''), |
|
470 | - array("Cost","90","cost",'','',''), |
|
465 | + array("ASR", "80", "asr", '', '', ''), |
|
466 | + array("ACD", "80", "acd ", '', '', ''), |
|
467 | + array("MCD", "80", "mcd", '', '', ''), |
|
468 | + array("Bilable", "90", "billable", '', '', ''), |
|
469 | + array("Price", "90", "price", '', '', ''), |
|
470 | + array("Cost", "90", "cost", '', '', ''), |
|
471 | 471 | array("Profit", "100", "profit", "", "", ""), |
472 | 472 | )); |
473 | 473 | return $grid_field_arr; |
474 | 474 | } |
475 | 475 | function build_grid_buttons_resellersummary() { |
476 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
476 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/resellersummary_export_cdr_xls", 'single'))); |
|
477 | 477 | return $buttons_json; |
478 | 478 | } |
479 | 479 | function get_customersummary_search_form() { |
480 | - $form['forms'] = array("",array('id' => "customersummary_search")); |
|
480 | + $form['forms'] = array("", array('id' => "customersummary_search")); |
|
481 | 481 | $form['Search'] = array( |
482 | 482 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
483 | 483 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
484 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")), |
|
484 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")), |
|
485 | 485 | array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''), |
486 | 486 | |
487 | 487 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''), |
488 | 488 | // array('Account Number', 'number', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("type"=>"0", "deleted" => "0")), |
489 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
489 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
490 | 490 | ); |
491 | 491 | $form['button_search'] = array('name' => 'action', 'id' => "customersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
492 | 492 | $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'); |
493 | 493 | |
494 | 494 | return $form; |
495 | 495 | } |
496 | - function build_customersummary(){ |
|
496 | + function build_customersummary() { |
|
497 | 497 | $grid_field_arr = json_encode(array( |
498 | 498 | array("Account", "190", "accountid", "first_name,last_name,number", "accounts", "build_concat_string"), |
499 | 499 | array("Code", "80", "pattern", "pattern", "", "get_only_numeric_val"), |
500 | 500 | array("Destination", "110", "notes", "", "", ""), |
501 | 501 | array("Attempted Calls", "140", "attempted_calls", "", "", ""), |
502 | 502 | array("Completed Calls", "130", "description", "", "", ""), |
503 | - array("ASR","70","asr",'','',''), |
|
504 | - array("ACD","70","acd ",'','',''), |
|
505 | - array("MCD","80","mcd",'','',''), |
|
506 | - array("Bilable","80","billable",'','',''), |
|
507 | - array("Debit","85","cost",'','',''), |
|
508 | - array("Cost","110","price",'','',''), |
|
503 | + array("ASR", "70", "asr", '', '', ''), |
|
504 | + array("ACD", "70", "acd ", '', '', ''), |
|
505 | + array("MCD", "80", "mcd", '', '', ''), |
|
506 | + array("Bilable", "80", "billable", '', '', ''), |
|
507 | + array("Debit", "85", "cost", '', '', ''), |
|
508 | + array("Cost", "110", "price", '', '', ''), |
|
509 | 509 | array("Profit", "123", "profit", "", "", ""), |
510 | 510 | )); |
511 | 511 | return $grid_field_arr; |
512 | 512 | } |
513 | 513 | function build_grid_buttons_customersummary() { |
514 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
514 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/reports/customersummary_export_cdr_xls", 'single'))); |
|
515 | 515 | return $buttons_json; |
516 | 516 | } |
517 | 517 | /********* |
@@ -520,45 +520,45 @@ discard block |
||
520 | 520 | *********/ |
521 | 521 | function build_charge_list_for_admin() { |
522 | 522 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
523 | - $currency_id=$account_info['currency_id']; |
|
524 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
523 | + $currency_id = $account_info['currency_id']; |
|
524 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
525 | 525 | if ($this->CI->session->userdata("logintype") == '1') { |
526 | 526 | $grid_field_arr = json_encode(array( |
527 | - array(gettext("Created Date"), "120", "created_date", "", "", "","","true","center"), |
|
528 | - array(gettext("Invoice Number"), "120", "created_date", "", "", "","","true","center"), |
|
529 | - array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
527 | + array(gettext("Created Date"), "120", "created_date", "", "", "", "", "true", "center"), |
|
528 | + array(gettext("Invoice Number"), "120", "created_date", "", "", "", "", "true", "center"), |
|
529 | + array(gettext("Account"), "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
530 | 530 | // array("Reseller", "120", "reseller_id", "first_name,last_name,number", "accounts", "reseller_select_value"), |
531 | - array(gettext("Charge Type"), "120", "item_type", "", "", "","","true","center"), |
|
532 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
533 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
534 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
535 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
536 | - array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
|
531 | + array(gettext("Charge Type"), "120", "item_type", "", "", "", "", "true", "center"), |
|
532 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
533 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
534 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
535 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
536 | + array(gettext("Description"), "300", "description", "", "", "", "", "true", "center"), |
|
537 | 537 | )); |
538 | - }else{ |
|
538 | + } else { |
|
539 | 539 | $grid_field_arr = json_encode(array( |
540 | - array("Created Date", "120", "created_date", "", "", "","","true","center"), |
|
541 | - array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
|
542 | - array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
543 | - array("Charge Type", "120", "item_type", "", "", "","","true","center"), |
|
544 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
545 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
546 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
547 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
548 | - array("Description", "300", "description", "", "", "","","true","center"), |
|
540 | + array("Created Date", "120", "created_date", "", "", "", "", "true", "center"), |
|
541 | + array("Invoice Number", "120", "created_date", "", "", "", "", "true", "center"), |
|
542 | + array("Account", "120", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
543 | + array("Charge Type", "120", "item_type", "", "", "", "", "true", "center"), |
|
544 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
545 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
546 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
547 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
548 | + array("Description", "300", "description", "", "", "", "", "true", "center"), |
|
549 | 549 | )); |
550 | 550 | |
551 | 551 | } |
552 | 552 | return $grid_field_arr; |
553 | 553 | } |
554 | 554 | function get_charges_search_form() { |
555 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
556 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
555 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
556 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
557 | 557 | $form['forms'] = array("", array('id' => "charges_search")); |
558 | 558 | $form['Search'] = array( |
559 | 559 | array('From Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'), |
560 | 560 | array('To Date', 'INPUT', array('name' => 'created_date[]', 'id' => 'charge_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'), |
561 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
561 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"GLOBAL")), |
|
562 | 562 | array('Debit ', 'INPUT', array('name' => 'debit[debit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'debit[debit-integer]', '', '', '', 'search_int_type', ''), |
563 | 563 | array('Credit ', 'INPUT', array('name' => 'credit[credit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit[credit-integer]', '', '', '', 'search_int_type', ''), |
564 | 564 | |
@@ -575,20 +575,20 @@ discard block |
||
575 | 575 | ASTPP 3.0 |
576 | 576 | Charges History |
577 | 577 | *********/ |
578 | - function build_charge_list_for_customer(){ |
|
578 | + function build_charge_list_for_customer() { |
|
579 | 579 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
580 | - $currency_id=$account_info['currency_id']; |
|
581 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
580 | + $currency_id = $account_info['currency_id']; |
|
581 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
582 | 582 | |
583 | 583 | $grid_field_arr = json_encode(array( |
584 | - array("Created Date", "100", "created_date", "", "", "","","true","center"), |
|
585 | - array("Invoice Number", "110", "created_date", "", "", "","","true","center"), |
|
586 | - array("Charge Type", "100", "item_type", "", "", "","","true","center"), |
|
587 | - array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency","","true","right"), |
|
588 | - array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency","","true","right"), |
|
589 | - array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
590 | - array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
|
591 | - array("Description", "270", "description", "", "", "","","true","center"), |
|
584 | + array("Created Date", "100", "created_date", "", "", "", "", "true", "center"), |
|
585 | + array("Invoice Number", "110", "created_date", "", "", "", "", "true", "center"), |
|
586 | + array("Charge Type", "100", "item_type", "", "", "", "", "true", "center"), |
|
587 | + array("Before Balance<br/>($currency)", "120", "before_balance", "before_balance", "before_balance", "convert_to_currency", "", "true", "right"), |
|
588 | + array("Debit (-)<br/>($currency)", "110", "debit", "debit", "debit", "convert_to_currency", "", "true", "right"), |
|
589 | + array("Credit (+)<br/>($currency)", "110", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
590 | + array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency", "", "true", "right"), |
|
591 | + array("Description", "270", "description", "", "", "", "", "true", "center"), |
|
592 | 592 | )); |
593 | 593 | return $grid_field_arr; |
594 | 594 | } |
@@ -596,17 +596,17 @@ discard block |
||
596 | 596 | ASTPP 3.0 |
597 | 597 | Refill History |
598 | 598 | *********/ |
599 | - function build_refillreport_for_customer(){ |
|
599 | + function build_refillreport_for_customer() { |
|
600 | 600 | |
601 | 601 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
602 | - $currency_id=$account_info['currency_id']; |
|
603 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
602 | + $currency_id = $account_info['currency_id']; |
|
603 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
604 | 604 | |
605 | 605 | $grid_field_arr = json_encode(array( |
606 | - array("Date", "225", "payment_date", "", "", "","","true","center"), |
|
607 | - array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency","","true","right"), |
|
608 | - array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by","","true","center"), |
|
609 | - array("Note", "325", "notes", "", "", "","","true","center") |
|
606 | + array("Date", "225", "payment_date", "", "", "", "", "true", "center"), |
|
607 | + array("Amount($currency)", "250", "credit", "credit", "credit", "convert_to_currency", "", "true", "right"), |
|
608 | + array("Refill By", "230", "payment_by", "payment_by", "payment_by", "get_refill_by", "", "true", "center"), |
|
609 | + array("Note", "325", "notes", "", "", "", "", "true", "center") |
|
610 | 610 | )); |
611 | 611 | return $grid_field_arr; |
612 | 612 | } |
@@ -20,8 +20,9 @@ discard block |
||
20 | 20 | # You should have received a copy of the GNU Affero General Public License |
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | -if (!defined('BASEPATH')) |
|
24 | - exit('No direct script access allowed'); |
|
23 | +if (!defined('BASEPATH')) { |
|
24 | + exit('No direct script access allowed'); |
|
25 | +} |
|
25 | 26 | |
26 | 27 | class Reports_form { |
27 | 28 | function __construct() { |
@@ -56,8 +57,7 @@ discard block |
||
56 | 57 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'), |
57 | 58 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
58 | 59 | array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
59 | - } |
|
60 | - else |
|
60 | + } else |
|
61 | 61 | { |
62 | 62 | $form['forms'] = array("", array('id' => "cdr_customer_search")); |
63 | 63 | $form['Search'] = array( |
@@ -190,8 +190,7 @@ discard block |
||
190 | 190 | $recording, |
191 | 191 | )); |
192 | 192 | |
193 | - } |
|
194 | - else{ |
|
193 | + } else{ |
|
195 | 194 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
196 | 195 | $currency_id=$account_info['currency_id']; |
197 | 196 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
@@ -348,7 +347,7 @@ discard block |
||
348 | 347 | $account_data = $this->CI->session->userdata("accountinfo"); |
349 | 348 | $loginid = $account_data['id']; |
350 | 349 | |
351 | - }else{ |
|
350 | + } else{ |
|
352 | 351 | $loginid = "0"; |
353 | 352 | } |
354 | 353 | if($logintype==0 || $logintype==3){ |
@@ -535,7 +534,7 @@ discard block |
||
535 | 534 | array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"), |
536 | 535 | array(gettext("Description"), "300", "description", "", "", "","","true","center"), |
537 | 536 | )); |
538 | - }else{ |
|
537 | + } else{ |
|
539 | 538 | $grid_field_arr = json_encode(array( |
540 | 539 | array("Created Date", "120", "created_date", "", "", "","","true","center"), |
541 | 540 | array("Invoice Number", "120", "created_date", "", "", "","","true","center"), |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | function Opensips_model() { |
26 | 26 | parent::__construct(); |
27 | 27 | $db_config = Common_model::$global_config['system_config']; |
28 | - $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
28 | + $opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
29 | 29 | $this->opensips_db = $this->load->database($opensipdsn, true); |
30 | 30 | } |
31 | 31 | |
32 | 32 | function getopensipsdevice_list($flag, $start = 0, $limit = 0) { |
33 | - $this->db_model->build_search_opensips($this->opensips_db,'opensipsdevice_list_search'); |
|
34 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
35 | - $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
36 | - $this->opensips_db->where('reseller_id',$reseller_id); |
|
33 | + $this->db_model->build_search_opensips($this->opensips_db, 'opensipsdevice_list_search'); |
|
34 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
35 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
36 | + $this->opensips_db->where('reseller_id', $reseller_id); |
|
37 | 37 | if ($flag) { |
38 | - $this->opensips_db->limit($limit,$start); |
|
39 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
40 | - $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
41 | - }else{ |
|
42 | - $this->opensips_db->order_by('username','asc'); |
|
38 | + $this->opensips_db->limit($limit, $start); |
|
39 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') { |
|
40 | + $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']); |
|
41 | + } else { |
|
42 | + $this->opensips_db->order_by('username', 'asc'); |
|
43 | 43 | } |
44 | 44 | $query = $this->opensips_db->get("subscriber"); |
45 | 45 | } else { |
@@ -49,52 +49,52 @@ discard block |
||
49 | 49 | return $query; |
50 | 50 | } |
51 | 51 | |
52 | - function getopensipsdevice_customer_list($flag, $accountid = "",$accounttype, $start = "0", $limit = "0") { |
|
52 | + function getopensipsdevice_customer_list($flag, $accountid = "", $accounttype, $start = "0", $limit = "0") { |
|
53 | 53 | |
54 | 54 | if ($accountid != "") { |
55 | 55 | $where = array("accountcode" => $this->common->get_field_name('number', 'accounts', array('id' => $accountid))); |
56 | 56 | } |
57 | - $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_opensips'); |
|
58 | - $like_str=!empty($instant_search) ? "(username like '%$instant_search%' |
|
57 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_opensips'); |
|
58 | + $like_str = ! empty($instant_search) ? "(username like '%$instant_search%' |
|
59 | 59 | OR password like '%$instant_search%' |
60 | 60 | OR domain like '%$instant_search%' |
61 | 61 | OR effective_caller_id_name like '%$instant_search%' |
62 | 62 | OR effective_caller_id_number like '%$instant_search%' |
63 | 63 | )" |
64 | 64 | :null; |
65 | - if(!empty($like_str)) |
|
65 | + if ( ! empty($like_str)) |
|
66 | 66 | $this->opensips_db->where($like_str); |
67 | 67 | $this->opensips_db->where($where); |
68 | 68 | if ($flag) { |
69 | - $this->opensips_db->limit($limit,$start); |
|
69 | + $this->opensips_db->limit($limit, $start); |
|
70 | 70 | } |
71 | 71 | $result = $this->opensips_db->get("subscriber"); |
72 | - if($result->num_rows() > 0){ |
|
73 | - if($flag){ |
|
72 | + if ($result->num_rows() > 0) { |
|
73 | + if ($flag) { |
|
74 | 74 | return $result; |
75 | 75 | } |
76 | - else{ |
|
76 | + else { |
|
77 | 77 | return $result->num_rows(); |
78 | 78 | } |
79 | - }else{ |
|
80 | - if($flag){ |
|
81 | - $result=(object)array('num_rows'=>0); |
|
79 | + } else { |
|
80 | + if ($flag) { |
|
81 | + $result = (object)array('num_rows'=>0); |
|
82 | 82 | } |
83 | - else{ |
|
84 | - $result=0; |
|
83 | + else { |
|
84 | + $result = 0; |
|
85 | 85 | } |
86 | 86 | return $result; |
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | 90 | function getopensipsdispatcher_list($flag, $start = '', $limit = '') { |
91 | - $this->db_model->build_search_opensips($this->opensips_db,'opensipsdispatcher_list_search'); |
|
91 | + $this->db_model->build_search_opensips($this->opensips_db, 'opensipsdispatcher_list_search'); |
|
92 | 92 | if ($flag) { |
93 | - $this->opensips_db->limit( $limit,$start); |
|
94 | - if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
|
95 | - $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
|
96 | - }else{ |
|
97 | - $this->opensips_db->order_by('setid','asc'); |
|
93 | + $this->opensips_db->limit($limit, $start); |
|
94 | + if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') { |
|
95 | + $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']); |
|
96 | + } else { |
|
97 | + $this->opensips_db->order_by('setid', 'asc'); |
|
98 | 98 | } |
99 | 99 | $query = $this->opensips_db->get("dispatcher"); |
100 | 100 | } else { |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | |
110 | 110 | function add_opensipsdevices($data) { |
111 | 111 | unset($data["action"]); |
112 | - $data['creation_date']=gmdate("Y-m-d H:i:s"); |
|
113 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
114 | - $data['reseller_id']=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
|
112 | + $data['creation_date'] = gmdate("Y-m-d H:i:s"); |
|
113 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
114 | + $data['reseller_id'] = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
115 | 115 | unset($data["id"]); |
116 | 116 | $this->opensips_db->insert("subscriber", $data); |
117 | 117 | } |
118 | 118 | |
119 | 119 | function edit_opensipsdevices($data, $id) { |
120 | 120 | unset($data["action"]); |
121 | - $data=array("username"=>$data['username'],"password"=>$data['password'],"accountcode"=>$data['accountcode'],"domain"=>$data['domain'],"effective_caller_id_name"=>$data['effective_caller_id_name'],"effective_caller_id_number"=>$data['effective_caller_id_number'],"status"=>$data['status']); |
|
121 | + $data = array("username"=>$data['username'], "password"=>$data['password'], "accountcode"=>$data['accountcode'], "domain"=>$data['domain'], "effective_caller_id_name"=>$data['effective_caller_id_name'], "effective_caller_id_number"=>$data['effective_caller_id_number'], "status"=>$data['status']); |
|
122 | 122 | $this->opensips_db->where("id", $id); |
123 | - $data['last_modified_date']=gmdate("Y-m-d H:i:s"); |
|
123 | + $data['last_modified_date'] = gmdate("Y-m-d H:i:s"); |
|
124 | 124 | $this->opensips_db->update("subscriber", $data); |
125 | 125 | } |
126 | 126 | function delete_opensips_devices($id) { |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | foreach ($account_search as $key => $value) { |
161 | 161 | if ($value != "") { |
162 | 162 | if (is_array($value)) { |
163 | - if (array_key_exists($key . "-integer", $value)) { |
|
164 | - $this->get_interger_array($key, $value[$key . "-integer"], $value[$key]); |
|
163 | + if (array_key_exists($key."-integer", $value)) { |
|
164 | + $this->get_interger_array($key, $value[$key."-integer"], $value[$key]); |
|
165 | 165 | } |
166 | - if (array_key_exists($key . "-string", $value)) { |
|
167 | - $this->get_string_array($key, $value[$key . "-string"], $value[$key]); |
|
166 | + if (array_key_exists($key."-string", $value)) { |
|
167 | + $this->get_string_array($key, $value[$key."-string"], $value[$key]); |
|
168 | 168 | } |
169 | 169 | } else { |
170 | 170 | $this->opensips_db->where($key, $value); |
@@ -181,19 +181,19 @@ discard block |
||
181 | 181 | $this->opensips_db->where($field, $search_array); |
182 | 182 | break; |
183 | 183 | case "2": |
184 | - $this->opensips_db->where($field . ' <>', $search_array); |
|
184 | + $this->opensips_db->where($field.' <>', $search_array); |
|
185 | 185 | break; |
186 | 186 | case "3": |
187 | - $this->opensips_db->where($field . ' > ', $search_array); |
|
187 | + $this->opensips_db->where($field.' > ', $search_array); |
|
188 | 188 | break; |
189 | 189 | case "4": |
190 | - $this->opensips_db->where($field . ' < ', $search_array); |
|
190 | + $this->opensips_db->where($field.' < ', $search_array); |
|
191 | 191 | break; |
192 | 192 | case "5": |
193 | - $this->opensips_db->where($field . ' >= ', $search_array); |
|
193 | + $this->opensips_db->where($field.' >= ', $search_array); |
|
194 | 194 | break; |
195 | 195 | case "6": |
196 | - $this->opensips_db->where($field . ' <= ', $search_array); |
|
196 | + $this->opensips_db->where($field.' <= ', $search_array); |
|
197 | 197 | break; |
198 | 198 | } |
199 | 199 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $this->opensips_db->where($field, $search_array); |
213 | 213 | break; |
214 | 214 | case "4": |
215 | - $this->opensips_db->where($field . ' <>', $search_array); |
|
215 | + $this->opensips_db->where($field.' <>', $search_array); |
|
216 | 216 | break; |
217 | 217 | } |
218 | 218 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->opensips_db->limit($limit,$start); |
39 | 39 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
40 | 40 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
41 | - }else{ |
|
41 | + } else{ |
|
42 | 42 | $this->opensips_db->order_by('username','asc'); |
43 | 43 | } |
44 | 44 | $query = $this->opensips_db->get("subscriber"); |
@@ -62,8 +62,9 @@ discard block |
||
62 | 62 | OR effective_caller_id_number like '%$instant_search%' |
63 | 63 | )" |
64 | 64 | :null; |
65 | - if(!empty($like_str)) |
|
66 | - $this->opensips_db->where($like_str); |
|
65 | + if(!empty($like_str)) { |
|
66 | + $this->opensips_db->where($like_str); |
|
67 | + } |
|
67 | 68 | $this->opensips_db->where($where); |
68 | 69 | if ($flag) { |
69 | 70 | $this->opensips_db->limit($limit,$start); |
@@ -72,15 +73,13 @@ discard block |
||
72 | 73 | if($result->num_rows() > 0){ |
73 | 74 | if($flag){ |
74 | 75 | return $result; |
75 | - } |
|
76 | - else{ |
|
76 | + } else{ |
|
77 | 77 | return $result->num_rows(); |
78 | 78 | } |
79 | - }else{ |
|
79 | + } else{ |
|
80 | 80 | if($flag){ |
81 | 81 | $result=(object)array('num_rows'=>0); |
82 | - } |
|
83 | - else{ |
|
82 | + } else{ |
|
84 | 83 | $result=0; |
85 | 84 | } |
86 | 85 | return $result; |
@@ -93,7 +92,7 @@ discard block |
||
93 | 92 | $this->opensips_db->limit( $limit,$start); |
94 | 93 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
95 | 94 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
96 | - }else{ |
|
95 | + } else{ |
|
97 | 96 | $this->opensips_db->order_by('setid','asc'); |
98 | 97 | } |
99 | 98 | $query = $this->opensips_db->get("dispatcher"); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $this->load->library('astpp/form'); |
32 | 32 | $this->load->model('opensips_model'); |
33 | 33 | $db_config = Common_model::$global_config['system_config']; |
34 | - $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
34 | + $opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
35 | 35 | $this->opensips_db = $this->load->database($opensipdsn, true); |
36 | 36 | if ($this->session->userdata('user_login') == FALSE) |
37 | - redirect(base_url() . '/astpp/login'); |
|
37 | + redirect(base_url().'/astpp/login'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | function opensips_add() { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $data['form'] = $this->form->build_form($this->opensips_form->get_opensips_form_fields_for_customer($accountid), $edit_data); |
70 | 70 | $this->load->view('view_opensips_add_edit', $data); |
71 | 71 | } |
72 | - function customer_opensips_add($accountid='') { |
|
72 | + function customer_opensips_add($accountid = '') { |
|
73 | 73 | $data['username'] = $this->session->userdata('user_name'); |
74 | 74 | $data['flag'] = 'create'; |
75 | 75 | $data['page_title'] = 'Create Opensips'; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | exit; |
89 | 89 | } else { |
90 | 90 | $auth_flag = $this->validate_device_data($add_array); |
91 | - if($auth_flag == "TRUE"){ |
|
91 | + if ($auth_flag == "TRUE") { |
|
92 | 92 | $this->opensips_model->edit_opensipsdevices($add_array, $add_array['id']); |
93 | 93 | echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!")); |
94 | 94 | exit; |
95 | - }else{ |
|
95 | + } else { |
|
96 | 96 | echo json_encode($auth_flag); |
97 | 97 | exit; |
98 | 98 | } |
@@ -105,36 +105,36 @@ discard block |
||
105 | 105 | exit; |
106 | 106 | } else { |
107 | 107 | $auth_flag = $this->validate_device_data($add_array); |
108 | - if($auth_flag == "TRUE"){ |
|
108 | + if ($auth_flag == "TRUE") { |
|
109 | 109 | $this->opensips_model->add_opensipsdevices($add_array); |
110 | 110 | echo json_encode(array("SUCCESS"=> "OpenSips added successfully!")); |
111 | 111 | exit; |
112 | - }else{ |
|
112 | + } else { |
|
113 | 113 | echo json_encode($auth_flag); |
114 | 114 | exit; |
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | - function validate_device_data($data){ |
|
119 | + function validate_device_data($data) { |
|
120 | 120 | |
121 | - if(isset($data["username"]) && $data["username"] != ""){ |
|
121 | + if (isset($data["username"]) && $data["username"] != "") { |
|
122 | 122 | $db_config = Common_model::$global_config['system_config']; |
123 | - $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
123 | + $opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
124 | 124 | $this->opensips_db = $this->load->database($opensipdsn, true); |
125 | 125 | $where = array("username"=>$data["username"]); |
126 | - if($data['id'] != ""){ |
|
127 | - $this->opensips_db->where("id <>",$data['id']); |
|
126 | + if ($data['id'] != "") { |
|
127 | + $this->opensips_db->where("id <>", $data['id']); |
|
128 | 128 | } |
129 | 129 | $this->opensips_db->where($where); |
130 | 130 | $auth_flag = $this->opensips_db->get("subscriber"); |
131 | 131 | $auth_flag = $auth_flag->num_rows(); |
132 | - if($auth_flag == 0){ |
|
132 | + if ($auth_flag == 0) { |
|
133 | 133 | return "TRUE"; |
134 | - }else{ |
|
134 | + } else { |
|
135 | 135 | return array("username_error"=>"Duplicate Email Address Found Email Must Be Unique."); |
136 | 136 | } |
137 | - }else{ |
|
137 | + } else { |
|
138 | 138 | return array("username_error"=>"User name is required field."); |
139 | 139 | } |
140 | 140 | return "0"; |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | echo json_encode(array("SUCCESS"=> "Opensips Updated Successfully!")); |
156 | 156 | exit; |
157 | 157 | } |
158 | - }else{ |
|
158 | + } else { |
|
159 | 159 | $data['page_title'] = 'Add Opensips'; |
160 | 160 | if ($this->form_validation->run() == FALSE) { |
161 | 161 | $data['validation_errors'] = validation_errors(); |
162 | 162 | echo $data['validation_errors']; |
163 | 163 | exit; |
164 | - }else{ |
|
164 | + } else { |
|
165 | 165 | $this->opensips_model->add_opensipsdevices($array_add); |
166 | 166 | echo json_encode(array("SUCCESS"=> "Opensips Added Successfully!")); |
167 | 167 | exit; |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | echo json_encode(array("SUCCESS"=> "OpenSips Updated Successfully!")); |
185 | 185 | exit; |
186 | 186 | } |
187 | - }else{ |
|
187 | + } else { |
|
188 | 188 | $data['page_title'] = 'Add Opensips'; |
189 | 189 | if ($this->form_validation->run() == FALSE) { |
190 | 190 | $data['validation_errors'] = validation_errors(); |
191 | 191 | echo $data['validation_errors']; |
192 | 192 | exit; |
193 | - }else{ |
|
193 | + } else { |
|
194 | 194 | $this->opensips_model->add_opensipsdevices($add_array); |
195 | 195 | echo json_encode(array("SUCCESS"=> "OpenSips Added Successfully!")); |
196 | 196 | exit; |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | - function customer_opensips_json($accountid,$accounttype) { |
|
201 | + function customer_opensips_json($accountid, $accounttype) { |
|
202 | 202 | |
203 | 203 | $json_data = array(); |
204 | - $count_all = $this->opensips_model->getopensipsdevice_customer_list(false, $accountid,$accounttype); |
|
204 | + $count_all = $this->opensips_model->getopensipsdevice_customer_list(false, $accountid, $accounttype); |
|
205 | 205 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
206 | 206 | $json_data = $paging_data["json_paging"]; |
207 | 207 | |
208 | - $query = $this->opensips_model->getopensipsdevice_customer_list(true, $accountid,$accounttype, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
208 | + $query = $this->opensips_model->getopensipsdevice_customer_list(true, $accountid, $accounttype, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
209 | 209 | $grid_fields = json_decode($this->opensips_form->opensips_customer_build_opensips_list($accountid)); |
210 | 210 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
211 | 211 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | function opensips_remove($id) { |
221 | 221 | $this->opensips_model->remove_opensips($id); |
222 | 222 | $this->session->set_flashdata('astpp_notification', 'OpenSips Removed Successfully!'); |
223 | - redirect(base_url() . 'opensips/opensips_list/'); |
|
223 | + redirect(base_url().'opensips/opensips_list/'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | function opensips_list() { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $grid_fields = json_decode($this->opensips_form->build_opensips_list()); |
249 | 249 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
250 | 250 | $result = $this->opensips_db->get("subscriber"); |
251 | - if($result->num_rows() <= 0){ |
|
251 | + if ($result->num_rows() <= 0) { |
|
252 | 252 | $json_data['page'] = 0; |
253 | 253 | $json_data['total'] = 0; |
254 | 254 | } |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | $this->session->set_userdata('opensipsdevice_list_search', $action); |
268 | 268 | } |
269 | 269 | if (@$ajax_search != 1) { |
270 | - redirect(base_url() . 'opensips/opensips_list/'); |
|
270 | + redirect(base_url().'opensips/opensips_list/'); |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 | function opensips_list_clearsearchfilter() { |
274 | - $this->session->set_userdata('advance_search',''); |
|
275 | - $this->session->set_userdata('opensipsdevice_list_search',''); |
|
274 | + $this->session->set_userdata('advance_search', ''); |
|
275 | + $this->session->set_userdata('opensipsdevice_list_search', ''); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | // dispather List add edit delete |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $data['page_title'] = 'Edit Dispatcher'; |
304 | 304 | if ($this->form_validation->run() == FALSE) { |
305 | 305 | $data['validation_errors'] = validation_errors(); |
306 | - echo $data['validation_errors'];exit; |
|
306 | + echo $data['validation_errors']; exit; |
|
307 | 307 | } else { |
308 | 308 | $this->opensips_model->edit_opensipsdispatcher($add_array, $add_array['id']); |
309 | 309 | echo json_encode(array("SUCCESS"=> "Dispatcher Updated Successfully!")); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $data['page_title'] = 'Add Dispatcher'; |
314 | 314 | if ($this->form_validation->run() == FALSE) { |
315 | 315 | $data['validation_errors'] = validation_errors(); |
316 | - echo $data['validation_errors'];exit; |
|
316 | + echo $data['validation_errors']; exit; |
|
317 | 317 | } else { |
318 | 318 | $this->opensips_model->add_opensipsdispatcher($add_array); |
319 | 319 | echo json_encode(array("SUCCESS"=> "Dispatcher Added Successfully!")); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | function dispatcher_remove($id) { |
326 | 326 | $this->opensips_model->remove_dispatcher($id); |
327 | 327 | $this->session->set_flashdata('astpp_notification', 'Dispatcher Removed Successfully!'); |
328 | - redirect(base_url() . 'opensips/dispatcher_list/'); |
|
328 | + redirect(base_url().'opensips/dispatcher_list/'); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | function dispatcher_list() { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $grid_fields = json_decode($this->opensips_form->build_opensipsdispatcher_list()); |
354 | 354 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
355 | 355 | $result = $this->opensips_db->get("subscriber"); |
356 | - if($result->num_rows() <= 0){ |
|
356 | + if ($result->num_rows() <= 0) { |
|
357 | 357 | $json_data['page'] = 0; |
358 | 358 | $json_data['total'] = 0; |
359 | 359 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $this->session->set_userdata('opensipsdispatcher_list_search', $this->input->post()); |
370 | 370 | } |
371 | 371 | if (@$ajax_search != 1) { |
372 | - redirect(base_url() . 'opensips/dispatcher_list/'); |
|
372 | + redirect(base_url().'opensips/dispatcher_list/'); |
|
373 | 373 | } |
374 | 374 | } |
375 | 375 |
@@ -33,8 +33,9 @@ discard block |
||
33 | 33 | $db_config = Common_model::$global_config['system_config']; |
34 | 34 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
35 | 35 | $this->opensips_db = $this->load->database($opensipdsn, true); |
36 | - if ($this->session->userdata('user_login') == FALSE) |
|
37 | - redirect(base_url() . '/astpp/login'); |
|
36 | + if ($this->session->userdata('user_login') == FALSE) { |
|
37 | + redirect(base_url() . '/astpp/login'); |
|
38 | + } |
|
38 | 39 | } |
39 | 40 | |
40 | 41 | function opensips_add() { |
@@ -92,7 +93,7 @@ discard block |
||
92 | 93 | $this->opensips_model->edit_opensipsdevices($add_array, $add_array['id']); |
93 | 94 | echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!")); |
94 | 95 | exit; |
95 | - }else{ |
|
96 | + } else{ |
|
96 | 97 | echo json_encode($auth_flag); |
97 | 98 | exit; |
98 | 99 | } |
@@ -109,7 +110,7 @@ discard block |
||
109 | 110 | $this->opensips_model->add_opensipsdevices($add_array); |
110 | 111 | echo json_encode(array("SUCCESS"=> "OpenSips added successfully!")); |
111 | 112 | exit; |
112 | - }else{ |
|
113 | + } else{ |
|
113 | 114 | echo json_encode($auth_flag); |
114 | 115 | exit; |
115 | 116 | } |
@@ -131,10 +132,10 @@ discard block |
||
131 | 132 | $auth_flag = $auth_flag->num_rows(); |
132 | 133 | if($auth_flag == 0){ |
133 | 134 | return "TRUE"; |
134 | - }else{ |
|
135 | + } else{ |
|
135 | 136 | return array("username_error"=>"Duplicate Email Address Found Email Must Be Unique."); |
136 | 137 | } |
137 | - }else{ |
|
138 | + } else{ |
|
138 | 139 | return array("username_error"=>"User name is required field."); |
139 | 140 | } |
140 | 141 | return "0"; |
@@ -155,13 +156,13 @@ discard block |
||
155 | 156 | echo json_encode(array("SUCCESS"=> "Opensips Updated Successfully!")); |
156 | 157 | exit; |
157 | 158 | } |
158 | - }else{ |
|
159 | + } else{ |
|
159 | 160 | $data['page_title'] = 'Add Opensips'; |
160 | 161 | if ($this->form_validation->run() == FALSE) { |
161 | 162 | $data['validation_errors'] = validation_errors(); |
162 | 163 | echo $data['validation_errors']; |
163 | 164 | exit; |
164 | - }else{ |
|
165 | + } else{ |
|
165 | 166 | $this->opensips_model->add_opensipsdevices($array_add); |
166 | 167 | echo json_encode(array("SUCCESS"=> "Opensips Added Successfully!")); |
167 | 168 | exit; |
@@ -184,13 +185,13 @@ discard block |
||
184 | 185 | echo json_encode(array("SUCCESS"=> "OpenSips Updated Successfully!")); |
185 | 186 | exit; |
186 | 187 | } |
187 | - }else{ |
|
188 | + } else{ |
|
188 | 189 | $data['page_title'] = 'Add Opensips'; |
189 | 190 | if ($this->form_validation->run() == FALSE) { |
190 | 191 | $data['validation_errors'] = validation_errors(); |
191 | 192 | echo $data['validation_errors']; |
192 | 193 | exit; |
193 | - }else{ |
|
194 | + } else{ |
|
194 | 195 | $this->opensips_model->add_opensipsdevices($add_array); |
195 | 196 | echo json_encode(array("SUCCESS"=> "OpenSips Added Successfully!")); |
196 | 197 | exit; |
@@ -21,7 +21,7 @@ discard block |
||
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 Opensips_form { |
@@ -35,18 +35,18 @@ discard block |
||
35 | 35 | |
36 | 36 | $uname_user = $this->CI->common->find_uniq_rendno('10', '', ''); |
37 | 37 | $password = $this->CI->common->generate_password(); |
38 | - $val = $id > 0 ? 'subscriber.username.' . $id : 'subscriber.username'; |
|
38 | + $val = $id > 0 ? 'subscriber.username.'.$id : 'subscriber.username'; |
|
39 | 39 | |
40 | 40 | // echo '<pre>'; print_r($val); exit; |
41 | 41 | $loginid = $this->CI->session->userdata('logintype') == 2 ? 0 : $accountinfo['id']; |
42 | - $form['forms'] = array(base_url() . 'opensips/opensips_save/', array("id" => "opensips_form", "name" => "opensips_form")); |
|
42 | + $form['forms'] = array(base_url().'opensips/opensips_save/', array("id" => "opensips_form", "name" => "opensips_form")); |
|
43 | 43 | $form['Opensips Device'] = array( |
44 | 44 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
45 | - array('Username', 'INPUT', array('name' => 'username', 'size' => '30', 'value' => $uname_user, 'id' => 'username', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'), |
|
46 | - array('Password', 'INPUT', array('name' => 'password', 'size' => '30', 'value' => $password, 'id' => 'password', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_pass fa fa-refresh"></i>'), |
|
45 | + array('Username', 'INPUT', array('name' => 'username', 'size' => '30', 'value' => $uname_user, 'id' => 'username', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'), |
|
46 | + array('Password', 'INPUT', array('name' => 'password', 'size' => '30', 'value' => $password, 'id' => 'password', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_pass fa fa-refresh"></i>'), |
|
47 | 47 | array('Account', 'accountcode', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'number', 'number', 'accounts', 'build_dropdown', 'where_arr', array("reseller_id" => $loginid, "type" => "GLOBAL", "deleted" => "0")), |
48 | 48 | array('Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
49 | - array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
49 | + array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
50 | 50 | array('Caller Number', 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
51 | 51 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'), |
52 | 52 | ); |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | |
59 | 59 | function get_dispatcher_form_fields() { |
60 | 60 | |
61 | - $form['forms'] = array(base_url() . 'opensips/dispatcher_save/', array("id" => "opensips_dispatcher_form", "name" => "opensips_dispatcher_form")); |
|
61 | + $form['forms'] = array(base_url().'opensips/dispatcher_save/', array("id" => "opensips_dispatcher_form", "name" => "opensips_dispatcher_form")); |
|
62 | 62 | $form['Dispatcher Information'] = array( |
63 | 63 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
64 | 64 | array('Setid', 'INPUT', array('name' => 'setid', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
65 | 65 | array('Destination', 'INPUT', array('name' => 'destination', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''), |
66 | - array('Weight', 'INPUT', array('name' => 'weight', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
66 | + array('Weight', 'INPUT', array('name' => 'weight', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
67 | 67 | array('Attrs', 'INPUT', array('name' => 'attrs', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
68 | - array('Description', 'INPUT', array('name' => 'description', 'size' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
68 | + array('Description', 'INPUT', array('name' => 'description', 'size' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
69 | 69 | ); |
70 | 70 | $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'type' => 'button', 'id' => 'submit', 'class' => 'btn btn-line-parrot'); |
71 | 71 | $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'/opensips/dispatcher_list/\')'); |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | function build_opensips_list() { |
104 | 104 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
105 | 105 | $grid_field_arr = json_encode(array( |
106 | - array("Username", "150", "username", "", "", "","","true","center"), |
|
107 | - array("Password", "150", "password", "", "", "","","true","center"), |
|
108 | - array("Account", "150", "accountcode", "", "", "","","true","center"), |
|
109 | - array("Domain", "317", "domain", "", "", "","","true","center"), |
|
110 | - array("Caller Name", "200", "effective_caller_id_name", "", "", "","","true","center"), |
|
111 | - array("Caller Number", "200", "effective_caller_id_number", "", "", "","","true","center"), |
|
106 | + array("Username", "150", "username", "", "", "", "", "true", "center"), |
|
107 | + array("Password", "150", "password", "", "", "", "", "true", "center"), |
|
108 | + array("Account", "150", "accountcode", "", "", "", "", "true", "center"), |
|
109 | + array("Domain", "317", "domain", "", "", "", "", "true", "center"), |
|
110 | + array("Caller Name", "200", "effective_caller_id_name", "", "", "", "", "true", "center"), |
|
111 | + array("Caller Number", "200", "effective_caller_id_number", "", "", "", "", "true", "center"), |
|
112 | 112 | array("Action", "100", "", "", "", array("EDIT" => array("url" => "/opensips/opensips_edit/", "mode" => "popup"), |
113 | 113 | "DELETE" => array("url" => "/opensips/opensips_remove/", "mode" => "single"))) |
114 | 114 | )); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | function build_opensipsdispatcher_list() { |
119 | 119 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
120 | 120 | $grid_field_arr = json_encode(array( |
121 | - array("Set Id", "160", "setid", "", "", "","","true","center"), |
|
122 | - array("Destination", "160", "destination", "", "", "","","true","center"), |
|
123 | - array("Weight", "190", "weight", "", "", "","","true","center"), |
|
124 | - array("Attrs", "180", "attrs", "", "", "","","true","center"), |
|
125 | - array("Description", "190", "description", "", "", "","","true","center"), |
|
121 | + array("Set Id", "160", "setid", "", "", "", "", "true", "center"), |
|
122 | + array("Destination", "160", "destination", "", "", "", "", "true", "center"), |
|
123 | + array("Weight", "190", "weight", "", "", "", "", "true", "center"), |
|
124 | + array("Attrs", "180", "attrs", "", "", "", "", "true", "center"), |
|
125 | + array("Description", "190", "description", "", "", "", "", "true", "center"), |
|
126 | 126 | array("Action", "170", "", "", "", array("EDIT" => array("url" => "/opensips/dispatcher_edit/", "mode" => "popup"), |
127 | 127 | "DELETE" => array("url" => "/opensips/dispatcher_remove/", "mode" => "single"))) |
128 | 128 | )); |
@@ -144,19 +144,19 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | function get_opensips_form_fields_for_customer($accountid, $id = false) { |
147 | - $val = $id > 0 ? 'subscriber.username.' . $id : 'subscriber.username'; |
|
147 | + $val = $id > 0 ? 'subscriber.username.'.$id : 'subscriber.username'; |
|
148 | 148 | $uname_user = $this->CI->common->find_uniq_rendno('10', '', ''); |
149 | 149 | $password = $this->CI->common->generate_password(); |
150 | 150 | $accountinfo = $this->CI->session->userdata('accountinfo'); |
151 | - $link = ($accountinfo['type']==1 || $accountinfo['type']==3 )? base_url() . 'opensips/user_opensips_save/true/' : base_url() . 'opensips/customer_opensips_save/true/'; |
|
151 | + $link = ($accountinfo['type'] == 1 || $accountinfo['type'] == 3) ? base_url().'opensips/user_opensips_save/true/' : base_url().'opensips/customer_opensips_save/true/'; |
|
152 | 152 | $form['forms'] = array($link, array("id" => "opensips_form", "name" => "opensips_form")); |
153 | 153 | $form['Opensips Device'] = array( |
154 | 154 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
155 | 155 | array('', 'HIDDEN', array('name' => 'accountcode', 'value' => $this->CI->common->get_field_name('number', 'accounts', array('id' => $accountid))), '', '', '', ''), |
156 | - array('Username', 'INPUT', array('name' => 'username', 'size' => '20', 'id' => 'username', 'value' => $uname_user, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'), |
|
156 | + array('Username', 'INPUT', array('name' => 'username', 'size' => '20', 'id' => 'username', 'value' => $uname_user, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_number fa fa-refresh"></i>'), |
|
157 | 157 | array('Password', 'PASSWORD', array('name' => 'password', 'size' => '20', 'id' => 'password1', 'value' => $password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;" title="Reset Password" class="change_pass fa fa-refresh"></i>'), |
158 | - array('Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
159 | - array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
158 | + array('Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
159 | + array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
160 | 160 | array('Caller Number', 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
161 | 161 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'), |
162 | 162 | ); |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | array("Username", "200", "username", "", "", ""), |
193 | 193 | array("Password", "200", "password", "", "", ""), |
194 | 194 | array("Domain", "200", "domain", "", "", ""), |
195 | - array("Caller Name", "150", "effective_caller_id_name", "", "", "","","true","center"), |
|
196 | - array("Caller Number", "150", "effective_caller_id_number", "", "", "","","true","center"), |
|
197 | - array("Action", "100", "", "", "", array("EDIT" => array("url" => 'accounts/customer_opensips_action/edit/' . $accountid . '/', "mode" => "popup"), |
|
198 | - "DELETE" => array("url" => 'accounts/customer_opensips_action/delete/' . $accountid . "/", "mode" => "popup"))) |
|
195 | + array("Caller Name", "150", "effective_caller_id_name", "", "", "", "", "true", "center"), |
|
196 | + array("Caller Number", "150", "effective_caller_id_number", "", "", "", "", "true", "center"), |
|
197 | + array("Action", "100", "", "", "", array("EDIT" => array("url" => 'accounts/customer_opensips_action/edit/'.$accountid.'/', "mode" => "popup"), |
|
198 | + "DELETE" => array("url" => 'accounts/customer_opensips_action/delete/'.$accountid."/", "mode" => "popup"))) |
|
199 | 199 | )); |
200 | 200 | |
201 | 201 | return $grid_field_arr; |
@@ -22,8 +22,9 @@ |
||
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 |
@@ -38,27 +38,27 @@ discard block |
||
38 | 38 | $account_email = $account_data['email']; |
39 | 39 | $account_type = $account_data['type']; |
40 | 40 | |
41 | - if($account_type == 0){ |
|
42 | - $this->db->where('accountid',$account_id); |
|
41 | + if ($account_type == 0) { |
|
42 | + $this->db->where('accountid', $account_id); |
|
43 | 43 | } |
44 | - if($account_type == 1){ |
|
44 | + if ($account_type == 1) { |
|
45 | 45 | $this->db->where_in('reseller_id'); |
46 | 46 | $this->db->select('id'); |
47 | - $email_address=$this->db->get('accounts'); |
|
47 | + $email_address = $this->db->get('accounts'); |
|
48 | 48 | |
49 | - $email_address=$email_address->result_array(); |
|
49 | + $email_address = $email_address->result_array(); |
|
50 | 50 | |
51 | - if(empty($email_address)){ |
|
52 | - $this->db->or_where('accountid',0); |
|
53 | - } else{ |
|
54 | - $this->db->where('reseller_id',$account_id); |
|
51 | + if (empty($email_address)) { |
|
52 | + $this->db->or_where('accountid', 0); |
|
53 | + } else { |
|
54 | + $this->db->where('reseller_id', $account_id); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | $this->db_model->build_search('email_search_list'); |
58 | 58 | if ($flag) { |
59 | 59 | $query = $this->db_model->select("*", "mail_details", '', "id", "DESC", $limit, $start); |
60 | 60 | } else { |
61 | - $query = $this->db_model->countQuery("*", "mail_details",''); |
|
61 | + $query = $this->db_model->countQuery("*", "mail_details", ''); |
|
62 | 62 | } |
63 | 63 | return $query; |
64 | 64 | } |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | $this->db->where("id", $id); |
79 | 79 | $this->db->update("mail_details", $data); |
80 | 80 | } |
81 | - function customer_get_email_list($flag,$accountid, $start = 0, $limit = 0) { |
|
81 | + function customer_get_email_list($flag, $accountid, $start = 0, $limit = 0) { |
|
82 | 82 | |
83 | - $this->db->where('accountid',$accountid); |
|
83 | + $this->db->where('accountid', $accountid); |
|
84 | 84 | if ($flag) { |
85 | 85 | $query = $this->db_model->select("*", "mail_details", '', "id", "desc", $limit, $start); |
86 | 86 | } else { |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | |
91 | 91 | return $query; |
92 | 92 | } |
93 | - function get_email_client_data($data, $start = 0, $limit = 0){ |
|
94 | - if($data['type'] == ''){ |
|
95 | - $where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'deleted'=>'0'); |
|
96 | - } else{ |
|
97 | - $where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'type'=>$data['type'],'deleted'=>'0'); |
|
93 | + function get_email_client_data($data, $start = 0, $limit = 0) { |
|
94 | + if ($data['type'] == '') { |
|
95 | + $where = array('pricelist_id'=>$data['pricelist_id'], 'posttoexternal'=>$data['posttoexternal'], 'status'=>$data['status'], 'deleted'=>'0'); |
|
96 | + } else { |
|
97 | + $where = array('pricelist_id'=>$data['pricelist_id'], 'posttoexternal'=>$data['posttoexternal'], 'status'=>$data['status'], 'type'=>$data['type'], 'deleted'=>'0'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $query = $this->db_model->getSelect("email,id", "accounts", $where); |
@@ -102,28 +102,28 @@ discard block |
||
102 | 102 | return $query; |
103 | 103 | } |
104 | 104 | /*Mass mail*/ |
105 | - function multipal_email($data){ |
|
106 | - $mail_ids=explode(',',$data['to']); |
|
107 | - foreach($mail_ids as $key=>$val) |
|
105 | + function multipal_email($data) { |
|
106 | + $mail_ids = explode(',', $data['to']); |
|
107 | + foreach ($mail_ids as $key=>$val) |
|
108 | 108 | { |
109 | - if($val!='') |
|
109 | + if ($val != '') |
|
110 | 110 | { |
111 | - $template_type['message']=$data['template']; |
|
112 | - $template_type['subject']=$data['subject']; |
|
113 | - $act_details = $this->db_model->getSelect("*", "accounts", array('email'=>$val,"deleted"=>0)); |
|
114 | - $count=$act_details->num_rows(); |
|
115 | - $account_info=array(); |
|
116 | - if($count<=0) |
|
111 | + $template_type['message'] = $data['template']; |
|
112 | + $template_type['subject'] = $data['subject']; |
|
113 | + $act_details = $this->db_model->getSelect("*", "accounts", array('email'=>$val, "deleted"=>0)); |
|
114 | + $count = $act_details->num_rows(); |
|
115 | + $account_info = array(); |
|
116 | + if ($count <= 0) |
|
117 | 117 | { |
118 | - $account_info['email']=$val; |
|
119 | - $account_info['accountid']='0'; |
|
120 | - } else{ |
|
118 | + $account_info['email'] = $val; |
|
119 | + $account_info['accountid'] = '0'; |
|
120 | + } else { |
|
121 | 121 | $res_data = $act_details->result_array(); |
122 | - $account_info=$res_data[0]; |
|
123 | - $account_info['accountid']=$account_info['id']; |
|
122 | + $account_info = $res_data[0]; |
|
123 | + $account_info['accountid'] = $account_info['id']; |
|
124 | 124 | } |
125 | 125 | $account_info['password'] = $this->common->decode($account_info['password']); |
126 | - $this->email_lib->send_email($template_type,$account_info,'',$data['file'],0,1); |
|
126 | + $this->email_lib->send_email($template_type, $account_info, '', $data['file'], 0, 1); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | return true; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->load->library('csvreader'); |
37 | 37 | $this->load->library('astpp/email_lib'); |
38 | 38 | if ($this->session->userdata('user_login') == FALSE) |
39 | - redirect(base_url() . '/astpp/login'); |
|
39 | + redirect(base_url().'/astpp/login'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | function email_edit($edit_id = '') { |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $edit_data); |
57 | 57 | $this->load->view('view_email_add_edit', $data); |
58 | 58 | } else { |
59 | - redirect(base_url() . 'email/email_history_list/'); |
|
59 | + redirect(base_url().'email/email_history_list/'); |
|
60 | 60 | } |
61 | - redirect(base_url() . 'email/email_history_list/'); |
|
61 | + redirect(base_url().'email/email_history_list/'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function email_resend() { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | foreach ($account->result_array() as $key => $value) { |
79 | 79 | $edit_data = $value; |
80 | 80 | } |
81 | - $add_array=array('accountid'=>$edit_data['accountid'], |
|
81 | + $add_array = array('accountid'=>$edit_data['accountid'], |
|
82 | 82 | 'subject'=>$add_array['subject'], |
83 | 83 | 'body'=>$add_array['body'], |
84 | 84 | 'from'=>$edit_data['from'], |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $this->email_re_send($add_array); |
92 | 92 | |
93 | 93 | $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!'); |
94 | - redirect(base_url() . 'email/email_history_list/'); |
|
94 | + redirect(base_url().'email/email_history_list/'); |
|
95 | 95 | } |
96 | 96 | function email_resend_edit($edit_id = '') { |
97 | 97 | $data['page_title'] = 'Resend Email'; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->load->view('view_email_add_edit', $data); |
108 | 108 | } else { |
109 | - redirect(base_url() . 'email/email_history_list/'); |
|
109 | + redirect(base_url().'email/email_history_list/'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $this->load->view('view_email_add_edit', $data); |
125 | 125 | } else { |
126 | - redirect(base_url() . 'email/email_history_list/'); |
|
126 | + redirect(base_url().'email/email_history_list/'); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | foreach ($account->result_array() as $key => $value) { |
137 | 137 | $edit_data = $value; |
138 | 138 | } |
139 | - $add_array=array('accountid'=>$edit_data['accountid'], |
|
139 | + $add_array = array('accountid'=>$edit_data['accountid'], |
|
140 | 140 | 'subject'=>$add_array['subject'], |
141 | 141 | 'body'=>$add_array['body'], |
142 | 142 | 'from'=>$edit_data['from'], |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | 'attachment'=>$edit_data['attachment'], |
147 | 147 | ); |
148 | 148 | $this->email_model->add_email($add_array); |
149 | - $this->email_lib->send_email('',$add_array,'','',1); |
|
149 | + $this->email_lib->send_email('', $add_array, '', '', 1); |
|
150 | 150 | |
151 | 151 | $this->load->module('accounts/accounts'); |
152 | 152 | $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!'); |
153 | - redirect(base_url() . 'accounts/customer_edit/'.$value["accountid"]); |
|
153 | + redirect(base_url().'accounts/customer_edit/'.$value["accountid"]); |
|
154 | 154 | } |
155 | 155 | function email_add($type = "") { |
156 | 156 | |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | function email_re_send($edit_data) { |
192 | - $this->email_lib->send_email('',$edit_data,'',$edit_data['attachment'],1); |
|
192 | + $this->email_lib->send_email('', $edit_data, '', $edit_data['attachment'], 1); |
|
193 | 193 | $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!'); |
194 | - redirect(base_url() . '/email/email_history_list/'); |
|
194 | + redirect(base_url().'/email/email_history_list/'); |
|
195 | 195 | } |
196 | 196 | function email_view($edit_id = '') { |
197 | 197 | $data['page_title'] = 'View Email'; |
@@ -201,16 +201,16 @@ discard block |
||
201 | 201 | foreach ($account->result_array() as $key => $value) { |
202 | 202 | $edit_data = $value; |
203 | 203 | } |
204 | - if($edit_data['status'] == 1){ |
|
205 | - $edit_data['status']='Not Sent'; |
|
206 | - } else{ |
|
207 | - $edit_data['status']='Sent'; |
|
204 | + if ($edit_data['status'] == 1) { |
|
205 | + $edit_data['status'] = 'Not Sent'; |
|
206 | + } else { |
|
207 | + $edit_data['status'] = 'Sent'; |
|
208 | 208 | } |
209 | 209 | $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data); |
210 | 210 | |
211 | 211 | $this->load->view('view_email_add_edit', $data); |
212 | 212 | } else { |
213 | - redirect(base_url() . 'email/email_history_list/'); |
|
213 | + redirect(base_url().'email/email_history_list/'); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | function email_view_customer($edit_id = '') { |
@@ -224,140 +224,140 @@ discard block |
||
224 | 224 | $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus(), $edit_data); |
225 | 225 | $this->load->view('view_email_add_edit', $data); |
226 | 226 | } else { |
227 | - redirect(base_url() . 'email/email_history_list/'.$edit_id); |
|
227 | + redirect(base_url().'email/email_history_list/'.$edit_id); |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | function email_delete($id) { |
231 | 231 | $this->email_model->remove_email($id); |
232 | 232 | $this->session->set_flashdata('astpp_notification', 'Email removed successfully!'); |
233 | - redirect(base_url() . '/email/email_history_list/'); |
|
233 | + redirect(base_url().'/email/email_history_list/'); |
|
234 | 234 | } |
235 | - function email_delete_customer($accounttype,$accountid,$id) { |
|
235 | + function email_delete_customer($accounttype, $accountid, $id) { |
|
236 | 236 | $this->email_model->remove_email($id); |
237 | 237 | $where = array('id' => $id); |
238 | 238 | $account = $this->db_model->getSelect("*", "mail_details", $where); |
239 | 239 | foreach ($account->result_array() as $key => $value) { |
240 | 240 | $edit_data = $value; |
241 | 241 | } |
242 | - $url ="accounts/".$accounttype."_emailhistory/$accountid/"; |
|
242 | + $url = "accounts/".$accounttype."_emailhistory/$accountid/"; |
|
243 | 243 | $this->session->set_flashdata('astpp_notification', 'Email removed successfully!'); |
244 | 244 | $this->load->module('accounts/accounts'); |
245 | - redirect(base_url() . $url); |
|
245 | + redirect(base_url().$url); |
|
246 | 246 | } |
247 | 247 | function email_mass() { |
248 | 248 | $account_data = $this->session->userdata("accountinfo"); |
249 | - if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) |
|
250 | - redirect(base_url() . '/astpp/dashboard/'); |
|
249 | + if ($account_data['type'] == '1' || $account_data['type'] == 0 || $account_data['type'] == 3) |
|
250 | + redirect(base_url().'/astpp/dashboard/'); |
|
251 | 251 | $data['username'] = $this->session->userdata('user_name'); |
252 | 252 | $data['page_title'] = 'Email Mass'; |
253 | 253 | $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), ''); |
254 | - $this->load->view('view_email_client_area',$data); |
|
254 | + $this->load->view('view_email_client_area', $data); |
|
255 | 255 | } |
256 | 256 | /*Mass Email*/ |
257 | - function attachment_icons($select = "", $table = "", $attachement="") { |
|
258 | - if($attachement!="") |
|
257 | + function attachment_icons($select = "", $table = "", $attachement = "") { |
|
258 | + if ($attachement != "") |
|
259 | 259 | { |
260 | - $array=explode(",", $attachement); |
|
261 | - $str=''; |
|
262 | - foreach($array as $key =>$val){ |
|
263 | - $link = base_url() . "email/email_history_list_attachment/".$val; |
|
264 | - $str.="<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a> "; |
|
260 | + $array = explode(",", $attachement); |
|
261 | + $str = ''; |
|
262 | + foreach ($array as $key =>$val) { |
|
263 | + $link = base_url()."email/email_history_list_attachment/".$val; |
|
264 | + $str .= "<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a> "; |
|
265 | 265 | } |
266 | 266 | return $str; |
267 | - } else{ |
|
267 | + } else { |
|
268 | 268 | return ""; |
269 | 269 | } |
270 | 270 | } |
271 | 271 | function email_client_get() |
272 | 272 | { |
273 | - $files=$_FILES; |
|
273 | + $files = $_FILES; |
|
274 | 274 | $add_array = $this->input->post(); |
275 | 275 | $add_array['page_title'] = 'Compose email'; |
276 | - $nooffile= $files['file']['name']; |
|
277 | - $count=count($nooffile); |
|
278 | - $add_array['attachment']=''; |
|
279 | - $add_array['file']=''; |
|
280 | - for($i=0;$i<$count;$i++){ |
|
281 | - $tmp_name[]= $files['file']['tmp_name'][$i]; |
|
282 | - if($files['file']['error'][$i]==0){ |
|
276 | + $nooffile = $files['file']['name']; |
|
277 | + $count = count($nooffile); |
|
278 | + $add_array['attachment'] = ''; |
|
279 | + $add_array['file'] = ''; |
|
280 | + for ($i = 0; $i < $count; $i++) { |
|
281 | + $tmp_name[] = $files['file']['tmp_name'][$i]; |
|
282 | + if ($files['file']['error'][$i] == 0) { |
|
283 | 283 | $cur_name = $files['file']['name'][$i]; |
284 | 284 | $parts = explode(".", $cur_name); |
285 | - $add_array['attachment'].=date('ymdhis').$i.'.'.$parts[1].','; |
|
286 | - $add_array['file'].=date('ymdhis').$i.'.'.$parts[1].','; |
|
285 | + $add_array['attachment'] .= date('ymdhis').$i.'.'.$parts[1].','; |
|
286 | + $add_array['file'] .= date('ymdhis').$i.'.'.$parts[1].','; |
|
287 | 287 | $uploadedFile1 = $files['file']['tmp_name'][$i]; |
288 | - $user_name='inextrix'; |
|
289 | - $actual_file_name=date('ymdhis').$i.'.'.$parts[1]; |
|
290 | - $dir_path= getcwd()."/attachments/"; |
|
291 | - $path =$dir_path.$actual_file_name; |
|
292 | - if (move_uploaded_file($uploadedFile1,$path)) { |
|
288 | + $user_name = 'inextrix'; |
|
289 | + $actual_file_name = date('ymdhis').$i.'.'.$parts[1]; |
|
290 | + $dir_path = getcwd()."/attachments/"; |
|
291 | + $path = $dir_path.$actual_file_name; |
|
292 | + if (move_uploaded_file($uploadedFile1, $path)) { |
|
293 | 293 | $this->session->set_flashdata('astpp_errormsg', 'files added successfully!'); |
294 | 294 | } |
295 | - else{ |
|
295 | + else { |
|
296 | 296 | $this->session->set_flashdata('astpp_errormsg', 'Please try again !'); |
297 | 297 | } |
298 | 298 | } |
299 | 299 | } |
300 | - $add_array['attachment']=trim($add_array['attachment'],','); |
|
301 | - $add_array['file']=trim($add_array['file'],','); |
|
302 | - $add_array['email']= explode(",",$add_array['to']); |
|
300 | + $add_array['attachment'] = trim($add_array['attachment'], ','); |
|
301 | + $add_array['file'] = trim($add_array['file'], ','); |
|
302 | + $add_array['email'] = explode(",", $add_array['to']); |
|
303 | 303 | $this->email_model->multipal_email($add_array); |
304 | 304 | $screen_path = getcwd()."/cron"; |
305 | 305 | $screen_filename = "Email_Broadcast_".strtotime('now'); |
306 | 306 | $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S $screen_filename php cron.php BroadcastEmail"; |
307 | 307 | exec($command); |
308 | 308 | $this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!'); |
309 | - redirect(base_url() . 'email/email_history_list/'); |
|
309 | + redirect(base_url().'email/email_history_list/'); |
|
310 | 310 | exit; |
311 | 311 | } |
312 | 312 | |
313 | 313 | function email_client_area() { |
314 | 314 | $add_array = $this->input->post(); |
315 | - if($add_array['temp'] == ''){ |
|
315 | + if ($add_array['temp'] == '') { |
|
316 | 316 | $subject = ''; |
317 | - $body =''; |
|
317 | + $body = ''; |
|
318 | 318 | } |
319 | - else{ |
|
319 | + else { |
|
320 | 320 | $where = array('id' => $add_array['temp']); |
321 | 321 | $account = $this->db_model->getSelect("subject,template", "default_templates", $where); |
322 | - $account_data =$account->result_array(); |
|
323 | - $subject = isset($account_data[0]['subject'])?$account_data[0]['subject']:''; |
|
324 | - $body = isset($account_data[0]['template'])?$account_data[0]['template']:''; |
|
322 | + $account_data = $account->result_array(); |
|
323 | + $subject = isset($account_data[0]['subject']) ? $account_data[0]['subject'] : ''; |
|
324 | + $body = isset($account_data[0]['template']) ? $account_data[0]['template'] : ''; |
|
325 | 325 | |
326 | 326 | |
327 | 327 | } |
328 | 328 | $count_all = $this->email_model->get_email_client_data($add_array); |
329 | 329 | $email_arr = array(); |
330 | 330 | $id_arr = array(); |
331 | - foreach($count_all as $key=>$value){ |
|
331 | + foreach ($count_all as $key=>$value) { |
|
332 | 332 | $value = $value; |
333 | - if($value['email']!=''){ |
|
334 | - $email_arr[$value['email']]= $value['email']; |
|
335 | - $id_arr[]= $value['id'];} |
|
333 | + if ($value['email'] != '') { |
|
334 | + $email_arr[$value['email']] = $value['email']; |
|
335 | + $id_arr[] = $value['id']; } |
|
336 | 336 | } |
337 | 337 | if (empty($email_arr)) |
338 | 338 | { |
339 | 339 | $this->session->set_flashdata('astpp_notification', 'No record found! '); |
340 | - redirect(base_url() . 'email/email_mass/'); |
|
340 | + redirect(base_url().'email/email_mass/'); |
|
341 | 341 | } |
342 | 342 | $to_email = $email_arr; |
343 | 343 | |
344 | 344 | $to_id = $id_arr; |
345 | - $to_send_mail = implode(",",$to_email); |
|
346 | - if($to_send_mail != ''){ |
|
347 | - $add_arr['email']= $email_arr; |
|
345 | + $to_send_mail = implode(",", $to_email); |
|
346 | + if ($to_send_mail != '') { |
|
347 | + $add_arr['email'] = $email_arr; |
|
348 | 348 | } |
349 | 349 | $data['username'] = $this->session->userdata('user_name'); |
350 | 350 | $data['page_title'] = 'Compose Email'; |
351 | 351 | $send_id = $this->db_model->getSelect("emailaddress", "invoice_conf", array()); |
352 | - $send_id =$send_id->result_array(); |
|
353 | - $send_id =$send_id[0]['emailaddress']; |
|
352 | + $send_id = $send_id->result_array(); |
|
353 | + $send_id = $send_id[0]['emailaddress']; |
|
354 | 354 | $add_arr['template'] = $body; |
355 | 355 | $add_arr['subject'] = $subject; |
356 | 356 | $add_arr['accountid'] = $id_arr; |
357 | 357 | $add_arr['from'] = $send_id; |
358 | 358 | $add_arr['temp'] = $add_array['temp']; |
359 | - $add_arr['to']=$to_send_mail; |
|
360 | - $add_arr['temp']=$add_array['temp']; |
|
359 | + $add_arr['to'] = $to_send_mail; |
|
360 | + $add_arr['temp'] = $add_array['temp']; |
|
361 | 361 | $this->load->view('view_email_brod', $add_arr); |
362 | 362 | } |
363 | 363 | |
@@ -370,10 +370,10 @@ discard block |
||
370 | 370 | $edit_data = $value; |
371 | 371 | } |
372 | 372 | $this->load->module('accounts/accounts'); |
373 | - redirect(base_url() . 'accounts/customer_edit/'.$value['accountid']); |
|
373 | + redirect(base_url().'accounts/customer_edit/'.$value['accountid']); |
|
374 | 374 | } |
375 | 375 | function email_history_list() { |
376 | - $data['logintype']=$this->session->userdata('logintype'); |
|
376 | + $data['logintype'] = $this->session->userdata('logintype'); |
|
377 | 377 | $data['username'] = $this->session->userdata('user_name'); |
378 | 378 | $data['search_flag'] = true; |
379 | 379 | $this->session->set_userdata('advance_search', 0); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $this->load->view('view_email_list', $data); |
385 | 385 | } |
386 | 386 | function email_history_list_json() { |
387 | - $data['logintype']=$this->session->userdata('logintype'); |
|
387 | + $data['logintype'] = $this->session->userdata('logintype'); |
|
388 | 388 | $json_data = array(); |
389 | 389 | $count_all = $this->email_model->get_email_list(false); |
390 | 390 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | echo json_encode($json_data); |
396 | 396 | } |
397 | 397 | |
398 | - function customer_mail_record($accountid,$accounttype){ |
|
398 | + function customer_mail_record($accountid, $accounttype) { |
|
399 | 399 | $json_data = array(); |
400 | - $count_all = $this->email_model->customer_get_email_list(false,$accountid,"",""); |
|
400 | + $count_all = $this->email_model->customer_get_email_list(false, $accountid, "", ""); |
|
401 | 401 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
402 | 402 | $json_data = $paging_data["json_paging"]; |
403 | - $query = $this->email_model->customer_get_email_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
404 | - $grid_fields = json_decode($this->email_form->build_list_for_email_customer($accountid,$accounttype)); |
|
403 | + $query = $this->email_model->customer_get_email_list(true, $accountid, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
404 | + $grid_fields = json_decode($this->email_form->build_list_for_email_customer($accountid, $accounttype)); |
|
405 | 405 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
406 | 406 | echo json_encode($json_data); |
407 | 407 | } |
@@ -412,11 +412,11 @@ discard block |
||
412 | 412 | echo $this->db->delete("email"); |
413 | 413 | } |
414 | 414 | |
415 | - function email_send_multipal(){ |
|
415 | + function email_send_multipal() { |
|
416 | 416 | $add_array = $this->input->post(); |
417 | - if($add_array['email'] == '' || $add_array['subject'] == '' || $add_array['template'] == ''){ |
|
417 | + if ($add_array['email'] == '' || $add_array['subject'] == '' || $add_array['template'] == '') { |
|
418 | 418 | $this->session->set_flashdata('astpp_notification', 'Email address not found!'); |
419 | - redirect(base_url() . '/email/email_client_area/'); |
|
419 | + redirect(base_url().'/email/email_client_area/'); |
|
420 | 420 | } |
421 | 421 | $this->email_model->multipal_email($add_array); |
422 | 422 | $screen_path = "/var/www/html/ITPLATP/cron"; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S $screen_filename php cron.php BroadcastEmail"; |
425 | 425 | exec($command); |
426 | 426 | $this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!'); |
427 | - redirect(base_url() . 'email/email_history_list/'); |
|
427 | + redirect(base_url().'email/email_history_list/'); |
|
428 | 428 | |
429 | 429 | } |
430 | 430 | function email_history_list_search() { |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $this->session->set_userdata('email_search_list', $action); |
439 | 439 | } |
440 | 440 | if (@$ajax_search != 1) { |
441 | - redirect(base_url() . 'email/email_history_list/'); |
|
441 | + redirect(base_url().'email/email_history_list/'); |
|
442 | 442 | } |
443 | 443 | } |
444 | 444 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | * Version 2.1 |
452 | 452 | */ |
453 | 453 | function email_history_list_attachment($file_name) { |
454 | - if(file_exists(getcwd().'/attachments/'.$file_name)){ |
|
454 | + if (file_exists(getcwd().'/attachments/'.$file_name)) { |
|
455 | 455 | header('Content-Type: application/octet-stream'); |
456 | 456 | header('Content-Disposition: attachment; filename='.$file_name); |
457 | 457 | ob_clean(); |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | $this->load->model('email_model'); |
36 | 36 | $this->load->library('csvreader'); |
37 | 37 | $this->load->library('astpp/email_lib'); |
38 | - if ($this->session->userdata('user_login') == FALSE) |
|
39 | - redirect(base_url() . '/astpp/login'); |
|
38 | + if ($this->session->userdata('user_login') == FALSE) { |
|
39 | + redirect(base_url() . '/astpp/login'); |
|
40 | + } |
|
40 | 41 | } |
41 | 42 | |
42 | 43 | function email_edit($edit_id = '') { |
@@ -246,8 +247,9 @@ discard block |
||
246 | 247 | } |
247 | 248 | function email_mass() { |
248 | 249 | $account_data = $this->session->userdata("accountinfo"); |
249 | - if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) |
|
250 | - redirect(base_url() . '/astpp/dashboard/'); |
|
250 | + if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) { |
|
251 | + redirect(base_url() . '/astpp/dashboard/'); |
|
252 | + } |
|
251 | 253 | $data['username'] = $this->session->userdata('user_name'); |
252 | 254 | $data['page_title'] = 'Email Mass'; |
253 | 255 | $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), ''); |
@@ -291,8 +293,7 @@ discard block |
||
291 | 293 | $path =$dir_path.$actual_file_name; |
292 | 294 | if (move_uploaded_file($uploadedFile1,$path)) { |
293 | 295 | $this->session->set_flashdata('astpp_errormsg', 'files added successfully!'); |
294 | - } |
|
295 | - else{ |
|
296 | + } else{ |
|
296 | 297 | $this->session->set_flashdata('astpp_errormsg', 'Please try again !'); |
297 | 298 | } |
298 | 299 | } |
@@ -315,8 +316,7 @@ discard block |
||
315 | 316 | if($add_array['temp'] == ''){ |
316 | 317 | $subject = ''; |
317 | 318 | $body =''; |
318 | - } |
|
319 | - else{ |
|
319 | + } else{ |
|
320 | 320 | $where = array('id' => $add_array['temp']); |
321 | 321 | $account = $this->db_model->getSelect("subject,template", "default_templates", $where); |
322 | 322 | $account_data =$account->result_array(); |
@@ -22,7 +22,7 @@ discard block |
||
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 Email_form { |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | function get_form_fields_email() { |
34 | - $form['forms'] = array(base_url() . 'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
34 | + $form['forms'] = array(base_url().'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
35 | 35 | $form['Resend Email'] = array( |
36 | 36 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
37 | - array('To', 'INPUT', array('name' => 'to', 'size' => '20', 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
38 | - array('From', 'INPUT', array('name' => 'from', 'size' => '20', 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
39 | - array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
40 | - array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
37 | + array('To', 'INPUT', array('name' => 'to', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
38 | + array('From', 'INPUT', array('name' => 'from', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
39 | + array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
40 | + array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
41 | 41 | |
42 | 42 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''), |
43 | 43 | |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | function get_form_fields_email_edit() { |
52 | - $readable='disabled'; |
|
53 | - $form['forms'] = array(base_url() . 'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
52 | + $readable = 'disabled'; |
|
53 | + $form['forms'] = array(base_url().'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
54 | 54 | $form['Resent Email'] = array( |
55 | 55 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
56 | 56 | array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''), |
57 | - array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
58 | - array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
59 | - array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
60 | - array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
57 | + array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
58 | + array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
59 | + array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
60 | + array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
61 | 61 | |
62 | 62 | ); |
63 | 63 | $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\')'); |
@@ -66,48 +66,48 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | function get_form_fields_email_view() { |
69 | - $readable='disabled'; |
|
70 | - $form['forms'] = array(base_url() . 'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
69 | + $readable = 'disabled'; |
|
70 | + $form['forms'] = array(base_url().'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
71 | 71 | $form['View Email'] = array( |
72 | 72 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
73 | 73 | array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''), |
74 | - array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
75 | - array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,'style'=>'margin-top: 3px;' ,'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
76 | - array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
77 | - array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
78 | - array('Status', 'INPUT', array('name' => 'status', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'width: 18% !important;margin-top: 3px;' , 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
74 | + array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
75 | + array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
76 | + array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
77 | + array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
78 | + array('Status', 'INPUT', array('name' => 'status', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'width: 18% !important;margin-top: 3px;', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
79 | 79 | |
80 | 80 | ); |
81 | 81 | $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
82 | 82 | return $form; |
83 | 83 | } |
84 | 84 | function get_form_fields_email_view_cus() { |
85 | - $readable='disabled'; |
|
86 | - $form['forms'] = array(base_url() . 'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
85 | + $readable = 'disabled'; |
|
86 | + $form['forms'] = array(base_url().'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
87 | 87 | $form['View Email'] = array( |
88 | 88 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
89 | 89 | array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''), |
90 | - array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
91 | - array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
92 | - array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
93 | - array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
90 | + array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
91 | + array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
92 | + array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
93 | + array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
94 | 94 | |
95 | - array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;','class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''), |
|
95 | + array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;', 'class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''), |
|
96 | 96 | |
97 | 97 | ); |
98 | 98 | $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')'); |
99 | 99 | return $form; |
100 | 100 | } |
101 | 101 | function get_form_fields_email_view_cus_edit() { |
102 | - $readable='disabled'; |
|
103 | - $form['forms'] = array(base_url() . 'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
102 | + $readable = 'disabled'; |
|
103 | + $form['forms'] = array(base_url().'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
104 | 104 | $form['Resent Email'] = array( |
105 | 105 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
106 | 106 | array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''), |
107 | - array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
108 | - array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
109 | - array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
110 | - array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
107 | + array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
108 | + array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
109 | + array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
110 | + array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
111 | 111 | ); |
112 | 112 | $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\')'); |
113 | 113 | $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
@@ -117,49 +117,49 @@ discard block |
||
117 | 117 | function build_list_for_email() { |
118 | 118 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
119 | 119 | $grid_field_arr = json_encode(array( |
120 | - array("Date", "100", "date", "", "", "","","true","center"), |
|
121 | - array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"), |
|
122 | - array("From", "145", "from", "", "", "","","true","center"), |
|
123 | - array("To", "140", "to", "", "", "","","true","center"), |
|
124 | - array("Subject", "180", "subject", "", "", "","","true","center"), |
|
125 | - array("Body", "320", "body", "", "", "","","true","center"), |
|
126 | - array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"), |
|
127 | - array("Status", "70", "status", "status", "status", "email_status","","true","center"), |
|
120 | + array("Date", "100", "date", "", "", "", "", "true", "center"), |
|
121 | + array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new", "", "true", "center"), |
|
122 | + array("From", "145", "from", "", "", "", "", "true", "center"), |
|
123 | + array("To", "140", "to", "", "", "", "", "true", "center"), |
|
124 | + array("Subject", "180", "subject", "", "", "", "", "true", "center"), |
|
125 | + array("Body", "320", "body", "", "", "", "", "true", "center"), |
|
126 | + array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons", "", "true", "center"), |
|
127 | + array("Status", "70", "status", "status", "status", "email_status", "", "true", "center"), |
|
128 | 128 | array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit/", "mode" => "popup"), |
129 | - "VIEW" => array("url" => "email/email_view/", "mode" => "popup","layout"=>"medium"), |
|
129 | + "VIEW" => array("url" => "email/email_view/", "mode" => "popup", "layout"=>"medium"), |
|
130 | 130 | "DELETE" => array("url" => "/email/email_delete/", "mode" => "single"))) |
131 | 131 | )); |
132 | 132 | return $grid_field_arr; |
133 | 133 | } |
134 | 134 | |
135 | - function build_list_for_email_customer($accountid,$accounttype) { |
|
135 | + function build_list_for_email_customer($accountid, $accounttype) { |
|
136 | 136 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
137 | 137 | $grid_field_arr = json_encode(array( |
138 | - array("Date", "140", "date", "", "", "","","true","center"), |
|
139 | - array("Subject", "230", "subject", "", "", "","","true","center"), |
|
140 | - array("Body", "350", "body", "", "", "","","true","center"), |
|
141 | - array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"), |
|
142 | - array("Status", "100", "status", "status", "status", "email_status","","true","center"), |
|
138 | + array("Date", "140", "date", "", "", "", "", "true", "center"), |
|
139 | + array("Subject", "230", "subject", "", "", "", "", "true", "center"), |
|
140 | + array("Body", "350", "body", "", "", "", "", "true", "center"), |
|
141 | + array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons", "", "true", "center"), |
|
142 | + array("Status", "100", "status", "status", "status", "email_status", "", "true", "center"), |
|
143 | 143 | array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit_customer/", "mode" => "popup"), |
144 | - "VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup","layout"=>"medium"), |
|
144 | + "VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup", "layout"=>"medium"), |
|
145 | 145 | "DELETE" => array("url" => "email/email_delete_customer/".$accounttype."/".$accountid."/", "mode" => "single"))) |
146 | 146 | )); |
147 | 147 | return $grid_field_arr; |
148 | 148 | } |
149 | 149 | |
150 | - function build_list_for_email_client_area(){ |
|
150 | + function build_list_for_email_client_area() { |
|
151 | 151 | $logintype = $this->CI->session->userdata('logintype'); |
152 | 152 | if ($logintype == 1 || $logintype == 5) { |
153 | 153 | $account_data = $this->CI->session->userdata("accountinfo"); |
154 | 154 | $loginid = $account_data['id']; |
155 | 155 | |
156 | - }else{ |
|
156 | + } else { |
|
157 | 157 | $loginid = "0"; |
158 | 158 | } |
159 | - $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
159 | + $form['forms'] = array(base_url().'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
160 | 160 | $form['Filter'] = array( |
161 | - array('Rate Group', 'pricelist_id', 'SELECT', '',array("name"=>"pricelist_id","rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => $loginid)), |
|
162 | - array('Account Type',array('name' => 'posttoexternal','class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'), |
|
161 | + array('Rate Group', 'pricelist_id', 'SELECT', '', array("name"=>"pricelist_id", "rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => $loginid)), |
|
162 | + array('Account Type', array('name' => 'posttoexternal', 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'), |
|
163 | 163 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'), |
164 | 164 | array('Entity Type', 'type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_entity_type_email_mass'), |
165 | 165 | ); |
@@ -174,26 +174,26 @@ discard block |
||
174 | 174 | return $form; |
175 | 175 | } |
176 | 176 | function get_form_fields_email_view_client($add_arr) { |
177 | - if($add_arr['type'] == ''){ |
|
178 | - $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id']), 'multi'); |
|
179 | - } else{ |
|
180 | - $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id'],'type'=>$add_arr['type']), 'multi'); |
|
177 | + if ($add_arr['type'] == '') { |
|
178 | + $email_add = array('To', 'email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr', array('status'=>$add_arr['status'], 'posttoexternal'=>$add_arr['posttoexternal'], 'pricelist_id'=>$add_arr['pricelist_id']), 'multi'); |
|
179 | + } else { |
|
180 | + $email_add = array('To', 'email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr', array('status'=>$add_arr['status'], 'posttoexternal'=>$add_arr['posttoexternal'], 'pricelist_id'=>$add_arr['pricelist_id'], 'type'=>$add_arr['type']), 'multi'); |
|
181 | 181 | } |
182 | 182 | |
183 | - $form['forms'] = array(base_url() . 'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
183 | + $form['forms'] = array(base_url().'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
|
184 | 184 | $form['Compose Email'] = array( |
185 | 185 | array('', 'HIDDEN', array('name' => 'accountid'), '', '', '', ''), |
186 | 186 | array('', 'HIDDEN', array('name' => 'temp'), '', '', '', ''), |
187 | - array('From', 'INPUT', array('name' => 'from', 'size' => '20','readonly'=>true,'value'=>'', 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''), |
|
187 | + array('From', 'INPUT', array('name' => 'from', 'size' => '20', 'readonly'=>true, 'value'=>'', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
188 | 188 | $email_add, |
189 | 189 | array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''), |
190 | 190 | array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''), |
191 | 191 | ); |
192 | - $form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'/email/email_mass/\')'); |
|
192 | + $form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'/email/email_mass/\')'); |
|
193 | 193 | $form['button_save'] = array('name' => 'action', 'content' => 'Send', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
194 | 194 | return $form; |
195 | 195 | } |
196 | - function build_grid_buttons_email(){ |
|
196 | + function build_grid_buttons_email() { |
|
197 | 197 | $buttons_json = json_encode(array( |
198 | 198 | )); |
199 | 199 | return $buttons_json; |
@@ -205,10 +205,10 @@ discard block |
||
205 | 205 | 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'), |
206 | 206 | array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'), |
207 | 207 | 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", "deleted" => "0")), |
208 | - array('From', 'INPUT', array('name' => 'from[from]', '','id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''), |
|
209 | - array('To', 'INPUT', array('name' => 'to[to]', '','id'=>'to', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'to[to-string]', '', '', '', 'search_string_type', ''), |
|
210 | - array('Subject', 'INPUT', array('name' => 'subject[subject]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''), |
|
211 | - array('Body', 'INPUT', array('name' => 'body[body]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''), |
|
208 | + array('From', 'INPUT', array('name' => 'from[from]', '', 'id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''), |
|
209 | + array('To', 'INPUT', array('name' => 'to[to]', '', 'id'=>'to', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'to[to-string]', '', '', '', 'search_string_type', ''), |
|
210 | + array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''), |
|
211 | + array('Body', 'INPUT', array('name' => 'body[body]', '', 'id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''), |
|
212 | 212 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
213 | 213 | array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
214 | 214 | ); |
@@ -22,8 +22,9 @@ discard block |
||
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 Email_form { |
29 | 30 | function __construct($library_name = '') { |
@@ -153,7 +154,7 @@ discard block |
||
153 | 154 | $account_data = $this->CI->session->userdata("accountinfo"); |
154 | 155 | $loginid = $account_data['id']; |
155 | 156 | |
156 | - }else{ |
|
157 | + } else{ |
|
157 | 158 | $loginid = "0"; |
158 | 159 | } |
159 | 160 | $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form')); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | <div class="col-md-12"> |
17 | 17 | <div class="w-box"> |
18 | 18 | <span style="margin-left:10px; text-align: center;background-color: none;color:#1c8400;"> |
19 | - <? if(isset($error) && !empty($error)) { |
|
19 | + <? if (isset($error) && ! empty($error)) { |
|
20 | 20 | echo $error; |
21 | 21 | }?> |
22 | 22 | </span> |
@@ -29,10 +29,10 @@ |
||
29 | 29 | </div> |
30 | 30 | <?php echo $form; ?> |
31 | 31 | </div> |
32 | - <?php if(isset($maildata) && $maildata != ''){ |
|
32 | + <?php if (isset($maildata) && $maildata != '') { |
|
33 | 33 | echo "<div class='col-md-12 no-padding'>Attachments :</div>"; |
34 | - $imgArr = explode(",",$maildata); |
|
35 | - foreach($imgArr as $key => $imgname){ |
|
34 | + $imgArr = explode(",", $maildata); |
|
35 | + foreach ($imgArr as $key => $imgname) { |
|
36 | 36 | $imgpath = base_url()."email/email_history_list_attachment/".$imgname; |
37 | 37 | echo "<div class='col-md-4 no-padding'> |
38 | 38 | <a href='".$imgpath."'>".$imgname."</a> |