@@ -181,13 +181,13 @@ discard block |
||
| 181 | 181 | </tr> |
| 182 | 182 | <tr> |
| 183 | 183 | <td> |
| 184 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
| 184 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
| 185 | 185 | </td> |
| 186 | 186 | </tr> |
| 187 | 187 | <tr> |
| 188 | 188 | <td> |
| 189 | 189 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
| 190 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
| 190 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
| 191 | 191 | ?></span> |
| 192 | 192 | </td> |
| 193 | 193 | </tr> |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | <th >Amount</th> |
| 219 | 219 | </tr> |
| 220 | 220 | <?php |
| 221 | -$j=1; |
|
| 221 | +$j = 1; |
|
| 222 | 222 | |
| 223 | - foreach($invoice_total_query as $value){ |
|
| 224 | - $id=$value['id']; |
|
| 225 | - $debit=$value['debit']; |
|
| 226 | - $created_date=$value['created_date']; |
|
| 223 | + foreach ($invoice_total_query as $value) { |
|
| 224 | + $id = $value['id']; |
|
| 225 | + $debit = $value['debit']; |
|
| 226 | + $created_date = $value['created_date']; |
|
| 227 | 227 | ?> |
| 228 | 228 | <tr> |
| 229 | 229 | <td width="20" align="center"> |
@@ -165,15 +165,15 @@ |
||
| 165 | 165 | </div> |
| 166 | 166 | <div class="col-md-5"><label style="text-align:left;float:left;" class="col-md-3"><?php echo gettext('Accounts'); ?> </label> |
| 167 | 167 | <?php |
| 168 | - if($login_type == -1){ |
|
| 169 | - $where="deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
| 170 | - }if($login_type == 1){ |
|
| 171 | - $where="deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
| 168 | + if ($login_type == -1) { |
|
| 169 | + $where = "deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
| 170 | + }if ($login_type == 1) { |
|
| 171 | + $where = "deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
| 172 | 172 | |
| 173 | 173 | } |
| 174 | - $account=$this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where);?> |
|
| 174 | + $account = $this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where); ?> |
|
| 175 | 175 | |
| 176 | - <?php echo form_dropdown_all('accountid', $account,''); ?> |
|
| 176 | + <?php echo form_dropdown_all('accountid', $account, ''); ?> |
|
| 177 | 177 | </div> |
| 178 | 178 | <div> |
| 179 | 179 | <div><label style="text-align:left;float:left;" class="col-md-1"><?php echo gettext('Notes'); ?> </label> |
@@ -158,13 +158,13 @@ |
||
| 158 | 158 | </tr> |
| 159 | 159 | <tr> |
| 160 | 160 | <td> |
| 161 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
| 161 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
| 162 | 162 | </td> |
| 163 | 163 | </tr> |
| 164 | 164 | <tr> |
| 165 | 165 | <td> |
| 166 | 166 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
| 167 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
| 167 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
| 168 | 168 | ?></span> |
| 169 | 169 | </td> |
| 170 | 170 | </tr> |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | </tr> |
| 101 | 101 | <tr> |
| 102 | 102 | <td> |
| 103 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
| 103 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
| 104 | 104 | </td> |
| 105 | 105 | </tr> |
| 106 | 106 | <tr> |
| 107 | 107 | <td> |
| 108 | 108 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
| 109 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
| 109 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
| 110 | 110 | ?></span> |
| 111 | 111 | </td> |
| 112 | 112 | </tr> |
@@ -140,24 +140,24 @@ discard block |
||
| 140 | 140 | </th> |
| 141 | 141 | </tr> |
| 142 | 142 | <?php |
| 143 | -$paypal=0; |
|
| 144 | - foreach($invoice_final_query as $value){ |
|
| 143 | +$paypal = 0; |
|
| 144 | + foreach ($invoice_final_query as $value) { |
|
| 145 | 145 | |
| 146 | - if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
| 147 | - $debit=$value['debit']; |
|
| 148 | - $credit=$value['credit']; |
|
| 149 | - $paypal+=$credit; |
|
| 150 | - $created_date=$value['created_date']; |
|
| 151 | - $paypalid=$value['item_id']; |
|
| 152 | - $outstanding=$amount-$paypal; |
|
| 153 | - $amount_visible='0000'; |
|
| 146 | + if ($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
| 147 | + $debit = $value['debit']; |
|
| 148 | + $credit = $value['credit']; |
|
| 149 | + $paypal += $credit; |
|
| 150 | + $created_date = $value['created_date']; |
|
| 151 | + $paypalid = $value['item_id']; |
|
| 152 | + $outstanding = $amount - $paypal; |
|
| 153 | + $amount_visible = '0000'; |
|
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | ?> |
| 158 | 158 | <tr style="height:20px;"> |
| 159 | 159 | <td><?php echo $value['description']; ?> </td> |
| 160 | - <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
| 160 | + <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
| 161 | 161 | <input type="hidden" name="new_amount" value="<?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?>"> |
| 162 | 162 | |
| 163 | 163 | |
@@ -196,18 +196,18 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | </tr> |
| 198 | 198 | <?php |
| 199 | -$paypal=0; |
|
| 200 | -if($invoice_date){ |
|
| 201 | - foreach($invoice_total_query as $value){ |
|
| 199 | +$paypal = 0; |
|
| 200 | +if ($invoice_date) { |
|
| 201 | + foreach ($invoice_total_query as $value) { |
|
| 202 | 202 | |
| 203 | 203 | |
| 204 | - $debit=$value['debit']; |
|
| 205 | - $credit=$value['credit']; |
|
| 206 | - $paypal+=$credit; |
|
| 207 | - $created_date=$value['created_date']; |
|
| 208 | - $paypalid=$value['item_id']; |
|
| 209 | - $outstanding=$amount-$paypal; |
|
| 210 | - $amount_visible='0000'; |
|
| 204 | + $debit = $value['debit']; |
|
| 205 | + $credit = $value['credit']; |
|
| 206 | + $paypal += $credit; |
|
| 207 | + $created_date = $value['created_date']; |
|
| 208 | + $paypalid = $value['item_id']; |
|
| 209 | + $outstanding = $amount - $paypal; |
|
| 210 | + $amount_visible = '0000'; |
|
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | unset($argv[1]); |
| 23 | 23 | // $argv = array_merge($argv, $config["argv"][$path]); |
| 24 | 24 | $argv[0] = $argv[0]; |
| 25 | - $argv[1] =$config["argv"][$path]; |
|
| 25 | + $argv[1] = $config["argv"][$path]; |
|
| 26 | 26 | $_SERVER['argv'] = $argv; |
| 27 | 27 | } else |
| 28 | 28 | die('Use: php cron.php controller/method'); |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | ob_start(); |
| 42 | 42 | |
| 43 | 43 | // chdir( dirname( CRON_CI_INDEX ) ); |
| 44 | -require( CRON_CI_INDEX ); // main CI index.php file |
|
| 44 | +require(CRON_CI_INDEX); // main CI index.php file |
|
| 45 | 45 | $output = ob_get_contents(); |
| 46 | 46 | |
| 47 | 47 | if (CRON_FLUSH_BUFFERS === TRUE) |
| 48 | - while (@ob_end_flush()); // display buffer contents |
|
| 48 | + while (@ob_end_flush()); // display buffer contents |
|
| 49 | 49 | else |
| 50 | 50 | ob_end_clean(); |
| 51 | 51 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | * as this file. |
| 69 | 69 | * |
| 70 | 70 | */ |
| 71 | - $assets_path='assets'; |
|
| 71 | + $assets_path = 'assets'; |
|
| 72 | 72 | /* |
| 73 | 73 | *--------------------------------------------------------------- |
| 74 | 74 | * APPLICATION FOLDER NAME |
@@ -162,9 +162,9 @@ |
||
| 162 | 162 | $str = remove_invisible_characters($str, FALSE); |
| 163 | 163 | //================ITPL======================= |
| 164 | 164 | $pos = strpos($str, "_json"); |
| 165 | - if($pos > 0 && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])){ |
|
| 165 | + if ($pos > 0 && ! isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { |
|
| 166 | 166 | $this->uri_string = str_replace('_json', '', trim($str, '/')); |
| 167 | - }else{ |
|
| 167 | + } else { |
|
| 168 | 168 | // If the URI contains only a slash we'll kill it |
| 169 | 169 | $this->uri_string = ($str == '/') ? '' : $str; |
| 170 | 170 | } |
@@ -254,7 +254,7 @@ |
||
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | - $_config[0] =& $config; |
|
| 257 | + $_config[0] = & $config; |
|
| 258 | 258 | return $_config[0]; |
| 259 | 259 | |
| 260 | 260 | } |
@@ -640,13 +640,13 @@ discard block |
||
| 640 | 640 | // Users can use any native PHP function call that has one param. |
| 641 | 641 | if (function_exists($rule)) |
| 642 | 642 | { |
| 643 | - $str=null; |
|
| 644 | - if(is_array($postdata)){ |
|
| 645 | - foreach($postdata as $key=>$value){ |
|
| 646 | - $str.=$value.","; |
|
| 643 | + $str = null; |
|
| 644 | + if (is_array($postdata)) { |
|
| 645 | + foreach ($postdata as $key=>$value) { |
|
| 646 | + $str .= $value.","; |
|
| 647 | 647 | } |
| 648 | - $str=rtrim($str,','); |
|
| 649 | - $postdata=$str; |
|
| 648 | + $str = rtrim($str, ','); |
|
| 649 | + $postdata = $str; |
|
| 650 | 650 | } |
| 651 | 651 | $result = $rule($postdata); |
| 652 | 652 | |
@@ -974,20 +974,20 @@ discard block |
||
| 974 | 974 | */ |
| 975 | 975 | public function is_unique($str, $field) |
| 976 | 976 | { |
| 977 | - $id=''; |
|
| 978 | - $data =explode('.', $field); |
|
| 979 | - $table=$data[0]; |
|
| 980 | - $field=$data[1]; |
|
| 981 | - if(isset($data[2])) |
|
| 982 | - $id=$data[2]; |
|
| 983 | - $where=array($field => $str); |
|
| 984 | - if($id != ''){ |
|
| 985 | - $where['id !=']=$id; |
|
| 977 | + $id = ''; |
|
| 978 | + $data = explode('.', $field); |
|
| 979 | + $table = $data[0]; |
|
| 980 | + $field = $data[1]; |
|
| 981 | + if (isset($data[2])) |
|
| 982 | + $id = $data[2]; |
|
| 983 | + $where = array($field => $str); |
|
| 984 | + if ($id != '') { |
|
| 985 | + $where['id !='] = $id; |
|
| 986 | 986 | } |
| 987 | - if($table == 'accounts'){ |
|
| 988 | - $where['deleted']=0; |
|
| 987 | + if ($table == 'accounts') { |
|
| 988 | + $where['deleted'] = 0; |
|
| 989 | 989 | } |
| 990 | - $query = $this->CI->db->limit(1)->get_where($table,$where ); |
|
| 990 | + $query = $this->CI->db->limit(1)->get_where($table, $where); |
|
| 991 | 991 | return $query->num_rows() > 0 ? FALSE : TRUE; |
| 992 | 992 | } |
| 993 | 993 | |
@@ -1421,54 +1421,54 @@ discard block |
||
| 1421 | 1421 | { |
| 1422 | 1422 | return ( ! preg_match("/^([.a-z0-9])+$/i", $str)) ? FALSE : TRUE; |
| 1423 | 1423 | } |
| 1424 | - public function valid_decimal($str){ |
|
| 1425 | - return (bool) preg_match('#^\d+(?:\.\d{1,5})?$#', $str); |
|
| 1424 | + public function valid_decimal($str) { |
|
| 1425 | + return (bool)preg_match('#^\d+(?:\.\d{1,5})?$#', $str); |
|
| 1426 | 1426 | } |
| 1427 | 1427 | public function alpha_numeric_space($str) |
| 1428 | 1428 | { |
| 1429 | 1429 | return ( ! preg_match("/^[A-Za-z0-9\s]+$/", $str)) ? FALSE : TRUE; |
| 1430 | 1430 | } |
| 1431 | - public function alpha_space($str){ |
|
| 1431 | + public function alpha_space($str) { |
|
| 1432 | 1432 | return ( ! preg_match("/^[A-Za-z\s]+$/", $str)) ? FALSE : TRUE; |
| 1433 | 1433 | // return ( ! preg_match("/^([-a-z0-9_-\s])+$/i", $str)) ? FALSE : TRUE; |
| 1434 | 1434 | } |
| 1435 | - public function currency_decimal($str){ |
|
| 1436 | - return (bool) preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str); |
|
| 1435 | + public function currency_decimal($str) { |
|
| 1436 | + return (bool)preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str); |
|
| 1437 | 1437 | // test(num) |
| 1438 | 1438 | } |
| 1439 | 1439 | /* ASTPP 3.0 |
| 1440 | 1440 | * For Old Password checking |
| 1441 | 1441 | */ |
| 1442 | - public function password_check($str,$table){ |
|
| 1442 | + public function password_check($str, $table) { |
|
| 1443 | 1443 | $this->CI->db->select('password'); |
| 1444 | - $this->CI->db->where('id',$_POST['id']); |
|
| 1445 | - $result=$this->CI->db->get($table); |
|
| 1446 | - if($result->num_rows() > 0 ){ |
|
| 1447 | - $result=(array)$result->first_row(); |
|
| 1448 | - $password=$this->CI->common->decode($result['password']); |
|
| 1449 | - if($password && $password == $str){ |
|
| 1444 | + $this->CI->db->where('id', $_POST['id']); |
|
| 1445 | + $result = $this->CI->db->get($table); |
|
| 1446 | + if ($result->num_rows() > 0) { |
|
| 1447 | + $result = (array)$result->first_row(); |
|
| 1448 | + $password = $this->CI->common->decode($result['password']); |
|
| 1449 | + if ($password && $password == $str) { |
|
| 1450 | 1450 | return true; |
| 1451 | - }else{ |
|
| 1451 | + } else { |
|
| 1452 | 1452 | return false; |
| 1453 | 1453 | } |
| 1454 | - }else{ |
|
| 1454 | + } else { |
|
| 1455 | 1455 | return false; |
| 1456 | 1456 | } |
| 1457 | 1457 | } |
| 1458 | - public function did_account_checking($str){ |
|
| 1459 | - $post_array=$this->CI->input->post(); |
|
| 1460 | - if($str > 0){ |
|
| 1461 | - $this->CI->db->where("id",$str); |
|
| 1458 | + public function did_account_checking($str) { |
|
| 1459 | + $post_array = $this->CI->input->post(); |
|
| 1460 | + if ($str > 0) { |
|
| 1461 | + $this->CI->db->where("id", $str); |
|
| 1462 | 1462 | $this->CI->db->select('posttoexternal,balance,credit_limit'); |
| 1463 | - $acc_result=$this->CI->db->get('accounts'); |
|
| 1464 | - $customer_info=(array)$acc_result->first_row(); |
|
| 1463 | + $acc_result = $this->CI->db->get('accounts'); |
|
| 1464 | + $customer_info = (array)$acc_result->first_row(); |
|
| 1465 | 1465 | $available_bal = ($customer_info["balance"]) + $customer_info["posttoexternal"] * ($customer_info["credit_limit"]); |
| 1466 | - if($available_bal >= $post_array['setup']){ |
|
| 1466 | + if ($available_bal >= $post_array['setup']) { |
|
| 1467 | 1467 | return TRUE; |
| 1468 | - }else{ |
|
| 1468 | + } else { |
|
| 1469 | 1469 | return FALSE; |
| 1470 | 1470 | } |
| 1471 | - }else{ |
|
| 1471 | + } else { |
|
| 1472 | 1472 | return TRUE; |
| 1473 | 1473 | } |
| 1474 | 1474 | } |