Passed
Pull Request — v3.0 (#167)
by Samir
11:33
created
astpp/application/modules/opensips/libraries/opensips_form.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
24
+if ( ! defined('BASEPATH'))
25 25
 	exit('No direct script access allowed');
26 26
 
27 27
 class Opensips_form {
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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(gettext("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
 block discarded – undo
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(gettext("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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/libraries/system_form.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -21,19 +21,19 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
24
+if ( ! defined('BASEPATH'))
25 25
 	exit('No direct script access allowed');
26 26
 
27 27
 class System_form {
28 28
 
29 29
 	function get_template_form_fields() {
30 30
 
31
-		$form['forms'] = array(base_url() . 'systems/template_save/', array("template_form", "name" => "template_form"));
31
+		$form['forms'] = array(base_url().'systems/template_save/', array("template_form", "name" => "template_form"));
32 32
 		$form['Email Template'] = array(
33 33
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
34
-			array(' Name', 'INPUT', array('name' => 'name', 'size' => '20',  'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
35
-			array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
36
-			array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20',  'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''),
34
+			array(' Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
35
+			array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
36
+			array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''),
37 37
 		);
38 38
 		$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'systems/template/\')');
39 39
 		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		$form['Search'] = array(
47 47
             
48 48
 			array(' Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''),
49
-			array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''),array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
49
+			array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
50 50
 			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
51 51
 		);
52 52
 		$form['button_search'] = array('name' => 'action', 'id' => "template_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
 
57 57
 	function get_configuration_form_fields() {
58 58
 
59
-		$form['forms'] = array(base_url() . 'systems/configuration_save/', array("id" => "config_form", "name" => "config_form"));
59
+		$form['forms'] = array(base_url().'systems/configuration_save/', array("id" => "config_form", "name" => "config_form"));
60 60
 		$form['Edit Settings '] = array(
61 61
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
62
-			array('Name', 'INPUT', array('name' => 'name', 'size' => '20',  'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
62
+			array('Name', 'INPUT', array('name' => 'name', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
63 63
 			array('Value', 'INPUT', array('name' => 'value', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''),
64
-			array('Comment', 'INPUT', array('name' => 'comment', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
64
+			array('Comment', 'INPUT', array('name' => 'comment', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
65 65
 		);
66 66
 
67 67
 		$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			array('Name', 'INPUT', array('name' => 'name[name]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'name[name-string]', '', '', '', 'search_string_type', ''),
78 78
 			array('Value', 'INPUT', array('name' => 'value[value]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'value[value-string]', '', '', '', 'search_string_type', ''),
79 79
 			array('Description', 'INPUT', array('name' => 'comment[comment]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'comment[comment-string]', '', '', '', 'search_string_type', ''),
80
-			array('Group', 'group_title', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'group_title', 'group_title', 'system', 'build_dropdown','where_arr',"group_title NOT IN ('asterisk','osc','freepbx')", 'group_by', 'group_title'),
80
+			array('Group', 'group_title', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'group_title', 'group_title', 'system', 'build_dropdown', 'where_arr', "group_title NOT IN ('asterisk','osc','freepbx')", 'group_by', 'group_title'),
81 81
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
82 82
 			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
83 83
 		);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             array("Value", "190", "value", "", "", ""),
93 93
             array("Description", "320", "comment", "", "", ""),
94 94
             array("Group", "120", "group_title", "", "", ""),
95
-            array(gettext("Action"), "442", "", "", "",array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"),
95
+            array(gettext("Action"), "442", "", "", "", array("EDIT" => array("url" => "systems/configuration_edit/", "mode" => "popup"),
96 96
             ))
97 97
                 ));
98 98
         return $grid_field_arr;
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 
107 107
     function build_template_list_for_admin() {
108
-        $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "","","true","center"),
109
-            array("Subject", "650", "subject", "", "", "","","true","center"),
110
-            array(gettext("Action"), "200", "", "", "",array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"),
108
+        $grid_field_arr = json_encode(array(array("Name", "425", "name", "", "", "", "", "true", "center"),
109
+            array("Subject", "650", "subject", "", "", "", "", "true", "center"),
110
+            array(gettext("Action"), "200", "", "", "", array("EDIT" => array("url" => "systems/template_edit/", "mode" => "single"),
111 111
             ))
112 112
                 ));
113 113
         return $grid_field_arr;
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
     function build_country_list_for_admin() {     
117 117
             $action = 'systems/country_list_edit/';
118 118
             $action_remove = 'systems/country_remove/';
119
-            $mode="popup";
119
+            $mode = "popup";
120 120
         $grid_field_arr = json_encode(array(
121
-	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"),
122
-            array("Name", "705", "country", "", "", "","","true","center"),
121
+	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "", "", "false", "center"),
122
+            array("Name", "705", "country", "", "", "", "", "true", "center"),
123 123
                array(gettext("Action"), "100", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"),
124 124
                     "DELETE" => array("url" => "$action_remove", "mode" => "single")
125 125
                 ))
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
 
130 130
     
131 131
 	 function build_admin_grid_buttons() {
132
-		$buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/country_add/", "popup"),
133
-			array("Delete",  "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/country_delete_multiple"),
132
+		$buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/country_add/", "popup"),
133
+			array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/country_delete_multiple"),
134 134
 		   ));
135 135
 		return $buttons_json;
136 136
 	}
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
 	 function get_country_form_fields() {
155 155
      
156 156
         
157
-		$form['forms'] = array(base_url() . 'systems/country_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form'));
157
+		$form['forms'] = array(base_url().'systems/country_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form'));
158 158
 		$form['Country List'] = array(
159 159
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
160
-			array('Name', 'INPUT', array('name' => 'country', 'size' => '20',  'class' => "text field medium"), 'trim|required|char|min_length[2]|max_length[20]|xss_clean', 'tOOL TIP', 'Please Enter country'),
160
+			array('Name', 'INPUT', array('name' => 'country', 'size' => '20', 'class' => "text field medium"), 'trim|required|char|min_length[2]|max_length[20]|xss_clean', 'tOOL TIP', 'Please Enter country'),
161 161
 
162 162
 		);
163 163
 		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
@@ -168,13 +168,13 @@  discard block
 block discarded – undo
168 168
 	  function build_currency_list_for_admin() {        
169 169
 			$action = 'systems/currency_list_edit/';
170 170
 			$action_remove = 'systems/currency_remove/';
171
-			$mode="popup";
171
+			$mode = "popup";
172 172
         
173 173
         $grid_field_arr = json_encode(array(
174
-	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "","","false","center"),
175
-            array("Name", "320", "currencyname", "", "", "","","true","center"),
176
-	    array("Code", "290", "currency", "", "", "","","true","center"),
177
-	    array(" Rate", "330", "currencyrate", "", "", "","","true","right"),
174
+	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "70", "", "", "", "", "", "false", "center"),
175
+            array("Name", "320", "currencyname", "", "", "", "", "true", "center"),
176
+	    array("Code", "290", "currency", "", "", "", "", "true", "center"),
177
+	    array(" Rate", "330", "currencyrate", "", "", "", "", "true", "right"),
178 178
                array(gettext("Action"), "265", "", "", "", array("EDIT" => array("url" => "$action", "mode" => "$mode"),
179 179
                     "DELETE" => array("url" => "$action_remove", "mode" => "single")
180 180
                 ))
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 	function get_currency_form_fields() {
203 203
      
204 204
         
205
-		$form['forms'] = array(base_url() . 'systems/currency_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form'));
205
+		$form['forms'] = array(base_url().'systems/currency_save/', array('id' => 'system_form', 'method' => 'POST', 'name' => 'system_form'));
206 206
 		$form['Currency List'] = array(
207 207
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
208
-			array('Name', 'INPUT', array('name' => 'currencyname', 'size' => '20','maxlength' => '40',  'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'),
209
-			array('Code', 'INPUT', array('name' => 'currency', 'size' => '20','maxlength' => '3', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'),
210
-			array('Rate', 'INPUT', array('name' => 'currencyrate', 'size' => '20','maxlength' => '7', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter country'),
208
+			array('Name', 'INPUT', array('name' => 'currencyname', 'size' => '20', 'maxlength' => '40', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'),
209
+			array('Code', 'INPUT', array('name' => 'currency', 'size' => '20', 'maxlength' => '3', 'class' => "text field medium"), 'trim|required|char|xss_clean', 'tOOL TIP', 'Please Enter country'),
210
+			array('Rate', 'INPUT', array('name' => 'currencyrate', 'size' => '20', 'maxlength' => '7', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter country'),
211 211
 
212 212
 		);
213 213
 		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
@@ -216,21 +216,21 @@  discard block
 block discarded – undo
216 216
 	}
217 217
 
218 218
 	 function build_admin_currency_grid_buttons() {
219
-		$buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/currency_add/", "popup"),
220
-			array("Update Currencies","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "currencyupdate/update_currency/", 'single'),
221
-			array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/currency_delete_multiple"),
219
+		$buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/currency_add/", "popup"),
220
+			array("Update Currencies", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "currencyupdate/update_currency/", 'single'),
221
+			array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/currency_delete_multiple"),
222 222
 		   ));
223 223
 		return $buttons_json;
224 224
 	}
225 225
  
226 226
   
227
-  function get_backup_database_form_fields($file_name,$id='') {
227
+  function get_backup_database_form_fields($file_name, $id = '') {
228 228
    $val = $id > 0 ? "backup_database.path.$id" : 'backup_database.path';
229
-	  $form['forms'] = array(base_url() . 'systems/database_backup_save/',array('id' => 'backup_form', 'method' => 'POST', 'name' => 'backup_form'));
229
+	  $form['forms'] = array(base_url().'systems/database_backup_save/', array('id' => 'backup_form', 'method' => 'POST', 'name' => 'backup_form'));
230 230
 	  $form['Database Information'] = array(
231 231
 	  array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
232 232
 	  array('Name', 'INPUT', array('name' => 'backup_name', 'size' => '20', 'class' => "text field medium"), 'required', 'tOOL TIP', ''),
233
-	  array('File Name', 'INPUT', array('name' => 'path', 'size' => '20', 'value'=>$file_name,'class' => "text field medium"), 'trim|required|is_unique[' . $val . ']', 'tOOL TIP', ''),
233
+	  array('File Name', 'INPUT', array('name' => 'path', 'size' => '20', 'value'=>$file_name, 'class' => "text field medium"), 'trim|required|is_unique['.$val.']', 'tOOL TIP', ''),
234 234
 	  );
235 235
 	  $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\')');
236 236
 	  $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
   }
239 239
   function build_backupdastabase_list() {
240 240
 		$grid_field_arr = json_encode(array(
241
-			array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"),
242
-			array("Date", "260", "date", "date", "date", "convert_GMT_to","","true","center"),
243
-			array("Name", "295", "backup_name", "", "", "","","true","center"),
244
-			array("File Name", "480", "path", "", "", "","","true","center"),
241
+			array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "", "", "false", "center"),
242
+			array("Date", "260", "date", "date", "date", "convert_GMT_to", "", "true", "center"),
243
+			array("Name", "295", "backup_name", "", "", "", "", "true", "center"),
244
+			array("File Name", "480", "path", "", "", "", "", "true", "center"),
245 245
 			array(gettext("Action"), "185", "", "", "",
246 246
 			array("EDIT_RESTORE" => array("url" => "systems/database_restore_one/", "mode" => ""),
247 247
 			"DOWNLOAD_DATABASE" => array("url" => "systems/database_download/", "mode" => ""),
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 		return $grid_field_arr;
251 251
 	}
252 252
 	function build_backupdastabase_buttons() {
253
-		$buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "systems/database_backup/", "popup"),
254
-		  array("import","btn btn-line-blue" ,"fa fa-upload fa-lg", "button_action", "systems/database_import/", "popup"),	
255
-		array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "systems/database_backup_delete_multiple")
253
+		$buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "systems/database_backup/", "popup"),
254
+		  array("import", "btn btn-line-blue", "fa fa-upload fa-lg", "button_action", "systems/database_import/", "popup"),	
255
+		array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "systems/database_backup_delete_multiple")
256 256
 						));
257 257
 		  return $buttons_json;
258 258
 	}
Please login to merge, or discard this patch.
astpp/application/modules/accounts/libraries/accounts_form.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
24
+if ( ! defined('BASEPATH'))
25 25
 	exit('No direct script access allowed');
26 26
 
27 27
 class Accounts_form {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		$type = $entity_type == 'customer' ? 0 : 3;
37 37
 		$uname = $this->CI->common->find_uniq_rendno_customer(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts');
38 38
 		$pin = Common_model::$global_config['system_config']['pinlength'];
39
-		$pin_number=$this->CI->common->find_uniq_rendno($pin, 'pin', 'accounts');
39
+		$pin_number = $this->CI->common->find_uniq_rendno($pin, 'pin', 'accounts');
40 40
 		$uname_user = $this->CI->common->find_uniq_rendno('10', 'number', 'accounts');
41 41
 		$password = $this->CI->common->generate_password();
42 42
 		$logintype = $this->CI->session->userdata('logintype');
@@ -48,33 +48,33 @@  discard block
 block discarded – undo
48 48
 		}
49 49
 		$sip_device = null;
50 50
 		$opensips_device = null;
51
-		if (!$entity_type) {
51
+		if ( ! $entity_type) {
52 52
 			$entity_type = 'customer';
53 53
 		}
54
-		$params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true);
54
+		$params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true);
55 55
         
56 56
 		if ($id > 0) {
57 57
 			$readable = 'disabled';
58
-			$val = 'accounts.email.' . $id;
59
-			$account_val='accounts.number.'.$id;
58
+			$val = 'accounts.email.'.$id;
59
+			$account_val = 'accounts.number.'.$id;
60 60
 			$password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|', 'tOOL TIP', '');
61 61
 			$balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), '', 'tOOL TIP', '');
62
-			$account=array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '');
62
+			$account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '');
63 63
 			/*             * ******************************** */
64 64
 		} else {
65 65
 			$val = 'accounts.email';
66
-			$account_val='accounts.number';
66
+			$account_val = 'accounts.number';
67 67
 			 if (common_model::$global_config['system_config']['opensips'] == 0) {
68 68
 				$sip_device = array('Create Opensips Device', 'opensips_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate');
69 69
 			} else {
70 70
 			  $sip_device = array('Create SIP Device', 'sip_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate');   
71 71
 		}
72
-			$account = array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');      
72
+			$account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');      
73 73
 			$password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>');
74
-			$balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20','class' => "text field medium"), '', 'tOOL TIP', '');
74
+			$balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', '');
75 75
 		}
76 76
 		$pin = array('Pin', 'INPUT', array('name' => 'pin', 'value' => $pin_number, 'size' => '20', 'class' => "text field medium", 'id' => 'change_pin'), 'required|is_numeric', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Pin" class="change_pin fa fa-refresh" ></i>');
77
-		$form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_save/'.$id."/", array("id" => "customer_form", "name" => "customer_form"));
77
+		$form['forms'] = array(base_url().'accounts/'.$entity_type.'_save/'.$id."/", array("id" => "customer_form", "name" => "customer_form"));
78 78
 		$form[gettext('Account Profile')] = array(
79 79
 		array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
80 80
 		array('', 'HIDDEN', array('name' => 'type', 'value' => $type), '', '', ''),
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
 			$password,
83 83
 			$pin,
84 84
 			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15', 'class' => "text field medium"), 'required', 'tOOL TIP', ''),
85
-			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
85
+			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
86 86
 			array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
87 87
 			array(gettext('Phone'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
88 88
 			array(gettext('Mobile'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
89
-			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50',  'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''),
90
-			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', ''),
89
+			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''),
90
+			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
91 91
 			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
92
-			array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
93
-			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', ''),
94
-			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
92
+			array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
93
+			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
94
+			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
95 95
 			array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''),
96 96
 			array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''),
97 97
 			array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array())
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 			array(gettext('Number Translation'), 'INPUT', array('name' => 'dialed_modify', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
106 106
 			array(gettext('Concurrent Calls'), 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''),
107 107
 			array(gettext('Interval'), 'INPUT', array('name' => 'interval', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''),
108
-			array(gettext('First Used'), 'INPUT', array('name' => 'first_used', 'size' => '20', 'readonly' => true,  'class' => "text field medium", 'value' => '0000-00-00 00:00:00'), '', 'tOOL TIP', ''),
108
+			array(gettext('First Used'), 'INPUT', array('name' => 'first_used', 'size' => '20', 'readonly' => true, 'class' => "text field medium", 'value' => '0000-00-00 00:00:00'), '', 'tOOL TIP', ''),
109 109
 		array(gettext('Account Valid Days'), 'INPUT', array('name' => 'validfordays', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
110
-		array(gettext('Expiry Date'), 'INPUT', array('name' => 'expiry', 'size' => '20',  'class' => "text field medium", 'value' => $expiry_date, 'id' => 'expiry'), '', 'tOOL TIP', ''),
110
+		array(gettext('Expiry Date'), 'INPUT', array('name' => 'expiry', 'size' => '20', 'class' => "text field medium", 'value' => $expiry_date, 'id' => 'expiry'), '', 'tOOL TIP', ''),
111 111
 		);
112 112
 		
113 113
 		$form[gettext('Billing Settings')] = array(
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
 			array(gettext('LC Charge / Min'), 'INPUT', array('name' => 'charge_per_min', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),           
122 122
 			array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, "reseller_id" => $loginid), 'multi'),
123 123
 		);
124
-	if($id==0){
124
+	if ($id == 0) {
125 125
 	  $form[gettext('Alert Threshold')] = array(
126 126
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
127 127
 			array(gettext('Email Alerts ?'), 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'),
128
-			array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20',  'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''),
129
-			array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50',  'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''),
128
+			array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''),
129
+			array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''),
130 130
 	  );
131 131
 	}
132 132
 		$form['button_save'] = array('name' => 'action', 'content' => gettext('Save'), 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
 	}
139 139
 
140 140
 	function customer_alert_threshold($entity_type) {
141
-		$form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_alert_threshold_save/' . $entity_type . "/", array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold"));
141
+		$form['forms'] = array(base_url().'accounts/'.$entity_type.'_alert_threshold_save/'.$entity_type."/", array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold"));
142 142
 		$form[gettext('Alert Threshold')] = array(
143 143
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
144 144
 			array(gettext('Email Alerts ?'), 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'),
145
-			array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20',  'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''),
146
-			array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50',  'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''),
145
+			array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''),
146
+			array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''),
147 147
 		);
148 148
 		$form['button_save'] = array('name' => 'action', 'content' => gettext('Save'), 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
149 149
 		return $form;
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 				$sip_device = array(gettext('Create SIP Device'), 'sip_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status');
165 165
 			}
166 166
 		}
167
-		$form['forms'] = array(base_url() . 'accounts/customer_bulk_save/', array("id" => "customer_bulk_form", "name" => "customer_bulk_form"));
167
+		$form['forms'] = array(base_url().'accounts/customer_bulk_save/', array("id" => "customer_bulk_form", "name" => "customer_bulk_form"));
168 168
 		$form[gettext('General Details')] = array(
169
-			array(gettext('Account Count'), 'INPUT', array('name' => 'count', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
170
-			array(gettext('Start Prefix'), 'INPUT', array('name' => 'prefix', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
171
-			array(gettext('Acc. Number Length'), 'INPUT', array('name' => 'account_length', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
172
-			array(gettext('Company'), 'INPUT', array('name' => 'company_name',  'size' => '15', 'class' => 'text field medium'), 'trim|required|xss_clean', 'tOOL TIP', ''),
169
+			array(gettext('Account Count'), 'INPUT', array('name' => 'count', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
170
+			array(gettext('Start Prefix'), 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
171
+			array(gettext('Acc. Number Length'), 'INPUT', array('name' => 'account_length', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
172
+			array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|required|xss_clean', 'tOOL TIP', ''),
173 173
 			array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''),
174 174
 			array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''),
175 175
 			array(gettext('Generate Pin'), 'pin', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_pin_allow_customer'),
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			array(gettext('Billing Schedule'), array('name' => 'sweep_id', 'id' => 'sweep_id', 'class' => 'sweep_id'), 'SELECT', '', '', 'tOOL TIP', '', 'id', 'sweep', 'sweeplist', 'build_dropdown', '', ''),
185 185
 			array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'),
186 186
 			array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()),
187
-			array(gettext('Balance'), 'INPUT', array('name' => 'balance', 'size' => '20',  'class' => "text field medium"), 'trim|numeric|greater_than[0]|currency_decimal|xss_clean', 'tOOL TIP', ''),
187
+			array(gettext('Balance'), 'INPUT', array('name' => 'balance', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|greater_than[0]|currency_decimal|xss_clean', 'tOOL TIP', ''),
188 188
 			array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), 'trim|currency_decimal|xss_clean', 'tOOL TIP', ''),
189 189
 			array(gettext('Valid Days'), 'INPUT', array('name' => 'validfordays', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
190 190
 		array(gettext('Allow Local Calls'), 'local_call', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status'),
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	}
197 197
 
198 198
 	function get_customer_callerid_fields() {
199
-		$form['forms'] = array(base_url() . 'accounts/customer_add_callerid/', array("id" => "callerid_form"));
199
+		$form['forms'] = array(base_url().'accounts/customer_add_callerid/', array("id" => "callerid_form"));
200 200
 		$form[gettext('Information')] = array(
201 201
 			array('', 'HIDDEN', array('name' => 'flag'), '', '', '', ''),
202 202
 			array(gettext('Account'), 'INPUT', array('name' => 'accountid', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	}
211 211
 
212 212
 	function get_customer_payment_fields($currency, $number, $currency_id, $id) {
213
-		$form['forms'] = array(base_url() . 'accounts/customer_payment_save/', array('id' => 'acccount_charges_form', 'method' => 'POST', 'name' => 'acccount_charges_form'));
213
+		$form['forms'] = array(base_url().'accounts/customer_payment_save/', array('id' => 'acccount_charges_form', 'method' => 'POST', 'name' => 'acccount_charges_form'));
214 214
 		$form['​Refill information'] = array(
215 215
 			array('', 'HIDDEN', array('name' => 'id', 'value' => $id), '', '', '', ''),
216 216
 			array('', 'HIDDEN', array('name' => 'account_currency', 'value' => $currency_id), '', '', ''),
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
 	function get_form_reseller_fields($id = false) {
228 228
 		$readable = false;
229 229
 		$invoice_config = null;
230
-		$concurrent_calls=null;
230
+		$concurrent_calls = null;
231 231
 		$logintype = $this->CI->session->userdata('logintype');
232 232
 		$uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts');
233 233
 		$password = $this->CI->common->generate_password();
234
-		$params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true);
234
+		$params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true);
235 235
 		if ($logintype == 1 || $logintype == 5) {
236 236
 			$account_data = $this->CI->session->userdata("accountinfo");
237 237
 			$loginid = $account_data['id'];
@@ -239,18 +239,18 @@  discard block
 block discarded – undo
239 239
 			$loginid = "0";
240 240
 		}
241 241
 		if ($id > 0) {
242
-			$val = 'accounts.email.' . $id;
243
-			$account_val='accounts.number.'.$id;
242
+			$val = 'accounts.email.'.$id;
243
+			$account_val = 'accounts.number.'.$id;
244 244
 			$readable = 'disabled';
245
-			$password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20',  'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', '');
246
-			$concurrent_calls=array('Concurrent Calls', 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', '');
247
-			$account=array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '');
245
+			$password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', '');
246
+			$concurrent_calls = array('Concurrent Calls', 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', '');
247
+			$account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '');
248 248
 		} else {
249 249
 			$val = 'accounts.email';
250
-			$account_val='accounts.number';
250
+			$account_val = 'accounts.number';
251 251
 			$invoice_config = array('Use same credential for Invoice Config', 'invoice_config_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate');
252 252
 			$password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>');
253
-			$account = array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');
253
+			$account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');
254 254
 		}
255 255
 		if ($id == "") {
256 256
 			$reg_url = array('', 'HIDDEN', array('name' => 'id'), '', '', '', '');
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			$reg_url = array('Registration URL', 'INPUT', array('name' => 'registration_url', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'tOOL TIP', '');
259 259
 		}
260 260
 		/*         * ****************************************************************** */
261
-		$form['forms'] = array(base_url() . 'accounts/reseller_save/', array("id" => "reseller_form", "name" => "reseller_form"));
261
+		$form['forms'] = array(base_url().'accounts/reseller_save/', array("id" => "reseller_form", "name" => "reseller_form"));
262 262
 		$form['Client Panel Access'] = array(
263 263
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
264 264
 			array('', 'HIDDEN', array('name' => 'type', 'value' => '1'), '', '', ''),
@@ -275,12 +275,12 @@  discard block
 block discarded – undo
275 275
 			array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'),
276 276
 			array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()),
277 277
 			array(gettext('Account Type'), array('name' => 'posttoexternal', 'disabled' => $readable, 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
278
-			array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
278
+			array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
279 279
 			array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'),
280 280
 		);
281 281
 
282 282
 }
283
-else{
283
+else {
284 284
 			$form[gettext('Billing Information')] = array(
285 285
 			array(gettext('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" => "0")),
286 286
             
@@ -288,31 +288,31 @@  discard block
 block discarded – undo
288 288
 			array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'),
289 289
 			array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()),
290 290
 			array(gettext('Account Type'), array('name' => 'posttoexternal', 'disabled' => $readable, 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
291
-			array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
291
+			array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
292 292
 			array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'),
293 293
 			$invoice_config,
294 294
 		);
295 295
 	}
296 296
 		$form[gettext('Reseller Profile')] = array(
297
-			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '50',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
298
-			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
299
-			array(gettext('Company'), 'INPUT', array('name' => 'company_name',  'size' => '50', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
297
+			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '50', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
298
+			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
299
+			array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '50', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
300 300
 			array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
301 301
 			array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
302
-			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''),
302
+			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''),
303 303
 			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
304
-			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', ''),
304
+			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
305 305
 			array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
306 306
 			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''),
307
-			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
307
+			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
308 308
 			array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''),
309 309
 			array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''),
310 310
 			array(gettext('Account Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
311 311
 		);
312
-		if($id==0){
312
+		if ($id == 0) {
313 313
 	  $form[gettext('Alert Threshold')] = array(
314 314
 	  array('Email Alert?', 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'),
315
-		  array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
315
+		  array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
316 316
 		  array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''),
317 317
 	  );
318 318
 	}
@@ -323,24 +323,24 @@  discard block
 block discarded – undo
323 323
 
324 324
 	function get_form_admin_fields($entity_type = '', $id = false) {
325 325
 	  $uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts');
326
-	  $params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true);
326
+	  $params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true);
327 327
 		if ($id > 0) {
328
-			$val = 'accounts.email.' . $id;
329
-			$account_val='accounts.number.'.$id;
330
-			$password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20',  'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', '');
331
-			$account=array('Account', 'INPUT',$params, 'required|is_unique[' . $account_val . ']', 'tOOL TIP', '');
328
+			$val = 'accounts.email.'.$id;
329
+			$account_val = 'accounts.number.'.$id;
330
+			$password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', '');
331
+			$account = array('Account', 'INPUT', $params, 'required|is_unique['.$account_val.']', 'tOOL TIP', '');
332 332
 		} else {
333 333
 			$val = 'accounts.email';
334
-			$account_val='accounts.number';
334
+			$account_val = 'accounts.number';
335 335
 			$password = $this->CI->common->generate_password();
336
-			$password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20','class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>');
337
-			$account = array('Account', 'INPUT',$params, 'required|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');
336
+			$password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>');
337
+			$account = array('Account', 'INPUT', $params, 'required|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>');
338 338
 			/*             * ****************** */
339 339
 		}
340 340
 
341 341
         
342 342
 		$type = $entity_type == 'admin' ? 2 : 4;
343
-		$form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_save/', array("id" => "admin_form", "name" => "admin_form"));
343
+		$form['forms'] = array(base_url().'accounts/'.$entity_type.'_save/', array("id" => "admin_form", "name" => "admin_form"));
344 344
 		$form['Client Panel Access'] = array(
345 345
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
346 346
 			array('', 'HIDDEN', array('name' => 'type', 'value' => $type), '', '', ''),
@@ -348,17 +348,17 @@  discard block
 block discarded – undo
348 348
 			$password,
349 349
 				/*                 * ********************* */
350 350
 		);
351
-		$form[gettext($entity_type . ' Profile')] = array(
351
+		$form[gettext($entity_type.' Profile')] = array(
352 352
 			array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15', 'maxlength' => '40', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
353 353
 			array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter Password'),
354
-			array(gettext('Company'), 'INPUT', array('name' => 'company_name',  'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
355
-			array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
354
+			array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''),
355
+			array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
356 356
 			array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
357
-			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50',  'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''),
358
-			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15','class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
359
-			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
357
+			array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''),
358
+			array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
359
+			array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
360 360
 			array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
361
-			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
361
+			array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
362 362
 			array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter Password'),
363 363
 			array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''),
364 364
 			array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''),
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 		$form['forms'] = array("accounts/customer_batch_update/", array('id' => "reseller_batch_update"));
405 405
 		$form[gettext('Batch Update')] = array(
406 406
 			array(gettext('Rate Group'), array('name' => 'pricelist_id[pricelist_id]', 'id' => 'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0"), array('name' => 'pricelist_id[operator]', 'class' => 'update_drp'), 'update_drp_type'),
407
-			array(gettext('Balance'), 'INPUT', array('name' => 'balance[balance]', 'id' => 'balance', 'value' => '', 'size' => '20',  'class' => "text field "), '', 'Tool tips info', '1', array('name' => 'balance[operator]', 'class' => 'update_drp'), '', '', '', 'update_int_type', ''),
407
+			array(gettext('Balance'), 'INPUT', array('name' => 'balance[balance]', 'id' => 'balance', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name' => 'balance[operator]', 'class' => 'update_drp'), '', '', '', 'update_int_type', ''),
408 408
 			$status,
409 409
 		);
410 410
 		$form['button_search'] = array('name' => 'action', 'id' => "batch_update_btn", 'content' => gettext('Update'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 
420 420
 	function get_search_customer_form() {
421 421
 		$logintype = $this->CI->session->userdata('userlevel_logintype');
422
-		 if($logintype != 1){
422
+		 if ($logintype != 1) {
423 423
 		$form['forms'] = array("", array('id' => "account_search"));
424 424
 		$form[gettext('Search')] = array(
425 425
 			array(gettext('Account'), 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
@@ -525,15 +525,15 @@  discard block
 block discarded – undo
525 525
     function build_account_list_for_admin() {
526 526
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
527 527
         $grid_field_arr = json_encode(array(
528
-            array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
529
-            array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"),
530
-            array(gettext("First Name"), "150", "first_name", "", "", "","","true","center"),
531
-            array(gettext("Last Name"), "150", "last_name", "", "", "","","true","center"),
532
-            array(gettext("Company"), "150", "company_name", "", "", "","","true","center"),
533
-            array(gettext("Email"), "170", "email", "", "", "","","true","center"),
534
-            array(gettext("Phone"), "150", "telephone_1", "", "", "","","true","center"),
535
-            array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name","","true","center"),
536
-            array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"),
528
+            array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
529
+            array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE", "true", "left"),
530
+            array(gettext("First Name"), "150", "first_name", "", "", "", "", "true", "center"),
531
+            array(gettext("Last Name"), "150", "last_name", "", "", "", "", "true", "center"),
532
+            array(gettext("Company"), "150", "company_name", "", "", "", "", "true", "center"),
533
+            array(gettext("Email"), "170", "email", "", "", "", "", "true", "center"),
534
+            array(gettext("Phone"), "150", "telephone_1", "", "", "", "", "true", "center"),
535
+            array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name", "", "true", "center"),
536
+            array(gettext("Status"), "110", "status", "status", "accounts", "get_status", "", "true", "center"),
537 537
             /*******************************************************************/
538 538
             array(gettext("Action"), "100", "", "", "", array(
539 539
                     "EDIT" => array("url" => "accounts/admin_edit/", "mode" => "single"),
@@ -545,24 +545,24 @@  discard block
 block discarded – undo
545 545
 
546 546
     function build_account_list_for_customer() {
547 547
       $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
548
-      $currency_id=$account_info['currency_id'];
549
-      $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
548
+      $currency_id = $account_info['currency_id'];
549
+      $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
550 550
       
551 551
 	  // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
552 552
 	  $grid_field_arr = json_encode(array(
553
-		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "","","","","false","center"),
554
-		array(gettext("Account"), "125", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"),
555
-			array(gettext("First Name"), "95", "first_name", "", "", "","","true","center"),
556
-			array(gettext("Last Name"), "95", "last_name", "", "", "","","true","center"),
557
-			array(gettext("Company"), "85", "company_name", "", "", "","","true","center"),
558
-			array(gettext("Rate Group"), "85", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"),
559
-			array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency_account","","true","right"),
560
-			array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency_account","","true","right"),
561
-			array(gettext("First Used"), "80", "first_used", "", "", "","","true","center"),
562
-			array(gettext("Expiry Date"), "80", "expiry", "", "", "","","true","center"),
563
-			array("CC", "45", "maxchannels", "", "", "","","true","center"),
564
-			array(gettext("Status"), "90", "status", "status", "accounts", "get_status","","true","center"),
565
-			array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"),
553
+		array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
554
+		array(gettext("Account"), "125", "number", "number", "accounts", "account_number_icon", "EDITABLE", "true", "left"),
555
+			array(gettext("First Name"), "95", "first_name", "", "", "", "", "true", "center"),
556
+			array(gettext("Last Name"), "95", "last_name", "", "", "", "", "true", "center"),
557
+			array(gettext("Company"), "85", "company_name", "", "", "", "", "true", "center"),
558
+			array(gettext("Rate Group"), "85", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"),
559
+			array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency_account", "", "true", "right"),
560
+			array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency_account", "", "true", "right"),
561
+			array(gettext("First Used"), "80", "first_used", "", "", "", "", "true", "center"),
562
+			array(gettext("Expiry Date"), "80", "expiry", "", "", "", "", "true", "center"),
563
+			array("CC", "45", "maxchannels", "", "", "", "", "true", "center"),
564
+			array(gettext("Status"), "90", "status", "status", "accounts", "get_status", "", "true", "center"),
565
+			array(gettext("Created Date"), "90", "creation", "", "", "", "", "true", "center"),
566 566
 			/************************************************************************/
567 567
 			array(gettext("Action"), "140", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"),
568 568
 					"CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => "popup"),
@@ -574,21 +574,21 @@  discard block
 block discarded – undo
574 574
 
575 575
 	function build_account_list_for_reseller() {
576 576
 	$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
577
-	$currency_id=$account_info['currency_id'];
578
-	$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
577
+	$currency_id = $account_info['currency_id'];
578
+	$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
579 579
 	
580 580
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
581
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
582
-            array(gettext("Account"), "105", "number", "", "", "", "EDITABLE","true","center"),
583
-            array(gettext("First Name"), "120", "first_name", "", "", "","","true","center"),
584
-            array(gettext("Last Name"), "115", "last_name", "", "", "","","true","center"),
585
-            array(gettext("Company"), "130", "company_name", "", "", "","","true","center"),
586
-            array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"),
587
-            array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type","","true","center"),
588
-            array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency","","true","right"),
589
-            array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency","","true","right"),
590
-            array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"),
591
-            array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"),          
581
+        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
582
+            array(gettext("Account"), "105", "number", "", "", "", "EDITABLE", "true", "center"),
583
+            array(gettext("First Name"), "120", "first_name", "", "", "", "", "true", "center"),
584
+            array(gettext("Last Name"), "115", "last_name", "", "", "", "", "true", "center"),
585
+            array(gettext("Company"), "130", "company_name", "", "", "", "", "true", "center"),
586
+            array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"),
587
+            array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type", "", "true", "center"),
588
+            array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency", "", "true", "right"),
589
+            array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency", "", "true", "right"),
590
+            array(gettext("Status"), "110", "status", "status", "accounts", "get_status", "", "true", "center"),
591
+            array(gettext("Created Date"), "90", "creation", "", "", "", "", "true", "center"),          
592 592
             /**************************************************************/
593 593
             array(gettext("Action"), "139", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"),
594 594
                     "CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => 'popup'),
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
              // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
609 609
         $buttons_json = json_encode(array(
610 610
             array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"),
611
-            array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup","medium"),
611
+            array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup", "medium"),
612 612
             $provider,
613 613
             array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/customer_export_cdr_xls/", 'single'),
614 614
             array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/customer_selected_delete/")
@@ -636,23 +636,23 @@  discard block
 block discarded – undo
636 636
 
637 637
     function build_ip_list_for_customer($accountid, $accountype) {
638 638
         $grid_field_arr = json_encode(array(
639
-            array(gettext('Name'), "180", "name", "", "", "","","true","center"),
640
-            array(gettext('IP'), "180", "ip", "", "", "","","true","center"),
641
-            array(gettext('Prefix'), "180", "prefix", "", "", "","","true","center"),
642
-            array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to","","true","center"),
643
-            array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
644
-            array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/" . $accountype . "_ipmap_action/delete/$accountid/$accountype/", "mode" => "single")))
639
+            array(gettext('Name'), "180", "name", "", "", "", "", "true", "center"),
640
+            array(gettext('IP'), "180", "ip", "", "", "", "", "true", "center"),
641
+            array(gettext('Prefix'), "180", "prefix", "", "", "", "", "true", "center"),
642
+            array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to", "", "true", "center"),
643
+            array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
644
+            array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/".$accountype."_ipmap_action/delete/$accountid/$accountype/", "mode" => "single")))
645 645
                 ));
646 646
         return $grid_field_arr;
647 647
     }
648 648
 
649 649
     function build_animap_list_for_customer($accountid, $accounttype) {
650 650
         $grid_field_arr = json_encode(array(
651
-            array(gettext("Caller ID"), "200", "number", "", "", "","","true","center"),
652
-            array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new","","true","center"),
653
-            array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
654
-            array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
655
-            array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/" . $accounttype . "_animap_action/delete/$accountid/", "mode" => "single")))
651
+            array(gettext("Caller ID"), "200", "number", "", "", "", "", "true", "center"),
652
+            array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new", "", "true", "center"),
653
+            array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
654
+            array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
655
+            array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/".$accounttype."_animap_action/delete/$accountid/", "mode" => "single")))
656 656
                 ));
657 657
         return $grid_field_arr;
658 658
     }
@@ -668,13 +668,13 @@  discard block
 block discarded – undo
668 668
 
669 669
     function set_block_pattern_action_buttons($id) {
670 670
         $ret_url = '';
671
-        $ret_url .= '<a href="/did/delete/' . $id . '/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();">&nbsp;</a>';
671
+        $ret_url .= '<a href="/did/delete/'.$id.'/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();">&nbsp;</a>';
672 672
         return $ret_url;
673 673
     }
674 674
 
675 675
     function build_animap_list() {
676 676
         $grid_field_arr = json_encode(array(array("Caller ID", "180", "number", "", "", ""),
677
-            array(gettext("status"),"180","status","status","animap","get_status"),    
677
+            array(gettext("status"), "180", "status", "status", "animap", "get_status"),    
678 678
             array(gettext("Action"), "130", "", "", "",
679 679
                 array(
680 680
                     "EDIT_ANIMAP" => array("url" => "accounts/callingcards_animap_list_edit/", "mode" => "single"),
Please login to merge, or discard this patch.