$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)); //add value to invalid_potential_money table $column_name = array("membership_id", "product_id", "product_quantity", "child_id", "date", "amount", "frozen_money"); $column_value = array($Senior_id, "M_1001", 1, $membership_id, $date, $money_distribute, 0); $insert_potential = $managedata->insertValue("invalid_potential_money", $column_name, $column_value); } } $_SESSION['memberId'] = $membership_id; $mail->getDataForRegistration($email_id, $membership_id); //to purchase the membership product header("Location: ../../view_cart.php"); } else { $message = "Senior Id Does Not Exists"; header("Location: ../../sign_up.php?msg=" . $message); } } else { $message = "Email Id Exists,Register With Different Email ID"; header("Location: ../../sign_up.php?msg=" . $message); } } else {