| @@ -27,6 +27,9 @@ discard block | ||
| 27 | 27 | |
| 28 | 28 | class Helper | 
| 29 | 29 |  { | 
| 30 | + /** | |
| 31 | + * @param string $sLang | |
| 32 | + */ | |
| 30 | 33 | public static function validateCustomerForm($sLang, $aErr = [], $bEdit = false) | 
| 31 | 34 |      { | 
| 32 | 35 |          if (!isset($_POST["email"]) || !\filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) { | 
| @@ -92,6 +95,11 @@ discard block | ||
| 92 | 95 | return ''; | 
| 93 | 96 | } | 
| 94 | 97 | |
| 98 | + /** | |
| 99 | + * @param string $sKeyConfig | |
| 100 | + * @param string $sKeyForm | |
| 101 | + * @param boolean $aUserData | |
| 102 | + */ | |
| 95 | 103 |      public static function getCustomerFormDefaultValue($sKeyConfig, $sKeyForm, $aUserData) { | 
| 96 | 104 | $sDefaultValue = self::getUserData($sKeyConfig, $aUserData); | 
| 97 | 105 |          if (!$sDefaultValue && isset($_SESSION["formsave_addrform"][$sKeyForm])) { | 
| @@ -101,6 +109,9 @@ discard block | ||
| 101 | 109 | return $sDefaultValue; | 
| 102 | 110 | } | 
| 103 | 111 | |
| 112 | + /** | |
| 113 | + * @param string $sLang | |
| 114 | + */ | |
| 104 | 115 | public static function buildCustomerForm($sLang, $sPurpose = 'none', $sErr = '', $aUserData = false) | 
| 105 | 116 |      { | 
| 106 | 117 |          $sDefaultCountry = self::getCustomerFormDefaultValue('cust_country', "country", $aUserData); | 
| @@ -62,7 +62,7 @@ | ||
| 62 | 62 |          if (!$bEdit && (!isset($_POST["tos"]) || $_POST["tos"] != 'y')) { | 
| 63 | 63 | $aErr["tos"] = true; | 
| 64 | 64 | } | 
| 65 | -        if (!$bEdit && (!isset( $_POST["cancellationdisclaimer"] ) || $_POST["cancellationdisclaimer"] != 'y')) { | |
| 65 | +        if (!$bEdit && (!isset($_POST["cancellationdisclaimer"]) || $_POST["cancellationdisclaimer"] != 'y')) { | |
| 66 | 66 | $aErr["cancellationdisclaimer"] = true; | 
| 67 | 67 | } | 
| 68 | 68 | |
| @@ -77,7 +77,7 @@ discard block | ||
| 77 | 77 | unset($sTMP); | 
| 78 | 78 | |
| 79 | 79 |                                  if (isset($_REQUEST[$sValue]) && in_array($_REQUEST[$sValue], $aOptions)) { | 
| 80 | - $sCartKey .= '|' . $sValue . ':' . $_REQUEST[$sValue]; | |
| 80 | + $sCartKey .= '|'.$sValue.':'.$_REQUEST[$sValue]; | |
| 81 | 81 |                                  } else { | 
| 82 | 82 |                                      $this->replyToCartUpdate('requiredfieldmissing'); | 
| 83 | 83 | } | 
| @@ -137,7 +137,7 @@ discard block | ||
| 137 | 137 | } | 
| 138 | 138 |              echo $this->serviceManager->get('twig')->render('shop/update-cart.twig', $aAR); | 
| 139 | 139 |          } else { | 
| 140 | - $aMSG["msg"] = $sReply; | |
| 140 | + $aMSG["msg"] = $sReply; | |
| 141 | 141 |              if (count($aMore)) { | 
| 142 | 142 | $aMSG = array_merge($aMSG, $aMore); | 
| 143 | 143 | } | 
| @@ -56,14 +56,14 @@ discard block | ||
| 56 | 56 |          if (!CHelper::getUserData()) { | 
| 57 | 57 |              $this->P->oPayload->cl_html = $this->textcats->T("denied_notloggedin"); | 
| 58 | 58 |          } else { | 
| 59 | - require_once PATH_BASEDIR . 'src/shop/functions.shoppingcart.php'; | |
| 59 | + require_once PATH_BASEDIR.'src/shop/functions.shoppingcart.php'; | |
| 60 | 60 | |
| 61 | 61 | $this->P->cb_customcontenttemplate = 'shop/myorders'; | 
| 62 | 62 | |
| 63 | 63 |              if (isset($_GET["action"], $_GET["id"]) && $_GET["action"] === 'show') { | 
| 64 | 64 | $iId = \filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); | 
| 65 | 65 | |
| 66 | - $sql = "SELECT * FROM " . 'orders WHERE o_id = :id AND o_custno = \'' . $_SESSION['user']['cust_no'] . '\' AND o_ordercompleted != \'d\''; | |
| 66 | + $sql = "SELECT * FROM ".'orders WHERE o_id = :id AND o_custno = \''.$_SESSION['user']['cust_no'].'\' AND o_ordercompleted != \'d\''; | |
| 67 | 67 | $hResult = $this->db->prepare($sql); | 
| 68 | 68 |                  $hResult->bindValue(':id', $iId); | 
| 69 | 69 | $hResult->execute(); | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | $aOrder["o_ordertimestamp"] | 
| 77 | 77 | ); | 
| 78 | 78 | $this->P->cb_customdata['orderdata']['orderremarks'] = $aOrder["o_remarks"]; | 
| 79 | -                    $this->P->cb_customdata['orderdata']['paymentmethod'] = $this->textcats->T("order_paymentmethod_" . $aOrder["o_paymentmethod"]); | |
| 79 | +                    $this->P->cb_customdata['orderdata']['paymentmethod'] = $this->textcats->T("order_paymentmethod_".$aOrder["o_paymentmethod"]); | |
| 80 | 80 |                      $this->P->cb_customdata['orderdata']['paymentcompleted'] = (($aOrder["o_paymentcompleted"] == 'y') ? $this->textcats->T("myorders_paymentstatus_completed") : $this->textcats->T("myorders_paymentstatus_open")); | 
| 81 | 81 | $this->P->cb_customdata['orderdata']['orderstatus'] = SHelper::showOrderStatusText($this->textcats, $aOrder["o_ordercompleted"]); | 
| 82 | 82 | $this->P->cb_customdata['orderdata']['shippingservice'] = $aOrder["o_shipping_service"]; | 
| @@ -118,12 +118,12 @@ discard block | ||
| 118 | 118 | } | 
| 119 | 119 |              } else { | 
| 120 | 120 | $COList = [ | 
| 121 | -                    ['title' => $this->textcats->T("order_head_orderdate"), 'key' => 'o_ordertime', 'width' => 110, 'linked' => false,], | |
| 122 | -                    ['title' => $this->textcats->T("order_head_paymenthethod"), 'key' => 'o_paymentmethod', 'width' => 125, 'linked' => false,], | |
| 123 | -                    ['title' => $this->textcats->T("order_head_paid"), 'key' => 'o_paymentcompleted', 'width' => 60, 'linked' => false,], | |
| 124 | -                    ['title' => $this->textcats->T("order_head_status"), 'key' => 'o_order_status', 'width' => 80, 'linked' => false,], | |
| 125 | -                    ['title' => $this->textcats->T("order_head_shipping_service"), 'key' => 'o_shipping_service', 'width' => 90, 'linked' => false,], | |
| 126 | -                    ['title' => $this->textcats->T("order_head_shipping_trackingno"), 'key' => 'o_shipping_trackingno', 'width' => 130, 'linked' => false,], | |
| 121 | +                    ['title' => $this->textcats->T("order_head_orderdate"), 'key' => 'o_ordertime', 'width' => 110, 'linked' => false, ], | |
| 122 | +                    ['title' => $this->textcats->T("order_head_paymenthethod"), 'key' => 'o_paymentmethod', 'width' => 125, 'linked' => false, ], | |
| 123 | +                    ['title' => $this->textcats->T("order_head_paid"), 'key' => 'o_paymentcompleted', 'width' => 60, 'linked' => false, ], | |
| 124 | +                    ['title' => $this->textcats->T("order_head_status"), 'key' => 'o_order_status', 'width' => 80, 'linked' => false, ], | |
| 125 | +                    ['title' => $this->textcats->T("order_head_shipping_service"), 'key' => 'o_shipping_service', 'width' => 90, 'linked' => false, ], | |
| 126 | +                    ['title' => $this->textcats->T("order_head_shipping_trackingno"), 'key' => 'o_shipping_trackingno', 'width' => 130, 'linked' => false, ], | |
| 127 | 127 | [ | 
| 128 | 128 |                          'title' => $this->textcats->T("order_show"), | 
| 129 | 129 | 'key' => 'o_id', | 
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | 'linked' => true, | 
| 132 | 132 | 'ltarget' => '/_misc/myorders.html', | 
| 133 | 133 | 'lkeyname' => 'id', | 
| 134 | - 'lgetvars' => ['action' => 'show',], | |
| 134 | + 'lgetvars' => ['action' => 'show', ], | |
| 135 | 135 | ], | 
| 136 | 136 | ]; | 
| 137 | 137 | |
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | $hResult->execute(); | 
| 84 | 84 | $iRows = $hResult->rowCount(); | 
| 85 | 85 |                      if ($iRows == 1) { | 
| 86 | -                        $sErr .= $this->textcats->T("userprofile_emailalreadyinuse") . '<br>'; | |
| 86 | +                        $sErr .= $this->textcats->T("userprofile_emailalreadyinuse").'<br>'; | |
| 87 | 87 | } | 
| 88 | 88 | $sErr = CHelper::validateCustomerForm(HelperConfig::$lang, $sErr, true); | 
| 89 | 89 | |
| @@ -112,7 +112,7 @@ discard block | ||
| 112 | 112 | $sql = \HaaseIT\Toolbox\DBTools::buildPSUpdateQuery($aData, 'customer', 'cust_id'); | 
| 113 | 113 | $hResult = $this->db->prepare($sql); | 
| 114 | 114 |                              foreach ($aData as $sKey => $sValue) { | 
| 115 | -                                $hResult->bindValue(':' . $sKey, $sValue); | |
| 115 | +                                $hResult->bindValue(':'.$sKey, $sValue); | |
| 116 | 116 | } | 
| 117 | 117 | $hResult->execute(); | 
| 118 | 118 | $aPData["infochangessaved"] = true; | 
| @@ -45,19 +45,19 @@ discard block | ||
| 45 | 45 |          } else { | 
| 46 | 46 | $mLogin = $this->getLogin(); | 
| 47 | 47 |              if (isset($mLogin["status"]) && $mLogin["status"] === 'success') { | 
| 48 | -                $this->P->oPayload->cl_html = $textcats->T("login_success") . '<br>'; | |
| 48 | +                $this->P->oPayload->cl_html = $textcats->T("login_success").'<br>'; | |
| 49 | 49 |                  header('Location: /_misc/userhome.html?login=true'); | 
| 50 | 50 | die(); | 
| 51 | 51 |              } elseif (isset($mLogin["status"]) && $mLogin["status"] === 'tosnotaccepted') { | 
| 52 | -                $this->P->oPayload->cl_html = $textcats->T("login_fail_tosnotaccepted") . '<br>'; | |
| 52 | +                $this->P->oPayload->cl_html = $textcats->T("login_fail_tosnotaccepted").'<br>'; | |
| 53 | 53 | $this->P->cb_customcontenttemplate = 'customer/login'; | 
| 54 | 54 |              } elseif (isset($mLogin["status"]) && $mLogin["status"] === 'emailnotverified') { | 
| 55 | -                $this->P->oPayload->cl_html = $textcats->T("login_fail_emailnotverified") . '<br><br>'; | |
| 55 | +                $this->P->oPayload->cl_html = $textcats->T("login_fail_emailnotverified").'<br><br>'; | |
| 56 | 56 | $this->P->oPayload->cl_html .= '<a href="/_misc/resendverificationmail.html?email=' | 
| 57 | -                    . $mLogin["data"]['cust_email'] . '">' . $textcats->T("login_fail_emailnotverifiedresend") . '</a>'; | |
| 57 | +                    . $mLogin["data"]['cust_email'].'">'.$textcats->T("login_fail_emailnotverifiedresend").'</a>'; | |
| 58 | 58 | $this->P->cb_customcontenttemplate = 'customer/login'; | 
| 59 | 59 |              } elseif (isset($mLogin["status"]) && $mLogin["status"] === 'accountinactive') { | 
| 60 | -                $this->P->oPayload->cl_html = $textcats->T("login_fail_accountinactive") . '<br>'; | |
| 60 | +                $this->P->oPayload->cl_html = $textcats->T("login_fail_accountinactive").'<br>'; | |
| 61 | 61 | $this->P->cb_customcontenttemplate = 'customer/login'; | 
| 62 | 62 |              } else { | 
| 63 | 63 |                  $this->P->oPayload->cl_html = $textcats->T("login_fail"); | 
| @@ -111,7 +111,7 @@ discard block | ||
| 111 | 111 | $hResult->execute(); | 
| 112 | 112 | |
| 113 | 113 | $iRows = $hResult->rowCount(); | 
| 114 | -        if($iRows == 1) { | |
| 114 | +        if ($iRows == 1) { | |
| 115 | 115 | $aRow = $hResult->fetch(); | 
| 116 | 116 | |
| 117 | 117 |              if (password_verify($_POST["password"], $aRow['cust_password'])) { | 
| @@ -121,9 +121,9 @@ discard block | ||
| 121 | 121 |                  } elseif ($aRow['cust_tosaccepted'] === 'n') { | 
| 122 | 122 | return ['status' => 'tosnotaccepted']; | 
| 123 | 123 |                  } elseif ($aRow['cust_emailverified'] === 'n') { | 
| 124 | - return ['status' => 'emailnotverified', 'data' => $aRow,]; | |
| 124 | + return ['status' => 'emailnotverified', 'data' => $aRow, ]; | |
| 125 | 125 |                  } elseif ($aRow['cust_active'] === 'n') { | 
| 126 | - return ['status' => 'accountinactive',]; | |
| 126 | + return ['status' => 'accountinactive', ]; | |
| 127 | 127 | } | 
| 128 | 128 | } | 
| 129 | 129 | } | 
| @@ -57,11 +57,11 @@ discard block | ||
| 57 | 57 | $this->P->cb_subnav = 'admin'; | 
| 58 | 58 | |
| 59 | 59 | $CUA = [ | 
| 60 | -            ['title' => HardcodedText::get('customeradmin_list_no'), 'key' => 'cust_no', 'width' => '16%', 'linked' => false,'stylehead' => 'text-align: left;',], | |
| 61 | -            ['title' => HardcodedText::get('customeradmin_list_company'), 'key' => 'cust_corp', 'width' => '16%', 'linked' => false,'stylehead' => 'text-align: left;',], | |
| 62 | -            ['title' => HardcodedText::get('customeradmin_list_name'), 'key' => 'cust_name', 'width' => '16%', 'linked' => false,'stylehead' => 'text-align: left;',], | |
| 63 | -            ['title' => HardcodedText::get('customeradmin_list_town'), 'key' => 'cust_town', 'width' => '16%', 'linked' => false,'stylehead' => 'text-align: left;',], | |
| 64 | -            ['title' => HardcodedText::get('customeradmin_list_active'), 'key' => 'cust_active', 'width' => '16%', 'linked' => false,'stylehead' => 'text-align: left;',], | |
| 60 | +            ['title' => HardcodedText::get('customeradmin_list_no'), 'key' => 'cust_no', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;', ], | |
| 61 | +            ['title' => HardcodedText::get('customeradmin_list_company'), 'key' => 'cust_corp', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;', ], | |
| 62 | +            ['title' => HardcodedText::get('customeradmin_list_name'), 'key' => 'cust_name', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;', ], | |
| 63 | +            ['title' => HardcodedText::get('customeradmin_list_town'), 'key' => 'cust_town', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;', ], | |
| 64 | +            ['title' => HardcodedText::get('customeradmin_list_active'), 'key' => 'cust_active', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;', ], | |
| 65 | 65 | [ | 
| 66 | 66 |                  'title' => HardcodedText::get('customeradmin_list_edit'), | 
| 67 | 67 | 'key' => 'cust_id', | 
| @@ -69,7 +69,7 @@ discard block | ||
| 69 | 69 | 'linked' => true, | 
| 70 | 70 | 'ltarget' => '/_admin/customeradmin.html', | 
| 71 | 71 | 'lkeyname' => 'id', | 
| 72 | - 'lgetvars' => ['action' => 'edit',], | |
| 72 | + 'lgetvars' => ['action' => 'edit', ], | |
| 73 | 73 | ], | 
| 74 | 74 | ]; | 
| 75 | 75 |          $aPData = $this->handleCustomerAdmin($CUA, $this->serviceManager->get('twig')); | 
| @@ -161,7 +161,7 @@ discard block | ||
| 161 | 161 | $sql = \HaaseIT\Toolbox\DBTools::buildPSUpdateQuery($aData, 'customer', 'cust_id'); | 
| 162 | 162 | $hResult = $this->db->prepare($sql); | 
| 163 | 163 |                          foreach ($aData as $sKey => $sValue) { | 
| 164 | -                            $hResult->bindValue(':' . $sKey, $sValue); | |
| 164 | +                            $hResult->bindValue(':'.$sKey, $sValue); | |
| 165 | 165 | } | 
| 166 | 166 | $hResult->execute(); | 
| 167 | 167 | $aInfo["changeswritten"] = true; | 
| @@ -43,7 +43,7 @@ | ||
| 43 | 43 |          $html .= implode("\n", | 
| 44 | 44 | array_map( | 
| 45 | 45 |                  function($i) { | 
| 46 | - return ".phpinfodisplay " . preg_replace( "/,/", ",.phpinfodisplay ", $i ); | |
| 46 | +                    return ".phpinfodisplay ".preg_replace("/,/", ",.phpinfodisplay ", $i); | |
| 47 | 47 | }, | 
| 48 | 48 |                  preg_split('/\n/', $matches[1]) | 
| 49 | 49 | ) |