//creating object of DAL $managedata = new ManageContent_DAL(); //getting values from edit account page if ($_SERVER['REQUEST_METHOD'] == 'POST') { $membership_id = $_POST['membership_id']; $ac_name = $_POST['ac_name']; $ac_no = $_POST['ac_no']; $bank = $_POST['bank']; $branch = $_POST['branch']; $ifsc = $_POST['ifsc_code']; } //fetching the id value of database $table_id = $managedata->getValue_where("member_account_details", "id", "membership_id", $membership_id); $id = $table_id[0]['id']; //updating the selected values if (isset($ac_name)) { $result = $managedata->updateValueWhere("member_account_details", "ac_name", $ac_name, "id", $id); } if (isset($ac_no)) { $result = $managedata->updateValueWhere("member_account_details", "ac_no", $ac_no, "id", $id); } if (isset($bank)) { $result = $managedata->updateValueWhere("member_account_details", "bank", $bank, "id", $id); } if (isset($branch)) { $result = $managedata->updateValueWhere("member_account_details", "branch", $branch, "id", $id); } if (isset($ifsc)) { $result = $managedata->updateValueWhere("member_account_details", "ifsc_code", $ifsc, "id", $id); } header("Location: ../../editProfile.php");
$contact_no = $_POST['contact_no']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $city = $_POST['city']; $postal_code = $_POST['postal_code']; $state = $_POST['state_id']; $country = $_POST['country_id']; } //fetching the id value of database $table_id = $managedata->getValue_where("member_table", "id", "membership_id", $membership_id); $id = $table_id[0]['id']; //making address field $address = $address1 . "<br>" . $address2; //updating the selected values if (isset($name)) { $result = $managedata->updateValueWhere("member_table", "name", $name, "id", $id); } if (isset($dob)) { $result = $managedata->updateValueWhere("member_table", "dob", $dob, "id", $id); } if (isset($gender)) { $result = $managedata->updateValueWhere("member_table", "gender", $gender, "id", $id); } if (isset($contact_no)) { $result = $managedata->updateValueWhere("member_table", "contact_no", $contact_no, "id", $id); } if (isset($address1) || isset($address2)) { $result = $managedata->updateValueWhere("member_table", "address", $address, "id", $id); } if (isset($city)) { $result = $managedata->updateValueWhere("member_table", "city", $city, "id", $id);
//include the DAL library to use the model layer methods include '../class.DAL.php'; //creating object of DAL $managedata = new ManageContent_DAL(); //getting values from change password page if ($_SERVER['REQUEST_METHOD'] == 'POST') { $password = $_POST['password']; $newPassword = $_POST['new_password']; $newPassword1 = $_POST['re_new_password']; $membership_id = $_POST['membership_id']; } if ($password != "" && isset($password) && isset($newPassword) && isset($newPassword1) && $newPassword != "" && $newPassword1 != "") { $password_db = $managedata->getValue_where('member_table', 'password', 'membership_id', $membership_id); if ($newPassword == $newPassword1) { if ($password == $password_db[0]['password']) { $rowCount = $managedata->updateValueWhere("member_table", "password", $newPassword, "membership_id", $membership_id); if ($rowCount == 1) { $_SESSION['result'] = "Password successfully changed"; } else { $_SESSION['result'] = "Password change Failed"; } } else { $_SESSION['result'] = "Wrong Password"; } } else { $_SESSION['result'] = "New passwords don't match."; } } else { $_SESSION['result'] = "Please fill the form properly"; } header("Location: ../../changePassword.php");
$expiration_date = date('Y-m-d', strtotime('+1 years')); //make membership_id as username of the user $username = $email_id; //inserting values in member_table $result = $managedata->insertMember($name, $email_id, $dob, $gender, $contact_no, $address, $city, $postal_code, $state, $country, $username, $password, $membership_id, $date, $expiration_date); //inserting membership id in mlm_table $result_mlm = $managedata->insertMembershipId($membership_id, $date); //checking for valid senior membership id if (isset($Senior_id) && !empty($Senior_id) && $result_mlm == 1) { //finding id value of memberdhip_id $member_id = $managedata->getValue_where("mlm_info", "id", "membership_id", $membership_id); //getting child ids of senior id $child_id = $managedata->getValue_where("mlm_info", "*", "membership_id", $Senior_id); //update parent id value of new member if (!empty($child_id[0]['id'])) { $update_parent_id = $managedata->updateValueWhere("mlm_info", "parent_id", $child_id[0]['id'], "membership_id", $membership_id); } //adding child id value if ($child_id[0]['child_id'] != "") { $new_child_id = $child_id[0]['child_id'] . "," . $member_id[0]['id']; } else { $new_child_id = $member_id[0]['id']; } //update child_id value of senior member $update_child_id = $managedata->updateValueWhere("mlm_info", "child_id", $new_child_id, "membership_id", $Senior_id); //checking that parent member is valid or not $senior_member_details = $managedata->getValue_where("member_table", "*", "membership_id", $Senior_id); if ($senior_member_details[0]['membership_activation'] == 0) { //amount that will debited to senior member $member_product = $managedata->getValue_where("membership_product", "*", "product_id", "M_1001"); $money_distribute = 0.5 * ($member_product[0]['price'] * ($member_product[0]['discount'] / 100));