<?php include ("connect.php");?>
<?php
$Today = date("Y-m-d");
//Edit Product Info
if ((isset($_POST["Product"])) && ($_POST["Product"] == "Info")) {
$id =$_POST['id'];
$name = mysqli_real_escape_string($LogoMasters, $_POST['name']);
$description = mysqli_real_escape_string($LogoMasters, $_POST['description']);
$price =$_POST['price'];
$unitNumber =$_POST['unitNumber'];
$manufacture = mysqli_real_escape_string($LogoMasters, $_POST['manufacture']);
$nfcu =$_POST['nfcu'];
$main =$_POST['main'];
$FloridaWest =$_POST['FloridaWest'];
$GE =$_POST['GE'];
$EC =$_POST['EC'];
$featured_nfcu =$_POST['featured_nfcu'];
$featured_main =$_POST['featured_main'];
$featured_FloridaWest =$_POST['featured_FloridaWest'];
$featured_GE =$_POST['featured_GE'];
$featured_EC =$_POST['featured_EC'];
$OnSale =$_POST['OnSale'];
$New =$_POST['New'];
$Popular =$_POST['Popular'];
$OddsEnds =$_POST['OddsEnds'];
$GE_Standard =$_POST['GE_Standard'];
$Companion_Style =$_POST['Companion_Style'];
$Embroidery =$_POST['Embroidery'];
$Print =$_POST['Print'];
$Blank =$_POST['Blank'];
$AllowPurchase =$_POST['Allow_Purchase'];
$AMGI_PRICE =$_POST['AMGI_PRICE'];
$showPrice_main =$_POST['showPrice_main'];
$showPrice_EC =$_POST['showPrice_EC'];
$showPrice_GE =$_POST['showPrice_GE'];
$showPrice_NFCU =$_POST['showPrice_NFCU'];
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET name='$name', description='$description', price='$price', unitNumber='$unitNumber', manufacture='$manufacture', nfcu='$nfcu', main='$main', GE='$GE', EC='$EC', FloridaWest='$FloridaWest', featured_nfcu='$featured_nfcu', featured_main='$featured_main', featured_GE='$featured_GE', featured_EC='$featured_EC', featured_FloridaWest='$featured_FloridaWest', OnSale='$OnSale', New='$New', Popular='$Popular', OddsEnds='$OddsEnds', GE_Standard = '$GE_Standard', Companion_Style='$Companion_Style', Embroidery='$Embroidery', Print='$Print', Blank='$Blank', Allow_Purchase='$AllowPurchase', AMGI_PRICE='$AMGI_PRICE', date_updated='$Today', showPrice_main='$showPrice_main', showPrice_EC='$showPrice_EC', showPrice_GE='$showPrice_GE', showPrice_NFCU='$showPrice_NFCU' WHERE id='$id'");
$AddGoTo = "../edit-product-basic.php?pid=$id";
header("Location: $AddGoTo");
}
if((isset($_POST['Edit'])) && ($_POST['Edit'] == "PrimaryImage")) {
$image = ""; $image = $image . basename($_FILES['image']['name']);
$id = $_POST['id'];
$new = $id."-".$image;
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET image='$new', date_updated='$Today' WHERE id='$id'") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['image']['tmp_name'], "../../../largeimages/" .$new));
$updateGoTo = "../edit-product-basic.php?pid=$id";
header("Location: $updateGoTo");
}
//Edit Product Placement
if ((isset($_POST["Product"])) && ($_POST["Product"] == "Placement")) {
$id =$_POST['id'];
$Men =$_POST['Men'];
$Woman =$_POST['Woman'];
$Youth =$_POST['Youth'];
$Junior =$_POST['Junior'];
$all_polos =$_POST['all_polos'];
$polo_solid =$_POST['polo_solid'];
$polo_perform =$_POST['polo_perform'];
$polo_trim =$_POST['polo_trim'];
$polo_long =$_POST['polo_long'];
$polo_pocket =$_POST['polo_pockets'];
$polo_sweater =$_POST['polo_sweater'];
$polo_knit =$_POST['polo_knit'];
$woven_button =$_POST['woven_button'];
$woven_long =$_POST['woven_long'];
$woven_short =$_POST['woven_short'];
$woven_3_4 =$_POST['woven_3_4'];
$woven_camp =$_POST['woven_camp'];
$woven_outdoor =$_POST['woven_outdoor'];
$big_tall =$_POST['big_tall'];
$big_polo =$_POST['big_polo'];
$big_woven =$_POST['big_woven'];
$big_outerwear =$_POST['big_outerwear'];
$big_fleece =$_POST['big_fleece'];
$tshirt_fleece =$_POST['tshirt_fleece'];
$T_basic =$_POST['T_basic'];
$T_long =$_POST['T_long'];
$T_pocket =$_POST['T_pocket'];
$T_perform =$_POST['T_perform'];
$T_fashion =$_POST['T_fashion'];
$T_sweats =$_POST['T_sweats'];
$u_workwear =$_POST['u_workwear'];
$u_medical =$_POST['u_medical'];
$u_industrial =$_POST['u_industrial'];
$u_hospitality =$_POST['u_hospitality'];
$u_safety =$_POST['u_safety'];
$u_flame =$_POST['u_flame'];
$team_sports =$_POST['team_sports'];
$team_top =$_POST['team_top'];
$team_bottom =$_POST['team_bottom'];
$team_head =$_POST['team_head'];
$team_warmup =$_POST['team_warmup'];
$team_belts =$_POST['team_belts'];
$all_outerwear =$_POST['all_outerwear'];
$outer_wind =$_POST['outer_wind'];
$outer_jackets =$_POST['outer_jackets'];
$outer_polar =$_POST['outer_polar'];
$all_headwear =$_POST['all_headwear'];
$head_cap =$_POST['head_cap'];
$head_visor =$_POST['head_visor'];
$head_bags =$_POST['head_bags'];
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET Men='$Men', Woman='$Woman', Youth='$Youth', Junior='$Junior', all_polos='$all_polos', polo_solid='$polo_solid', polo_perform='$polo_perform', polo_trim='$polo_trim', polo_long='$polo_long', polo_pockets='$polo_pocket', polo_sweater='$polo_sweater', polo_knit='$polo_knit', woven_button='$woven_button', woven_long='$woven_long', woven_short='$woven_short', woven_3_4='$woven_3_4', woven_camp='$woven_camp', woven_outdoor='$woven_outdoor', big_tall='$big_tall', big_polo='$big_polo', big_woven='$big_woven', big_outerwear='$big_outerwear', big_fleece='$big_fleece', tshirt_fleece='$tshirt_fleece', T_basic='$T_basic', T_long='$T_long', T_pocket='$T_pocket', T_perform='$T_perform', T_fashion='$T_fashion', T_sweats='$T_sweats', u_workwear='$u_workwear', u_medical='$u_medical', u_industrial='$u_industrial', u_hospitality='$u_hospitality', u_safety='$u_safety', u_flame='$u_flame', team_sports='$team_sports', team_top='$team_top', team_bottom='$team_bottom', team_head='$team_head', team_warmup='$team_warmup', team_belts='$team_belts', all_outerwear='$all_outerwear', outer_wind='$outer_wind', outer_jackets='$outer_jackets', outer_polar='$outer_polar', all_headwear='$all_headwear', head_cap='$head_cap', head_visor='$head_visor', head_bags='$head_bags', date_updated='$Today' WHERE id='$id'");
$AddGoTo = "../edit-product-basic.php?pid=$id";
header("Location: $AddGoTo");
}
//Edit Product Size
if ((isset($_POST["Product"])) && ($_POST["Product"] == "Size")) {
$id =$_POST['id'];
$XXS =$_POST['XXS'];
$XS =$_POST['XS'];
$S =$_POST['S'];
$M =$_POST['M'];
$L =$_POST['L'];
$XL =$_POST['XL'];
$XXL =$_POST['XXL'];
$XXXL =$_POST['XXXL'];
$XL4 =$_POST['4XL'];
$XL5 =$_POST['5XL'];
$XL6 =$_POST['6XL'];
$LT =$_POST['LT'];
$XLT =$_POST['XLT'];
$XLT2 =$_POST['2XLT'];
$XLT3 =$_POST['3XLT'];
$XLT4 =$_POST['4XLT'];
$XLT5 =$_POST['5XLT'];
$XLT6 =$_POST['6XLT'];
$S_M =$_POST['S_M'];
$M_L =$_POST['M_L'];
$L_XL =$_POST['L_XL'];
$OSFM =$_POST['OSFM'];
$Y_7_9 =$_POST['Y_7_9'];
$I_9_11 =$_POST['I_9_11'];
$A_10_13 =$_POST['A_10_13'];
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET XXS='$XXS', XS='$XS', S='$S', M='$M', L='$L', XL='$XL', XXL='$XXL', XXXL='$XXXL', 4XL='$XL4', 5XL='$XL5', 6XL='$XL6', LT='$LT', XLT='$XLT', 2XLT='$XLT2', 3XLT='$XLT3', 4XLT='$XLT4', 5XLT='$XLT5', 6XLT='$XLT6', S_M='$S_M', M_L='$M_L', L_XL='$L_XL', OSFM='$OSFM', Y_7_9='$Y_7_9', I_9_11='$I_9_11', A_10_13='$A_10_13', date_updated='$Today' WHERE id='$id'");
$AddGoTo = "../edit-product-size-chart.php?pid=$id";
header("Location: $AddGoTo");
}
//Edit Product Size
if ((isset($_POST["SizePrices"])) && ($_POST["SizePrices"] == "Edit")) {
$id =$_POST['pid'];
$XXS =$_POST['price_XXS'];
$XS =$_POST['price_XS'];
$S =$_POST['price_S'];
$M =$_POST['price_M'];
$L =$_POST['price_L'];
$XL =$_POST['price_XL'];
$XXL =$_POST['price_2XL'];
$XXXL =$_POST['price_3XL'];
$XL4 =$_POST['price_4XL'];
$XL5 =$_POST['price_5XL'];
$XL6 =$_POST['price_6XL'];
$LT =$_POST['price_LT'];
$XLT =$_POST['price_XLT'];
$XLT2 =$_POST['price_2XLT'];
$XLT3 =$_POST['price_3XLT'];
$XLT4 =$_POST['price_4XLT'];
$XLT5 =$_POST['price_5XLT'];
$XLT6 =$_POST['price_6XLT'];
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET price_XXS='$XXS', price_XS='$XS', price_S='$S', price_M='$M', price_L='$L', price_XL='$XL', price_2XL='$XXL', price_3XL='$XXXL', price_4XL='$XL4', price_5XL='$XL5', price_6XL='$XL6', price_LT='$LT', price_XLT='$XLT', price_2XLT='$XLT2', price_3XLT='$XLT3', price_4XLT='$XLT4', price_5XLT='$XLT5', price_6XLT='$XLT6', date_updated='$Today' WHERE id='$id'");
$AddGoTo = "../edit-product-size-chart.php?pid=$id";
header("Location: $AddGoTo");
}
//Edit Product Bust Sizes
if ((isset($_POST["Edit"])) && ($_POST["Edit"] == "BustSizes")) {
$id =$_POST['id'];
$XXS =$_POST['B_XXS'];
$XS =$_POST['B_XS'];
$S =$_POST['B_S'];
$M =$_POST['B_M'];
$L =$_POST['B_L'];
$XL =$_POST['B_XL'];
$XXL =$_POST['B_2XL'];
$XXXL =$_POST['B_3XL'];
$XL4 =$_POST['B_4XL'];
$XL5 =$_POST['B_5XL'];
$XL6 =$_POST['B_6XL'];
$LT =$_POST['B_LT'];
$XLT =$_POST['B_XLT'];
$XLT2 =$_POST['B_2XLT'];
$XLT3 =$_POST['B_3XLT'];
$XLT4 =$_POST['B_4XLT'];
$XLT5 =$_POST['B_5XLT'];
$XLT6 =$_POST['B_6XLT'];
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET B_XXS='$XXS', B_XS='$XS', B_S='$S', B_M='$M', B_L='$L', B_XL='$XL', B_2XL='$XXL', B_3XL='$XXXL', B_4XL='$XL4', B_5XL='$XL5', B_6XL='$XL6', B_LT='$LT', B_XLT='$XLT', B_2XLT='$XLT2', B_3XLT='$XLT3', B_4XLT='$XLT4', B_5XLT='$XLT5', B_6XLT='$XLT6', date_updated='$Today' WHERE id='$id'");
$AddGoTo = "../edit-product-size-chart.php?pid=$id";
header("Location: $AddGoTo");
}
//Edit Product Pant Sizes
if ((isset($_POST["Edit"])) && ($_POST["Edit"] == "PantSizes")) {
$id =$_POST['id'];
$XXS_W =$_POST['XXS_W'];
$XS_W =$_POST['XS_W'];
$S_W =$_POST['S_W'];
$M_W =$_POST['M_W'];
$L_W =$_POST['L_W'];
$XL_W =$_POST['XL_W'];
$XXL_W =$_POST['2XL_W'];
$XXXL_W =$_POST['3XL_W'];
$XL4_W =$_POST['4XL_W'];
$XL5_W =$_POST['5XL_W'];
$XL6_W =$_POST['6XL_W'];
$XXS_L =$_POST['LN_XXS'];
$XS_L =$_POST['LN_XS'];
$S_L =$_POST['LN_S'];
$M_L =$_POST['LN_M'];
$L_L =$_POST['LN_L'];
$XL_L =$_POST['LN_XL'];
$XXL_L =$_POST['LN_2XL'];
$XXXL_L =$_POST['LN_3XL'];
$XL4_L =$_POST['LN_4XL'];
$XL5_L =$_POST['LN_5XL'];
$XL6_L =$_POST['LN_6XL'];
// Connects to your Database
//Writes the information to the database
mysqli_query($LogoMasters, "UPDATE products SET XXS_W ='$XXS_W', XS_W ='$XS_W', S_W='$S_W', M_W='$M_W', L_W='$L_W', XL_W='$XL_W', 2XL_W='$XXL_W', 3XL_W='$XXXL_W', 4XL_W='$XL4_W', 5XL_W='$XL5_W', 6XL_W='$XL6_W', LN_XXS='$XXS_L', LN_XS='$XS_L', LN_S='$S_L', LN_M='$M_L', LN_L='$L_L', LN_XL='$XL_L', LN_2XL='$XXL_L', LN_3XL='$XXXL_L', LN_4XL='$XL4_L', LN_5XL='$XL5_L', LN_6XL='$XL6_L', date_updated='$Today' WHERE id='$id'");
$AddGoTo = "../edit-product-size-chart.php?pid=$id";
header("Location: $AddGoTo");
}
// Edit Product Colors
if((isset($_POST['Edit'])) && ($_POST['Edit'] == "Color")) {
$id = $_POST['id'];
$image = ""; $image = $image . basename($_FILES['largeImage']['name']);
$pid = $_POST['pid'];
$color = mysqli_real_escape_string($LogoMasters, $_POST['color']);
$thumbnail = $_POST['thumbnail'];
$FloridaWest = $_POST['FloridaWest'];
$new = $pid."-".$image;
if($_POST['largeImage'] == ''){
// Connects to your Database
mysqli_query($LogoMasters, "UPDATE images SET color='$color', FlordiaWest='$FloridaWest', thumbnail='$thumbnail' WHERE id='$id'");
$updateGoTo = "../color-editor.php?color=$id&&pid=$pid";
header("Location: $updateGoTo");
}
else {
// Connects to your Database
mysqli_query($LogoMasters, "UPDATE images SET color='$color', thumbnail='$thumbnail', FlordiaWest='$FloridaWest', largeImage='$new' WHERE id='$id'");
if(move_uploaded_file($_FILES['largeImage']['tmp_name'], "../../../largeimage/" .$new));
$updateGoTo = "../color-editor.php?color=$id&&pid=$pid";
header("Location: $updateGoTo");
}
}
if((isset($_POST['Edit'])) && ($_POST['Edit'] == "SpecPDF")) {
$image = ""; $image = $image . basename($_FILES['specPDF']['name']);
$pid = $_POST['pid'];
$new = $pid."-".$image;
$date = date("Y-m-d");
$query_SpecSheet = "SELECT * FROM product_specs WHERE pid = $pid";
$SpecSheet = mysqli_query($LogoMasters, $query_SpecSheet);
$row_SpecSheet = mysqli_fetch_assoc($SpecSheet);
$totalRows_SpecSheet = mysqli_num_rows($SpecSheet);
if($totalRows_SpecSheet > 0){
$file_to_delete = "../../../specs/".$row_SpecSheet['pdf'];
// Connects to your Database
mysqli_query($LogoMasters, "DELETE FROM product_specs WHERE pid = '$pid'");
unlink($file_to_delete);
}
mysqli_query($LogoMasters, "INSERT INTO product_specs (pid, pdf, date) VALUES ('$pid', '$new', '$date')");
if(move_uploaded_file($_FILES['specPDF']['tmp_name'], "../../../specs/" .$new));
$updateGoTo = "../edit-product-size-chart.php?pid=$pid";
header("Location: $updateGoTo");
}
?> |