@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | $this->db->where_in('accountid',$acc_arr); |
| 51 | 51 | if($flag){ |
| 52 | 52 | $this->db->select('*'); |
| 53 | - } |
|
| 54 | - else{ |
|
| 53 | + } else{ |
|
| 55 | 54 | $this->db->select('count(id) as count'); |
| 56 | 55 | } |
| 57 | 56 | if($flag){ |
@@ -63,21 +62,20 @@ discard block |
||
| 63 | 62 | //echo $this->db->last_query();exit; |
| 64 | 63 | if($flag){ |
| 65 | 64 | return $result; |
| 66 | - }else{ |
|
| 65 | + } else{ |
|
| 67 | 66 | $result=$result->result_array(); |
| 68 | 67 | return $result[0]['count']; |
| 69 | 68 | } |
| 70 | - }else{ |
|
| 69 | + } else{ |
|
| 71 | 70 | if($flag){ |
| 72 | 71 | $query=(object)array('num_rows'=>0); |
| 73 | - } |
|
| 74 | - else{ |
|
| 72 | + } else{ |
|
| 75 | 73 | $query=0; |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | 76 | return $query; |
| 79 | 77 | } |
| 80 | - }else{ |
|
| 78 | + } else{ |
|
| 81 | 79 | |
| 82 | 80 | if($result->num_rows() >0){ |
| 83 | 81 | /**** |
@@ -93,8 +91,7 @@ discard block |
||
| 93 | 91 | |
| 94 | 92 | if($flag){ |
| 95 | 93 | $this->db->select('*'); |
| 96 | - } |
|
| 97 | - else{ |
|
| 94 | + } else{ |
|
| 98 | 95 | $this->db->select('count(id) as count'); |
| 99 | 96 | } |
| 100 | 97 | if($flag){ |
@@ -107,18 +104,17 @@ discard block |
||
| 107 | 104 | if($flag){ |
| 108 | 105 | |
| 109 | 106 | return $result; |
| 110 | - }else{ |
|
| 107 | + } else{ |
|
| 111 | 108 | $result=$result->result_array(); |
| 112 | 109 | |
| 113 | 110 | return $result[0]['count']; |
| 114 | 111 | } |
| 115 | - }else{ |
|
| 112 | + } else{ |
|
| 116 | 113 | if($flag){ |
| 117 | 114 | |
| 118 | 115 | $query=(object)array('num_rows'=>0); |
| 119 | 116 | // echo '<pre>'; print_r($query); |
| 120 | - } |
|
| 121 | - else{ |
|
| 117 | + } else{ |
|
| 122 | 118 | $query=0; |
| 123 | 119 | } |
| 124 | 120 | return $query; |
@@ -193,7 +189,7 @@ discard block |
||
| 193 | 189 | if ($logintype == 1 || $logintype == 5) { |
| 194 | 190 | |
| 195 | 191 | $where = array("accountid" => $this->session->userdata["accountinfo"]['id']); |
| 196 | - }else{ |
|
| 192 | + } else{ |
|
| 197 | 193 | $where=array('id'=> $accountid); |
| 198 | 194 | } |
| 199 | 195 | $query = $this->db_model->getSelect("*","invoice_conf",$where); |
@@ -37,8 +37,9 @@ discard block |
||
| 37 | 37 | $this->load->library('fpdf'); |
| 38 | 38 | $this->load->library('pdf'); |
| 39 | 39 | |
| 40 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 41 | - redirect(base_url() . '/astpp/login'); |
|
| 40 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 41 | + redirect(base_url() . '/astpp/login'); |
|
| 42 | + } |
|
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | |
@@ -66,7 +67,7 @@ discard block |
||
| 66 | 67 | $result_query = $this->invoices_model->get_invoice_list(true,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 67 | 68 | if($logintype == -1){ |
| 68 | 69 | $currency_id = Common_model::$global_config['system_config']['base_currency']; |
| 69 | - }else{ |
|
| 70 | + } else{ |
|
| 70 | 71 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $login_info["currency_id"]); |
| 71 | 72 | $currency_id = $accountdata["currency_id"]; |
| 72 | 73 | } |
@@ -85,7 +86,7 @@ discard block |
||
| 85 | 86 | $duedate = strtotime($value['due_date']); |
| 86 | 87 | if($value['type'] == 'I'){ |
| 87 | 88 | $due_date =date("Y-m-d",$duedate); |
| 88 | - }else{ |
|
| 89 | + } else{ |
|
| 89 | 90 | $due_date=''; |
| 90 | 91 | } |
| 91 | 92 | $outstanding = $value['amount']; |
@@ -97,7 +98,7 @@ discard block |
||
| 97 | 98 | //echo '<pre>'; print_r($invoice_total_query); |
| 98 | 99 | if($value['type'] == 'I'){ |
| 99 | 100 | $outstanding -= $this->common->currency_decimal($invoice_total_query[0]['credit']); |
| 100 | - }else{ |
|
| 101 | + } else{ |
|
| 101 | 102 | $outstanding=''; |
| 102 | 103 | } |
| 103 | 104 | $last_payment_date = $invoice_total_query[0]['created_date']; |
@@ -105,10 +106,10 @@ discard block |
||
| 105 | 106 | if($last_payment_date ){ |
| 106 | 107 | $payment_date=strtotime( $last_payment_date); |
| 107 | 108 | $payment_last=date("Y-m-d",$payment_date); |
| 108 | - }else{ |
|
| 109 | + } else{ |
|
| 109 | 110 | $payment_last=''; |
| 110 | 111 | } |
| 111 | - }else{ |
|
| 112 | + } else{ |
|
| 112 | 113 | $payment_last=''; |
| 113 | 114 | } |
| 114 | 115 | |
@@ -119,7 +120,7 @@ discard block |
||
| 119 | 120 | $id=$accountinfo['id']; |
| 120 | 121 | if($accountinfo['type'] == 1){ |
| 121 | 122 | $query ="select sum(amount) as grand_total from invoices where reseller_id='$id'"; |
| 122 | - }else{ |
|
| 123 | + } else{ |
|
| 123 | 124 | $query ="select sum(amount) as grand_total from invoices where reseller_id='0'"; |
| 124 | 125 | } |
| 125 | 126 | $ext_query=$this->db->query($query); |
@@ -132,7 +133,7 @@ discard block |
||
| 132 | 133 | |
| 133 | 134 | if($accountinfo['type'] == 1){ |
| 134 | 135 | $invoice_query ="select sum(credit) as grand_credit from invoice_details where reseller_id='$id'"; |
| 135 | - }else{ |
|
| 136 | + } else{ |
|
| 136 | 137 | $invoice_query ="select sum(credit) as grand_credit from invoice_details where reseller_id='0'"; |
| 137 | 138 | } |
| 138 | 139 | $credit_query=$this->db->query($invoice_query); |
@@ -147,28 +148,28 @@ discard block |
||
| 147 | 148 | if($value['confirm'] ==0){ |
| 148 | 149 | if($value['generate_type'] ==1){ |
| 149 | 150 | $payment = '<a href="'. base_url() .'invoices/invoice_manually_edit/' . $value['id'] . '" class="btn btn-royelblue btn-sm" title="Edit"><i class="fa fa-pencil-square-o fa-fw"></i></a>'; |
| 150 | - }else{ |
|
| 151 | + } else{ |
|
| 151 | 152 | $payment = '<a href="'. base_url() .'invoices/invoice_automatically_edit/' . $value['id'] . '" class="btn btn-royelblue btn-sm" title="Edit"><i class="fa fa-pencil-square-o fa-fw"></i></a>'; |
| 152 | 153 | } |
| 153 | 154 | $id=$value['id']; |
| 154 | 155 | $delete_button="<a onclick='invoice_delete($id)' class='btn btn-royelblue btn-sm' title='Delete' ><i class='fa fa-trash fa-fw'></i></a> "; |
| 155 | 156 | |
| 156 | - }else{ |
|
| 157 | + } else{ |
|
| 157 | 158 | if($outstanding > 0){ |
| 158 | 159 | $payment = '<a style="padding: 0 8px;" href="'. base_url() .'invoices/invoice_summary/' . $value['id'] . '" class="btn btn-warning" title="Payment">Unpaid</i></a>'; |
| 159 | - }else{ |
|
| 160 | + } else{ |
|
| 160 | 161 | $payment = '<button style="padding: 0 17px;" type="button" class="btn btn-success">Paid</button>'; |
| 161 | 162 | } |
| 162 | 163 | $delete_button=" "; |
| 163 | 164 | } |
| 164 | - }else{ |
|
| 165 | + } else{ |
|
| 165 | 166 | $payment = ''; |
| 166 | 167 | } |
| 167 | 168 | $account_arr = $this->db_model->getSelect('first_name,number,last_name','accounts', array('id'=>$value['accountid'])); |
| 168 | 169 | $account_array = $account_arr->result_array(); |
| 169 | 170 | if($value['generate_type'] == 1){ |
| 170 | 171 | $invoice_type='Manually'; |
| 171 | - }else{ |
|
| 172 | + } else{ |
|
| 172 | 173 | $invoice_type='Automatically'; |
| 173 | 174 | } |
| 174 | 175 | if($value['deleted'] == 1){ |
@@ -236,7 +237,7 @@ discard block |
||
| 236 | 237 | if($value['item_type'] == 'TAX'){ |
| 237 | 238 | $data['total_tax_dis'][$taxi]=$value['debit']; |
| 238 | 239 | $taxi++; |
| 239 | - }else{ |
|
| 240 | + } else{ |
|
| 240 | 241 | if($i >= 5){ |
| 241 | 242 | $data['row_count']=$i+1; |
| 242 | 243 | } |
@@ -285,7 +286,7 @@ discard block |
||
| 285 | 286 | if($system_config["paypal_mode"]==0){ |
| 286 | 287 | $data["paypal_url"] = $system_config["paypal_url"]; |
| 287 | 288 | $data["paypal_email_id"] = $system_config["paypal_id"]; |
| 288 | - }else{ |
|
| 289 | + } else{ |
|
| 289 | 290 | $data["paypal_url"] = $system_config["paypal_sandbox_url"]; |
| 290 | 291 | $data["paypal_email_id"] = $system_config["paypal_sandbox_id"]; |
| 291 | 292 | } |
@@ -419,7 +420,7 @@ discard block |
||
| 419 | 420 | if($system_config["paypal_mode"]==0){ |
| 420 | 421 | $data["paypal_url"] = $system_config["paypal_url"]; |
| 421 | 422 | $data["paypal_email_id"] = $system_config["paypal_id"]; |
| 422 | - }else{ |
|
| 423 | + } else{ |
|
| 423 | 424 | $data["paypal_url"] = $system_config["paypal_sandbox_url"]; |
| 424 | 425 | $data["paypal_email_id"] = $system_config["paypal_sandbox_id"]; |
| 425 | 426 | } |
@@ -432,10 +433,10 @@ discard block |
||
| 432 | 433 | if($account_data['type'] == -1){ |
| 433 | 434 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 434 | 435 | $data["to_currency"] = $accountdata["currency_id"]; |
| 435 | - }elseif($account_data['type'] == 1){ |
|
| 436 | + } elseif($account_data['type'] == 1){ |
|
| 436 | 437 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 437 | 438 | $data["to_currency"] = $accountdata["currency_id"]; |
| 438 | - }else{ |
|
| 439 | + } else{ |
|
| 439 | 440 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 440 | 441 | $data["to_currency"] = $accountdata["currency_id"]; |
| 441 | 442 | } |
@@ -739,7 +740,7 @@ discard block |
||
| 739 | 740 | if($system_config["paypal_mode"]==0){ |
| 740 | 741 | $data["paypal_url"] = $system_config["paypal_url"]; |
| 741 | 742 | $data["paypal_email_id"] = $system_config["paypal_id"]; |
| 742 | - }else{ |
|
| 743 | + } else{ |
|
| 743 | 744 | $data["paypal_url"] = $system_config["paypal_sandbox_url"]; |
| 744 | 745 | $data["paypal_email_id"] = $system_config["paypal_sandbox_id"]; |
| 745 | 746 | } |
@@ -751,10 +752,10 @@ discard block |
||
| 751 | 752 | if($account_data['type'] == -1){ |
| 752 | 753 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 753 | 754 | $data["to_currency"] = $accountdata["currency_id"]; |
| 754 | - }elseif($account_data['type'] == 1){ |
|
| 755 | + } elseif($account_data['type'] == 1){ |
|
| 755 | 756 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 756 | 757 | $data["to_currency"] = $accountdata["currency_id"]; |
| 757 | - }else{ |
|
| 758 | + } else{ |
|
| 758 | 759 | $accountdata["currency_id"] = $this->common->get_field_name('currency', 'currency', $account_data["currency_id"]); |
| 759 | 760 | $data["to_currency"] = $accountdata["currency_id"]; |
| 760 | 761 | } |
@@ -778,13 +779,13 @@ discard block |
||
| 778 | 779 | $data['notify_url'] = base_url() . "invoices/invoice_list_get_data/"; |
| 779 | 780 | if($account_data['type'] =='1'){ |
| 780 | 781 | $data['response_url'] = base_url() . "invoices/invoice_list_responce/"; |
| 781 | - }else{ |
|
| 782 | + } else{ |
|
| 782 | 783 | $data['response_url'] = base_url() . "user/user_list_responce/"; |
| 783 | 784 | } |
| 784 | 785 | $data['sucess_url'] = base_url() . "invoices/invoice_list_sucess/"; |
| 785 | 786 | } |
| 786 | 787 | |
| 787 | - }else{ |
|
| 788 | + } else{ |
|
| 788 | 789 | |
| 789 | 790 | redirect(base_url() . 'dashboard/'); |
| 790 | 791 | } |
@@ -847,7 +848,7 @@ discard block |
||
| 847 | 848 | $data = array('status' => '0'); |
| 848 | 849 | $this->db->update("invoices", $data); |
| 849 | 850 | // echo $this->db->last_query(); exit; |
| 850 | - }else{ |
|
| 851 | + } else{ |
|
| 851 | 852 | $this->db->where("id", $invoice_id); |
| 852 | 853 | $data = array('status' => '2'); |
| 853 | 854 | $this->db->update("invoices", $data); |
@@ -894,7 +895,7 @@ discard block |
||
| 894 | 895 | ); // echo '<pre>'; print_r( $tax_array); exit; |
| 895 | 896 | $this->db->insert("invoice_details",$tax_array); |
| 896 | 897 | |
| 897 | - }else{ |
|
| 898 | + } else{ |
|
| 898 | 899 | |
| 899 | 900 | // echo 'else'; exit; |
| 900 | 901 | $actual_amount=$debit-$amount; |
@@ -902,11 +903,11 @@ discard block |
||
| 902 | 903 | |
| 903 | 904 | $this->db->insert("invoice_details",$tax_array); |
| 904 | 905 | } |
| 905 | - }else{ |
|
| 906 | + } else{ |
|
| 906 | 907 | if($logintype = 0){ |
| 907 | 908 | $this->session->set_flashdata('astpp_notification', 'Invoice payment amount should be higher then the invoice amount.'); |
| 908 | 909 | redirect(base_url().'user/user_invoice_payment/'.$invoice_id); |
| 909 | - }else{ |
|
| 910 | + } else{ |
|
| 910 | 911 | $this->session->set_flashdata('astpp_notification', 'Invoice payment amount should be higher then the invoice amount.'); |
| 911 | 912 | redirect(base_url().'invoices/invoice_summary/'.$invoice_id); |
| 912 | 913 | } |
@@ -928,7 +929,7 @@ discard block |
||
| 928 | 929 | if($logintype = '1'){ |
| 929 | 930 | $this->session->set_flashdata('astpp_errormsg', 'Invoice payment done successfully!'); |
| 930 | 931 | redirect(base_url() . 'invoices/invoice_list/'); |
| 931 | - }else{ |
|
| 932 | + } else{ |
|
| 932 | 933 | $this->session->set_flashdata('astpp_errormsg', 'Invoice payment done successfully!'); |
| 933 | 934 | redirect(base_url() . 'user/user_invoices_list/'); |
| 934 | 935 | } |
@@ -969,7 +970,7 @@ discard block |
||
| 969 | 970 | $data = array('status' => '0'); |
| 970 | 971 | $this->db->update("invoices", $data); |
| 971 | 972 | // echo $this->db->last_query(); exit; |
| 972 | - }else{ |
|
| 973 | + } else{ |
|
| 973 | 974 | $this->db->where("id", $invoice_id); |
| 974 | 975 | $data = array('status' => '2'); |
| 975 | 976 | $this->db->update("invoices", $data); |
@@ -988,7 +989,7 @@ discard block |
||
| 988 | 989 | $this->db->insert("invoice_details",$tax_array); |
| 989 | 990 | |
| 990 | 991 | |
| 991 | - }else{ |
|
| 992 | + } else{ |
|
| 992 | 993 | |
| 993 | 994 | $this->session->set_flashdata('astpp_notification', 'Invoice payment amount should be higher then the invoice amount.'); |
| 994 | 995 | redirect(base_url().'invoices/invoice_summary/'.$invoice_id); |
@@ -1136,7 +1137,7 @@ discard block |
||
| 1136 | 1137 | if($last_payment_date ){ |
| 1137 | 1138 | $payment_date=strtotime( $last_payment_date); |
| 1138 | 1139 | $payment_last=date("d/m/Y",$payment_date); |
| 1139 | - }else{ |
|
| 1140 | + } else{ |
|
| 1140 | 1141 | $payment_last=''; |
| 1141 | 1142 | } |
| 1142 | 1143 | |
@@ -1169,10 +1170,10 @@ discard block |
||
| 1169 | 1170 | if($value['type'] == 'R'){ |
| 1170 | 1171 | $payment =''; |
| 1171 | 1172 | $outstanding=0; |
| 1172 | - }else{ |
|
| 1173 | + } else{ |
|
| 1173 | 1174 | if($outstanding > 0){ |
| 1174 | 1175 | $payment = '<a style="padding: 0 8px;" href="'. base_url() .'invoices/invoice_summary/' . $value['id'] . '" class="btn btn-warning" title="Payment">Unpaid</i></a>'; |
| 1175 | - }else{ |
|
| 1176 | + } else{ |
|
| 1176 | 1177 | $payment = ' <button style="padding: 0 8px;" type="button" class="btn btn-success">Paid</button>'; |
| 1177 | 1178 | } |
| 1178 | 1179 | } |
@@ -1244,7 +1245,7 @@ discard block |
||
| 1244 | 1245 | if($last_payment_date ){ |
| 1245 | 1246 | $payment_date=strtotime( $last_payment_date); |
| 1246 | 1247 | $payment_last=date("d/m/Y",$payment_date); |
| 1247 | - }else{ |
|
| 1248 | + } else{ |
|
| 1248 | 1249 | $payment_last=''; |
| 1249 | 1250 | } |
| 1250 | 1251 | |
@@ -1277,7 +1278,7 @@ discard block |
||
| 1277 | 1278 | $download='<a href="'. base_url() .'/user/user_invoice_download/' . $value['id'].'/00'.$value['invoice_prefix'].$value['invoiceid'].'" class="btn btn-royelblue btn-sm" title="Download Invoice" ><i class="fa fa-cloud-download fa-fw"></i></a> '; |
| 1278 | 1279 | if($outstanding > 0){ |
| 1279 | 1280 | $payment = ' <a style="padding: 0 8px;" href="'. base_url() .'user/user_invoice_payment/' . $value['id'] . '" class="btn btn-warning" title="Payment">Unpaid</a>'; |
| 1280 | -}else{ |
|
| 1281 | +} else{ |
|
| 1281 | 1282 | |
| 1282 | 1283 | $payment = ' <button style="padding: 0 8px;" class="btn btn-success" type="button">Paid</button>'; |
| 1283 | 1284 | } $account_arr = $this->db_model->getSelect('first_name,number,last_name','accounts', array('id'=>$value['accountid'])); |
@@ -1384,7 +1385,7 @@ discard block |
||
| 1384 | 1385 | if($type=='R'){ |
| 1385 | 1386 | $this->receipt_download($invoiceid); |
| 1386 | 1387 | } |
| 1387 | - }else{ |
|
| 1388 | + } else{ |
|
| 1388 | 1389 | redirect(base_url() . 'invoices/invoice_list/'); |
| 1389 | 1390 | } |
| 1390 | 1391 | } |
@@ -1410,7 +1411,7 @@ discard block |
||
| 1410 | 1411 | if( $to_date > $feture_date){ |
| 1411 | 1412 | $this->session->set_flashdata('astpp_notification', 'To date should not be greater than current date.'); |
| 1412 | 1413 | redirect(base_url()."invoices/invoice_list/"); |
| 1413 | - }else{ |
|
| 1414 | + } else{ |
|
| 1414 | 1415 | $todate=$data['todate'].' '.'23:59:59'; |
| 1415 | 1416 | $from_date=$data['fromdate'].' '.'00:00:01'; |
| 1416 | 1417 | $accountid=$data['accountid']; |
@@ -1440,18 +1441,18 @@ discard block |
||
| 1440 | 1441 | $last_invoice_ID = $this->get_invoice_date("invoiceid"); |
| 1441 | 1442 | if($last_invoice_ID && $last_invoice_ID > 0){ |
| 1442 | 1443 | $last_invoice_ID = ($last_invoice_ID+1); |
| 1443 | - }else{ |
|
| 1444 | + } else{ |
|
| 1444 | 1445 | $last_invoice_ID = $invoice_conf['invoice_start_from']; |
| 1445 | 1446 | } |
| 1446 | 1447 | $last_invoice_ID =str_pad($last_invoice_ID,(strlen($last_invoice_ID)+4),'0',STR_PAD_LEFT); |
| 1447 | 1448 | if($accountdata['posttoexternal'] == 1){ |
| 1448 | 1449 | $balance = ($accountdata['credit_limit']-$accountdata['balance']); |
| 1449 | - }else{ |
|
| 1450 | + } else{ |
|
| 1450 | 1451 | $balance = $accountdata['balance']; |
| 1451 | 1452 | } |
| 1452 | 1453 | if($accountdata['invoice_interval'] > 0){ |
| 1453 | 1454 | $due_date = gmdate("Y-m-d H:i:s",strtotime(gmdate("Y-m-d H:i:s")." +".$accountdata['invoice_interval']." days")); |
| 1454 | - }else{ |
|
| 1455 | + } else{ |
|
| 1455 | 1456 | $due_date = gmdate("Y-m-d H:i:s",strtotime(gmdate("Y-m-d H:i:s")." +7 days")); |
| 1456 | 1457 | } |
| 1457 | 1458 | $invoice_data = array("accountid"=>$accountdata['id'],"invoice_prefix" =>$invoice_conf['invoice_prefix'],"invoiceid"=>$last_invoice_ID,"reseller_id"=> |
@@ -1585,13 +1586,13 @@ discard block |
||
| 1585 | 1586 | $data['description']=$value['description']; |
| 1586 | 1587 | if($value['item_type'] == 'Refill'){ |
| 1587 | 1588 | $data['debit']=$value['credit']; |
| 1588 | - }else{ |
|
| 1589 | + } else{ |
|
| 1589 | 1590 | $data['debit']=$value['debit']; |
| 1590 | 1591 | } |
| 1591 | 1592 | $created_date=$value['created_date']; |
| 1592 | 1593 | $invoicedata['invoiceid']=$value['invoiceid']; |
| 1593 | 1594 | } |
| 1594 | - }else{ |
|
| 1595 | + } else{ |
|
| 1595 | 1596 | $query="select item_type,description,created_date,invoiceid,debit,credit from invoice_details where invoiceid = ".$invoiceid." And item_type='SUBCHRG' Group By item_type"; |
| 1596 | 1597 | $invoice_total_query=$this->db->query($query); |
| 1597 | 1598 | if($invoice_total_query ->num_rows() > 0) { |
@@ -1611,15 +1612,16 @@ discard block |
||
| 1611 | 1612 | } |
| 1612 | 1613 | $data['accountinfo'] = $accountdata; |
| 1613 | 1614 | //Get invoice header information |
| 1614 | - if($accountdata['reseller_id']=='0') |
|
| 1615 | - $accountid = '1'; |
|
| 1616 | - else |
|
| 1617 | - $accountid = $accountdata['reseller_id']; |
|
| 1615 | + if($accountdata['reseller_id']=='0') { |
|
| 1616 | + $accountid = '1'; |
|
| 1617 | + } else { |
|
| 1618 | + $accountid = $accountdata['reseller_id']; |
|
| 1619 | + } |
|
| 1618 | 1620 | $invoiceconf = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> $accountid)); |
| 1619 | 1621 | $invoiceconf = $invoiceconf->result_array(); |
| 1620 | 1622 | if(!empty($invoiceconf)){ |
| 1621 | 1623 | $data['invoiceconf'] = $invoiceconf[0]; |
| 1622 | - }else{ |
|
| 1624 | + } else{ |
|
| 1623 | 1625 | $invoiceconf = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> "1")); |
| 1624 | 1626 | $invoiceconf = $invoiceconf->result_array(); |
| 1625 | 1627 | $data['invoiceconf'] = $invoiceconf[0]; |
@@ -1630,20 +1632,26 @@ discard block |
||
| 1630 | 1632 | // echo '<pre>'; print_r($accountdata); exit; |
| 1631 | 1633 | //FOR the Customer Address |
| 1632 | 1634 | $customer_address="<div style='font-size:12px;' >"; |
| 1633 | - if ( $accountdata['company_name'] != "") |
|
| 1634 | - $customer_address .= $accountdata['company_name'] . "<br/>"; |
|
| 1635 | - if ( $accountdata['address_1'] != "") |
|
| 1636 | - $customer_address .= $accountdata['address_1'] . "," .$accountdata['address_2'] .",". "<br/>"; |
|
| 1637 | - if ( $accountdata['city'] != "") |
|
| 1638 | - $customer_address .= $accountdata['city'] . "<br/>"; |
|
| 1639 | - if ( $accountdata['province'] != "") |
|
| 1640 | - $customer_address .= $accountdata['province']."<br/>"; |
|
| 1641 | - if ( $accountdata['country_id'] != "") |
|
| 1642 | - $customer_address .= $this->common->get_field_name('country', 'countrycode', $accountdata['country_id'])."<br/>"; |
|
| 1643 | - if ( $accountdata['postal_code'] != "") |
|
| 1644 | - $customer_address .= "Pincode - " . $accountdata['postal_code'] . "<br/>"; |
|
| 1645 | - else |
|
| 1646 | - $customer_address .= "\n"; |
|
| 1635 | + if ( $accountdata['company_name'] != "") { |
|
| 1636 | + $customer_address .= $accountdata['company_name'] . "<br/>"; |
|
| 1637 | + } |
|
| 1638 | + if ( $accountdata['address_1'] != "") { |
|
| 1639 | + $customer_address .= $accountdata['address_1'] . "," .$accountdata['address_2'] .",". "<br/>"; |
|
| 1640 | + } |
|
| 1641 | + if ( $accountdata['city'] != "") { |
|
| 1642 | + $customer_address .= $accountdata['city'] . "<br/>"; |
|
| 1643 | + } |
|
| 1644 | + if ( $accountdata['province'] != "") { |
|
| 1645 | + $customer_address .= $accountdata['province']."<br/>"; |
|
| 1646 | + } |
|
| 1647 | + if ( $accountdata['country_id'] != "") { |
|
| 1648 | + $customer_address .= $this->common->get_field_name('country', 'countrycode', $accountdata['country_id'])."<br/>"; |
|
| 1649 | + } |
|
| 1650 | + if ( $accountdata['postal_code'] != "") { |
|
| 1651 | + $customer_address .= "Pincode - " . $accountdata['postal_code'] . "<br/>"; |
|
| 1652 | + } else { |
|
| 1653 | + $customer_address .= "\n"; |
|
| 1654 | + } |
|
| 1647 | 1655 | // $customer_address .= "Date of Invoice: " .date('d/m/Y', strtotime($invoicedata['invoice_date']))."<br/>"; |
| 1648 | 1656 | $customer_address .= "</div>"; |
| 1649 | 1657 | |
@@ -1657,7 +1665,7 @@ discard block |
||
| 1657 | 1665 | if($logo != ''){ |
| 1658 | 1666 | $src=$path; |
| 1659 | 1667 | $logo = "<img style='height:50px; width:180px; margin-left:70px;' alt='logo' src='".$src."'>"; |
| 1660 | - }else{ |
|
| 1668 | + } else{ |
|
| 1661 | 1669 | $path = getcwd()."/assets/images/logo.png"; |
| 1662 | 1670 | $src=$path; |
| 1663 | 1671 | $logo = "<img style='height:50px; width:180px; margin-left:70px;' alt='logo' src='".$src."'>"; |
@@ -1753,8 +1761,7 @@ discard block |
||
| 1753 | 1761 | if($to_currency->num_rows() > 0){ |
| 1754 | 1762 | $to_currency_arr = $to_currency->result_array(); |
| 1755 | 1763 | $to_currency = $to_currency_arr[0]["currencyrate"]; |
| 1756 | - } |
|
| 1757 | - else{ |
|
| 1764 | + } else{ |
|
| 1758 | 1765 | $to_currency= $from_currency; |
| 1759 | 1766 | } |
| 1760 | 1767 | |
@@ -1773,8 +1780,9 @@ discard block |
||
| 1773 | 1780 | function date_diff_custom($end='2020-06-09 10:30:00', $out_in_array=false){ |
| 1774 | 1781 | $intervalo = date_diff(date_create(), date_create($end)); |
| 1775 | 1782 | $out = $intervalo->format("Years:%Y,Months:%M,Days:%d,Hours:%H,Minutes:%i,Seconds:%s"); |
| 1776 | - if(!$out_in_array) |
|
| 1777 | - return $out; |
|
| 1783 | + if(!$out_in_array) { |
|
| 1784 | + return $out; |
|
| 1785 | + } |
|
| 1778 | 1786 | $a_out = array(); |
| 1779 | 1787 | array_walk(explode(',',$out), |
| 1780 | 1788 | function($val,$key) use(&$a_out){ |
@@ -1833,7 +1841,7 @@ discard block |
||
| 1833 | 1841 | $tax_value=$tax_value[0]; |
| 1834 | 1842 | if($tax_value["taxes_priority"] == ""){ |
| 1835 | 1843 | $tax_priority = $tax_value["taxes_priority"]; |
| 1836 | - }else if($tax_value["taxes_priority"] > $tax_priority){ |
|
| 1844 | + } else if($tax_value["taxes_priority"] > $tax_priority){ |
|
| 1837 | 1845 | $query = $this->db_model->getSelect("SUM(value) as total", "invoices_total", array("invoiceid"=> $invoiceid)); |
| 1838 | 1846 | $query = $query->result_array(); |
| 1839 | 1847 | $sub_total = $query["0"]["total"]; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if(!empty($invoiceconf)){
|
| 130 | 130 | if($invoiceconf['logo'] != ''){
|
| 131 | 131 | $logo=$invoiceconf['file']; |
| 132 | - }else{
|
|
| 132 | + } else{
|
|
| 133 | 133 | $logo=$invoiceconf['logo']; |
| 134 | 134 | } |
| 135 | 135 | $accountid=$invoiceconf['accountid']; |
@@ -137,13 +137,13 @@ discard block |
||
| 137 | 137 | $file_name= base_url()."upload/$logo"; |
| 138 | 138 | $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', '');
|
| 139 | 139 | $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number');
|
| 140 | - }else{
|
|
| 140 | + } else{
|
|
| 141 | 141 | $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', '');
|
| 142 | 142 | $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number');
|
| 143 | 143 | // $image_path=array(); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - }else{
|
|
| 146 | + } else{
|
|
| 147 | 147 | $logo = ''; |
| 148 | 148 | $file_name = ''; |
| 149 | 149 | $accountid=0; |
@@ -298,7 +298,7 @@ |
||
| 298 | 298 | </td> |
| 299 | 299 | </tr> |
| 300 | 300 | </table> |
| 301 | -<?php }elseif ($logintype == 1) {?> |
|
| 301 | +<?php } elseif ($logintype == 1) {?> |
|
| 302 | 302 | <table class="invoice_table1 pull-right"> |
| 303 | 303 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
| 304 | 304 | <tr> |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | $_doctypes = array( |
| 4 | 6 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | $_doctypes = array( |
| 4 | 6 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | $_doctypes = array( |
| 4 | 6 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('BASEPATH')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | $_doctypes = array( |
| 4 | 6 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -11,21 +11,24 @@ discard block |
||
| 11 | 11 | define('CRON_BETA_MODE', $config['CRON_BETA_MODE']); |
| 12 | 12 | |
| 13 | 13 | // Set index.php location |
| 14 | -if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) |
|
| 14 | +if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) { |
|
| 15 | 15 | define('CRON_CI_INDEX', $config['CRON_CI_INDEX']); |
| 16 | -else |
|
| 16 | +} else { |
|
| 17 | 17 | define('CRON_CI_INDEX', '../index.php'); |
| 18 | +} |
|
| 18 | 19 | |
| 19 | -if (count($argv) <= 2) |
|
| 20 | +if (count($argv) <= 2) { |
|
| 20 | 21 | if (count($config['argv'])) { |
| 21 | 22 | $path = $argv[1]; |
| 23 | +} |
|
| 22 | 24 | unset($argv[1]); |
| 23 | 25 | // $argv = array_merge($argv, $config["argv"][$path]); |
| 24 | 26 | $argv[0] = $argv[0]; |
| 25 | 27 | $argv[1] =$config["argv"][$path]; |
| 26 | 28 | $_SERVER['argv'] = $argv; |
| 27 | - } else |
|
| 28 | - die('Use: php cron.php controller/method'); |
|
| 29 | + } else { |
|
| 30 | + die('Use: php cron.php controller/method'); |
|
| 31 | + } |
|
| 29 | 32 | |
| 30 | 33 | // Simulate an HTTP request |
| 31 | 34 | $_SERVER['PATH_INFO'] = $argv[1]; |
@@ -44,10 +47,13 @@ discard block |
||
| 44 | 47 | require( CRON_CI_INDEX ); // main CI index.php file |
| 45 | 48 | $output = ob_get_contents(); |
| 46 | 49 | |
| 47 | -if (CRON_FLUSH_BUFFERS === TRUE) |
|
| 48 | - while (@ob_end_flush()); // display buffer contents |
|
| 49 | - else |
|
| 50 | - ob_end_clean(); |
|
| 50 | +if (CRON_FLUSH_BUFFERS === TRUE) { |
|
| 51 | + while (@ob_end_flush()); |
|
| 52 | +} |
|
| 53 | +// display buffer contents |
|
| 54 | + else { |
|
| 55 | + ob_end_clean(); |
|
| 56 | + } |
|
| 51 | 57 | |
| 52 | 58 | echo "\n"; |
| 53 | 59 | ?> |