コード例 #1
0
    $heading1 = $_POST['heading1'];
    $link1 = $_POST['link1'];
    $description1 = $_POST['description1'];
    $heading2 = $_POST['heading2'];
    $link2 = $_POST['link2'];
    $description2 = $_POST['description2'];
    $heading3 = $_POST['heading3'];
    $link3 = $_POST['link3'];
    $description3 = $_POST['description3'];
    $photo1 = $_FILES['photo1']['name'];
    $photo2 = $_FILES['photo2']['name'];
    $photo3 = $_FILES['photo3']['name'];
}
if (!empty($photo1)) {
    //1st other image upload
    $result_upload_1st = $uploadFile->upload_file('slider_1st', 'photo1', '../../../img/');
    //photo_name variable saves the image location
    $photo_name1 = "img/" . $result_upload_1st;
} else {
    $photo_name1 = "";
}
if (!empty($photo2)) {
    //2nd other image upload
    $result_upload_2nd = $uploadFile->upload_file('slider_2nd', 'photo2', '../../../img/');
    //photo_name variable saves the image location
    $photo_name2 = "img/" . $result_upload_2nd;
} else {
    $photo_name2 = "";
}
if (!empty($photo3)) {
    //3rd other image upload
コード例 #2
0
ファイル: function.addCoupon.php プロジェクト: enakee/mlm
$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/');
    //photo_name variable saves the image location
    $photo_name = "img/" . $result_upload;
} else {
    $photo_name = "";
}
if (!empty($photo1)) {
    //1st other image upload
    $result_upload_1st = $uploadFile->upload_file($coupon_id . '_1st', 'photo1', '../../../img/');
    //photo_name variable saves the image location
    $photo_name1 = "img/" . $result_upload_1st;
} else {
    $photo_name1 = "";
}
if (!empty($photo2)) {
    //2nd other image upload
コード例 #3
0
}
/* 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 {
    $photo_name = "";
}
/*checking the number of product is more than '5' or not
 * setting the database value for stock column
 */
if ($stock > 5) {
    $status = 1;
} else {
    $status = 0;
}
//discount is set or not
if (!empty($discount)) {