$price_guest = $_POST['price_guest']; $price_members = $_POST['price_members']; $tax = $_POST['tax']; $discount = $_POST['discount']; $stock = $_POST['stock']; $expiration_date = $_POST['expiration_date']; $maxpick = $_POST['maxpick']; $photo = $_FILES['photo']['name']; $photo1 = $_FILES['photo1']['name']; $photo2 = $_FILES['photo2']['name']; $photo3 = $_FILES['photo3']['name']; $photo4 = $_FILES['photo4']['name']; } /* creating coupon id for new product */ //getting last value of coupon id $c_id = $manageData->getLastValue("coupon_table", "coupon_id", "id"); if ($c_id[0]['coupon_id'] != "") { //setting the new coupon id increamented by 1 $new_c_id = substr($c_id[0]['coupon_id'], 7) + 1; //coupon id for new coupon $coupon_id = "Coupon_" . $new_c_id; } else { $coupon_id = "Coupon_1001"; } /* product id is set*/ //getting current date/time $getdate = getdate(); $date = $getdate['year'] . "-" . $getdate['mon'] . "-" . $getdate['mday']; if (!empty($photo)) { //move the uploaded file to the UI Layer img folder of main image $result_upload = $uploadFile->upload_file($coupon_id, 'photo', '../../../img/');
$manageData = new manageContent_DAL(); //include the library for uploading the files include '../library/class.upload_file.php'; $uploadFile = new FileUpload(); //taking the values from form if ($_SERVER['REQUEST_METHOD'] == 'POST') { $product_name = $_POST['product_name']; $description = $_POST['description']; $price = $_POST['price']; $discount = $_POST['discount']; $stock = $_POST['stock']; $photo = $_FILES['photo']['name']; } /* creating product id for new product */ //getting last value of product id $p_id = $manageData->getLastValue("membership_product", "product_id", "product_id"); if ($p_id[0]['product_id'] != "") { //setting the new product id increamented by 1 $new_p_id = substr($p_id[0]['product_id'], 2) + 1; //product id for new product $product_id = "M_" . $new_p_id; } else { $product_id = "M_1001"; } /* product id is set*/ if (!empty($photo)) { //move the uploaded file to the UI Layer img folder $result_upload = $uploadFile->upload_file($product_id, 'photo', '../../../img/'); //photo_name variable saves the image location. $photo_name = "img/" . $result_upload; } else {
$order_id = $_GET['o_id']; if (!empty($order_id)) { //setting payment request value $value = "Progressing"; //calling method for money distribution $result = $manageData->updateValueWhere("purchase_info", "payment_request", $value, "order_id", $order_id); } //getting current date $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';
$price_guest = $_POST['price_guest']; $price_members = $_POST['price_members']; $tax = $_POST['tax']; $discount = $_POST['discount']; $stock = $_POST['stock']; $expiration_date = $_POST['expiration_date']; $maxpick = $_POST['maxpick']; $photo = $_FILES['photo']['name']; $photo1 = $_FILES['photo1']['name']; $photo2 = $_FILES['photo2']['name']; $photo3 = $_FILES['photo3']['name']; $photo4 = $_FILES['photo4']['name']; } /* creating product id for new product */ //getting last value of product id $p_id = $manageData->getLastValue("product_table", "product_id", "product_id"); if ($p_id[0]['product_id'] != "") { //setting the new product id increamented by 1 $new_p_id = substr($p_id[0]['product_id'], 2) + 1; //product id for new product $product_id = "P_" . $new_p_id; } else { $product_id = "P_1001"; } /* product id is set*/ //getting current date/time $getdate = getdate(); $date = $getdate['year'] . "-" . $getdate['mon'] . "-" . $getdate['mday']; //move the uploaded file to the UI Layer img folder of main image $result_upload = $uploadFile->upload_file($product_id, 'photo', '../../../img/'); //photo_name variable saves the image location