Exemplo n.º 1
0
<?php

//include the DAL library to use the model layer methods
include '../class.DAL.php';
//creating object of DAL
$managedata = new ManageContent_DAL();
/*taking as constant value*/
$product_id = "P_003";
$membership_id = "member528c9e69f2d45";
$table_name1 = "mlm_info";
$table_name2 = "member_table";
$table_name3 = "product_table";
$table_name4 = "money_transfer_log";
$product_details = $managedata->getValue_where($table_name3, "*", "product_id", $product_id);
$discount = $product_details[0]['discount'];
$price_member = $product_details[0]['price_members'];
$distributed_amount = $price_member * $discount / 100;
echo $distributed_amount . "<br>";
//money calculation for buyer as member
$receiving_amount = $distributed_amount / 2;
echo $receiving_amount;
//money calculation for 1st parent member
$parent_id = $managedata->getValue_where($table_name1, "parent_id", "membership_id", $membership_id);
if (count($parent_id) > 0) {
    print_r($parent_id) . "<br>";
    $parent_membership_id = $managedata->getValue_where($table_name1, "membership_id", "id", $parent_id[0]['parent_id']);
    print_r($parent_membership_id) . "<br>";
    $amount_1st = $distributed_amount / 4;
    echo $amount_1st;
}
/*if($result0[0] == 1)
Exemplo n.º 2
0
session_start();
//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 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)) {
Exemplo n.º 3
0
//getting values from signup page
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $membership_id = $_POST['membership_id'];
    $name = $_POST['name'];
    $dob = $_POST['dob'];
    $gender = $_POST['gender'];
    $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);
Exemplo n.º 4
0
<?php

session_start();
//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 {
Exemplo n.º 5
0
    $gender = $_POST['gender'];
    $contact_no = $_POST['contact_no'];
    $Senior_id = $_POST['Senior_id'];
    $address1 = $_POST['address1'];
    $address2 = $_POST['address2'];
    $city = $_POST['city'];
    $postal_code = $_POST['postal_code'];
    $state = $_POST['state_id'];
    $country = $_POST['country_id'];
    $password = $_POST['password'];
    $confirm_password = $_POST['confirm_password'];
}
//checking for same password
if ($password == $confirm_password) {
    //checking for valid email id
    $all_email_id = $managedata->getValue_where("member_table", "*", "email_id", $email_id);
    if (empty($all_email_id[0])) {
        //checking for valid senior id
        $valid_senior_id = $managedata->getValue_where("member_table", "*", "membership_id", $Senior_id);
        if (!empty($valid_senior_id[0]['membership_id'])) {
            //make the name,address by concatening f_name,l_name AND address1, address2
            $name = $firstname . " " . $lastname;
            $address = $address1 . "<br>" . $address2;
            //creting memebership id using unique id with prefix member
            $membership_id = uniqid('member');
            //getting current date/time and expiration date
            $getdate = getdate();
            $date = $getdate['year'] . "-" . $getdate['mon'] . "-" . $getdate['mday'];
            $expiration_date = date('Y-m-d', strtotime('+1 years'));
            //make membership_id as username of the user
            $username = $email_id;