Completed
Push — v3.0 ( 495b61...be1e07 )
by Samir
24:09 queued 10:48
created
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   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@
 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.
web_interface/astpp/application/modules/animap/models/animap_model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		}
54 54
 		   $this->db_model->build_search('animap_list_search');
55 55
 		if ($flag) {
56
-			$query = $this->db_model->select("*", "ani_map",  "", "id", "ASC", $limit, $start);
56
+			$query = $this->db_model->select("*", "ani_map", "", "id", "ASC", $limit, $start);
57 57
 		} else {
58 58
 			$query = $this->db_model->countQuery("*", "ani_map", "");
59 59
 		}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         ASTPP  3.0 
66 66
         Add creation date
67 67
         */
68
-		$data=array('creation_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
68
+		$data = array('creation_date'=>gmdate('Y-m-d H:i:s'), 'number'=>$add_array['number'], 'accountid'=>$add_array['accountid'], 'status'=>$add_array['status'], 'context'=>'default');
69 69
 		$this->db->insert("ani_map", $data);
70 70
 		return $this->db->insert_id();
71 71
 	}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
          ASTPP  3.0 
76 76
          last modify date update
77 77
          */
78
-		 $data=array('last_modified_date'=>gmdate('Y-m-d H:i:s'),'number'=>$add_array['number'],'accountid'=>$add_array['accountid'],'status'=>$add_array['status'],'context'=>'default');
78
+		 $data = array('last_modified_date'=>gmdate('Y-m-d H:i:s'), 'number'=>$add_array['number'], 'accountid'=>$add_array['accountid'], 'status'=>$add_array['status'], 'context'=>'default');
79 79
 		 /*********************************************************/
80 80
 		$this->db->where("id", $id);
81 81
 		return  $this->db->update("ani_map", $data);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/controllers/animap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 		$this->load->model('animap_model');
34 34
 
35 35
 		if ($this->session->userdata('user_login') == FALSE)
36
-			redirect(base_url() . '/astpp/login');
36
+			redirect(base_url().'/astpp/login');
37 37
 	}
38 38
 
39 39
 	function animap_add() {
40 40
 		$data['username'] = $this->session->userdata('user_name');
41 41
 		$data['flag'] = 'create';
42 42
 		$data['page_title'] = 'Add Caller ID';
43
-		$edit_id='';
43
+		$edit_id = '';
44 44
 		$data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), '');
45 45
 
46 46
 		$this->load->view('animap_add_edit', $data);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	function animap_save() {
62 62
 		$add_array = $this->input->post();
63 63
 
64
-	  $edit_id=$add_array['id'];
64
+	  $edit_id = $add_array['id'];
65 65
 		$data['form'] = $this->form->build_form($this->animap_form->get_animap_form_fields($edit_id), $add_array);
66 66
 		if ($add_array['id'] != '') {
67 67
 			$data['page_title'] = 'Add Caller ID';
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	function animap_delete($id) {
97 97
 		$this->animap_model-> remove_animap($id);
98 98
 		$this->session->set_flashdata('astpp_notification', 'Caller ID removed successfully!');
99
-		redirect(base_url() . 'animap/animap_detail/');
99
+		redirect(base_url().'animap/animap_detail/');
100 100
 	}
101 101
 
102 102
 	function  animap_detail_search() {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 			$this->session->set_userdata('animap_list_search', $action);
110 110
 		}
111 111
 		if (@$ajax_search != 1) {
112
-			redirect(base_url() . 'animap/animap_list/');
112
+			redirect(base_url().'animap/animap_list/');
113 113
 		}
114 114
 	}
115 115
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/libraries/animap_form.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
25
+if ( ! defined('BASEPATH'))
26 26
 	exit('No direct script access allowed');
27 27
 
28 28
 class Animap_form {
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	}
32 32
    
33 33
 	function get_animap_form_fields($edit_id) {
34
-   $id=$edit_id;
35
-		$form['forms'] = array(base_url() . 'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
36
-  $val=$id > 0 ? 'ani_map.number.'.$id : 'ani_map.number';   
34
+   $id = $edit_id;
35
+		$form['forms'] = array(base_url().'animap/animap_save/', array('id' => 'animap_form', 'method' => 'POST', 'name' => 'animap_form'));
36
+  $val = $id > 0 ? 'ani_map.number.'.$id : 'ani_map.number';   
37 37
 		$form['Caller ID'] = array(
38 38
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
39
-			array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0","status" => "0")),
39
+			array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3", "deleted" => "0", "status" => "0")),
40 40
 			array('Caller ID', 'INPUT', array('name' => 'number', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_unique['.$val.']|numeric|xss_clean', 'tOOL TIP', 'Please Enter ANI number'),
41 41
 			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_status'),
42 42
             
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      
52 52
 		$form['forms'] = array("", array('id' => "animap_search"));
53 53
 		$form['Search'] = array(
54
-			 array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")),
54
+			 array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type"=>"0", "deleted" => "0")),
55 55
 	   array('Caller ID', 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''),
56 56
 	   array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),
57 57
 		array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 
68 68
 	function build_animap_list_for_admin() {
69 69
 		// array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
70
-		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
71
-	   array("Account", "250", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
72
-			array("Caller ID", "250", "number", "", "", "","","true","center"),
70
+		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
71
+	   array("Account", "250", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new", "", "true", "center"),
72
+			array("Caller ID", "250", "number", "", "", "", "", "true", "center"),
73 73
 			 /*
74 74
             ASTPP  3.0 
75 75
             creation field show in grid
76 76
             */
77
-			array("Status", "180", "status", "status", "ani_map", "get_status","","true","center"),
78
-			array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"),
79
-			array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"),
77
+			array("Status", "180", "status", "status", "ani_map", "get_status", "", "true", "center"),
78
+			array("Created Date", "220", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"),
79
+			array("Modified Date", "220", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"),
80 80
            
81 81
 			/********************************************************************/
82 82
 			array("Action", "100", "", "", "", array("EDIT" => array("url" => "animap/animap_edit/", "mode" => "popup", 'popup'),
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	function build_grid_buttons() {
89
-		$buttons_json = json_encode(array(array("Add" , "btn btn-line-warning btn" , "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
-			array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg",  "button_action", "/animap/animap_delete_multiple/")
89
+		$buttons_json = json_encode(array(array("Add", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/animap/animap_add/", "popup"),
90
+			array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/animap/animap_delete_multiple/")
91 91
 			));
92 92
 		return $buttons_json;
93 93
 	}
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/models/taxes_model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 		$this->db_model->build_search('taxes_list_search');
31 31
 		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32 32
 			$where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
-		}else{
34
-		$where =array("reseller_id"=>0);
33
+		} else {
34
+		$where = array("reseller_id"=>0);
35 35
 		}
36 36
 		if ($flag) {
37 37
 			$query = $this->db_model->select("*", "taxes", $where, "id", "ASC", $limit, $start);
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 		$data["creation_date"] = date("Y-m-d H:i:s");
47 47
 		 if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
48 48
 	  $data['reseller_id'] = $this->session->userdata["accountinfo"]['id'];
49
-		 }else{
50
-	  $data['reseller_id'] =0;
49
+		 } else {
50
+	  $data['reseller_id'] = 0;
51 51
 		 }
52 52
 		$this->db->insert("taxes", $data);
53 53
 	}
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	function remove_taxes($id) {
63
-		$this->db->delete('taxes_to_accounts',array('taxes_id'=>$id));
64
-		return $this->db->delete("taxes",array('id'=>$id));
63
+		$this->db->delete('taxes_to_accounts', array('taxes_id'=>$id));
64
+		return $this->db->delete("taxes", array('id'=>$id));
65 65
 	}
66 66
 
67 67
 }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/controllers/taxes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$this->load->model('taxes_model');
34 34
 
35 35
 		if ($this->session->userdata('user_login') == FALSE)
36
-			redirect(base_url() . '/astpp/login');
36
+			redirect(base_url().'/astpp/login');
37 37
 	}
38 38
 
39 39
 	function taxes_add() {
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 	function taxes_delete($id) {
91 91
 		$this->db->select('taxes_description');
92
-		$this->db->where('id',$id);
93
-		$taxes_name=(array)$this->db->get('taxes')->first_row();
92
+		$this->db->where('id', $id);
93
+		$taxes_name = (array)$this->db->get('taxes')->first_row();
94 94
 		$this->taxes_model->remove_taxes($id);
95 95
 		$this->session->set_flashdata('astpp_notification', $taxes_name["taxes_description"].' Tax removed successfully!');
96
-		redirect(base_url() . 'taxes/taxes_list/');
96
+		redirect(base_url().'taxes/taxes_list/');
97 97
 	}
98 98
 
99 99
 	function taxes_list() {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	function taxes_list_json() {
110 110
 		$json_data = array();
111 111
 		$count_all = $this->taxes_model->get_taxes_list(false);
112
-		$paging_data =  $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
112
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
113 113
 		$json_data = $paging_data["json_paging"];
114 114
 
115 115
 		$query = $this->taxes_model->get_taxes_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		$this->session->set_userdata('taxes_list_search', $this->input->post());
132 132
 		}
133 133
 		if (@$ajax_search != 1) {
134
-			redirect(base_url() . 'taxes/taxes_list/');
134
+			redirect(base_url().'taxes/taxes_list/');
135 135
 		}
136 136
 	}
137 137
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	function taxes_delete_multiple() {
144 144
 		$ids = $this->input->post("selected_ids", true);
145 145
 		$where = "id IN ($ids)";
146
-		$taxes_where="taxes_id IN(".$ids.")";
146
+		$taxes_where = "taxes_id IN(".$ids.")";
147 147
 		$this->db->where($taxes_where);
148 148
 		$this->db->delete('taxes_to_accounts');
149 149
 		$this->db->where($where);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/libraries/taxes_form.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  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 Taxes_form {
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 		$this->CI = & get_instance();
29 29
 	}
30 30
 	function get_taxes_form_fields() {
31
-		$form['forms'] = array(base_url() . 'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
31
+		$form['forms'] = array(base_url().'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
32 32
 		$form['Tax Information'] = array(
33 33
 			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
34
-			array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
34
+			array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
35 35
 			array('Priority', 'INPUT', array('name' => 'taxes_priority', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
36 36
 			array('Amount', 'INPUT', array('name' => 'taxes_amount', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
37
-			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20','maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
37
+			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
38 38
 			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
39 39
 
40 40
 		);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		$form['Search'] = array(
49 49
 			array('Name', 'INPUT', array('name' => 'taxes_description[taxes_description]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'taxes_description[taxes_description-string]', '', '', '', 'search_string_type', ''),
50 50
 			array('Amount', 'INPUT', array('name' => 'taxes_amount[taxes_amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_amount[taxes_amount-integer]', '', '', '', 'search_int_type', ''),
51
-			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),   array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
51
+			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
52 52
 			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
53 53
 		);
54 54
 		$form['button_search'] = array('name' => 'action', 'id' => "taxes_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 
59 59
 	function build_taxes_list_for_admin() {
60 60
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
61
-		$currency_id=$account_info['currency_id'];
62
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
63
-		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
64
-			array("Name", "270", "taxes_description", "", "", "","","true","center"),
65
-			array("Priority", "145", "taxes_priority", "", "", "","","true","center"),
66
-			array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency","","true","right"),
67
-			array("Rate(%)", "230", "taxes_rate", "", "", "","","true","right"),
68
-			array("Status", "160", "status", "status", "taxes", "get_status","","true","center"),
61
+		$currency_id = $account_info['currency_id'];
62
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
63
+		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
64
+			array("Name", "270", "taxes_description", "", "", "", "", "true", "center"),
65
+			array("Priority", "145", "taxes_priority", "", "", "", "", "true", "center"),
66
+			array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency", "", "true", "right"),
67
+			array("Rate(%)", "230", "taxes_rate", "", "", "", "", "true", "right"),
68
+			array("Status", "160", "status", "status", "taxes", "get_status", "", "true", "center"),
69 69
 			array("Action", "175", "", "", "", array("EDIT" => array("url" => "taxes/taxes_edit/", "mode" => "popup"),
70 70
 					"DELETE" => array("url" => "taxes/taxes_delete/", "mode" => "single")))
71 71
 				));
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	}
74 74
 
75 75
 	function build_grid_buttons() {
76
-		$buttons_json = json_encode(array(array("Create","btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
-			array("Delete","btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
76
+		$buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
+			array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
78 78
 		return $buttons_json;
79 79
 	}
80 80
 
Please login to merge, or discard this patch.
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.