$MI_FIELDS['zip'] = $_POST['zip']; $MI_FIELDS['phone'] = $_POST['phone']; $MI_FIELDS['email_2'] = $_POST['phone2']; $MI_FIELDS['email_1'] = $_POST['email']; $MI_FIELDS['ads_OK'] = $_POST['mailflag']; $cust = new CustdataModel($dbc); $cust->CardNo($memNum); $cust->personNum(1); $cust->load(); // get all current values $cust->MemDiscountLimit($_POST['chargeLimit']); $cust->ChargeLimit($_POST['chargeLimit']); $cust->ChargeOk($_POST['chargeLimit'] == 0 ? 0 : 1); $cust->memType($_POST['discList']); $cust->Type('REG'); $cust->Staff(0); $cust->Discount(0); $cards = new MemberCardsModel($dbc); $cards->card_no($memNum); $cards->upc($_REQUEST['cardUPC']); $cards->save(); $mcP = $sql->prepare("UPDATE memContact SET pref=? WHERE card_no=?"); $sql->execute($mcP, array($MI_FIELDS['ads_OK'], $memNum)); if ($cust->memType() == 1 || $cust->memType() == 3) { $cust->Type('PC'); } if ($cust->memType() == 3 || $cust->memType() == 9) { $cust->Discount(12); $cust->Staff(1); } $cust->FirstName($_POST['fName']);