From b7cb5c5873a9205e712191828fc42391a41c59b4 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Fri, 1 Jul 2016 17:08:01 +0100 Subject: [PATCH] make consistent use of elseif in place of else if --- application/controllers/Receivings.php | 6 +++--- application/controllers/Sales.php | 6 +++--- application/libraries/Barcode_lib.php | 10 +++++----- application/libraries/Sale_lib.php | 4 ++-- application/models/Sale.php | 2 +- application/views/barcodes/Code128.php | 2 +- application/views/barcodes/Code39.php | 2 +- application/views/configs/email_config.php | 2 +- application/views/partial/datepicker_locale.php | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index b12a53c34..5e92f4df4 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -50,7 +50,7 @@ class Receivings extends Secure_Controller $mode = $this->input->post('mode'); $this->receiving_lib->set_mode($mode); } - else if($this->Stock_location->is_allowed_location($stock_source, 'receivings')) + elseif($this->Stock_location->is_allowed_location($stock_source, 'receivings')) { $this->receiving_lib->set_stock_source($stock_source); $this->receiving_lib->set_stock_destination($stock_destination); @@ -87,11 +87,11 @@ class Receivings extends Secure_Controller { $this->receiving_lib->return_entire_receiving($item_id_or_number_or_item_kit_or_receipt); } - else if($this->receiving_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt)) + elseif($this->receiving_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt)) { $this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location); } - else if(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location)) + elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location)) { $data['error'] = $this->lang->line('receivings_unable_to_add_item'); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index a37de6c5a..bfad3240c 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -143,7 +143,7 @@ class Sales extends Secure_Controller $mode = $this->input->post('mode'); $this->sale_lib->set_mode($mode); } - else if($this->Stock_location->is_allowed_location($stock_location, 'sales')) + elseif($this->Stock_location->is_allowed_location($stock_location, 'sales')) { $this->sale_lib->set_sale_location($stock_location); } @@ -269,11 +269,11 @@ class Sales extends Secure_Controller { $this->sale_lib->return_entire_sale($item_id_or_number_or_item_kit_or_receipt); } - else if($this->sale_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt)) + elseif($this->sale_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt)) { $this->sale_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location); } - else if(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount)) + elseif(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount)) { $data['error'] = $this->lang->line('sales_unable_to_add_item'); } diff --git a/application/libraries/Barcode_lib.php b/application/libraries/Barcode_lib.php index 1ce160341..d41b5012a 100644 --- a/application/libraries/Barcode_lib.php +++ b/application/libraries/Barcode_lib.php @@ -178,23 +178,23 @@ class Barcode_lib { $result = $this->CI->lang->line('items_name') . " " . $item['name']; } - else if($layout_type == 'category' && isset($item['category'])) + elseif($layout_type == 'category' && isset($item['category'])) { $result = $this->CI->lang->line('items_category') . " " . $item['category']; } - else if($layout_type == 'cost_price' && isset($item['cost_price'])) + elseif($layout_type == 'cost_price' && isset($item['cost_price'])) { $result = $this->CI->lang->line('items_cost_price') . " " . to_currency($item['cost_price']); } - else if($layout_type == 'unit_price' && isset($item['unit_price'])) + elseif($layout_type == 'unit_price' && isset($item['unit_price'])) { $result = $this->CI->lang->line('items_unit_price') . " " . to_currency($item['unit_price']); } - else if($layout_type == 'company_name') + elseif($layout_type == 'company_name') { $result = $barcode_config['company']; } - else if($layout_type == 'item_code') + elseif($layout_type == 'item_code') { $result = $barcode_config['barcode_content'] !== "id" && isset($item['item_number']) ? $item['item_number'] : $item['item_id']; } diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index f6ab95504..881f069fd 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -370,7 +370,7 @@ class Sale_lib { return $this->CI->lang->line('sales_quantity_less_than_zero'); } - else if($item_quantity - $quantity_added < $item_info->reorder_level) + elseif($item_quantity - $quantity_added < $item_info->reorder_level) { return $this->CI->lang->line('sales_quantity_less_than_reorder_level'); } @@ -443,7 +443,7 @@ class Sale_lib { return $this->CI->Sale->exists($pieces[1]); } - else if($this->CI->config->item('invoice_enable') == TRUE) + elseif($this->CI->config->item('invoice_enable') == TRUE) { $sale_info = $this->CI->Sale->get_sale_by_invoice_number($receipt_sale_id); if($sale_info->num_rows() > 0) diff --git a/application/models/Sale.php b/application/models/Sale.php index ba8be2977..09b595e70 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -473,7 +473,7 @@ class Sale extends CI_Model $payments[$this->lang->line('sales_credit')] = $this->lang->line('sales_credit'); $payments[$this->lang->line('sales_cash')] = $this->lang->line('sales_cash'); } - else if($this->config->item('payment_options_order') == 'debitcashcredit') + elseif($this->config->item('payment_options_order') == 'debitcashcredit') { $payments[$this->lang->line('sales_debit')] = $this->lang->line('sales_debit'); $payments[$this->lang->line('sales_cash')] = $this->lang->line('sales_cash'); diff --git a/application/views/barcodes/Code128.php b/application/views/barcodes/Code128.php index 896df8624..f3e320407 100644 --- a/application/views/barcodes/Code128.php +++ b/application/views/barcodes/Code128.php @@ -207,7 +207,7 @@ class Code128 extends BarcodeBase $this->type = self::TYPE_C; } // Are there only capitals? - else if(strtoupper($this->data) == $this->data) + elseif(strtoupper($this->data) == $this->data) { $this->type = self::TYPE_A; } diff --git a/application/views/barcodes/Code39.php b/application/views/barcodes/Code39.php index 990edd030..73dded99f 100644 --- a/application/views/barcodes/Code39.php +++ b/application/views/barcodes/Code39.php @@ -160,7 +160,7 @@ class Code39 extends BarcodeBase $currentBarX += $narrowBar; } // Wide Bar - else if($bit == '1') + elseif($bit == '1') { imagefilledrectangle($this->img, $currentBarX, 0, ($currentBarX + $wideBar), ($this->y - 1), $color); $currentBarX += $wideBar; diff --git a/application/views/configs/email_config.php b/application/views/configs/email_config.php index 430904e1f..62754b991 100644 --- a/application/views/configs/email_config.php +++ b/application/views/configs/email_config.php @@ -121,7 +121,7 @@ $(document).ready(function() $("#mailpath").prop('disabled', false); $("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', true); } - else if($("#protocol").val() == 'smtp') + elseif($("#protocol").val() == 'smtp') { $("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', false); $("#mailpath").prop('disabled', true); diff --git a/application/views/partial/datepicker_locale.php b/application/views/partial/datepicker_locale.php index 8d4d7500c..126d849ac 100644 --- a/application/views/partial/datepicker_locale.php +++ b/application/views/partial/datepicker_locale.php @@ -65,7 +65,7 @@ $.fn.datetimepicker.dates['config->item("language"); ?>'] = { meridiem: ["am", "pm"], config->item('timeformat'), 'A') !== false ) + elseif( strpos($this->config->item('timeformat'), 'A') !== false ) { ?> meridiem: ["AM", "PM"],