Esempio n. 1
0
if (!empty($GLOBALS['_POST']['category']) && isset($GLOBALS['_POST']['category'])) {
    $category = $GLOBALS['_POST']['category'];
    if ($category != "") {
        //convert array to string seperated by commas
        foreach ($category as $cate) {
            $category_string = $category_string . "," . $cate;
        }
    }
    /*
    - remove the first word from the $category_string sa it
    - it contains a comma
    */
    $category_string = substr($category_string, 1);
}
//fetching the id value of database
$table_id = $manageData->getValueWhere("product_table", "id", "product_id", $product_id);
$id = $table_id[0]['id'];
//updating the selected values
if (isset($product_name)) {
    $result = $manageData->updateValueWhere("product_table", "product_name", $product_name, "id", $id);
}
if (isset($category_string) && !empty($category_string)) {
    $result = $manageData->updateValueWhere("product_table", "category", $category_string, "id", $id);
}
if (isset($description)) {
    $result = $manageData->updateValueWhere("product_table", "product_description", $description, "id", $id);
}
if (isset($references)) {
    $result = $manageData->updateValueWhere("product_table", "references", $references, "id", $id);
}
if (isset($price_guest)) {
Esempio n. 2
0
$getdate = getdate();
$date = $getdate['year'] . "-" . $getdate['mon'] . "-" . $getdate['mday'];
//change date format
$change_date = explode("-", $date);
$curdate = $change_date[2] . "-" . $change_date[1] . "-" . $change_date[0];
$year = $getdate['year'];
//getting invoice no
$invoice = $manageData->getLastValue("purchase_log", "*", "invoice_no");
//separating year from invoice no and increase the value by 1
$new_no = sprintf("%05s", substr($invoice[0]['invoice_no'], 5) + 1);
$new_invoice_no = $year . "-" . $new_no;
//update invoice no and date
$updateinvoice = $manageData->updateValueWhere("purchase_log", "invoice_no", $new_invoice_no, "order_id", $order_id);
$updatedate = $manageData->updateValueWhere("purchase_log", "invoice_date", $date, "order_id", $order_id);
//getting member or guest email id
$email = $manageData->getValueWhere("purchase_log", "*", "order_id", $order_id);
if ($email[0]['membership_id'] == 'guest') {
    $email_id = $email[0]['email_id'];
    $price = 'price_guest';
} else {
    $member = $manageData->getValueWhere("member_table", "*", "membership_id", $email[0]['membership_id']);
    $email_id = $member[0]['email_id'];
    $price = 'price_members';
}
//getting the product and coupon id
$all_products = $manageData->getValueWhere("purchase_info", "*", "order_id", $order_id);
//initialize parameter
$product_details = "";
$cate = "";
$quantity = "";
$total_price_without_tax = 0;
Esempio n. 3
0
<?php

session_start();
//include the DAL library for the method to insert the details
include '../library/library.DAL.php';
$manageData = new manageContent_DAL();
//include class mail
include '../library/class.mail.php';
$mail = new Mail();
//taking the values from form
if (isset($GLOBALS['_POST'])) {
    $id = $_POST['id'];
    $amount = $_POST['amount'];
}
//getting member details
$member_id = $manageData->getValueWhere("addmoney_info", "*", "id", $id);
$member_details = $manageData->getValueWhere("member_table", "*", "membership_id", $member_id[0]['membership_id']);
//updating the selected values
$result = $manageData->updateValueWhere("addmoney_info", "amount", $amount, "id", $id);
$result1 = $manageData->updateValueWhere("addmoney_info", "status", 1, "id", $id);
//sending mail to the member
$mailsent = $mail->confirmationOfAddMoney($member_details[0]['email_id'], $member_id[0]['money_id'], $amount);
header("Location: ../../pending_add_money.php");
Esempio n. 4
0
<?php

session_start();
//include the DAL library for the method to insert the details
include '../library/library.DAL.php';
$manageData = new manageContent_DAL();
//taking the values from form
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $old_password = $_POST['old_password'];
    $new_password = $_POST['new_password'];
    $confirm_new_password = $_POST['confirm_new_password'];
}
//checking the values with database values
if ($new_password == $confirm_new_password) {
    $database_pass = $manageData->getValueWhere("admin_info", "*", "id", 1);
    if ($old_password == $database_pass[0]['password']) {
        //update password field
        $update = $manageData->updateValueWhere("admin_info", "password", $new_password, "id", 1);
        $_SESSION['p_msg'] = 'Password Changes Successfully';
        header("Location: ../../changePwd.php");
    } else {
        $_SESSION['p_msg'] = 'old password does not match';
        header("Location: ../../changePwd.php");
    }
} else {
    $_SESSION['p_msg'] = 'password and confirm password field do not match';
    header("Location: ../../changePwd.php");
}
<?php

session_start();
//include the DAL library for the method to insert the details
include '../library/library.DAL.php';
$manageData = new manageContent_DAL();
//include class mail
include '../library/class.mail.php';
$mail = new Mail();
//taking the values from form
$m_id = $_POST['m_id'];
$mail_body = $_POST['mail_body'];
//getting member details
$member_details = $manageData->getValueWhere("member_table", "*", "membership_id", $m_id);
//sending mail to the member
$mailsent = $mail->membershipExtendationMail($member_details[0]['email_id'], $mail_body);
header("Location: ../../membership_extendation.php");
Esempio n. 6
0
//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;
//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->getValueWhere("mlm_info", "id", "membership_id", $membership_id);
    //getting child ids of senior id
    $child_id = $manageData->getValueWhere("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);
}
session_start();
//include the DAL library for the method to insert the details
include '../library/library.DAL.php';
$manageData = new manageContent_DAL();
//taking the values from form
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $product_id = $_POST['product_id'];
    $product_name = $_POST['product_name'];
    $description = $_POST['description'];
    $price = $_POST['price'];
    $discount = $_POST['discount'];
    $stock = $_POST['stock'];
}
//fetching the id value of database
$table_id = $manageData->getValueWhere("membership_product", "id", "product_id", $product_id);
$id = $table_id[0]['id'];
//updating the selected values
if (isset($product_name)) {
    $result = $manageData->updateValueWhere("membership_product", "product_name", $product_name, "id", $id);
}
if (isset($description)) {
    $result = $manageData->updateValueWhere("membership_product", "product_description", $description, "id", $id);
}
if (isset($price)) {
    $result = $manageData->updateValueWhere("membership_product", "price", $price, "id", $id);
}
if (isset($discount)) {
    $result = $manageData->updateValueWhere("membership_product", "discount", $discount, "id", $id);
}
if (isset($stock)) {
Esempio n. 8
0
if (!empty($GLOBALS['_POST']['category']) && isset($GLOBALS['_POST']['category'])) {
    $category = $GLOBALS['_POST']['category'];
    if ($category != "") {
        //convert array to string seperated by commas
        foreach ($category as $cate) {
            $category_string = $category_string . "," . $cate;
        }
    }
    /*
    - remove the first word from the $category_string sa it
    - it contains a comma
    */
    $category_string = substr($category_string, 1);
}
//fetching the id value of database
$table_id = $manageData->getValueWhere("coupon_table", "id", "coupon_id", $coupon_id);
$id = $table_id[0]['id'];
//updating the selected values
if (isset($coupon_name)) {
    $result = $manageData->updateValueWhere("coupon_table", "coupon_name", $coupon_name, "id", $id);
}
if (isset($category_string) && !empty($category_string)) {
    $result = $manageData->updateValueWhere("coupon_table", "category", $category_string, "id", $id);
}
if (isset($description)) {
    $result = $manageData->updateValueWhere("coupon_table", "coupon_description", $description, "id", $id);
}
if (isset($references)) {
    $result = $manageData->updateValueWhere("coupon_table", "references", $references, "id", $id);
}
if (isset($coupon_code)) {
Esempio n. 9
0
<?php

session_start();
//include the DAL library for the method to insert the details
include '../library/library.DAL.php';
$manageData = new manageContent_DAL();
switch ($_POST['refData']) {
    case 'country':
        //taking the values from form
        $country = $_POST['country'];
        $country_id = $manageData->getValueWhere("country", "*", "name", $country);
        //getting state list
        $state_list = $manageData->getValueWhere("zone", "*", "country_id", $country_id[0]['country_id']);
        foreach ($state_list as $state) {
            echo '<option value="' . $state['name'] . '">' . $state['name'] . '</option>';
        }
        break;
    default:
        break;
}