@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | function index() { |
39 | - if ($this->session->userdata('user_login') == FALSE) |
|
40 | - redirect(base_url() . 'login/login'); |
|
39 | + if ($this->session->userdata('user_login') == FALSE) { |
|
40 | + redirect(base_url() . 'login/login'); |
|
41 | + } |
|
41 | 42 | $data['page_title'] = 'Dashboard'; |
42 | 43 | $this->load->view('view_user_dashboard', $data); |
43 | 44 | } |
@@ -266,7 +267,7 @@ discard block |
||
266 | 267 | $this->session->set_flashdata('astpp_notification', 'Insuffiecient fund to purchase this did'); |
267 | 268 | redirect(base_url() . "user/user_didlist/"); |
268 | 269 | } |
269 | - }else{ |
|
270 | + } else{ |
|
270 | 271 | $this->session->set_flashdata('astpp_notification', 'This DID already purchased by someone.'); |
271 | 272 | redirect(base_url() . "user/user_didlist/"); |
272 | 273 | } |
@@ -298,7 +299,7 @@ discard block |
||
298 | 299 | $this->session->set_flashdata('astpp_notification', 'DID Removed Successfully.'); |
299 | 300 | redirect(base_url() . "user/user_didlist/"); |
300 | 301 | } |
301 | - }else{ |
|
302 | + } else{ |
|
302 | 303 | $this->session->set_flashdata('astpp_notification', 'DID not found.'); |
303 | 304 | redirect(base_url() . "user/user_didlist/"); |
304 | 305 | } |
@@ -355,8 +356,9 @@ discard block |
||
355 | 356 | $markup = $this->common->get_field_name('markup', 'pricelists', array('id'=>$account_data["pricelist_id"])); |
356 | 357 | $markup = ($markup > 0)?$markup:1; |
357 | 358 | $action['cost']['cost'] = $this->common_model->add_calculate_currency($action['cost']['cost'], "", '', true, false); |
358 | - if($account_data['type']!=3) |
|
359 | - $action['cost']['cost']=($action['cost']['cost'] - ($action['cost']['cost']*$markup)/100); |
|
359 | + if($account_data['type']!=3) { |
|
360 | + $action['cost']['cost']=($action['cost']['cost'] - ($action['cost']['cost']*$markup)/100); |
|
361 | + } |
|
360 | 362 | } |
361 | 363 | $this->session->set_userdata('user_rates_list_search', $action); |
362 | 364 | } |
@@ -695,7 +697,7 @@ discard block |
||
695 | 697 | $this->session->set_userdata('accountinfo', $result[0]); |
696 | 698 | $this->session->set_flashdata('astpp_errormsg',' Your profile updated successfully!'); |
697 | 699 | redirect(base_url() . 'user/user_myprofile/'); |
698 | - }else{ |
|
700 | + } else{ |
|
699 | 701 | $this->session->set_flashdata('astpp_notification', 'Something wrong.Please contact to administrator.'); |
700 | 702 | } |
701 | 703 | } |
@@ -729,7 +731,7 @@ discard block |
||
729 | 731 | $this->session->set_flashdata('astpp_errormsg', 'Password updated successfully!'); |
730 | 732 | redirect(base_url() . 'user/user_change_password/'); |
731 | 733 | } |
732 | - }else{ |
|
734 | + } else{ |
|
733 | 735 | $data_array['id']=$accountinfo['id']; |
734 | 736 | $data['form'] = $this->form->build_form($this->user_form->get_userprofile_change_password(),$data_array); |
735 | 737 | } |
@@ -745,7 +747,7 @@ discard block |
||
745 | 747 | $data['form_search'] = $this->form->build_serach_form($this->user_form->build_user_refill_report_search()); |
746 | 748 | if($accountinfo['type'] == 1){ |
747 | 749 | $this->load->view('view_reseller_refill_report', $data); |
748 | - }else{ |
|
750 | + } else{ |
|
749 | 751 | $this->load->view('view_user_refill_report', $data); |
750 | 752 | } |
751 | 753 | } |
@@ -829,19 +831,18 @@ discard block |
||
829 | 831 | } else { |
830 | 832 | $payment = ' <button style="padding: 0 8px;" class="btn btn-success" type="button">Paid</button>'; |
831 | 833 | } |
832 | - }else{ |
|
834 | + } else{ |
|
833 | 835 | $payment = ''; |
834 | 836 | } |
835 | 837 | if($value['generate_type'] == 1){ |
836 | 838 | $invoice_type='Manually'; |
837 | - }else{ |
|
839 | + } else{ |
|
838 | 840 | $invoice_type='Automatically'; |
839 | 841 | } |
840 | 842 | |
841 | 843 | if($value['type'] == 'R'){ |
842 | 844 | $icon = '<div class="flx_font flx_magenta">R</div>'; |
843 | - } |
|
844 | - else |
|
845 | + } else |
|
845 | 846 | { |
846 | 847 | $icon = '<div class="flx_font flx_drk_pink">I</div>'; |
847 | 848 | |
@@ -904,7 +905,7 @@ discard block |
||
904 | 905 | $amount = $this->input->post("value",true); |
905 | 906 | $amount = $this->common_model->add_calculate_currency($amount,"","",true,false); |
906 | 907 | echo number_format($amount,2); |
907 | - }else{ |
|
908 | + } else{ |
|
908 | 909 | $this->payment->index(); |
909 | 910 | } |
910 | 911 | } |
@@ -1092,7 +1093,7 @@ discard block |
||
1092 | 1093 | $this->db->where('reseller_pricing.note','dids.number',false); |
1093 | 1094 | $this->db->where('reseller_pricing.reseller_id',$accountinfo['reseller_id']); |
1094 | 1095 | $this->db->from('dids,reseller_pricing'); |
1095 | - }else{ |
|
1096 | + } else{ |
|
1096 | 1097 | $this->db->where('parent_id',0); |
1097 | 1098 | $this->db->where('accountid',0); |
1098 | 1099 | $this->db->select('id,number,setup,monthlycost'); |
@@ -1393,7 +1394,7 @@ discard block |
||
1393 | 1394 | ); |
1394 | 1395 | $this->db->insert("ani_map", $insert_arr); |
1395 | 1396 | $this->session->set_flashdata('astpp_errormsg', 'Add Caller ID Sucessfully!'); |
1396 | - }else{ |
|
1397 | + } else{ |
|
1397 | 1398 | $this->session->set_flashdata('astpp_notification', 'Please Enter Caller ID value.'); |
1398 | 1399 | } |
1399 | 1400 | } else { |
@@ -1538,7 +1539,7 @@ discard block |
||
1538 | 1539 | if($action=="GET_AMT"){ |
1539 | 1540 | $amount = $this->input->post("value",true); |
1540 | 1541 | $this->payment->convert_amount($amount); |
1541 | - }else{ |
|
1542 | + } else{ |
|
1542 | 1543 | $this->payment->index(); |
1543 | 1544 | } |
1544 | 1545 | } |
@@ -1573,34 +1574,25 @@ discard block |
||
1573 | 1574 | $minimum_fund=(array)$this->db->get_where('system',array("name"=>"minimum_fund_transfer"),1)->first_row(); |
1574 | 1575 | if ($post_array['toaccountid'] == $account_info['number']) { |
1575 | 1576 | $this->session->set_flashdata('astpp_notification', 'You can not transfer fund in same account.'); |
1576 | - } |
|
1577 | - elseif ($reseller_id != $account_info['reseller_id']) { |
|
1577 | + } elseif ($reseller_id != $account_info['reseller_id']) { |
|
1578 | 1578 | $this->session->set_flashdata('astpp_notification', 'You can only transfer fund in same level account.'); |
1579 | - } |
|
1580 | - elseif ($post_array['toaccountid'] == '') { |
|
1579 | + } elseif ($post_array['toaccountid'] == '') { |
|
1581 | 1580 | $this->session->set_flashdata('astpp_notification', 'Please enter To account number.'); |
1582 | - } |
|
1583 | - elseif (empty($post_array['credit'])) { |
|
1581 | + } elseif (empty($post_array['credit'])) { |
|
1584 | 1582 | $this->session->set_flashdata('astpp_notification', 'Please enter a amount.'); |
1585 | - } |
|
1586 | - elseif ($post_array['credit'] > $balance) { |
|
1583 | + } elseif ($post_array['credit'] > $balance) { |
|
1587 | 1584 | $this->session->set_flashdata('astpp_notification', 'You have insufficient balance.'); |
1588 | - } |
|
1589 | - elseif ($toid <= 0 || !isset($post_array['toaccountid'])) { |
|
1585 | + } elseif ($toid <= 0 || !isset($post_array['toaccountid'])) { |
|
1590 | 1586 | $this->session->set_flashdata('astpp_notification', 'Please enter valid account number.'); |
1591 | - } |
|
1592 | - elseif ($post_array['credit'] < 0) { |
|
1587 | + } elseif ($post_array['credit'] < 0) { |
|
1593 | 1588 | $this->session->set_flashdata('astpp_notification', 'Please enter amount greater then 0.'); |
1594 | - } |
|
1595 | - elseif ($minimum_fund['value'] >= $post_array['credit']) { |
|
1589 | + } elseif ($minimum_fund['value'] >= $post_array['credit']) { |
|
1596 | 1590 | $this->session->set_flashdata('astpp_notification', 'You need to enter minimum amount of fund transfer ' . $minimum_fund['value'] . ' .'); |
1597 | - } |
|
1598 | - elseif (!isset($toid) || !isset($post_array['toaccountid'])) { |
|
1591 | + } elseif (!isset($toid) || !isset($post_array['toaccountid'])) { |
|
1599 | 1592 | $this->session->set_flashdata('astpp_notification', 'Please enter valid account number!'); |
1600 | - } |
|
1601 | - elseif ($post_array['credit'] < 0 || $post_array['credit'] > $balance) { |
|
1593 | + } elseif ($post_array['credit'] < 0 || $post_array['credit'] > $balance) { |
|
1602 | 1594 | $this->session->set_flashdata('astpp_notification', 'Insuffiecient amount !'); |
1603 | - }else{ |
|
1595 | + } else{ |
|
1604 | 1596 | $from['id'] = $post_array['id']; |
1605 | 1597 | $from['account_currency'] = $post_array['account_currency']; |
1606 | 1598 | $from['accountid'] = $post_array['fromaccountid']; |
@@ -1635,7 +1627,7 @@ discard block |
||
1635 | 1627 | $this->session->set_flashdata('astpp_notification', 'Sorry We are not able to process this request.'); |
1636 | 1628 | } |
1637 | 1629 | } |
1638 | - }else{ |
|
1630 | + } else{ |
|
1639 | 1631 | $this->session->set_flashdata('astpp_notification', 'Account number not found.'); |
1640 | 1632 | } |
1641 | 1633 | } else { |
@@ -1727,7 +1719,7 @@ discard block |
||
1727 | 1719 | $this->user_model->user_opensips_edit($add_array, $add_array['id']); |
1728 | 1720 | echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!")); |
1729 | 1721 | exit; |
1730 | - }else{ |
|
1722 | + } else{ |
|
1731 | 1723 | echo json_encode($auth_flag); |
1732 | 1724 | exit; |
1733 | 1725 | } |
@@ -1744,7 +1736,7 @@ discard block |
||
1744 | 1736 | $this->user_model->user_opensips_add($add_array); |
1745 | 1737 | echo json_encode(array("SUCCESS"=> "OpenSips added successfully!")); |
1746 | 1738 | exit; |
1747 | - }else{ |
|
1739 | + } else{ |
|
1748 | 1740 | echo json_encode($auth_flag); |
1749 | 1741 | exit; |
1750 | 1742 | } |
@@ -1765,10 +1757,10 @@ discard block |
||
1765 | 1757 | $auth_flag = $auth_flag->num_rows(); |
1766 | 1758 | if($auth_flag == 0){ |
1767 | 1759 | return "TRUE"; |
1768 | - }else{ |
|
1760 | + } else{ |
|
1769 | 1761 | return array("username_error"=>"Duplicate Username Found.Username Must be Unique"); |
1770 | 1762 | } |
1771 | - }else{ |
|
1763 | + } else{ |
|
1772 | 1764 | return array("username_error"=>"User name is required field."); |
1773 | 1765 | } |
1774 | 1766 | return "0"; |
@@ -78,10 +78,11 @@ |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | function get_userprofile_form_fields($dataArr = false) { |
81 | - if ($dataArr['id'] > 0) |
|
82 | - $val = 'accounts.email.' . $dataArr['id']; |
|
83 | - else |
|
84 | - $val = 'accounts.email'; |
|
81 | + if ($dataArr['id'] > 0) { |
|
82 | + $val = 'accounts.email.' . $dataArr['id']; |
|
83 | + } else { |
|
84 | + $val = 'accounts.email'; |
|
85 | + } |
|
85 | 86 | $uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts'); |
86 | 87 | $password = $this->CI->common->generate_password(); |
87 | 88 | $logintype=$this->CI->session->userdata('logintype'); |
@@ -62,8 +62,9 @@ |
||
62 | 62 | $this->db->where('callstart >=',$start_date." 00:00:00"); |
63 | 63 | $this->db->where('callstart <=',$end_date." 23:59:59"); |
64 | 64 | $this->db->where('reseller_id',$parent_id); |
65 | - if($group_flag) |
|
66 | - $this->db->group_by("DAY(callstart)"); |
|
65 | + if($group_flag) { |
|
66 | + $this->db->group_by("DAY(callstart)"); |
|
67 | + } |
|
67 | 68 | $result=$this->db->get($table); |
68 | 69 | return $result; |
69 | 70 | } |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | |
38 | 38 | function index() |
39 | 39 | { |
40 | - if ($this->session->userdata('user_login') == FALSE) |
|
41 | - redirect(base_url() . 'login/login'); |
|
40 | + if ($this->session->userdata('user_login') == FALSE) { |
|
41 | + redirect(base_url() . 'login/login'); |
|
42 | + } |
|
42 | 43 | $data['page_title'] = 'Dashboard'; |
43 | 44 | if ($this->session->userdata('logintype') == 0) |
44 | 45 | { |
@@ -116,7 +117,7 @@ discard block |
||
116 | 117 | $acc_arr[$data['day']]['completed']= $data['completed']+$acc_arr[$data['day']]['completed']; |
117 | 118 | $acc_arr[$data['day']]['duration'] = $data['duration']+$acc_arr[$data['day']]['duration']; |
118 | 119 | $acc_arr[$data['day']]['mcd'] =$data['mcd'] > $acc_arr[$data['day']]['mcd'] ? $data['mcd']: $acc_arr[$data['day']]['mcd']; |
119 | - }else{ |
|
120 | + } else{ |
|
120 | 121 | $acc_arr[$data['day']]=$data; |
121 | 122 | } |
122 | 123 | } |
@@ -134,7 +135,7 @@ discard block |
||
134 | 135 | $json_data['acd'][]=array((string)$acc_arr[$day]['day'],(float)$acd); |
135 | 136 | $json_data['mcd'][]=array((string)$acc_arr[$day]['day'],(float)$acc_arr[$day]['mcd']); |
136 | 137 | $json_data['asr'][]=array((string)$acc_arr[$day]['day'],(float)$asr); |
137 | - }else{ |
|
138 | + } else{ |
|
138 | 139 | $json_data['total'][]= array($date->format("d"), 0); |
139 | 140 | $json_data['answered'][]= array($date->format("d"), 0); |
140 | 141 | $json_data['failed'][]= array($date->format("d"), 0); |
@@ -145,8 +146,7 @@ discard block |
||
145 | 146 | } |
146 | 147 | |
147 | 148 | } |
148 | - } |
|
149 | - else{ |
|
149 | + } else{ |
|
150 | 150 | foreach($daterange as $date){ |
151 | 151 | $json_data['date'][]=$date->format("d"); |
152 | 152 | $day = (int) $date->format("d"); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $json_data[$i][]= round($data['billseconds']/60,0); |
208 | 208 | $i++; |
209 | 209 | } |
210 | - }else{ |
|
210 | + } else{ |
|
211 | 211 | $json_data[] = array(); |
212 | 212 | } |
213 | 213 | echo json_encode($json_data); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $i++; |
247 | 247 | } |
248 | 248 | |
249 | - }else{ |
|
249 | + } else{ |
|
250 | 250 | $json_data[] = array(); |
251 | 251 | } |
252 | 252 | echo json_encode($json_data); |
@@ -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> |
@@ -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 | ?> |