Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/application/modules/package/models/package_model.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
         }
42 42
         return $query;
43 43
     }
44
-    function get_reseller_package_list($flag,$accountid,$accounttype,$start = 0, $limit = 0){
45
-         $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_packages'); 
44
+    function get_reseller_package_list($flag, $accountid, $accounttype, $start = 0, $limit = 0) {
45
+         $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_packages'); 
46 46
      $instant_search_currency = $this->common_model->add_calculate_currency($instant_search, "", '', true, false);
47
-     $like_str=!empty($instant_search) ? "(package_name like '%$instant_search%'  
48
-                                        OR includedseconds like '%$instant_search%')":null;
49
-     $this->db->where('id',$accountid);
47
+     $like_str = ! empty($instant_search) ? "(package_name like '%$instant_search%'  
48
+                                        OR includedseconds like '%$instant_search%')" : null;
49
+     $this->db->where('id', $accountid);
50 50
      $this->db->select('pricelist_id');
51
-     $account_info=(array)$this->db->get('accounts')->first_row();     
52
-     $where=array('pricelist_id'=>$account_info['pricelist_id']);
53
-      if(!empty($like_str))
51
+     $account_info = (array)$this->db->get('accounts')->first_row();     
52
+     $where = array('pricelist_id'=>$account_info['pricelist_id']);
53
+      if ( ! empty($like_str))
54 54
       $this->db->where($like_str); 
55 55
      if ($flag) {
56 56
        $query = $this->db_model->select("*", "packages", $where, "id", "ASC", $limit, $start);
57
-     }else {
57
+     } else {
58 58
        $query = $this->db_model->countQuery("*", "packages", $where);
59 59
      }
60 60
       return $query;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         /*
69 69
         ASTPP  3.0  Add creation date 
70 70
         */
71
-        $add_array['creation_date']=gmdate('Y-m-d H:i:s');
71
+        $add_array['creation_date'] = gmdate('Y-m-d H:i:s');
72 72
         /*******************************************/
73 73
         $this->db->insert("packages", $add_array);
74 74
         return true;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         /*
80 80
         ASTPP  3.0  add last modified field.
81 81
         */
82
-        $data['last_modified_date']=gmdate('Y-m-d H:i:s');
82
+        $data['last_modified_date'] = gmdate('Y-m-d H:i:s');
83 83
         /********************************************/
84 84
         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
85 85
             $account_data = $this->session->userdata("accountinfo");
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         /* ASTPP  3.0 
95 95
          * Remove Package information from table package_patterns as well.
96 96
         */
97
-        $this->db->where('package_id',$id);
97
+        $this->db->where('package_id', $id);
98 98
         $this->db->delete('package_patterns');
99 99
         /***************************************/
100 100
         $this->db->where("id", $id);
@@ -105,89 +105,89 @@  discard block
 block discarded – undo
105 105
     function getpackage_counter_list($flag, $start = 0, $limit = 0) {
106 106
         $where = array();
107 107
 	$accountinfo = $this->session->userdata('accountinfo');
108
-	$reseller_id=$accountinfo['type']== -1 ? 0 : $accountinfo['id'];
109
-	$this->db->where('reseller_id',$reseller_id);
108
+	$reseller_id = $accountinfo['type'] == -1 ? 0 : $accountinfo['id'];
109
+	$this->db->where('reseller_id', $reseller_id);
110 110
 	$this->db->select('id');
111
-	$result=$this->db->get('accounts');
111
+	$result = $this->db->get('accounts');
112 112
 	$this->db_model->build_search('package_list_search');	
113
-	if($this->session->userdata('advance_search')!= 1){
114
-	  if($result->num_rows() >0){
115
-	  $acc_arr=array();
116
-	  $result=$result->result_array();
117
-	    foreach($result as $data){
118
-	      $acc_arr[]=$data['id'];
113
+	if ($this->session->userdata('advance_search') != 1) {
114
+	  if ($result->num_rows() > 0) {
115
+	  $acc_arr = array();
116
+	  $result = $result->result_array();
117
+	    foreach ($result as $data) {
118
+	      $acc_arr[] = $data['id'];
119 119
 	    }
120
-	    $this->db->where_in('accountid',$acc_arr);
121
-	    if($flag){
120
+	    $this->db->where_in('accountid', $acc_arr);
121
+	    if ($flag) {
122 122
 	      $this->db->select('*');
123 123
 	    }
124
-	    else{
124
+	    else {
125 125
 	      $this->db->select('count(id) as count');
126 126
 	    }
127
-	    if($flag){
127
+	    if ($flag) {
128 128
 	      $this->db->limit($limit, $start);
129 129
 	    }
130
-            if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
131
-                $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
132
-            }else{
133
-                $this->db->order_by('seconds','desc');
130
+            if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') {
131
+                $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']);
132
+            } else {
133
+                $this->db->order_by('seconds', 'desc');
134 134
             }
135
-	    $result=$this->db->get('counters');
135
+	    $result = $this->db->get('counters');
136 136
 // 	    echo $this->db->last_query();exit;    
137
-	    if($flag){
137
+	    if ($flag) {
138 138
 	      return $result;
139
-	    }else{
140
-	      $result=$result->result_array();
139
+	    } else {
140
+	      $result = $result->result_array();
141 141
 	      return $result[0]['count'];
142 142
 	    }
143
-	  }else{
144
-            if($flag){
145
-                $query=(object)array('num_rows'=>0);
143
+	  } else {
144
+            if ($flag) {
145
+                $query = (object)array('num_rows'=>0);
146 146
             }
147
-            else{
148
-                $query=0;
147
+            else {
148
+                $query = 0;
149 149
             }
150 150
 	  return $query;
151 151
         }
152
-    }else{
152
+    } else {
153 153
           
154
-         if($result->num_rows() >0){
155
-	    $acc_arr=array();
156
-	    $result=$result->result_array();
157
-	    foreach($result as $data){
158
-	      $acc_arr[]=$data['id'];
154
+         if ($result->num_rows() > 0) {
155
+	    $acc_arr = array();
156
+	    $result = $result->result_array();
157
+	    foreach ($result as $data) {
158
+	      $acc_arr[] = $data['id'];
159 159
 	    }
160
-	    $this->db->where_in('accountid',$acc_arr);
160
+	    $this->db->where_in('accountid', $acc_arr);
161 161
 	}
162 162
          
163
-         if($flag){
163
+         if ($flag) {
164 164
 	  $this->db->select('*');
165 165
          }
166
-         else{
166
+         else {
167 167
           $this->db->select('count(id) as count');
168 168
          }
169
-         if($flag){
170
-	  $this->db->order_by('seconds','desc');
169
+         if ($flag) {
170
+	  $this->db->order_by('seconds', 'desc');
171 171
 	  $this->db->limit($limit, $start);
172 172
          }
173
-         $result=$this->db->get('counters');
173
+         $result = $this->db->get('counters');
174 174
 //  	echo $this->db->last_query();exit;              
175
-         if($result->num_rows() > 0){
176
-	      if($flag){
175
+         if ($result->num_rows() > 0) {
176
+	      if ($flag) {
177 177
 	        
178 178
 		return $result;
179
-	      }else{
180
-		$result=$result->result_array();
179
+	      } else {
180
+		$result = $result->result_array();
181 181
 		
182 182
 		return $result[0]['count'];
183 183
 	      }
184
-         }else{
185
-	      if($flag){
184
+         } else {
185
+	      if ($flag) {
186 186
 	          
187
-		  $query=(object)array('num_rows'=>0);
187
+		  $query = (object)array('num_rows'=>0);
188 188
 	      }
189
-	      else{
190
-		  $query=0;
189
+	      else {
190
+		  $query = 0;
191 191
 	      }
192 192
 // 	echo $this->db->last_query();exit;    
193 193
 	return $query;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		//echo "<pre>"; prit_r($data); exit;
200 200
         $this->db->select("pattern,comment");
201 201
         $this->db->where("id IN (".$data.")");
202
-        $result=$this->db->get("routes")->result_array();
202
+        $result = $this->db->get("routes")->result_array();
203 203
        
204 204
         $tmp = array();
205 205
         foreach ($result as $key => $data_value) {
Please login to merge, or discard this patch.
astpp/application/modules/refill_coupon/controllers/refill_coupon.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 class Refill_coupon extends MX_Controller {
26 26
     
27
-    function Refill_coupon(){
27
+    function Refill_coupon() {
28 28
 	      parent::__construct();
29 29
 	      $this->load->helper('template_inheritance');
30 30
 	      $this->load->helper('form');
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 	      $this->load->library("astpp/form");
34 34
 	      $this->load->library("session");
35 35
 	      if ($this->session->userdata('user_login') == FALSE)
36
-		    redirect(base_url() . 'login/login');
36
+		    redirect(base_url().'login/login');
37 37
       }
38
-    function refill_coupon_list(){
39
-	if($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3){
40
-            redirect(base_url() . 'user/user/');
38
+    function refill_coupon_list() {
39
+	if ($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3) {
40
+            redirect(base_url().'user/user/');
41 41
 	}
42 42
 		$data['username'] = $this->session->userdata('user_name');
43 43
         $data['page_title'] = gettext('Refill Coupon');
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $data['form_search'] = $this->form->build_serach_form($this->refill_coupon_form->get_refill_coupon_search_form());
50 50
         $this->load->view('view_refill_coupon_list', $data);
51 51
     }
52
-    function refill_coupon_list_json(){
52
+    function refill_coupon_list_json() {
53 53
 	$json_data = array();
54 54
         $count_all = $this->refill_coupon_model->get_refill_coupon_list(false, "", "");
55 55
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
60 60
         echo json_encode($json_data);
61 61
     }   
62
-    function refill_coupon_list_search(){
62
+    function refill_coupon_list_search() {
63 63
         $ajax_search = $this->input->post('ajax_search', 0);
64 64
         if ($this->input->post('advance_search', TRUE) == 1) {
65 65
             $this->session->set_userdata('advance_search', $this->input->post('advance_search'));
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
             $this->session->set_userdata('refill_coupon_list_search', $action);
73 73
         }
74 74
         if (@$ajax_search != 1) {
75
-            redirect(base_url() . 'refill_coupon/refill_coupon_list/');
75
+            redirect(base_url().'refill_coupon/refill_coupon_list/');
76 76
         }
77 77
     }
78
-    function refill_coupon_clearsearchfilter(){
78
+    function refill_coupon_clearsearchfilter() {
79 79
 	$this->session->set_userdata('advance_search', 0);
80 80
         $this->session->set_userdata('refill_coupon_list_search', "");
81 81
     }
82
-    function refill_coupon_list_view($id){
82
+    function refill_coupon_list_view($id) {
83 83
     $data['username'] = $this->session->userdata('user_name');
84 84
         $data['page_title'] = 'View Refill Coupon';
85 85
         if ($cc = $this->refill_coupon_model->get_refill_coupon_details($id)) {
86
-	    $refill_coupon_details=$cc->result_array();
87
-	    $data['refill_coupon_details']=$refill_coupon_details[0];
88
-            $data['refill_coupon_details']['callingcard']= $this->common->get_field_name('cardnumber', 'callingcards', $refill_coupon_details[0]['callingcard_id']);
89
-            $data['refill_coupon_details']['currency']= $this->common->build_concat_string('currencyname,currency', 'currency', $refill_coupon_details[0]['currency_id']);
86
+	    $refill_coupon_details = $cc->result_array();
87
+	    $data['refill_coupon_details'] = $refill_coupon_details[0];
88
+            $data['refill_coupon_details']['callingcard'] = $this->common->get_field_name('cardnumber', 'callingcards', $refill_coupon_details[0]['callingcard_id']);
89
+            $data['refill_coupon_details']['currency'] = $this->common->build_concat_string('currencyname,currency', 'currency', $refill_coupon_details[0]['currency_id']);
90 90
         } else {
91 91
             echo "This card is not available.";
92 92
             return;
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
     
96 96
     }
97 97
     function refill_coupon_add() {
98
-	if($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3){
99
-            redirect(base_url() . 'user/user/');
98
+	if ($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3) {
99
+            redirect(base_url().'user/user/');
100 100
 	}
101 101
         $data['username'] = $this->session->userdata('user_name');
102 102
         $data['flag'] = 'create';
@@ -105,16 +105,16 @@  discard block
 block discarded – undo
105 105
         $this->load->view('view_refill_coupon_add', $data);
106 106
     }
107 107
     function refill_coupon_save() {
108
-        $account_length=Common_model::$global_config['system_config']['refill_coupon_length'];
108
+        $account_length = Common_model::$global_config['system_config']['refill_coupon_length'];
109 109
         $add_array = $this->input->post();
110
-        $add_array['status']=0;
110
+        $add_array['status'] = 0;
111 111
         $data['form'] = $this->form->build_form($this->refill_coupon_form->get_refill_coupon_form_fields(), $add_array);
112
-	$result=$this->refill_coupon_model->refill_coupon_count($add_array);
113
-        $count=$result[0]['count'];
114
-        $remaining_length =0;
115
-        $remaining_length=$account_length - strlen($add_array['prefix']);
116
-        $currentlength =pow(5,$remaining_length);
117
-        $currentlength=$currentlength-$count;
112
+	$result = $this->refill_coupon_model->refill_coupon_count($add_array);
113
+        $count = $result[0]['count'];
114
+        $remaining_length = 0;
115
+        $remaining_length = $account_length - strlen($add_array['prefix']);
116
+        $currentlength = pow(5, $remaining_length);
117
+        $currentlength = $currentlength - $count;
118 118
         $data['page_title'] = 'Add Refill Coupon';
119 119
         if ($this->form_validation->run() == FALSE) {
120 120
                 $data['validation_errors'] = validation_errors();
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
                 exit;
123 123
         }
124 124
         else {    
125
-    	  if($account_length<=strlen($add_array['prefix'])){
125
+    	  if ($account_length <= strlen($add_array['prefix'])) {
126 126
     	      echo json_encode(array("count_error"=>"You Can Not Create ".$add_array['count']." Accounts with ".$add_array['prefix']." prefix."));
127 127
     	      exit;      
128 128
     	  }
129
-    	  if($currentlength <= 0){
129
+    	  if ($currentlength <= 0) {
130 130
     		echo json_encode(array("count_error"=>"You Can Not Create ".$add_array['count']." Accounts with ".$add_array['prefix']." prefix"));
131 131
     		exit;  
132 132
     	  }
133
-    	  if($currentlength > 0 && $add_array['count'] > $currentlength){
133
+    	  if ($currentlength > 0 && $add_array['count'] > $currentlength) {
134 134
     		echo json_encode(array("count_error"=>"You Can Create Maximum ".$currentlength." accounts with ".$add_array['prefix']." prefix"));
135 135
     		exit;      
136
-    	  }else{
136
+    	  } else {
137 137
     	    $this->refill_coupon_model->add_refill_coupon($add_array);
138 138
     	    echo json_encode(array("SUCCESS"=> "Refill coupon created successfully!"));
139 139
     	    exit;
@@ -143,26 +143,26 @@  discard block
 block discarded – undo
143 143
     function refill_coupon_list_delete($id) {
144 144
         $this->refill_coupon_model->remove_refill_coupon($id);
145 145
         $this->session->set_flashdata('astpp_notification', 'Refill coupon removed successfully!');
146
-        redirect(base_url() . 'refill_coupon/refill_coupon_list/');
146
+        redirect(base_url().'refill_coupon/refill_coupon_list/');
147 147
     }
148
-    function refill_coupon_export(){
148
+    function refill_coupon_export() {
149 149
 	 $account_info = $accountinfo = $this->session->userdata('accountinfo');
150
-		$currency_id=$account_info['currency_id'];
151
-		$currency=$this->common->get_field_name('currency', 'currency', $currency_id);
152
-	$query = $this->refill_coupon_model->get_refill_coupon_list(true,'','',true);
150
+		$currency_id = $account_info['currency_id'];
151
+		$currency = $this->common->get_field_name('currency', 'currency', $currency_id);
152
+	$query = $this->refill_coupon_model->get_refill_coupon_list(true, '', '', true);
153 153
         $cc_array = array();
154 154
         ob_clean();
155
-        $cc_array[] = array('Coupon No.','Description', 'Account','Amount('.$currency.')','Created Date',"Used?",'Used Date');
155
+        $cc_array[] = array('Coupon No.', 'Description', 'Account', 'Amount('.$currency.')', 'Created Date', "Used?", 'Used Date');
156 156
         if ($query->num_rows() > 0) {
157 157
             foreach ($query->result_array() as $row) {
158 158
                 $row['currency'] = $this->common->build_concat_string('currencyname,currency', 'currency', $row['currency_id']);
159 159
                 $row['acc_name'] = $row['account_id'] > 0 ? $this->common->get_field_name('number', 'accounts', $row['account_id']) : "";
160
-                $row['status']=$this->common->get_refill_coupon_status('','',$row['status']);
160
+                $row['status'] = $this->common->get_refill_coupon_status('', '', $row['status']);
161 161
                 $cc_array[] = array(
162 162
                     $row['number'],
163 163
                     $row['description'],
164 164
                     $row['acc_name'],
165
-                    $this->common->convert_to_currency('','',$row['amount']),
165
+                    $this->common->convert_to_currency('', '', $row['amount']),
166 166
                     $row['creation_date'],
167 167
                     $row['status'],
168 168
                     $row['firstused']
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
             }
171 171
         }
172 172
         $this->load->helper('csv');
173
-        array_to_csv($cc_array, 'refill_coupon_' . date("Y-m-d") . '.csv');
173
+        array_to_csv($cc_array, 'refill_coupon_'.date("Y-m-d").'.csv');
174 174
     }
175
-    function refill_coupon_customer_json($accountid){
175
+    function refill_coupon_customer_json($accountid) {
176 176
 	$json_data = array();
177
-        $count_all = $this->refill_coupon_model->get_customer_refill_coupon_list(false, "", "",$accountid);
177
+        $count_all = $this->refill_coupon_model->get_customer_refill_coupon_list(false, "", "", $accountid);
178 178
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
179 179
         $json_data = $paging_data["json_paging"];
180
-        $query = $this->refill_coupon_model->get_customer_refill_coupon_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"],$accountid);
180
+        $query = $this->refill_coupon_model->get_customer_refill_coupon_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"], $accountid);
181 181
         $grid_fields = json_decode($this->refill_coupon_form->build_user_refill_coupon_grid());
182 182
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
183 183
         echo json_encode($json_data);
Please login to merge, or discard this patch.
astpp/application/modules/refill_coupon/libraries/refill_coupon_form.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -20,18 +20,18 @@  discard block
 block discarded – undo
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 Refill_coupon_form {
27 27
     function __construct($library_name = '') {
28 28
         $this->CI = & get_instance();
29 29
     }
30
-    function get_refill_coupon_form_fields(){
31
-        $form['forms'] = array(base_url() . 'refill_coupon/refill_coupon_save/',array("id" => "refill_coupon_form", "name" => "refill_coupon_form"));
30
+    function get_refill_coupon_form_fields() {
31
+        $form['forms'] = array(base_url().'refill_coupon/refill_coupon_save/', array("id" => "refill_coupon_form", "name" => "refill_coupon_form"));
32 32
         $form['Coupon Information'] = array(
33
-	    array('Description', 'INPUT', array('name' => 'description', 'size' => '20',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter account number'),
34
-	    array('Start prefix', 'INPUT', array('name' => 'prefix', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
33
+	    array('Description', 'INPUT', array('name' => 'description', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter account number'),
34
+	    array('Start prefix', 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
35 35
             array('Quantity', 'INPUT', array('name' => 'count', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|is_numeric|greater_than[0]|xss_clean', 'tOOL TIP', 'Please Enter account number'),
36 36
             array('Amount', 'INPUT', array('name' => 'amount', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_numeric|greater_than[0]|xss_clean', 'tOOL TIP', 'Please Enter account number'),
37 37
         );
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     } 
43 43
     function build_grid_buttons_refill_coupon() {
44 44
         $buttons_json = json_encode(array(
45
-	    array(gettext("Create"),"btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/refill_coupon/refill_coupon_add/","popup"),
46
-	    array(gettext("Export"),"btn btn-xing" ," fa fa-download fa-lg", "button_action", "/refill_coupon/refill_coupon_export/", 'single'),
45
+	    array(gettext("Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/refill_coupon/refill_coupon_add/", "popup"),
46
+	    array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/refill_coupon/refill_coupon_export/", 'single'),
47 47
            ));
48 48
         return $buttons_json;
49 49
     }
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
         return $buttons_json;
54 54
     }
55 55
     function get_refill_coupon_search_form() {
56
-       $accountinfo=$this->CI->session->userdata('accountinfo');
57
-       $reseller_id=$accountinfo['type']== 1 ?$accountinfo['id'] :  0 ;
56
+       $accountinfo = $this->CI->session->userdata('accountinfo');
57
+       $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0;
58 58
         $form['forms'] = array("", array('id' => "refill_coupon_list_search"));
59 59
         $form['Search'] = array(
60 60
             array('Coupon Number', 'INPUT', array('name' => 'number[number]', '', 'id' => 'number', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
61
-            array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15','class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''),
62
-           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")),
63
-            array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15',  'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''),
61
+            array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''),
62
+           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")),
63
+            array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''),
64 64
             array('Used?', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_refill_coupon_status', '', ''),
65 65
              
66 66
             array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $form['Search Refill Coupon'] = array(
78 78
             array('Coupon Number', 'INPUT', array('name' => 'number[number]', '', 'id' => 'number', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
79 79
             array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''),
80
-            array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15',  'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''),
80
+            array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''),
81 81
             array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_refill_coupon_status', '', ''),
82 82
             array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
83 83
             array('', 'HIDDEN', 'advance_search', '1', '', '', ''),
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
     function build_refill_coupon_grid() {
90 90
 		
91 91
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
92
-		$currency_id=$account_info['currency_id'];
93
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
92
+		$currency_id = $account_info['currency_id'];
93
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
94 94
 		
95 95
         $grid_field_arr = json_encode(array(
96
-            array(gettext("Coupon Number"), "150", "number", "", "", "","","true","center"),
97
-            array(gettext("Description"), "165", "description", "", "", "","","true","center"),
98
-            array(gettext("Account"), "165", "account_id", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"),
99
-            array("Amount($currency)", "150", "amount", "amount", "amount", "convert_to_currency","","true","right"),
100
-            array(gettext("Created Date"), "200", "creation_date", "", "", "","","true","center"),
101
-            array(gettext("Used?"),"135","status",'status','status','get_refill_coupon_used',"","true","center"),
102
-            array(gettext("Used Date"), "180", "firstused", "firstused", "firstused", "firstused_check","","true","center"),
96
+            array(gettext("Coupon Number"), "150", "number", "", "", "", "", "true", "center"),
97
+            array(gettext("Description"), "165", "description", "", "", "", "", "true", "center"),
98
+            array(gettext("Account"), "165", "account_id", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"),
99
+            array("Amount($currency)", "150", "amount", "amount", "amount", "convert_to_currency", "", "true", "right"),
100
+            array(gettext("Created Date"), "200", "creation_date", "", "", "", "", "true", "center"),
101
+            array(gettext("Used?"), "135", "status", 'status', 'status', 'get_refill_coupon_used', "", "true", "center"),
102
+            array(gettext("Used Date"), "180", "firstused", "firstused", "firstused", "firstused_check", "", "true", "center"),
103 103
             array("Action", "120", "", "", "", array(
104 104
                     "DELETE" => array("url" => "refill_coupon/refill_coupon_list_delete/", "mode" => "single")
105 105
             ))
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
     }
109 109
     function build_user_refill_coupon_grid() {
110 110
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
111
-         $currency_id=$account_info['currency_id'];
112
-         $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
111
+         $currency_id = $account_info['currency_id'];
112
+         $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
113 113
 		 $grid_field_arr = json_encode(array(
114
-            array("Coupon Number", "230", "number", "", "", "","","true","center"),
115
-            array("Description", "210", "description", "", "", "","","true","center"),
116
-            array("Amount($currency)", "190", "amount", "amount", "amount", "convert_to_currency","","true","right"),
117
-            array("Created Date", "250", "creation_date", "", "", "","","true","center"),
118
-            array("Used Date", "250", "firstused", "firstused", "firstused", "firstused_check","","true","center"),
114
+            array("Coupon Number", "230", "number", "", "", "", "", "true", "center"),
115
+            array("Description", "210", "description", "", "", "", "", "true", "center"),
116
+            array("Amount($currency)", "190", "amount", "amount", "amount", "convert_to_currency", "", "true", "right"),
117
+            array("Created Date", "250", "creation_date", "", "", "", "", "true", "center"),
118
+            array("Used Date", "250", "firstused", "firstused", "firstused", "firstused_check", "", "true", "center"),
119 119
                 ));
120 120
         return $grid_field_arr;
121 121
     }
Please login to merge, or discard this patch.
application/modules/refill_coupon/views/view_refill_coupon_details.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
   }
21 21
   </style> 
22 22
 <div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
23
-  <div class="portlet-header ui-widget-header"><?= $page_title;?><span class="ui-icon ui-icon-circle-arrow-s"></span></div>
23
+  <div class="portlet-header ui-widget-header"><?= $page_title; ?><span class="ui-icon ui-icon-circle-arrow-s"></span></div>
24 24
   <div class="portlet-content">
25 25
       <table class="details_table" style="width:700px;">        
26 26
         <tr>      
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
            <th>Expiry Date</th><td><?=$refill_coupon_details['expiry_date']?></td>      
35 35
            <th>Callingcard</th><td><?=$refill_coupon_details['callingcard']?></td>      
36 36
         </tr>      
37
-            <th>Status</th><td><?php if($refill_coupon_details['status'] == 0){ echo "Inactive";} elseif($refill_coupon_details['status'] == 1){ echo "Active"; } elseif($refill_coupon_details['status'] == 2){ echo "Inuse"; }else{ echo "Expired";}?></td>      
37
+            <th>Status</th><td><?php if ($refill_coupon_details['status'] == 0) { echo "Inactive"; } elseif ($refill_coupon_details['status'] == 1) { echo "Active"; } elseif ($refill_coupon_details['status'] == 2) { echo "Inuse"; } else { echo "Expired"; }?></td>      
38 38
         </tr>     
39 39
         </table>
40 40
         
41
-        <?php if(isset($cdrs) && is_array($cdrs)){?>
41
+        <?php if (isset($cdrs) && is_array($cdrs)) {?>
42 42
         <table class="details_table" style="width:700px;">        
43 43
         <tr>      
44 44
           <th>Destination</th>
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
           <th>Length in Seconds</th>
49 49
           <th>Cost(CAD)</th>
50 50
         </tr>
51
-        <?php foreach($cdrs as $cdr){
52
-	    $debit= '';
53
-	    $debit =($cdr['debit']/10000);
54
-	    $debit=$debit+0;
51
+        <?php foreach ($cdrs as $cdr) {
52
+	    $debit = '';
53
+	    $debit = ($cdr['debit'] / 10000);
54
+	    $debit = $debit + 0;
55 55
         ?>
56 56
         <tr>
57 57
           <td><?=$cdr['destination']?></td>
Please login to merge, or discard this patch.
astpp/application/modules/refill_coupon/models/refill_coupon_model.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -27,81 +27,81 @@
 block discarded – undo
27 27
     function refill_coupon_model() {
28 28
         parent::__construct();
29 29
     }
30
-    function get_refill_coupon_list($flag,$start = 0, $limit = 0,$export=false){
30
+    function get_refill_coupon_list($flag, $start = 0, $limit = 0, $export = false) {
31 31
         $this->db_model->build_search('refill_coupon_list_search');
32
-        $accountinfo=$this->session->userdata('accountinfo');
33
-        $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0;
34
-        $where=array('reseller_id'=>$reseller_id);
32
+        $accountinfo = $this->session->userdata('accountinfo');
33
+        $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0;
34
+        $where = array('reseller_id'=>$reseller_id);
35 35
         if ($flag) {
36
-	    if($export)
37
-	      $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'','');
36
+	    if ($export)
37
+	      $query = $this->db_model->select("*", "refill_coupon", $where, "id", "ASC", '', '');
38 38
 	    else
39
-	    $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start);
39
+	    $query = $this->db_model->select("*", "refill_coupon", $where, "id", "ASC", $limit, $start);
40 40
         } else {
41
-            $query = $this->db_model->countQuery("*", "refill_coupon",$where);
41
+            $query = $this->db_model->countQuery("*", "refill_coupon", $where);
42 42
         }
43 43
         return $query;
44 44
     }
45
-    function get_customer_refill_coupon_list($flag,$start = 0, $limit = 0,$accountid){
45
+    function get_customer_refill_coupon_list($flag, $start = 0, $limit = 0, $accountid) {
46 46
         $this->db_model->build_search('refill_coupon_list_search');
47
-        $accountinfo=$this->session->userdata('accountinfo');
48
-        $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : ($accountinfo['type']== 0 ? $accountinfo['reseller_id']: 0 );
49
-        $where=array('reseller_id'=>$reseller_id,"account_id"=>$accountid);
47
+        $accountinfo = $this->session->userdata('accountinfo');
48
+        $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : ($accountinfo['type'] == 0 ? $accountinfo['reseller_id'] : 0);
49
+        $where = array('reseller_id'=>$reseller_id, "account_id"=>$accountid);
50 50
         if ($flag) {
51
-	    $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start);
51
+	    $query = $this->db_model->select("*", "refill_coupon", $where, "id", "ASC", $limit, $start);
52 52
         } else {
53
-            $query = $this->db_model->countQuery("*", "refill_coupon",$where);
53
+            $query = $this->db_model->countQuery("*", "refill_coupon", $where);
54 54
         }
55 55
         return $query;
56 56
     }
57
-    function add_refill_coupon($add_array){
57
+    function add_refill_coupon($add_array) {
58 58
       $count = $add_array['count'];
59 59
         unset($add_array['action']);
60 60
         unset($add_array['count']);
61
-        $prefix=$add_array['prefix'];
61
+        $prefix = $add_array['prefix'];
62 62
         unset($add_array['prefix']);
63
-    	$accountinfo=$this->session->userdata('accountinfo');
64
-    	$reseller_id=$accountinfo['type']==1 ? $accountinfo['id']:0;
65
-    	$insert_arr=array();
66
-    	$account_length=Common_model::$global_config['system_config']['refill_coupon_length'];
67
-    	$length=strlen($prefix);
68
-        if($length !=0){
69
-	  $number_length=$account_length-$length;
63
+    	$accountinfo = $this->session->userdata('accountinfo');
64
+    	$reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0;
65
+    	$insert_arr = array();
66
+    	$account_length = Common_model::$global_config['system_config']['refill_coupon_length'];
67
+    	$length = strlen($prefix);
68
+        if ($length != 0) {
69
+	  $number_length = $account_length - $length;
70 70
 	}
71
-	else{
72
-	  $number_length=$account_length;
71
+	else {
72
+	  $number_length = $account_length;
73 73
 	}
74 74
 	$add_array['amount'] = $this->common_model->add_calculate_currency($add_array['amount'], '', '', false, false);
75
-	$number=$this->common->find_uniq_rendno_accno($number_length, 'number', 'refill_coupon',$prefix,$count);
76
-	$date=gmdate('Y-m-d H:i:s');
75
+	$number = $this->common->find_uniq_rendno_accno($number_length, 'number', 'refill_coupon', $prefix, $count);
76
+	$date = gmdate('Y-m-d H:i:s');
77 77
         for ($i = 0; $i < $count; $i++) {
78 78
             $add_array['number'] = trim($number[$i]);
79
-	    $add_array['currency_id']=$accountinfo['currency_id'];
80
-	    $add_array['reseller_id']=$reseller_id;
81
-	    $add_array['creation_date']=$date;
82
-	    $insert_arr[$i]=$add_array;
79
+	    $add_array['currency_id'] = $accountinfo['currency_id'];
80
+	    $add_array['reseller_id'] = $reseller_id;
81
+	    $add_array['creation_date'] = $date;
82
+	    $insert_arr[$i] = $add_array;
83 83
         }
84
-        $this->db->insert_batch("refill_coupon",$insert_arr);
84
+        $this->db->insert_batch("refill_coupon", $insert_arr);
85 85
         return true;
86 86
     }
87
-    function remove_refill_coupon($id){
87
+    function remove_refill_coupon($id) {
88 88
 		$this->db->where("id", $id);
89 89
         $this->db->delete("refill_coupon");
90 90
         return true;
91 91
     }
92
-    function get_refill_coupon_details($id){
92
+    function get_refill_coupon_details($id) {
93 93
        $this->db->where("id", $id);
94
-       $result=$this->db->get('refill_coupon');
94
+       $result = $this->db->get('refill_coupon');
95 95
        return $result;
96 96
     }
97
-    function refill_coupon_count($add_array){
98
-        $account_length=Common_model::$global_config['system_config']['refill_coupon_length'];
99
-        $this->db->where("length(number)",$account_length);
100
-        $this->db->like('number',$add_array['prefix'],'after');
97
+    function refill_coupon_count($add_array) {
98
+        $account_length = Common_model::$global_config['system_config']['refill_coupon_length'];
99
+        $this->db->where("length(number)", $account_length);
100
+        $this->db->like('number', $add_array['prefix'], 'after');
101 101
         $this->db->select("count(id) as count");
102 102
         $this->db->from('refill_coupon');
103
-        $result=$this->db->get();
104
-        $result=$result->result_array();
103
+        $result = $this->db->get();
104
+        $result = $result->result_array();
105 105
 	return $result;
106 106
     }
107 107
 }
Please login to merge, or discard this patch.
astpp/application/modules/freeswitch/controllers/freeswitch.php 1 patch
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $this->load->model('freeswitch_model');
37 37
 
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 fssipdevices_add($type = "") {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
          $account_data = $this->session->userdata("accountinfo");
45 45
         $data['flag'] = 'create';
46 46
         $data['page_title'] = 'Create SIP Device';
47
-       if($account_data['type'] == '-1'  || $account_data['type'] == '1')
47
+       if ($account_data['type'] == '-1' || $account_data['type'] == '1')
48 48
        {
49 49
             $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($type), '');
50 50
             $this->load->view('view_freeswitch_add_edit', $data);
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
      $data['username'] = $this->session->userdata('user_name');
58 58
      $account_data = $this->session->userdata("accountinfo");
59 59
         $data['page_title'] = 'Create SIP Device';
60
-        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid),"");
61
-        if($account_data['type'] == '-1'  || $account_data['type'] == '1')
60
+        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid), "");
61
+        if ($account_data['type'] == '-1' || $account_data['type'] == '1')
62 62
         {
63 63
             $this->load->view('view_freeswitch_add_edit', $data);
64
-        }else{
64
+        } else {
65 65
             $this->load->view('view_freeswitch_customer_add_edit', $data);
66 66
         }
67 67
     }
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
         $account_data = $this->session->userdata("accountinfo");
72 72
         $where = array('id' => $edit_id);
73 73
         $account = $this->freeswitch_model->get_edited_data($edit_id);
74
-        if($account_data['type'] == '-1')
74
+        if ($account_data['type'] == '-1')
75 75
         {
76 76
 			$data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account);
77 77
 			$this->load->view('view_freeswitch_add_edit', $data);
78
-        }else{
78
+        } else {
79 79
          $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account);
80 80
         $this->load->view('view_freeswitch_customer_add_edit', $data);
81 81
         }
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
         $data['page_title'] = 'Edit SIP device';
88 88
         $where = array('id' => $edit_id);
89 89
         $account = $this->freeswitch_model->get_edited_data($edit_id);
90
-          if($account_data['type'] == '-1' || $account_data['type'] == '1')
90
+          if ($account_data['type'] == '-1' || $account_data['type'] == '1')
91 91
         {
92
-        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account);
92
+        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid, $edit_id), $account);
93 93
         $this->load->view('view_freeswitch_add_edit', $data);
94
-        }else{
94
+        } else {
95 95
         
96
-        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account);
96
+        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid, $edit_id), $account);
97 97
         $this->load->view('view_freeswitch_customer_add_edit', $data);
98 98
         }
99 99
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             $this->session->set_userdata('fsgateway_list_search', $action);
110 110
         }
111 111
         if (@$ajax_search != 1) {
112
-            redirect(base_url() . 'freeswitch/fsgateway/');
112
+            redirect(base_url().'freeswitch/fsgateway/');
113 113
         }
114 114
     }
115 115
     function fssipprofile_search() {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $this->session->set_userdata('fssipprofile_list_search', $action);
124 124
         }
125 125
         if (@$ajax_search != 1) {
126
-            redirect(base_url() . 'freeswitch/fssipprofile/');
126
+            redirect(base_url().'freeswitch/fssipprofile/');
127 127
         }
128 128
     }
129 129
     function fssipdevices_clearsearchfilter() {
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
     }
141 141
     function fssipdevices_save($user_flg = false) {
142 142
         $add_array = $this->input->post();
143
-        if (!$user_flg) {
143
+        if ( ! $user_flg) {
144 144
             $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($add_array['id']), $add_array);
145 145
         } else {
146
-            $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"],$add_array['id']),  $add_array);
146
+            $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"], $add_array['id']), $add_array);
147 147
         }
148 148
         if ($add_array['id'] != '') {
149 149
             $data['page_title'] = 'Freeswitch SIP Devices';
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
     }
172 172
     function customer_fssipdevices_save($user_flg = false) {
173 173
         $add_array = $this->input->post();      
174
-        if (!$user_flg) {
174
+        if ( ! $user_flg) {
175 175
             $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields(), $add_array);
176 176
         } else {
177
-            $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"],$add_array['id']), $add_array);
177
+            $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"], $add_array['id']), $add_array);
178 178
         }
179 179
         if ($add_array['id'] != '') {
180 180
             $data['page_title'] = 'Edit Freeswitch SIP Devices';
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     }
203 203
     function user_fssipdevices_save($user_flg = false) {
204 204
         $add_array = $this->input->post();
205
-        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"],$add_array['id']), $add_array);
205
+        $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array["accountcode"], $add_array['id']), $add_array);
206 206
         if ($add_array['id'] != '') {
207 207
             $data['page_title'] = 'Edit Freeswitch SIP Devices';
208 208
             if ($this->form_validation->run() == FALSE) {
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
                 echo json_encode(array("SUCCESS"=> "SIP Device Updated Successfully!"));
215 215
                 exit;
216 216
             }
217
-        }else{
217
+        } else {
218 218
             $data['page_title'] = 'Create Freeswitch SIP Devices';
219 219
             if ($this->form_validation->run() == FALSE) {
220 220
                 $data['validation_errors'] = validation_errors();
221 221
                 echo $data['validation_errors'];
222 222
                 exit;
223 223
             } else {
224
-		$sip_profile_id=$this->common->get_field_name('id','sip_profiles',array('name'=>'default'));
224
+		$sip_profile_id = $this->common->get_field_name('id', 'sip_profiles', array('name'=>'default'));
225 225
                 $this->freeswitch_model->add_freeswith($add_array);
226 226
                 echo json_encode(array("SUCCESS"=> "SIP Device Added Successfully!"));
227 227
                 exit;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             $this->session->set_userdata('fssipdevices_list_search', $action);
240 240
         }
241 241
         if (@$ajax_search != 1) {
242
-            redirect(base_url() . 'freeswitch/fssipdevices/');
242
+            redirect(base_url().'freeswitch/fssipdevices/');
243 243
         }
244 244
     }
245 245
 
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
         foreach ($query as $key => $value) {
268 268
 	$path_true = base_url().'/assets/images/true.png';
269 269
 	$path_false = base_url().'/assets/images/false.png';
270
-	if($value['voicemail_enabled'] == 'true'){
271
-		$voicemail_enabled ='<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">';
272
-	}else{
273
-		$voicemail_enabled ='<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
270
+	if ($value['voicemail_enabled'] == 'true') {
271
+		$voicemail_enabled = '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">';
272
+	} else {
273
+		$voicemail_enabled = '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
274 274
 	}
275 275
         $json_data['rows'][] = array('cell' => array(
276
-		    '<input type="checkbox" name="chkAll" id=' . $value['id'] . ' class="ace chkRefNos" onclick="clickchkbox(' . $value['id'] . ')" value=' . $value['id'] . '><lable class="lbl"></lable>',
276
+		    '<input type="checkbox" name="chkAll" id='.$value['id'].' class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value='.$value['id'].'><lable class="lbl"></lable>',
277 277
 		    "<a href='/freeswitch/fssipdevices_edit/".$value['id']."' style='cursor:pointer;color:#005298;' rel='facebox_medium' title='username'>".$value['username']."</a>",
278 278
 /**************************/
279 279
                     $value['password'],
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
                     $this->common->get_field_name_coma_new('first_name,last_name,number', 'accounts', array('0' => $value['accountid'])),
282 282
                     $value['effective_caller_id_name'],
283 283
                     $value['effective_caller_id_number'],
284
-                     $voicemail_enabled ,
285
-                     $this->common->get_status('status', 'sip_devices',$value),
286
-                    $this->common->convert_GMT_to('','',$value['creation_date']),
287
-                    $this->common->convert_GMT_to('','',$value['last_modified_date']),                
284
+                     $voicemail_enabled,
285
+                     $this->common->get_status('status', 'sip_devices', $value),
286
+                    $this->common->convert_GMT_to('', '', $value['creation_date']),
287
+                    $this->common->convert_GMT_to('', '', $value['last_modified_date']),                
288 288
                     $this->get_action_buttons_fssipdevices($value['id'])
289 289
                     ));
290 290
         }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $this->db->delete("sip_devices");
305 305
         echo TRUE;
306 306
     }
307
-    function customer_fssipdevices_delete_multiple(){
307
+    function customer_fssipdevices_delete_multiple() {
308 308
         $ids = $this->input->post("selected_ids", true);
309 309
         $where = "id IN ($ids)";
310 310
         $this->db->where($where);
@@ -316,42 +316,42 @@  discard block
 block discarded – undo
316 316
 ASTPP 3.0
317 317
 Customer side show voice mail detials
318 318
 ******/
319
-    function customer_fssipdevices_json($accountid,$entity_type='') {
319
+    function customer_fssipdevices_json($accountid, $entity_type = '') {
320 320
         $json_data = array();
321
-        $count_all = $this->freeswitch_model->get_sipdevices_list(false, $accountid,$entity_type);
321
+        $count_all = $this->freeswitch_model->get_sipdevices_list(false, $accountid, $entity_type);
322 322
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
323 323
         $json_data = $paging_data["json_paging"];
324 324
         $devices_result = array();
325
-        $query = $this->freeswitch_model->get_sipdevices_list(true, $accountid,$entity_type, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
325
+        $query = $this->freeswitch_model->get_sipdevices_list(true, $accountid, $entity_type, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
326 326
         foreach ($query as $key => $value) {
327 327
 	$path_true = base_url().'/assets/images/true.png';
328 328
 	$path_false = base_url().'/assets/images/false.png';
329
-	$voicemail_enabled = $value['voicemail_enabled'] == 'true'? '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">' : '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
329
+	$voicemail_enabled = $value['voicemail_enabled'] == 'true' ? '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">' : '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">';
330 330
         $json_data['rows'][] = array('cell' => array(
331
-		    '<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value=' .$value['id'].'><lable class="lbl"></lable>',
331
+		    '<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value='.$value['id'].'><lable class="lbl"></lable>',
332 332
                     $value['username'],
333 333
                     $value['password'],
334 334
                     $this->common->get_field_name('name', '`sip_profiles', array('id' => $value['sip_profile_id'])),
335 335
                     $value['effective_caller_id_name'],
336 336
                     $value['effective_caller_id_number'],
337 337
                     $voicemail_enabled,
338
-                    $this->common->get_status('status', 'sip_devices',$value),
339
-                    $this->common->convert_GMT_to('','',$value['creation_date']),
340
-                    $this->common->convert_GMT_to('','',$value['last_modified_date']),
341
-                    $this->get_action_fssipdevices_buttons($value['id'], $value['accountid'],$entity_type)
338
+                    $this->common->get_status('status', 'sip_devices', $value),
339
+                    $this->common->convert_GMT_to('', '', $value['creation_date']),
340
+                    $this->common->convert_GMT_to('', '', $value['last_modified_date']),
341
+                    $this->get_action_fssipdevices_buttons($value['id'], $value['accountid'], $entity_type)
342 342
                     ));
343 343
         }//exit;
344 344
         echo json_encode($json_data);
345 345
     }
346 346
 /****************************/
347
-    function get_action_fssipdevices_buttons($id, $accountid,$entity_type='') {
347
+    function get_action_fssipdevices_buttons($id, $accountid, $entity_type = '') {
348 348
         $ret_url = '';
349
-        if ($this->session->userdata("logintype") == '0'||$this->session->userdata("logintype") == '3') {
350
-            $ret_url = '<a href="'. base_url() .'user/user_fssipdevices_action/edit/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
351
-            $ret_url .= '<a href="'. base_url() .'user/user_fssipdevices_action/delete/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
349
+        if ($this->session->userdata("logintype") == '0' || $this->session->userdata("logintype") == '3') {
350
+            $ret_url = '<a href="'.base_url().'user/user_fssipdevices_action/edit/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
351
+            $ret_url .= '<a href="'.base_url().'user/user_fssipdevices_action/delete/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
352 352
         } else {
353
-            $ret_url = '<a href="'. base_url() .'accounts/'.$entity_type.'_fssipdevices_action/edit/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
354
-            $ret_url .= '<a href="'. base_url() .'accounts/'.$entity_type.'_fssipdevices_action/delete/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
353
+            $ret_url = '<a href="'.base_url().'accounts/'.$entity_type.'_fssipdevices_action/edit/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
354
+            $ret_url .= '<a href="'.base_url().'accounts/'.$entity_type.'_fssipdevices_action/delete/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
355 355
         }
356 356
         return $ret_url;
357 357
     }
@@ -359,15 +359,15 @@  discard block
 block discarded – undo
359 359
     function fssipdevices_delete($id) {
360 360
         $this->freeswitch_model->delete_freeswith_devices($id);
361 361
         $this->session->set_flashdata('astpp_notification', 'SIP Device Removed Successfully!');
362
-        redirect(base_url() . 'freeswitch/fssipdevices/');
362
+        redirect(base_url().'freeswitch/fssipdevices/');
363 363
         exit;
364 364
     }
365 365
 
366 366
     function get_action_buttons_fssipdevices($id) {
367 367
 
368 368
         $ret_url = '';
369
-        $ret_url = '<a href="'. base_url() .'freeswitch/fssipdevices_edit/' . $id . '/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
370
-        $ret_url .= '<a href="'. base_url() .'freeswitch/fssipdevices_delete/' . $id . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
369
+        $ret_url = '<a href="'.base_url().'freeswitch/fssipdevices_edit/'.$id.'/" class="btn btn-royelblue btn-sm"  rel="facebox_medium" title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;';
370
+        $ret_url .= '<a href="'.base_url().'freeswitch/fssipdevices_delete/'.$id.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>';
371 371
         return $ret_url;
372 372
     }
373 373
 
@@ -385,10 +385,10 @@  discard block
 block discarded – undo
385 385
         $calls_final = array();
386 386
         $data_header = array();
387 387
         $k = 0;
388
-            $data = explode("\n",$response);
388
+            $data = explode("\n", $response);
389 389
             for ($i = 0; $i < count($data) - 2; $i++) {
390 390
                 if (trim($data[$i]) != '') {
391
-                    if (count($data_header) ==0 || substr($data[$i],0,4) == "uuid") {
391
+                    if (count($data_header) == 0 || substr($data[$i], 0, 4) == "uuid") {
392 392
                         $data_header = explode(",", $data[$i]);
393 393
                     } else {
394 394
                         $data_call = explode(",", $data[$i]);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $this->session->set_userdata('advance_search', 0);
436 436
         $data['grid_fields'] = $this->freeswitch_form->build_fsgateway_list_for_admin();
437 437
         $data["grid_buttons"] = $this->freeswitch_form->build_fdgateway_grid_buttons();
438
-      	$data['form_search']=$this->form->build_serach_form($this->freeswitch_form->get_gateway_search_form());
438
+      	$data['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_gateway_search_form());
439 439
         $this->load->view('view_fsgateway_list', $data);
440 440
     }
441 441
 
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
         if ($query->num_rows > 0) {
453 453
             $query = $query->result_array();
454 454
             foreach ($query as $key => $query_value) {
455
-$gateway_data=array();
456
-$tmp=null;
455
+$gateway_data = array();
456
+$tmp = null;
457 457
                 foreach ($query_value as $gateway_key => $gateway_val) {
458 458
                     if ($gateway_key != "gateway_data") {
459 459
                         $gateway_data[$gateway_key] = $gateway_val;
460 460
                     } else {
461
-                        $tmp = (array) json_decode($gateway_val);
461
+                        $tmp = (array)json_decode($gateway_val);
462 462
                     }
463 463
                 }
464 464
                         $gateway_result[$key] = array_merge($gateway_data, $tmp);
@@ -486,22 +486,22 @@  discard block
 block discarded – undo
486 486
         $gateway_result = array();
487 487
         foreach ($query as $key => $query_value) {
488 488
             foreach ($query_value as $gateway_key => $gatewau_val) {
489
-  	        $gateway_data["status"] = isset($query_value["status"])?$query_value["status"]:"";
489
+  	        $gateway_data["status"] = isset($query_value["status"]) ? $query_value["status"] : "";
490 490
                 if ($gateway_key != "gateway_data") {
491 491
                     $gateway_data[$gateway_key] = $gatewau_val;
492
-                }else if($gateway_key == "status") {
492
+                } else if ($gateway_key == "status") {
493 493
                     $gateway_data[$gateway_key] = $gatewau_val;
494 494
                 } 
495 495
                  /**
496 496
                  ASTPP 3.0 
497 497
                  put one variable with the name of dialplan variable 
498 498
                  **/ 
499
-                else if($gateway_key == "dialplan_variable") {
499
+                else if ($gateway_key == "dialplan_variable") {
500 500
                     $gateway_data[$gateway_key] = $gatewau_val;
501 501
                 } 
502 502
                 /****************************************************/
503 503
                 else {
504
-                    $tmp = (array) json_decode($gatewau_val);
504
+                    $tmp = (array)json_decode($gatewau_val);
505 505
                     $gateway_result = array_merge($gateway_data, $tmp);
506 506
                 }
507 507
             }
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
         ASTPP  3.0 
511 511
         put one variable with the name of dialplan variable 
512 512
         **/
513
-        if(!empty($gateway_data['dialplan_variable']) && $gateway_data['dialplan_variable'] != ''){
514
-         $gateway_result['dialplan_variable']  = $gateway_data['dialplan_variable'];
515
-         }else{
513
+        if ( ! empty($gateway_data['dialplan_variable']) && $gateway_data['dialplan_variable'] != '') {
514
+         $gateway_result['dialplan_variable'] = $gateway_data['dialplan_variable'];
515
+         } else {
516 516
          $gateway_result['dialplan_variable'] = '';
517 517
          }
518 518
          /**********************************************************************************************/
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
         $data['form'] = $this->form->build_form($this->freeswitch_form->get_gateway_form_fields(), $gateway_data);
526 526
         $insert_arr = array();
527 527
         $gateway_arr = array();
528
-        $insert_arr['dialplan_variable'] ="";
528
+        $insert_arr['dialplan_variable'] = "";
529 529
         foreach ($gateway_data as $key => $gateway_value) {
530 530
             if ($gateway_value != "") {
531 531
                 if ($key == "sip_profile_id") {
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
                     $insert_arr['dialplan_variable'] = $gateway_data["dialplan_variable"];
544 544
                 }
545 545
                 /*********************************************************************/
546
-                else if($key == "status") {
546
+                else if ($key == "status") {
547 547
                     $insert_arr[$key] = $gateway_data["status"];
548
-                }  else {
548
+                } else {
549 549
                     if ($key != "id") {
550 550
                         $gateway_arr[$key] = $gateway_value;
551 551
                     }
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
                 echo $data['validation_errors'];
563 563
                 exit;
564 564
             } else {
565
-		if ( preg_match('/\s/',$insert_arr['name']) )
565
+		if (preg_match('/\s/', $insert_arr['name']))
566 566
 		{
567 567
 		  echo json_encode(array("name_error"=> "Gateway name must not have any space."));
568 568
 		  exit;
@@ -571,17 +571,17 @@  discard block
 block discarded – undo
571 571
 		ASTPP  3.0 
572 572
 		gateway last modified date
573 573
 		*/
574
-		$insert_arr['last_modified_date']=gmdate('Y-m-d H:i:s');
574
+		$insert_arr['last_modified_date'] = gmdate('Y-m-d H:i:s');
575 575
 		/*************************************************/
576 576
                 $update = $this->db->update("gateways", $insert_arr, array('id' => $gateway_data['id']));
577 577
                 if ($update) {
578 578
                     $profile_name = $this->common->get_field_name('name', 'sip_profiles', $insert_arr['sip_profile_id']);
579 579
 		    $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $insert_arr['sip_profile_id']);
580 580
                     $cmd = "api sofia profile ".$profile_name." killgw '".$insert_arr['name']."' ";
581
-                    $this->freeswitch_model->reload_freeswitch($cmd,$sip_ip);
581
+                    $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip);
582 582
 
583
-                    $cmd2 = "api sofia profile " . $profile_name . " rescan reloadacl reloadxml";
584
-                    $this->freeswitch_model->reload_freeswitch($cmd2,$sip_ip);
583
+                    $cmd2 = "api sofia profile ".$profile_name." rescan reloadacl reloadxml";
584
+                    $this->freeswitch_model->reload_freeswitch($cmd2, $sip_ip);
585 585
                 }
586 586
                 echo json_encode(array("SUCCESS"=> $insert_arr['name']." Gateway Updated Successfully!"));
587 587
                 exit;
@@ -593,18 +593,18 @@  discard block
 block discarded – undo
593 593
                 echo $data['validation_errors'];
594 594
                 exit;
595 595
             } else {
596
-		if ( preg_match('/\s/',$insert_arr['name']) )
596
+		if (preg_match('/\s/', $insert_arr['name']))
597 597
 		{
598 598
 		  echo json_encode(array("name_error"=> "Gateway name must not have any space."));
599 599
 		  exit;
600 600
 		}
601
-        	$insert_arr['created_date']=gmdate('Y-m-d H:i:s'); 
601
+        	$insert_arr['created_date'] = gmdate('Y-m-d H:i:s'); 
602 602
                 $insert = $this->db->insert("gateways", $insert_arr);
603 603
                 if ($insert) {
604 604
                     $profile_name = $this->common->get_field_name('name', 'sip_profiles', $insert_arr['sip_profile_id']);
605 605
 		    $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $insert_arr['sip_profile_id']);
606
-                    $cmd = "api sofia profile " . $profile_name . " rescan reloadacl reloadxml";
607
-                    $this->freeswitch_model->reload_freeswitch($cmd,$sip_ip);
606
+                    $cmd = "api sofia profile ".$profile_name." rescan reloadacl reloadxml";
607
+                    $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip);
608 608
                 }
609 609
                 echo json_encode(array("SUCCESS"=> $insert_arr['name']." Gateway Added Successfully!"));
610 610
                 exit;
@@ -619,12 +619,12 @@  discard block
 block discarded – undo
619 619
             $profile_name = $this->common->get_field_name('name', 'sip_profiles', $profile_id);
620 620
 	    $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $profile_id);
621 621
             $gateway_name = $this->common->get_field_name('name', 'gateways', $gateway_id);
622
-            $cmd = "api sofia profile " . $profile_name . " killgw " . $gateway_name . " reloadxml";
623
-            $this->freeswitch_model->reload_freeswitch($cmd,$sip_ip);
622
+            $cmd = "api sofia profile ".$profile_name." killgw ".$gateway_name." reloadxml";
623
+            $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip);
624 624
         }
625 625
 
626 626
         $this->session->set_flashdata('astpp_notification', 'Gateway Removed Successfully!');
627
-        redirect(base_url() . 'freeswitch/fsgateway/');
627
+        redirect(base_url().'freeswitch/fsgateway/');
628 628
     }
629 629
 
630 630
     function fsgateway_delete_multiple() {
@@ -641,8 +641,8 @@  discard block
 block discarded – undo
641 641
         $this->session->set_userdata('advance_search', 0);
642 642
         $data['grid_fields'] = $this->freeswitch_form->build_fssipprofile_list_for_admin();
643 643
         $data["grid_buttons"] = $this->freeswitch_form->build_fssipprofile_grid_buttons();
644
-	$data['form_search']=$this->form->build_serach_form($this->freeswitch_form->get_sipprofile_search_form());
645
-	$data['button_name']="Add Setting";
644
+	$data['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_sipprofile_search_form());
645
+	$data['button_name'] = "Add Setting";
646 646
 	//$data['form_search'] = $this->form->build_serach_form($this->trunk_form->get_trunk_search_form());
647 647
         $this->load->view('view_fssipprofile_list', $data);
648 648
     }
@@ -674,14 +674,14 @@  discard block
 block discarded – undo
674 674
         $query = $this->db_model->getSelect("*", "sip_profiles", $where);
675 675
         $query = $query->result_array();
676 676
         $gateway_result = array();
677
-        $i=0;
677
+        $i = 0;
678 678
         foreach ($query as $key => $query_value) {
679 679
             foreach ($query_value as $gateway_key => $gatewau_val) {
680
-	      if($gateway_key != 'id' && $gateway_key != 'name' && $gateway_key != 'sip_ip' && $gateway_key != 'sip_port'){
680
+	      if ($gateway_key != 'id' && $gateway_key != 'name' && $gateway_key != 'sip_ip' && $gateway_key != 'sip_port') {
681 681
                 if ($gateway_key != "profile_data") {
682 682
                     $gateway_data[$gateway_key] = $gatewau_val;
683 683
                 } else {
684
-                    $tmp = (array) json_decode($gatewau_val);
684
+                    $tmp = (array)json_decode($gatewau_val);
685 685
                     $gateway_result = array_merge($gateway_data, $tmp);
686 686
                 }
687 687
 	}
@@ -694,74 +694,74 @@  discard block
 block discarded – undo
694 694
 	  $json_data['rows'][] = array('cell' => array(
695 695
 	      $key,
696 696
 	      $value,
697
-	      array('<a href="/freeswitch/fssipprofile_edit/'.$edited_id.'/edit/' . $key .'/" class="btn btn-royelblue btn-sm"  title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;<a href="/freeswitch/fssipprofile_delete_params/'.$edited_id.'/' . $key .'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>')
697
+	      array('<a href="/freeswitch/fssipprofile_edit/'.$edited_id.'/edit/'.$key.'/" class="btn btn-royelblue btn-sm"  title="Edit">&nbsp;<i class="fa fa-pencil-square-o fa-fw"></i></a>&nbsp;<a href="/freeswitch/fssipprofile_delete_params/'.$edited_id.'/'.$key.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();">&nbsp;<i class="fa fa-trash fa-fw"></i></a>')
698 698
 	      ));
699 699
   }
700 700
         echo json_encode($json_data);
701 701
     }
702
-     function fssipprofile_action($button_name,$id) {
702
+     function fssipprofile_action($button_name, $id) {
703 703
         $where = array('id' => $id);
704 704
         $query = $this->db_model->getSelect("*", "sip_profiles", $where);
705 705
         $query = $query->result_array();
706 706
         $where = array('sip_profile_id' => $id);
707
-        if($button_name == "start")
707
+        if ($button_name == "start")
708 708
         { 
709
-           $cmd = "api sofia profile " . trim($query[0]['name']) ." start"; 
709
+           $cmd = "api sofia profile ".trim($query[0]['name'])." start"; 
710 710
         }
711
-        elseif($button_name == "stop")
711
+        elseif ($button_name == "stop")
712 712
         {
713
-            $cmd= "api sofia profile stop";
713
+            $cmd = "api sofia profile stop";
714 714
         }
715
-        elseif($button_name == "reload")
715
+        elseif ($button_name == "reload")
716 716
         {
717 717
             $cmd = "api reloadxml";
718 718
         }
719
-        elseif($button_name == "rescan")
719
+        elseif ($button_name == "rescan")
720 720
         {
721
-            $cmd = "api sofia profile " . trim($query[0]['name']) . " rescan";
721
+            $cmd = "api sofia profile ".trim($query[0]['name'])." rescan";
722 722
         }
723 723
         
724 724
         $this->freeswitch_model->reload_freeswitch($cmd);
725
-	redirect(base_url() . 'freeswitch/fssipprofile/');   
725
+	redirect(base_url().'freeswitch/fssipprofile/');   
726 726
     }
727
-     function fssipprofile_add($add='') {
727
+     function fssipprofile_add($add = '') {
728 728
      
729 729
         $data['username'] = $this->session->userdata('user_name');
730 730
         $data['flag'] = 'create';
731 731
         $data['page_title'] = 'Create SIP Profile';
732 732
         $sipprofile_data = $this->input->post();
733
-         $sipprofile_data['status']=$sipprofile_data['sipstatus'];
734
-        $data['button_name']="Add Setting";
735
-        if($add == 'add')
733
+         $sipprofile_data['status'] = $sipprofile_data['sipstatus'];
734
+        $data['button_name'] = "Add Setting";
735
+        if ($add == 'add')
736 736
         {
737 737
           
738 738
 	  unset($sipprofile_data['action']);
739 739
 	   unset($sipprofile_data['sipstatus']);
740
-	  $insert_data=$sipprofile_data;
740
+	  $insert_data = $sipprofile_data;
741 741
 	  
742
-	  if($sipprofile_data['name'] == '' || $sipprofile_data['sip_ip'] =='' || $sipprofile_data['sip_port'] =='')
742
+	  if ($sipprofile_data['name'] == '' || $sipprofile_data['sip_ip'] == '' || $sipprofile_data['sip_port'] == '')
743 743
 	  {
744 744
 	      $this->session->set_flashdata('astpp_notification', 'Please enter All profile value!');
745
-	      redirect(base_url() . 'freeswitch/fssipprofile_add/');
745
+	      redirect(base_url().'freeswitch/fssipprofile_add/');
746 746
 	      exit;
747 747
 	  }
748
-	  if(preg_match('/\s/',$sipprofile_data['name']))
748
+	  if (preg_match('/\s/', $sipprofile_data['name']))
749 749
 	  {
750 750
 	    $this->session->set_flashdata('astpp_notification', 'SIP Profile name must not have any space!');
751
- 	    redirect(base_url() . 'freeswitch/fssipprofile_add/');
751
+ 	    redirect(base_url().'freeswitch/fssipprofile_add/');
752 752
  	    exit;
753 753
 	  }
754
-	  if(!preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $sipprofile_data['sip_ip']))
754
+	  if ( ! preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $sipprofile_data['sip_ip']))
755 755
 	  {
756 756
 	    $this->session->set_flashdata('astpp_notification', 'SIP IP must be proper!');
757
- 	    redirect(base_url() . 'freeswitch/fssipprofile_add/');
757
+ 	    redirect(base_url().'freeswitch/fssipprofile_add/');
758 758
  	    exit;
759 759
 	  }
760
-	  $sipprofile_data['id']='';
760
+	  $sipprofile_data['id'] = '';
761 761
 	  $check_authentication = $this->freeswitch_model->profile_authentication($sipprofile_data);
762 762
 	  if ($check_authentication->num_rows == 0) {
763 763
 	      
764
-	      $sipprofile_data['created_date']=gmdate('Y-m-d H:i:s');
764
+	      $sipprofile_data['created_date'] = gmdate('Y-m-d H:i:s');
765 765
 	     /** Version 2.1
766 766
 	      * Purpose : Set default data for new created profile
767 767
 	      **/
@@ -772,40 +772,40 @@  discard block
 block discarded – undo
772 772
 	    }
773 773
 	    else {
774 774
                     $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!');
775
-		    redirect(base_url() . 'freeswitch/fssipprofile_add/');
775
+		    redirect(base_url().'freeswitch/fssipprofile_add/');
776 776
 	    }
777 777
 	    $this->session->set_flashdata('astpp_errormsg', 'SIP Profile Added Successfully!');
778
-	    redirect(base_url() . 'freeswitch/fssipprofile/');
778
+	    redirect(base_url().'freeswitch/fssipprofile/');
779 779
         }
780 780
 	
781
-        if($add == 'edit')
781
+        if ($add == 'edit')
782 782
         {
783 783
 	  $check_authentication = $this->freeswitch_model->profile_authentication($sipprofile_data);
784 784
 	    unset($sipprofile_data['action']);
785 785
 	    unset($sipprofile_data['sipstatus']);
786 786
 	    $insert_arr = $sipprofile_data;
787 787
 	        if ($check_authentication->num_rows == 0) {
788
-		    $insert_arr['last_modified_date']=gmdate("Y-m-d H:i:s");
788
+		    $insert_arr['last_modified_date'] = gmdate("Y-m-d H:i:s");
789 789
                     $update = $this->db->update("sip_profiles", $insert_arr, array('id' => $sipprofile_data['id']));
790 790
                     $this->session->set_flashdata('astpp_errormsg', $sipprofile_data['name']." SIP Profile Updated Successfully!");
791
-                    redirect(base_url() . 'freeswitch/fssipprofile/');   
791
+                    redirect(base_url().'freeswitch/fssipprofile/');   
792 792
                     exit;
793 793
                 } else {
794 794
                     $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!');
795
-		    redirect(base_url() . 'freeswitch/fssipprofile/');
795
+		    redirect(base_url().'freeswitch/fssipprofile/');
796 796
                 }
797
-	  redirect(base_url() . 'freeswitch/fssipprofile/');   
797
+	  redirect(base_url().'freeswitch/fssipprofile/');   
798 798
         }
799 799
         $this->load->view('view_fssipprofile_add', $data);
800 800
     }
801 801
 
802 802
 
803
-    function fssipprofile_edit($edit_id = '',$type='',$name_prams='') {
803
+    function fssipprofile_edit($edit_id = '', $type = '', $name_prams = '') {
804 804
         $data['page_title'] = 'Edit SIP Profile';
805 805
           $sipprofile_data = $this->input->post();
806
-        if(!$edit_id)
806
+        if ( ! $edit_id)
807 807
         {
808
-	  $edit_id=$sipprofile_data['id'];
808
+	  $edit_id = $sipprofile_data['id'];
809 809
         }
810 810
         $where = array('id' => $edit_id);
811 811
         $query = $this->db_model->getSelect("*", "sip_profiles", $where);
@@ -816,45 +816,45 @@  discard block
 block discarded – undo
816 816
                 if ($gateway_key != "profile_data") {
817 817
                     $gateway_data[$gateway_key] = $gatewau_val;
818 818
                 } else {
819
-                    $tmp = (array) json_decode($gatewau_val);
819
+                    $tmp = (array)json_decode($gatewau_val);
820 820
                     $gateway_result = array_merge($gateway_data, $tmp);
821 821
                 }
822 822
             }
823 823
         }
824 824
         $data['grid_fields'] = $this->freeswitch_form->build_fssipprofile_params_list_for_admin();
825 825
         $data['edited_id'] = $edit_id;
826
-        $data['sip_name']=$query[0]['name'];
827
-	$data['status']=$query[0]['status'];
828
-	$data['sip_ip']= $query[0]['sip_ip'];
829
-	$data['sip_port']=$query[0]['sip_port'];
830
-	$data['id']=$query[0]['id'];
831
-        $data['button_name']="Add Setting";
832
-        if($type == 'edit' || isset($sipprofile_data['type']) && $sipprofile_data['type'] == 'save')
826
+        $data['sip_name'] = $query[0]['name'];
827
+	$data['status'] = $query[0]['status'];
828
+	$data['sip_ip'] = $query[0]['sip_ip'];
829
+	$data['sip_port'] = $query[0]['sip_port'];
830
+	$data['id'] = $query[0]['id'];
831
+        $data['button_name'] = "Add Setting";
832
+        if ($type == 'edit' || isset($sipprofile_data['type']) && $sipprofile_data['type'] == 'save')
833 833
         {
834
-	    if($type == 'edit')
834
+	    if ($type == 'edit')
835 835
 	    {
836
-		$data['params_name']=$name_prams;
837
-		$data['params_status']=0;
838
-		if($gateway_result[$name_prams] == "true" || $gateway_result[$name_prams] == "false")
836
+		$data['params_name'] = $name_prams;
837
+		$data['params_status'] = 0;
838
+		if ($gateway_result[$name_prams] == "true" || $gateway_result[$name_prams] == "false")
839 839
 		{
840
-		  $data['params_status']=1;
840
+		  $data['params_status'] = 1;
841 841
 		}
842
-		$data['params_value']=$gateway_result[$name_prams];
843
-		$data['button_name']="Update Setting";
842
+		$data['params_value'] = $gateway_result[$name_prams];
843
+		$data['button_name'] = "Update Setting";
844 844
 	    }
845
-	    if(isset($sipprofile_data['type']) && $sipprofile_data['type'] == 'save'){
845
+	    if (isset($sipprofile_data['type']) && $sipprofile_data['type'] == 'save') {
846 846
 		$sipprofile_data = $this->input->post();
847
-		$tmp[$sipprofile_data['params_name']]=$sipprofile_data['params_value'];
848
-		  $final_data= json_encode($tmp);
847
+		$tmp[$sipprofile_data['params_name']] = $sipprofile_data['params_value'];
848
+		  $final_data = json_encode($tmp);
849 849
 		  $insert_arr["profile_data"] = json_encode($tmp);
850 850
 		  $update = $this->db->update("sip_profiles", $insert_arr, array('id' => $edit_id));
851
-		   if($sipprofile_data['type_settings']=="add_setting"){
852
-		    $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Added Successfully!");
853
-                  }else{
854
-		    $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Updated Successfully!");
851
+		   if ($sipprofile_data['type_settings'] == "add_setting") {
852
+		    $this->session->set_flashdata('astpp_errormsg', $data['sip_name']." SIP Setting Added Successfully!");
853
+                  } else {
854
+		    $this->session->set_flashdata('astpp_errormsg', $data['sip_name']." SIP Setting Updated Successfully!");
855 855
 		    
856 856
                   }
857
-                  redirect(base_url() . 'freeswitch/fssipprofile_edit/'.$sipprofile_data['id']);
857
+                  redirect(base_url().'freeswitch/fssipprofile_edit/'.$sipprofile_data['id']);
858 858
 		  exit;
859 859
 
860 860
 	    }
@@ -875,19 +875,19 @@  discard block
 block discarded – undo
875 875
                 if ($gateway_key != "profile_data") {
876 876
                     $gateway_data[$gateway_key] = $gatewau_val;
877 877
                 } else {
878
-                    $tmp = (array) json_decode($gatewau_val);
878
+                    $tmp = (array)json_decode($gatewau_val);
879 879
                     $gateway_result = array_merge($gateway_data, $tmp);
880 880
                 }
881 881
             }
882 882
         }
883
-        $tmp[$sipprofile_data['params_name']]=$sipprofile_data['params_value'];
884
-	$final_data= json_encode($tmp);
883
+        $tmp[$sipprofile_data['params_name']] = $sipprofile_data['params_value'];
884
+	$final_data = json_encode($tmp);
885 885
 	$insert_arr["profile_data"] = json_encode($tmp);
886 886
 	$update = $this->db->update("sip_profiles", $insert_arr, array('id' => $id));
887 887
 	$this->load->view('view_fssipprofile_edit', $data);
888 888
     }
889 889
     
890
-    function fssipprofile_delete_params($id,$name) {
890
+    function fssipprofile_delete_params($id, $name) {
891 891
 	$where = array('id' => $id);
892 892
         $query = $this->db_model->getSelect("*", "sip_profiles", $where);
893 893
         $query = $query->result_array();
@@ -897,18 +897,18 @@  discard block
 block discarded – undo
897 897
                 if ($gateway_key != "profile_data") {
898 898
                     $gateway_data[$gateway_key] = $gatewau_val;
899 899
                 } else {
900
-                    $tmp = (array) json_decode($gatewau_val);
900
+                    $tmp = (array)json_decode($gatewau_val);
901 901
                     $gateway_result = array_merge($gateway_data, $tmp);
902 902
                 }
903 903
             }
904 904
         }
905
-	if(isset($tmp[$name])){
905
+	if (isset($tmp[$name])) {
906 906
 	  unset($tmp[$name]);
907 907
 	}
908 908
 	$insert_arr["profile_data"] = json_encode($tmp);
909 909
 	$update = $this->db->update("sip_profiles", $insert_arr, array('id' => $id));
910 910
         $this->session->set_flashdata('astpp_notification', $name.' SIP Setting Removed Successfully!');
911
-        redirect(base_url() . 'freeswitch/fssipprofile_edit/'.$id);
911
+        redirect(base_url().'freeswitch/fssipprofile_edit/'.$id);
912 912
     }
913 913
     
914 914
     function fssipprofile_delete($profile_id) {
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
         $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $profile_id);
917 917
 	$delete = $this->db_model->delete("sip_profiles", array("id" => $profile_id));
918 918
         $this->session->set_flashdata('astpp_notification', 'SIP Profile Removed Successfully!');
919
-        redirect(base_url() . 'freeswitch/fssipprofile/');
919
+        redirect(base_url().'freeswitch/fssipprofile/');
920 920
     }
921 921
 
922 922
     function fsserver_list() {
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
     function fsserver_delete($id) {
1004 1004
         $this->freeswitch_model->fsserver_delete($id);
1005 1005
         $this->session->set_flashdata('astpp_notification', 'Freeswitch Server Removed Successfully!');
1006
-        redirect(base_url() . 'freeswitch/fsserver_list/');
1006
+        redirect(base_url().'freeswitch/fsserver_list/');
1007 1007
         exit;
1008 1008
     }
1009 1009
 
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
             $this->session->set_userdata('fsserver_list_search', $action);
1019 1019
         }
1020 1020
         if (@$ajax_search != 1) {
1021
-            redirect(base_url() . 'freeswitch/fsserver_list/');
1021
+            redirect(base_url().'freeswitch/fsserver_list/');
1022 1022
         }
1023 1023
     }
1024 1024
 
@@ -1026,11 +1026,11 @@  discard block
 block discarded – undo
1026 1026
         $this->session->set_userdata('advance_search', 0);
1027 1027
         $this->session->set_userdata('account_search', "");
1028 1028
     }
1029
-    function fssipprofile_edit_validation($id,$name){
1030
-	$sip_profile_data=$this->common->get_field_name('profile_data','sip_profiles',$id);
1031
-	$final_data= json_decode($sip_profile_data,true);
1032
-	foreach($final_data as $key=>$value){
1033
-		if($key == $name){
1029
+    function fssipprofile_edit_validation($id, $name) {
1030
+	$sip_profile_data = $this->common->get_field_name('profile_data', 'sip_profiles', $id);
1031
+	$final_data = json_decode($sip_profile_data, true);
1032
+	foreach ($final_data as $key=>$value) {
1033
+		if ($key == $name) {
1034 1034
 			echo 1;
1035 1035
 			return true;
1036 1036
 		}
Please login to merge, or discard this patch.
astpp/application/modules/freeswitch/libraries/freeswitch_form.php 1 patch
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
25
+if ( ! defined('BASEPATH'))
26 26
     exit('No direct script access allowed');
27 27
 
28 28
 class Freeswitch_form {
@@ -31,26 +31,26 @@  discard block
 block discarded – undo
31 31
         $this->CI = & get_instance();
32 32
     }
33 33
 
34
-    function get_freeswith_form_fields($id=false) {
34
+    function get_freeswith_form_fields($id = false) {
35 35
 	$log_type = $this->CI->session->userdata("logintype");
36
-	if($log_type == 0  || $log_type == 3 || $log_type == 1){
37
-	      $sip_pro=null;
36
+	if ($log_type == 0 || $log_type == 3 || $log_type == 1) {
37
+	      $sip_pro = null;
38 38
 	}
39
-	else{
40
-	      $sip_pro=array('SIP Profile', 'sip_profile_id', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', '');
39
+	else {
40
+	      $sip_pro = array('SIP Profile', 'sip_profile_id', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', '');
41 41
 
42 42
 	}  
43
-	$val=$id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username';   
43
+	$val = $id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username';   
44 44
 	  $uname_user = $this->CI->common->find_uniq_rendno('10', '', '');
45 45
         $password = $this->CI->common->generate_password();
46 46
         /*Edit functionality*/
47
-        $form['forms'] = array(base_url() . 'freeswitch/fssipdevices_save/', array("id" => "sipdevices_form", "name" => "sipdevices_form"));
47
+        $form['forms'] = array(base_url().'freeswitch/fssipdevices_save/', array("id" => "sipdevices_form", "name" => "sipdevices_form"));
48 48
         $form['Device Information'] = array(
49 49
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
50
-             array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user,'id'=>'username1', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number','<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_number  fa fa-refresh"></i>'),
51
-            array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20', 'value'=>$password ,'id'=>'password1','class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password','<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'), 
52
-			array('Account', 'accountcode', 'SELECT', '','trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
53
-            array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
50
+             array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user, 'id'=>'username1', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_number  fa fa-refresh"></i>'),
51
+            array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20', 'value'=>$password, 'id'=>'password1', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'), 
52
+			array('Account', 'accountcode', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"0", "deleted" => "0")),
53
+            array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
54 54
             array('Caller Number', 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
55 55
             array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
56 56
 	   $sip_pro,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             array('Enable', 'voicemail_enabled', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_sip_config_option'),
65 65
             
66 66
 			array('Password', 'INPUT', array('name' => 'voicemail_password', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
67
-			array('Mail To', 'INPUT', array('name' => 'voicemail_mail_to', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
67
+			array('Mail To', 'INPUT', array('name' => 'voicemail_mail_to', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
68 68
             
69 69
             array('Attach File', 'voicemail_attach_file', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status_voicemail'),
70 70
             
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
             
91 91
              array('SIP Profile', 'sip_profile_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', 'where_arr', ''),
92 92
             array('Username', 'INPUT', array('name' => 'username[username]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''),
93
-            array('Gateway', 'gateway_id', 'SELECT', '', '', 'tOOL TIP', 'Please select gateway first', 'id', 'name', 'gateways', 'build_dropdown','where_arr', ''), 
94
-            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
93
+            array('Gateway', 'gateway_id', 'SELECT', '', '', 'tOOL TIP', 'Please select gateway first', 'id', 'name', 'gateways', 'build_dropdown', 'where_arr', ''), 
94
+            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"0", "deleted" => "0")),
95 95
 	 array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),
96
-	array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
96
+	array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
97 97
         $form['button_search'] = array('name' => 'action', 'id' => "freeswith_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
98 98
         $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');
99 99
         return $form;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
       function get_sipdevices_search_form_user() {
103 103
         $form['forms'] = array("", array('id' => "sipdevices_search"));
104 104
         $form['Search'] = array(
105
-            array('Username', 'INPUT', array('name' => 'username[username]', '', 'size' => '20',  'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''),
105
+            array('Username', 'INPUT', array('name' => 'username[username]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''),
106 106
             array('SIP Profile', 'sip_profile_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', 'where_arr', ''),
107 107
 	    array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
108 108
             array('', 'HIDDEN', 'advance_search', '1', '', '', ''),
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $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');
132 132
         return $form;
133 133
     }
134
-    function get_sipprofile_search_form(){
134
+    function get_sipprofile_search_form() {
135 135
     
136 136
        $form['forms'] = array("", array('id' => "freeswitch_search"));
137 137
         $form['Search'] = array(
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
             
155 155
             array('Username', 'INPUT', array('name' => 'username[username]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''),
156 156
             array('SIP Profile', 'sip_profile_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', 'where_arr', ''),
157
-            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"=>"GLOBAL", "deleted" => "0")),
157
+            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"=>"GLOBAL", "deleted" => "0")),
158 158
             array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),  
159 159
             //array('Voicemail', 'vm-enabled', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_voicemail_status'),
160
-            array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
160
+            array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
161 161
         $form['button_search'] = array('name' => 'action', 'id' => "fssipdevice_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
162 162
         $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');
163 163
         return $form;
@@ -168,18 +168,18 @@  discard block
 block discarded – undo
168 168
     */
169 169
     function build_system_list_for_admin() {
170 170
         $grid_field_arr = json_encode(array(
171
-	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "","","false","center"),
172
-            array("User Name", "100", "username", "", "", "","","true","center"),
173
-            array("Password", "100", "password", "", "", "","","true","center"),
174
-            array("SIP Profile", "100", "sip_profile_id", "name", "sip_profiles", "get_field_name","","true","center"),
175
-            array("Account", "150", "accountid", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"),
176
-            array("Caller Name", "100", "effective_caller_id_name", "", "", "","","true","center"),
177
-            array("Caller Number", "100", "effective_caller_id_number", "", "", "","","true","center"),
178
-            array("Voicemail", "100", "voicemail_enabled", "", "", "","","true","center"),	
179
-            array("Status", "100", "status", "status", "sip_devies", "get_status","","true","center"),
180
-            array("Created Date", "130", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
181
-            array("Modified Date", "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
182
-            array("Action", "107", "", "", "", array("EDIT" => array("url" => "/freeswitch/fssipdevices_edit/", "mode" => "single","layout"=>"medium"),
171
+	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "50", "", "", "", "", "", "false", "center"),
172
+            array("User Name", "100", "username", "", "", "", "", "true", "center"),
173
+            array("Password", "100", "password", "", "", "", "", "true", "center"),
174
+            array("SIP Profile", "100", "sip_profile_id", "name", "sip_profiles", "get_field_name", "", "true", "center"),
175
+            array("Account", "150", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"),
176
+            array("Caller Name", "100", "effective_caller_id_name", "", "", "", "", "true", "center"),
177
+            array("Caller Number", "100", "effective_caller_id_number", "", "", "", "", "true", "center"),
178
+            array("Voicemail", "100", "voicemail_enabled", "", "", "", "", "true", "center"),	
179
+            array("Status", "100", "status", "status", "sip_devies", "get_status", "", "true", "center"),
180
+            array("Created Date", "130", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
181
+            array("Modified Date", "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
182
+            array("Action", "107", "", "", "", array("EDIT" => array("url" => "/freeswitch/fssipdevices_edit/", "mode" => "single", "layout"=>"medium"),
183 183
                     "DELETE" => array("url" => "/freeswitch/fssipdevices_delete/", "mode" => "single")))
184 184
                 ));
185 185
         return $grid_field_arr;
@@ -188,52 +188,52 @@  discard block
 block discarded – undo
188 188
 
189 189
 
190 190
     function build_grid_buttons() {
191
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fssipdevices_add/", "popup","medium"),
192
-			array("Delete",  "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/freeswitch/fssipdevices_delete_multiple/")   
191
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fssipdevices_add/", "popup", "medium"),
192
+			array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/freeswitch/fssipdevices_delete_multiple/")   
193 193
                         ));
194 194
         return $buttons_json;
195 195
     }
196 196
     
197 197
     function fsdevices_build_grid_buttons($accountid) {
198
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/freeswitch/customer_fssipdevices_add/$accountid/", "popup","medium"),
199
-	    array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/freeswitch/customer_fssipdevices_delete_multiple/")
198
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/freeswitch/customer_fssipdevices_add/$accountid/", "popup", "medium"),
199
+	    array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/freeswitch/customer_fssipdevices_delete_multiple/")
200 200
             ));
201 201
         return $buttons_json;
202 202
     }
203 203
 
204 204
     function get_gateway_form_fields() {
205 205
 
206
-        $form['forms'] = array(base_url() . 'freeswitch/fsgateway_save/', array("id" => "gateway_form", "name" => "gateway_form"));
206
+        $form['forms'] = array(base_url().'freeswitch/fsgateway_save/', array("id" => "gateway_form", "name" => "gateway_form"));
207 207
         $form['Basic Information'] = array(
208 208
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
209 209
             array('Name', 'INPUT', array('name' => 'name', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Gateway Name'),
210 210
             array('SIP Profile', 'sip_profile_id', 'SELECT', '', '', 'tOOL TIP', '', 'id', 'name', 'sip_profiles', 'build_dropdown', '', ''),
211
-            array('Username', 'INPUT', array('name' => 'username', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter user name'),
212
-           array('Password', 'INPUT', array('name' => 'password', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
213
-            array('Proxy', 'INPUT', array('name' => 'proxy', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
214
-            array('Outbound-<br/>Proxy', 'INPUT', array('name' => 'outbound-proxy', 'size' => '20',  'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
211
+            array('Username', 'INPUT', array('name' => 'username', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter user name'),
212
+           array('Password', 'INPUT', array('name' => 'password', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'),
213
+            array('Proxy', 'INPUT', array('name' => 'proxy', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
214
+            array('Outbound-<br/>Proxy', 'INPUT', array('name' => 'outbound-proxy', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''),
215 215
 			array('Register', array('name' => 'register', 'class' => 'add_settings'), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_option'),
216 216
             array('Caller-id-in-from', array('name' => 'caller-id-in-from', 'class' => 'add_settings'), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_option'),
217 217
                 array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
218 218
             
219 219
         );
220 220
         $form['Optional Information'] = array(
221
-            array('From- Domain', 'INPUT', array('name' => 'from_domain', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
222
-            array('From User', 'INPUT', array('name' => 'from_user', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
223
-            array('Realm', 'INPUT', array('name' => 'realm', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
221
+            array('From- Domain', 'INPUT', array('name' => 'from_domain', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
222
+            array('From User', 'INPUT', array('name' => 'from_user', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
223
+            array('Realm', 'INPUT', array('name' => 'realm', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
224 224
             array('Extension', 'INPUT', array('name' => 'extension', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
225 225
             array('Expire Seconds', 'INPUT', array('name' => 'expire-seconds', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
226
-            array('Reg-<br/>Transport', 'INPUT', array('name' => 'register-transport', 'size' => '20','class' => "text field medium"), '', 'tOOL TIP', ''),
226
+            array('Reg-<br/>Transport', 'INPUT', array('name' => 'register-transport', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
227 227
             array('Contact Params', 'INPUT', array('name' => 'contact-params', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
228 228
             array('Ping', 'INPUT', array('name' => 'ping', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
229
-            array('Retry-<br/>Seconds', 'INPUT', array('name' => 'retry-seconds', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
230
-            array('Register-<br/>Proxy', 'INPUT', array('name' => 'register-proxy', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
229
+            array('Retry-<br/>Seconds', 'INPUT', array('name' => 'retry-seconds', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
230
+            array('Register-<br/>Proxy', 'INPUT', array('name' => 'register-proxy', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
231 231
             array('Channel', 'INPUT', array('name' => 'channel', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
232 232
                /**
233 233
                ASTPP  3.0 
234 234
                               put one variable with the name of dialplan variable 
235 235
               **/ 
236
-              array('Dialplan Variable', 'TEXTAREA', array('name' => 'dialplan_variable', 'size' => '20','cols'=>'10','rows'=>'5', 'class' => "col_md-5 form-control", 'style'=>"width: 200px; height: 100px;font-family: Open sans,sans-serif !important;"), '', 'tOOL TIP', ''),
236
+              array('Dialplan Variable', 'TEXTAREA', array('name' => 'dialplan_variable', 'size' => '20', 'cols'=>'10', 'rows'=>'5', 'class' => "col_md-5 form-control", 'style'=>"width: 200px; height: 100px;font-family: Open sans,sans-serif !important;"), '', 'tOOL TIP', ''),
237 237
              /*********************************************************************************************************/
238 238
         );
239 239
 
@@ -250,26 +250,26 @@  discard block
 block discarded – undo
250 250
     function build_fsgateway_list_for_admin() {
251 251
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
252 252
         $grid_field_arr = json_encode(array(
253
-	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
253
+	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
254 254
 /**
255 255
 ASTPP  3.0 
256 256
 For Gateway Edit on Gateway name
257 257
 **/
258
-            array("Name", "140", "name", "", "", "","EDITABLE","true","center"),
258
+            array("Name", "140", "name", "", "", "", "EDITABLE", "true", "center"),
259 259
 /**********************************/
260
-            array("SIP Profile", "115", "sip_profile_id", "name", "sip_profiles", "get_field_name","","true","center"),
261
-            array("Username", "140", "username", "", "", "","","true","center"),
260
+            array("SIP Profile", "115", "sip_profile_id", "name", "sip_profiles", "get_field_name", "", "true", "center"),
261
+            array("Username", "140", "username", "", "", "", "", "true", "center"),
262 262
 //             array("Password", "181", "password", "", "", ""),
263
-            array("Proxy", "145", "proxy", "", "", "","","true","center"),
264
-            array("Register", "120", "register", "register", "register", "convert_to_ucfirst","","true","center"),
265
-            array("Caller-Id-In-Form", "130", "caller-id-in-from", "caller-id-in-from", "caller-id-in-from", "convert_to_ucfirst","","true","center"),
263
+            array("Proxy", "145", "proxy", "", "", "", "", "true", "center"),
264
+            array("Register", "120", "register", "register", "register", "convert_to_ucfirst", "", "true", "center"),
265
+            array("Caller-Id-In-Form", "130", "caller-id-in-from", "caller-id-in-from", "caller-id-in-from", "convert_to_ucfirst", "", "true", "center"),
266 266
              /*
267 267
             ASTPP  3.0 
268 268
              creation field show in grid
269 269
             */
270
-            array("Status", "110", "status", "status", "gateways", "get_status","","true","center"),
271
-            array("Created Date", "100", "created_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
272
-             array("Modified Date", "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
270
+            array("Status", "110", "status", "status", "gateways", "get_status", "", "true", "center"),
271
+            array("Created Date", "100", "created_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
272
+             array("Modified Date", "130", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
273 273
             /********************************************************************/
274 274
            /*
275 275
             ASTPP  3.0 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             */
279 279
            
280 280
             /******************************************/
281
-            array("Action", "106", "", "", "", array("EDIT" => array("url" => "/freeswitch/fsgateway_edit/", "mode" => "popup","layout"=>"medium"),
281
+            array("Action", "106", "", "", "", array("EDIT" => array("url" => "/freeswitch/fsgateway_edit/", "mode" => "popup", "layout"=>"medium"),
282 282
                     "DELETE" => array("url" => "/freeswitch/fsgateway_delete/", "mode" => "single")))
283 283
                 ));
284 284
         return $grid_field_arr;
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
     /******************************************************/
287 287
 
288 288
     function build_fdgateway_grid_buttons() {
289
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fsgateway_add/", "popup","medium"),
290
-	    array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/freeswitch/fsgateway_delete_multiple/")
289
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fsgateway_add/", "popup", "medium"),
290
+	    array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/freeswitch/fsgateway_delete_multiple/")
291 291
             ));
292 292
         return $buttons_json;
293 293
     }
294 294
 
295 295
     function get_sipprofile_form_fields() {
296
-        $form['forms'] = array(base_url() . 'freeswitch/fssipprofile_save/', array("id" => "fssipprofile_form", "name" => "fssipprofile_form"));
296
+        $form['forms'] = array(base_url().'freeswitch/fssipprofile_save/', array("id" => "fssipprofile_form", "name" => "fssipprofile_form"));
297 297
         $form['Basic Information'] = array(
298 298
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
299
-            array('Profile name', 'INPUT', array('name' => 'name', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Name'),
300
-            array('sip-ip', 'INPUT', array('name' => 'sip_ip', 'size' => '20',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter SIP IP Name'),
301
-            array('sip-port', 'INPUT', array('name' => 'sip_port', 'size' => '20', 'value' => '5060',  'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter SIP Port'),
299
+            array('Profile name', 'INPUT', array('name' => 'name', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Name'),
300
+            array('sip-ip', 'INPUT', array('name' => 'sip_ip', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter SIP IP Name'),
301
+            array('sip-port', 'INPUT', array('name' => 'sip_port', 'size' => '20', 'value' => '5060', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter SIP Port'),
302 302
             array('rtp-ip', 'INPUT', array('name' => 'rtp_ip', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
303
-            array('Dial Plan', 'INPUT', array('name' => 'dialplan', 'size' => '20', 'value' => 'XML',  'class' => "text field medium"), '', 'tOOL TIP', ''),
304
-            array('user-agent-string', 'INPUT', array('name' => 'user-agent-string', 'size' => '20', 'value' => 'ASTPP',  'class' => "text field medium"), '', 'tOOL TIP', ''),
305
-            array('debug', 'INPUT', array('name' => 'debug', 'size' => '20', 'value' => '0',  'class' => "text field medium"), '', 'tOOL TIP', ''),
303
+            array('Dial Plan', 'INPUT', array('name' => 'dialplan', 'size' => '20', 'value' => 'XML', 'class' => "text field medium"), '', 'tOOL TIP', ''),
304
+            array('user-agent-string', 'INPUT', array('name' => 'user-agent-string', 'size' => '20', 'value' => 'ASTPP', 'class' => "text field medium"), '', 'tOOL TIP', ''),
305
+            array('debug', 'INPUT', array('name' => 'debug', 'size' => '20', 'value' => '0', 'class' => "text field medium"), '', 'tOOL TIP', ''),
306 306
             array('sip-trace', 'sip-trace', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_drp_option'),
307 307
             array('tls', 'tls', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
308 308
             array('inbound-reg-force-matching-username', 'inbound-reg-force-matching-username', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_option'),
@@ -320,20 +320,20 @@  discard block
 block discarded – undo
320 320
             array('enable-100rel', 'enable-100rel', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
321 321
             array('rtp-timeout-sec', 'INPUT', array('name' => 'rtp-timeout-sec', 'size' => '20', 'value' => '60', 'class' => "text field medium"), '', 'tOOL TIP', ''),
322 322
             array('dtmf-duration', 'INPUT', array('name' => 'dtmf-duration', 'size' => '20', 'value' => '2000', 'class' => "text field medium"), '', 'tOOL TIP', ''),
323
-            array('manual-redirect','manual-redirect', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
323
+            array('manual-redirect', 'manual-redirect', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
324 324
             array('aggressive-nat-detection', 'aggressive-nat-detection', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_option'),
325 325
             array('enable-Timer', 'enable-timer', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
326 326
             array('minimum-session-expires', 'INPUT', array('name' => 'minimum-session-expires', 'value' => '120', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
327 327
             array('session-timeout', 'INPUT', array('name' => 'session-timeout-pt', 'value' => '1800', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
328 328
             array('auth-calls', 'auth-calls', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_option'),
329
-            array('apply-inbound-acl', 'INPUT', array('name' => 'apply-inbound-acl', 'value' => 'default', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
330
-            array('inbound-codec-prefs', 'INPUT', array('name' => 'inbound-codec-prefs', 'size' => '25',  'class' => "text field medium"), '', 'tOOL TIP', ''),
329
+            array('apply-inbound-acl', 'INPUT', array('name' => 'apply-inbound-acl', 'value' => 'default', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
330
+            array('inbound-codec-prefs', 'INPUT', array('name' => 'inbound-codec-prefs', 'size' => '25', 'class' => "text field medium"), '', 'tOOL TIP', ''),
331 331
             array('outbound-codec-prefs', 'INPUT', array('name' => 'outbound-codec-prefs', 'size' => '25', 'class' => "text field medium"), '', 'tOOL TIP', ''),
332 332
             array('inbound-late-negotiation', 'inbound-late-negotiation', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_sip_config_options'),
333 333
             array('inbound-codec-negotiation', 'INPUT', array('name' => 'inbound-codec-negotiation', 'size' => '25', 'class' => "text field medium"), '', 'tOOL TIP', ''),
334 334
         );
335 335
         $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\')');
336
-        $form['button_save'] = array('content' => 'Save', 'value' => 'save', 'type' => 'button','id'=>'submit', 'class' => 'btn btn-line-parrot');
336
+        $form['button_save'] = array('content' => 'Save', 'value' => 'save', 'type' => 'button', 'id'=>'submit', 'class' => 'btn btn-line-parrot');
337 337
 
338 338
         return $form;
339 339
     }
@@ -341,22 +341,22 @@  discard block
 block discarded – undo
341 341
     function build_fssipprofile_list_for_admin() {
342 342
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
343 343
         $grid_field_arr = json_encode(array(
344
-	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
344
+	    array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
345 345
 /**
346 346
 ASTPP  3.0
347 347
 For Sip Profile edit on Profile name
348 348
 **/
349
-            array("Name", "190", "name", "", "", "","EDITABLE","true","center"),
349
+            array("Name", "190", "name", "", "", "", "EDITABLE", "true", "center"),
350 350
 /************************************/
351
-            array("SIP IP", "205", "sip_ip", "", "", "","","true","center"),
352
-            array("SIP Port", "200", "sip_port", "", "", "","","true","center"),
351
+            array("SIP IP", "205", "sip_ip", "", "", "", "", "true", "center"),
352
+            array("SIP Port", "200", "sip_port", "", "", "", "", "true", "center"),
353 353
            /*
354 354
             ASTPP  3.0 
355 355
             status show active or inactive
356 356
             */
357
-            array("Status", "160", "status", "status", "sip_profiles", "get_status","","true","center"),
357
+            array("Status", "160", "status", "status", "sip_profiles", "get_status", "", "true", "center"),
358 358
            /*******************************************************/
359
-             array("Profile Action", "282", "", "", "", array("START" => array("url" => "/freeswitch/fssipprofile_action/start/","mode"=>"single"),
359
+             array("Profile Action", "282", "", "", "", array("START" => array("url" => "/freeswitch/fssipprofile_action/start/", "mode"=>"single"),
360 360
                     "STOP" => array("url" => "/freeswitch/fssipprofile_action/stop/", "mode" => "single"),
361 361
                     "RELOAD" => array("url" => "/freeswitch/fssipprofile_action/reload/", "mode" => "single"),
362 362
                     "RESCAN" => array("url" => "/freeswitch/fssipprofile_action/rescan/", "mode" => "single"),                    
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
     }
370 370
 
371 371
     function build_fssipprofile_grid_buttons() {
372
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fssipprofile_add/",""),
373
-	    array("Delete","btn btn-line-danger","fa fa-times-circle fa-lg","button_action", "/freeswitch/fssipprofile_delete_multiple/")
372
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fssipprofile_add/", ""),
373
+	    array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/freeswitch/fssipprofile_delete_multiple/")
374 374
            ));
375 375
         return $buttons_json;
376 376
     }
@@ -392,15 +392,15 @@  discard block
 block discarded – undo
392 392
     function build_fsserver_list() {
393 393
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
394 394
         $grid_field_arr = json_encode(array(
395
-            array("Host", "200", "freeswitch_host", "", "", "","","true","center"),
396
-            array(" Password", "200", "freeswitch_password", "", "", "","","true","center"),
397
-            array(" Port", "200", "freeswitch_port", "", "", "","","true","center"),
395
+            array("Host", "200", "freeswitch_host", "", "", "", "", "true", "center"),
396
+            array(" Password", "200", "freeswitch_password", "", "", "", "", "true", "center"),
397
+            array(" Port", "200", "freeswitch_port", "", "", "", "", "true", "center"),
398 398
             /*
399 399
             ASTPP  3.0 .3 creation field show in grid
400 400
             */
401
-            array("Status", "145", "status", "status", "freeswich_servers", "get_status","","true","center"),
402
-            array("Created Date", "170", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
403
-             array("Modified Date", "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
401
+            array("Status", "145", "status", "status", "freeswich_servers", "get_status", "", "true", "center"),
402
+            array("Created Date", "170", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
403
+             array("Modified Date", "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
404 404
             /********************************************************************/
405 405
            
406 406
             array("Action", "182", "", "", "", array("EDIT" => array("url" => "/freeswitch/fsserver_edit/", "mode" => "popup"),
@@ -411,19 +411,19 @@  discard block
 block discarded – undo
411 411
     /**************************************************/
412 412
 
413 413
     function build_fsserver_grid_buttons() {
414
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fsserver_add/", "popup"),
414
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/freeswitch/fsserver_add/", "popup"),
415 415
 //array("Delete",  "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/freeswitch/fssipdevices_delete_multiple/")
416 416
             ));
417 417
         return $buttons_json;
418 418
     }
419 419
 
420 420
     function get_form_fsserver_fields() {
421
-        $form['forms'] = array(base_url() . '/freeswitch/fsserver_save/', array("id" => "fsserver_form", "name" => "fsserver_form"));
421
+        $form['forms'] = array(base_url().'/freeswitch/fsserver_save/', array("id" => "fsserver_form", "name" => "fsserver_form"));
422 422
         $form['Freeswitch Server Information'] = array(
423 423
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
424 424
             array(' Host', 'INPUT', array('name' => 'freeswitch_host', 'size' => '20', 'class' => "text field medium"), 'trim|required|valid_ip', 'tOOL TIP', 'Please Enter account number'),
425
-            array(' Password', 'INPUT', array('name' => 'freeswitch_password', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
426
-            array(' Port', 'INPUT', array('name' => 'freeswitch_port', 'size' => '20',  'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', 'Please Enter account number'),
425
+            array(' Password', 'INPUT', array('name' => 'freeswitch_password', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
426
+            array(' Port', 'INPUT', array('name' => 'freeswitch_port', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', 'Please Enter account number'),
427 427
         );
428 428
 
429 429
         $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\')');
@@ -452,17 +452,17 @@  discard block
 block discarded – undo
452 452
 	*/
453 453
     function build_devices_list_for_customer() {
454 454
         $grid_field_arr = json_encode(array(
455
-			array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
456
-            array("User Name", "100", "username", "", "", "","","true","center"),
457
-            array("Password", "100", "password", "", "", "","","true","center"),
458
-            array("SIP Profile", "90", "sip_profile_id", "name", "sip_profiles", "get_field_name","","true","center"),
459
-            array("Caller Name", "100", "effective_caller_id_name", "", "", "","","true","center"),
460
-            array("Caller Number", "100", "effective_caller_id_number", "", "", "","","true","center"),
461
-            array("Voicemail", "100", "voicemail_enabled", "", "", "","","true","center"),
455
+			array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
456
+            array("User Name", "100", "username", "", "", "", "", "true", "center"),
457
+            array("Password", "100", "password", "", "", "", "", "true", "center"),
458
+            array("SIP Profile", "90", "sip_profile_id", "name", "sip_profiles", "get_field_name", "", "true", "center"),
459
+            array("Caller Name", "100", "effective_caller_id_name", "", "", "", "", "true", "center"),
460
+            array("Caller Number", "100", "effective_caller_id_number", "", "", "", "", "true", "center"),
461
+            array("Voicemail", "100", "voicemail_enabled", "", "", "", "", "true", "center"),
462 462
             //array("Call Waiting", "105", "call_waiting", "", "", ""),
463
-            array("Status", "100", "status", "", "", "","","true","center"),
464
-			array("Created Date", "100", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
465
-            array("Modified Date", "100", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
463
+            array("Status", "100", "status", "", "", "", "", "true", "center"),
464
+			array("Created Date", "100", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
465
+            array("Modified Date", "100", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
466 466
             array("Action", "110", "", "", "", array("EDIT" => array("url" => "/accounts/fssipdevices_action/edit/", "mode" => "single"),
467 467
                     "DELETE" => array("url" => "/accounts/fssipdevices_action/delete/", "mode" => "single")))
468 468
                 ));
@@ -471,21 +471,21 @@  discard block
 block discarded – undo
471 471
     
472 472
     /******************8*/
473 473
 
474
-    function fsdevice_form_fields_for_customer($accountid , $id=false) {
474
+    function fsdevice_form_fields_for_customer($accountid, $id = false) {
475 475
     
476 476
 	// $val = $id > 0 ? 'sip_devices.username.' . $id : 'sip_devices.username';
477
-	$val=$id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username';   
477
+	$val = $id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username';   
478 478
         $uname_user = $this->CI->common->find_uniq_rendno('10', '', '');
479 479
         $password = $this->CI->common->generate_password();
480
-        if ($this->CI->session->userdata("logintype") == '0'  || $this->CI->session->userdata("logintype") == '3') {
481
-            $link = base_url() . 'freeswitch/user_fssipdevices_save/true';
480
+        if ($this->CI->session->userdata("logintype") == '0' || $this->CI->session->userdata("logintype") == '3') {
481
+            $link = base_url().'freeswitch/user_fssipdevices_save/true';
482 482
             $form['forms'] = array($link, array("id" => "sipdevices_form", "name" => "sipdevices_form"));
483 483
             $form['Device Information'] = array(
484 484
                 array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
485 485
                 array('', 'HIDDEN', array('name' => 'accountcode', 'value' => $accountid), '', '', '', ''),
486
-                array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user,'id'=>'username', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number','<i style="cursor:pointer;color:#1BCB61 !important;font-size:14px; padding-left:5px; padding-top:8px; float:left; " title="Reset Password" class="change_number fa fa-refresh"></i>'),
487
-                array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20','id'=>'password1','value'=>$password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password','<i style="cursor:pointer;color:#1BCB61 !important;  font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
488
-                array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
486
+                array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user, 'id'=>'username', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer;color:#1BCB61 !important;font-size:14px; padding-left:5px; padding-top:8px; float:left; " title="Reset Password" class="change_number fa fa-refresh"></i>'),
487
+                array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20', 'id'=>'password1', 'value'=>$password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer;color:#1BCB61 !important;  font-size:14px;    padding-left:5px;    padding-top:8px;    float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
488
+                array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
489 489
                 array('Caller Number', 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
490 490
                 //array('Call Waiting', 'call_waiting', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_call_waiting'),
491 491
                 array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
@@ -510,25 +510,25 @@  discard block
 block discarded – undo
510 510
         );   
511 511
 /*******************/           
512 512
         } else {
513
-             if($accountid){
514
-	            $account_Arr=null;
515
-	     }else{
516
-	            $account_Arr=array('Account', 'accountcode', 'SELECT', '','trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0"));
513
+             if ($accountid) {
514
+	            $account_Arr = null;
515
+	     } else {
516
+	            $account_Arr = array('Account', 'accountcode', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"0", "deleted" => "0"));
517 517
 	     }       
518 518
             if ($this->CI->session->userdata("logintype") == '1') {
519
-		$sip_pro =null;
520
-                $link = base_url() . 'freeswitch/customer_fssipdevices_save/true';
521
-            }else{
522
-		$sip_pro =array('SIP Profile', 'sip_profile_id', 'SELECT', '','trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', '');
523
-                $link = base_url() . 'freeswitch/fssipdevices_save/true';
519
+		$sip_pro = null;
520
+                $link = base_url().'freeswitch/customer_fssipdevices_save/true';
521
+            } else {
522
+		$sip_pro = array('SIP Profile', 'sip_profile_id', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', '');
523
+                $link = base_url().'freeswitch/fssipdevices_save/true';
524 524
             }
525 525
             $form['forms'] = array($link, array("id" => "sipdevices_form", "name" => "sipdevices_form"));
526 526
             /*Add sipdevice*/
527 527
             $form['Device Information'] = array(
528 528
                 array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
529 529
                 array('', 'HIDDEN', array('name' => 'accountcode', 'value' => $accountid), '', '', '', ''),
530
-                 array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user,'id'=>'username1', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number','<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px;  padding-top:8px; float:left;" title="Reset Password" class="change_number fa fa-refresh"></i>'),
531
-             array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20', 'id'=>'password1','value'=>$password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password','<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px;padding-top:8px; float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
530
+                 array('Username', 'INPUT', array('name' => 'fs_username', 'size' => '20', 'value'=>$uname_user, 'id'=>'username1', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|xss_clean', 'tOOL TIP', 'Please Enter account number', '<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px;  padding-top:8px; float:left;" title="Reset Password" class="change_number fa fa-refresh"></i>'),
531
+             array('Password', 'INPUT', array('name' => 'fs_password', 'size' => '20', 'id'=>'password1', 'value'=>$password, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter Password', '<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px;padding-top:8px; float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>'),
532 532
                 array('Caller Name', 'INPUT', array('name' => 'effective_caller_id_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
533 533
                 array('Caller Number', 'INPUT', array('name' => 'effective_caller_id_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
534 534
 		$account_Arr,
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 	 $form['Voicemail Options'] = array(
543 543
             array('Enable', 'voicemail_enabled', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_sip_config_option'),
544 544
 			array('Password', 'INPUT', array('name' => 'voicemail_password', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'PleaseEnter account number'),
545
-			array('Mail To', 'INPUT', array('name' => 'voicemail_mail_to', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
545
+			array('Mail To', 'INPUT', array('name' => 'voicemail_mail_to', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'),
546 546
 			array('Attach File', 'voicemail_attach_file', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status_voicemail'),
547 547
 			//array('Local After Email', 'vm_keep_local_after_email', 'CHECKBOX', array('name' => 'vm_keep_local_after_email', 'value' => 'on', 'checked' => false), '', 'tOOL TIP', 'Please Select Status', 'custom_status_true', '', '', ''),
548 548
 			array('Local After Email', 'vm_keep_local_after_email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status_voicemail'),
Please login to merge, or discard this patch.
astpp/application/modules/freeswitch/views/view_fssipprofile_edit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -101,23 +101,23 @@  discard block
 block discarded – undo
101 101
 		      </div>
102 102
 		     <form method="post" action="<?= base_url() ?>freeswitch/fssipprofile_add/edit/" enctype="multipart/form-data" name='form1' id ="myForm1">
103 103
 			<input type='hidden' name='id' value="<?=$id?>" />
104
-			<div class='col-md-12'><div style="width:550px;" ><label style="text-align:right;" class="col-md-3">Name *</label><input class="col-md-5 form-control" value="<?=$sip_name;?>" id="sip_name" name="name" size="20" type="text"></div>
104
+			<div class='col-md-12'><div style="width:550px;" ><label style="text-align:right;" class="col-md-3">Name *</label><input class="col-md-5 form-control" value="<?=$sip_name; ?>" id="sip_name" name="name" size="20" type="text"></div>
105 105
 			<span style="color:red;margin-left: 10px;float:left;" id="error_msg_sip"></span>
106 106
 			</div>
107 107
 			<div class='col-md-12'>  
108
-			<div style="width:550px;" ><label style="text-align:right;" class="col-md-3">SIP IP  *</label><input class="col-md-5 form-control " value="<?=@$sip_ip;?>" name="sip_ip" size="20" id="sip_ip" type="text"></div>
108
+			<div style="width:550px;" ><label style="text-align:right;" class="col-md-3">SIP IP  *</label><input class="col-md-5 form-control " value="<?=@$sip_ip; ?>" name="sip_ip" size="20" id="sip_ip" type="text"></div>
109 109
 			<span style="color:red;margin-left: 10px;float:left;" id="error_msg_ip"></span>
110 110
 			</div>
111 111
 			<div>
112
-			<div style="width:550px;"><label style="text-align:right;"  class="col-md-3">SIP Port *</label><input class="col-md-5 form-control" value="<?=@$sip_port;?>" name="sip_port" size="20" id="sip_port" type="text"></div>
112
+			<div style="width:550px;"><label style="text-align:right;"  class="col-md-3">SIP Port *</label><input class="col-md-5 form-control" value="<?=@$sip_port; ?>" name="sip_port" size="20" id="sip_port" type="text"></div>
113 113
 			<span style="color:red;margin-left: 10px;float:left;" id="error_msg_port"></span>
114 114
 			</div>
115 115
 			<div class='col-md-12'>
116 116
 			<div style="width:550px;"><label style="text-align:right;" class="col-md-3">Status </label>
117 117
 			<select name="sipstatus" class="col-md-5 form-control selectpicker" data-live-search='true'>
118 118
 			    
119
-			    <option value="0" <?if($status==0)echo 'selected=selected;'?>>Active</option>
120
-			    <option value="1" <?if($status==1)echo 'selected=selected;'?>>Inactive</option>
119
+			    <option value="0" <?if ($status == 0)echo 'selected=selected;'?>>Active</option>
120
+			    <option value="1" <?if ($status == 1)echo 'selected=selected;'?>>Inactive</option>
121 121
 			  </select>
122 122
                        </div>
123 123
 		       </div>
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 			          
184 184
 			</div>
185 185
 			<?
186
-			  if($params_name!='')
186
+			  if ($params_name != '')
187 187
 			  {
188
-			    $type="edit_setting";
189
-			  }else{
190
-			    $type="add_setting";
188
+			    $type = "edit_setting";
189
+			  } else {
190
+			    $type = "add_setting";
191 191
 			  }
192 192
 			?>
193 193
 			<input type='hidden' name='type_settings' value='<?=$type?>' />
Please login to merge, or discard this patch.
astpp/application/modules/freeswitch/views/view_fs_freeswitch_execute.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 <?=$page_title?><br/>
7 7
 <? endblock() ?>
8 8
 <? startblock('content') ?>
9
-<?php 	$command_show = str_replace("api ","",$command); ?>
9
+<?php 	$command_show = str_replace("api ", "", $command); ?>
10 10
 <script>
11 11
 $(document).ready(function(){
12 12
   $("#freeswitch_command").change(function(){
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 		<div class="col-md-2">
40 40
 		  <select class="form-control" name="host_id" id="host_id">
41 41
   		      <?php
42
-    			foreach($fs_data as $name) { ?>
43
-     			 <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id))echo 'selected';?>><?= $name['freeswitch_host'] ?></option>
42
+    			foreach ($fs_data as $name) { ?>
43
+     			 <option value="<?= $name['id'] ?>"<?php if (isset($host_id) && ($name['id'] == $host_id))echo 'selected'; ?>><?= $name['freeswitch_host'] ?></option>
44 44
   			  <?php
45 45
     			  } ?>
46 46
 		   </select>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		</div>
58 58
 		<span style="color:red;margin-left:655px;float:left;" id="error_field_command"></span>
59 59
 		</div>
60
-	     <?php if($command != ''){ ?>
60
+	     <?php if ($command != '') { ?>
61 61
              <div style="margin-left:00px;"><h2>Command : <font color="blue"><?php echo $command_show; ?></font></h2></div>
62 62
 	
63 63
 	     <div class="col-md-12"> 
Please login to merge, or discard this patch.