Code Duplication    Length = 21-21 lines in 14 locations

catalog/includes/modules/payment/authorizenet_cc_sim.php 1 location

@@ 58-78 (lines=21) @@
55
      }
56
    }
57
58
    function update_status() {
59
      global $order;
60
61
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ZONE > 0) ) {
62
        $check_flag = false;
63
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
64
        while ($check = tep_db_fetch_array($check_query)) {
65
          if ($check['zone_id'] < 1) {
66
            $check_flag = true;
67
            break;
68
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
69
            $check_flag = true;
70
            break;
71
          }
72
        }
73
74
        if ($check_flag == false) {
75
          $this->enabled = false;
76
        }
77
      }
78
    }
79
80
    function javascript_validation() {
81
      return false;

catalog/includes/modules/payment/moneyorder.php 1 location

@@ 36-56 (lines=21) @@
33
    }
34
35
// class methods
36
    function update_status() {
37
      global $order;
38
39
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MONEYORDER_ZONE > 0) ) {
40
        $check_flag = false;
41
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MONEYORDER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
42
        while ($check = tep_db_fetch_array($check_query)) {
43
          if ($check['zone_id'] < 1) {
44
            $check_flag = true;
45
            break;
46
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
47
            $check_flag = true;
48
            break;
49
          }
50
        }
51
52
        if ($check_flag == false) {
53
          $this->enabled = false;
54
        }
55
      }
56
    }
57
58
    function javascript_validation() {
59
      return false;

catalog/includes/modules/payment/paypal_pro_dp.php 1 location

@@ 85-105 (lines=21) @@
82
                              'MAESTRO' => 'Maestro');
83
    }
84
85
    function update_status() {
86
      global $order;
87
88
      if ( ($this->enabled == true) && ((int)OSCOM_APP_PAYPAL_DP_ZONE > 0) ) {
89
        $check_flag = false;
90
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . OSCOM_APP_PAYPAL_DP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
91
        while ($check = tep_db_fetch_array($check_query)) {
92
          if ($check['zone_id'] < 1) {
93
            $check_flag = true;
94
            break;
95
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
96
            $check_flag = true;
97
            break;
98
          }
99
        }
100
101
        if ($check_flag == false) {
102
          $this->enabled = false;
103
        }
104
      }
105
    }
106
107
    function javascript_validation() {
108
      return false;

catalog/includes/modules/payment/pm2checkout.php 1 location

@@ 39-59 (lines=21) @@
36
    }
37
38
// class methods
39
    function update_status() {
40
      global $order;
41
42
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_2CHECKOUT_ZONE > 0) ) {
43
        $check_flag = false;
44
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_2CHECKOUT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
45
        while ($check = tep_db_fetch_array($check_query)) {
46
          if ($check['zone_id'] < 1) {
47
            $check_flag = true;
48
            break;
49
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
50
            $check_flag = true;
51
            break;
52
          }
53
        }
54
55
        if ($check_flag == false) {
56
          $this->enabled = false;
57
        }
58
      }
59
    }
60
61
    function javascript_validation() {
62
      return false;

catalog/includes/modules/payment/rbsworldpay_hosted.php 1 location

@@ 58-78 (lines=21) @@
55
      }
56
    }
57
58
    function update_status() {
59
      global $order;
60
61
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE > 0) ) {
62
        $check_flag = false;
63
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
64
        while ($check = tep_db_fetch_array($check_query)) {
65
          if ($check['zone_id'] < 1) {
66
            $check_flag = true;
67
            break;
68
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
69
            $check_flag = true;
70
            break;
71
          }
72
        }
73
74
        if ($check_flag == false) {
75
          $this->enabled = false;
76
        }
77
      }
78
    }
79
80
    function javascript_validation() {
81
      return false;

catalog/includes/modules/payment/sage_pay_form.php 1 location

@@ 64-84 (lines=21) @@
61
      }
62
    }
63
64
    function update_status() {
65
      global $order;
66
67
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_FORM_ZONE > 0) ) {
68
        $check_flag = false;
69
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SAGE_PAY_FORM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
70
        while ($check = tep_db_fetch_array($check_query)) {
71
          if ($check['zone_id'] < 1) {
72
            $check_flag = true;
73
            break;
74
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
75
            $check_flag = true;
76
            break;
77
          }
78
        }
79
80
        if ($check_flag == false) {
81
          $this->enabled = false;
82
        }
83
      }
84
    }
85
86
    function javascript_validation() {
87
      return false;

catalog/includes/modules/payment/sage_pay_server.php 1 location

@@ 65-85 (lines=21) @@
62
      }
63
    }
64
65
    function update_status() {
66
      global $order;
67
68
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE > 0) ) {
69
        $check_flag = false;
70
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
71
        while ($check = tep_db_fetch_array($check_query)) {
72
          if ($check['zone_id'] < 1) {
73
            $check_flag = true;
74
            break;
75
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
76
            $check_flag = true;
77
            break;
78
          }
79
        }
80
81
        if ($check_flag == false) {
82
          $this->enabled = false;
83
        }
84
      }
85
    }
86
87
    function javascript_validation() {
88
      return false;

catalog/includes/modules/payment/stripe.php 1 location

@@ 65-85 (lines=21) @@
62
      }
63
    }
64
65
    function update_status() {
66
      global $order;
67
68
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_STRIPE_ZONE > 0) ) {
69
        $check_flag = false;
70
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_STRIPE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
71
        while ($check = tep_db_fetch_array($check_query)) {
72
          if ($check['zone_id'] < 1) {
73
            $check_flag = true;
74
            break;
75
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
76
            $check_flag = true;
77
            break;
78
          }
79
        }
80
81
        if ($check_flag == false) {
82
          $this->enabled = false;
83
        }
84
      }
85
    }
86
87
    function javascript_validation() {
88
      return false;

catalog/includes/modules/payment/braintree_cc.php 1 location

@@ 92-112 (lines=21) @@
89
      }
90
    }
91
92
    function update_status() {
93
      global $order;
94
95
      if ( ($this->enabled == true) && ((int)OSCOM_APP_PAYPAL_DP_ZONE > 0) ) {
96
        $check_flag = false;
97
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . OSCOM_APP_PAYPAL_DP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
98
        while ($check = tep_db_fetch_array($check_query)) {
99
          if ($check['zone_id'] < 1) {
100
            $check_flag = true;
101
            break;
102
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
103
            $check_flag = true;
104
            break;
105
          }
106
        }
107
108
        if ($check_flag == false) {
109
          $this->enabled = false;
110
        }
111
      }
112
    }
113
114
    function checkout_initialization_method() {
115
      global $cart, $appBraintreeCcFormHash;

catalog/includes/modules/payment/paypal_pro_hs.php 1 location

@@ 75-95 (lines=21) @@
72
      }
73
    }
74
75
    function update_status() {
76
      global $order;
77
78
      if ( ($this->enabled == true) && ((int)OSCOM_APP_PAYPAL_HS_ZONE > 0) ) {
79
        $check_flag = false;
80
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . OSCOM_APP_PAYPAL_HS_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
81
        while ($check = tep_db_fetch_array($check_query)) {
82
          if ($check['zone_id'] < 1) {
83
            $check_flag = true;
84
            break;
85
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
86
            $check_flag = true;
87
            break;
88
          }
89
        }
90
91
        if ($check_flag == false) {
92
          $this->enabled = false;
93
        }
94
      }
95
    }
96
97
    function javascript_validation() {
98
      return false;

catalog/includes/modules/payment/paypal_standard.php 1 location

@@ 89-109 (lines=21) @@
86
      }
87
    }
88
89
    function update_status() {
90
      global $order;
91
92
      if ( ($this->enabled == true) && ((int)OSCOM_APP_PAYPAL_PS_ZONE > 0) ) {
93
        $check_flag = false;
94
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)OSCOM_APP_PAYPAL_PS_ZONE . "' and zone_country_id = '" . (int)$order->billing['country']['id'] . "' order by zone_id");
95
        while ($check = tep_db_fetch_array($check_query)) {
96
          if ($check['zone_id'] < 1) {
97
            $check_flag = true;
98
            break;
99
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
100
            $check_flag = true;
101
            break;
102
          }
103
        }
104
105
        if ($check_flag == false) {
106
          $this->enabled = false;
107
        }
108
      }
109
    }
110
111
    function javascript_validation() {
112
      return false;

catalog/includes/modules/payment/authorizenet_cc_aim.php 1 location

@@ 65-85 (lines=21) @@
62
      }
63
    }
64
65
    function update_status() {
66
      global $order;
67
68
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE > 0) ) {
69
        $check_flag = false;
70
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE . "' and zone_country_id = '" . (int)$order->billing['country']['id'] . "' order by zone_id");
71
        while ($check = tep_db_fetch_array($check_query)) {
72
          if ($check['zone_id'] < 1) {
73
            $check_flag = true;
74
            break;
75
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
76
            $check_flag = true;
77
            break;
78
          }
79
        }
80
81
        if ($check_flag == false) {
82
          $this->enabled = false;
83
        }
84
      }
85
    }
86
87
    function javascript_validation() {
88
      return false;

catalog/includes/modules/payment/authorizenet_cc_dpm.php 1 location

@@ 58-78 (lines=21) @@
55
      }
56
    }
57
58
    function update_status() {
59
      global $order;
60
61
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ZONE > 0) ) {
62
        $check_flag = false;
63
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ZONE . "' and zone_country_id = '" . (int)$order->billing['country']['id'] . "' order by zone_id");
64
        while ($check = tep_db_fetch_array($check_query)) {
65
          if ($check['zone_id'] < 1) {
66
            $check_flag = true;
67
            break;
68
          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
69
            $check_flag = true;
70
            break;
71
          }
72
        }
73
74
        if ($check_flag == false) {
75
          $this->enabled = false;
76
        }
77
      }
78
    }
79
80
    function javascript_validation() {
81
      return false;

catalog/includes/modules/payment/paypal_express.php 1 location

@@ 106-126 (lines=21) @@
103
      }
104
    }
105
106
    function update_status() {
107
      global $order;
108
109
      if ( ($this->enabled == true) && ((int)OSCOM_APP_PAYPAL_EC_ZONE > 0) ) {
110
        $check_flag = false;
111
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . OSCOM_APP_PAYPAL_EC_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
112
        while ($check = tep_db_fetch_array($check_query)) {
113
          if ($check['zone_id'] < 1) {
114
            $check_flag = true;
115
            break;
116
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
117
            $check_flag = true;
118
            break;
119
          }
120
        }
121
122
        if ($check_flag == false) {
123
          $this->enabled = false;
124
        }
125
      }
126
    }
127
128
    function checkout_initialization_method() {
129
      global $cart;