/
var
/
www
/
html
/
stengineers
/
admin
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once 'dbconnection.php'; error_reporting(0); $pmenu_active = "active"; include 'header.php'; $product_id = $_GET['id']; $row1 = mysqli_query($con, "select * from products as a where a.product_id='$product_id'"); $row2 = mysqli_fetch_array($row1); $modal = $row2['modal']; $product_title = $row2['product_title']; $description = $row2['description']; $product_desc = $row2['product_desc']; $brouchure = $row2['brouchure']; $preview_image = $row2['preview_image']; $gal_img = $row2['product_gallery']; $gallery_array = explode(',', $gal_img); $status = $row2['status']; $categoryId = $row2['category']; $sub_category = $row2['sub_category']; $mrp = $row2['mrp']; $selling_price = $row2['selling_price']; $price_status = $row2['price_status']; $display_order = $row2['display_order']; $brand = $row2['brandid']; $feature1 = $row2['feature1']; $feature2 = $row2['feature2']; $feature3 = $row2['feature3']; $fdescription1 = $row2['fdescription1']; $fdescription2 = $row2['fdescription2']; $fdescription3 = $row2['fdescription3']; $video_link = $row2['video_link']; $h1_title = $row2['h1_title']; $pagetitle = $row2['pagetitle']; $metadescription = $row2['metadescription']; $metatags = $row2['metatags']; ?> <style> .tab__container { background: #fafafa; width: 75vw; margin: auto; border-radius: 5px; padding: 30px 30px 120px; max-width: 1200px; } .tab__title { margin: 25px 0 0; } .tab__title .tab__button:first-of-type { margin: 0; } .tab__title .tab__button { padding: 15px; color: #545454; border: 1px solid #e5e5e5; background: #f5f5f5; outline: none; margin: 0 -5px; cursor: pointer; width: 25%; } .tab__title .tab__button img { height: 25px; display: block; margin: 0px auto 5px; -webkit-filter: grayscale(100%); filter: grayscale(100%); transition: filter 0.3s ease; } .tab__title .tab_button-active { border-bottom: none; background: #008D42; color: #fff; } .tab__title .tab_button-active img { filter: none; } .tab__inside { display:block; visibility: hidden; opacity: 0; height: 0; transform: translateY(10px); transition: transform 0.3s ease-in; } .tab__inside-active { visibility: visible; opacity: 1; height: 100%; transform: translateY(0); transition: transform 0.3s ease-out 0.1s, opacity 0.3s ease-out 0.1s; } .custom-dropdown { position: relative; display: inline-block; } .custom-option { display: flex; align-items: center; padding: 5px; cursor: pointer; } .brand-logo { max-width: 30px; max-height: 30px; margin-right: 10px; } /* Hidden default select box */ select { display: none; } </style> <div class="tab__title"> <button class="tab__button tab_button-active">Edit Product</button> <!-- <button class="tab__button" onclick="openTab('two')">Specifications</button> --> </div> <div id="one" class=""> <div class="card o-hidden border-0 "> <div class="card-body p-0"> <!-- Nested Row within Card Body --> <div class="row"> <!-- <div class="col-lg-5 d-none d-lg-block bg-register-image"></div> --> <div class="col-lg-12"> <div class="ml-4 mr-4"> <form class="user"> <input type="hidden" class="form-control form-control-solid" id="product_id" name="id" value="<?php echo $product_id ?>" > <div class="form-group row"> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Product Name</label> <input type="text" class="form-control form-control-solid" id="product_name" name="product_name" value="<?php echo $product_title ?>" placeholder="Product Name"> <div class="audit_error" style="color:red;" id="productErr"></div> </div> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Product Modal</label> <input type="text" class="form-control form-control-solid" id="product_modal" name="product_modal" value="<?php echo $modal ?>" placeholder="Product Modal"> <div class="audit_error" style="color:red;" id="product_modalErr"></div> </div> <div class="col-sm-4"> <?php // Fetch the category ID associated with the product $resultProductCategory = $con->query("SELECT category FROM products WHERE product_id = $product_id"); if (!$resultProductCategory) { // Query failed, handle the error die('Error in query: ' . $con->error); } // Fetch categories from the 'categories' table $resultCategories = $con->query("SELECT id, category_name FROM category WHERE category_type='Parent' AND status='active'"); if (!$resultCategories) { // Query failed, handle the error die('Error in query: ' . $con->error); } // Get the category ID associated with the product if ($rowProductCategory = $resultProductCategory->fetch_assoc()) { $selectedCategoryId = $rowProductCategory['category']; } else { // Set a default value if the product ID is not found or there is no associated category $selectedCategoryId = ''; } ?> <label>Product Category</label> <select class="form-control form-control-solid" name="category" id="category"> <option value="">Select</option> <?php while ($rowCategory = $resultCategories->fetch_assoc()) { $categoryId = $rowCategory['id']; $categoryName = $rowCategory['category_name']; $selected = ($categoryId == $selectedCategoryId) ? 'selected="selected"' : ''; echo "<option value='$categoryId' $selected>$categoryName</option>"; } ?> </select> <!-- <label>Product Category</label> <select class="form-control form-control-solid" name="category" id="category" > <option value="">Select Category</option> <option value="active">Active</option> <option value="inactive">Inactive</option> </select> --> <div class="audit_error" style="color:red;" id="categoryErr"></div> </div> </div> <div class="form-group row"> <div class="col-sm-8"> <label>Brouchure</label> <input type="hidden" id="pdf_path" name="pdf_path" value="<?php echo $brouchure ?>"/> <form method="post" action="" enctype="multipart/form-data" id="myform"> <!-- Hidden input for storing file path --> <div class="form-control form-control-solid" style="padding-bottom: 45px !important;display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="pdfFile" name="pdfFile" accept=".pdf" required value="<?php echo $brouchure ?>" /> <button type="button" class="btn btn-success" value="Upload" id="pdf_upload">Upload <i class="fas fa-upload"></i></button> </div> </form> <div id="pdfFileErr" class="audit_error" style="color: red;"></div> <?php if ($brouchure != '') { echo "<br><div id='my_resume' class='profile-skill' style='text-align: center;width: 30%; margin:0 auto;'><a target='_blank' href='$brouchure'>View Brouchure</a> [ <a style='width: 10%; height: 25px;' class='btn btn-danger btn-circle btn-sm' onclick='deletebrouchure()'><i class='fas fa-trash'></i></a> ]</div><br>"; } else{ echo "<br><div id='my_resume' class='profile-skill' style='text-align: center;width: 30%; margin:0 auto;'></div>"; } ?> </div> <div class="col-sm-4"> <?php // Assuming $product_id has a valid value // Fetch the category ID associated with the product $resultProductCategory = $con->query("SELECT sub_category FROM products WHERE product_id = $product_id"); if (!$resultProductCategory) { // Query failed, handle the error die('Error in query: ' . $con->error); } // Fetch subcategories from the 'category' table where category_type is 'Child' $resultSubCategories = $con->query("SELECT id, category_name FROM category WHERE category_type='Child' AND status='active'"); if (!$resultSubCategories) { // Query failed, handle the error die('Error in query: ' . $con->error); } // Get the category ID associated with the product if ($rowProductCategory = $resultProductCategory->fetch_assoc()) { $selectedSubCategoryId = $rowProductCategory['sub_category']; } else { // Set a default value if the product ID is not found or there is no associated category $selectedSubCategoryId = ''; } ?> <label>Product Sub Category</label> <select class="form-control form-control-solid" name="subcategory" id="subcategory"> <option value="">Select</option> <?php while ($rowSubCategory = $resultSubCategories->fetch_assoc()) { $subCategoryId = $rowSubCategory['id']; $subCategoryName = $rowSubCategory['category_name']; $selected = ($subCategoryId == $selectedSubCategoryId) ? 'selected="selected"' : ''; echo "<option value='$subCategoryId' $selected>$subCategoryName</option>"; } ?> </select> <div class="audit_error" style="color:red;" id="subcategoryErr"></div> </div> </div> <div class="form-group row"> <!-- <div class="col-sm-1"> <img src="" id="tpimg" width="50" height="50" > </div> <div class="col-sm-3"> <input type="hidden" id='event_img' name="event_img"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <img src="" id="img" width="250" height="250" style="display: none;"> <div class="form-control form-control-solid" style="padding-bottom: 45px !important;display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="logofile" name="logofile" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload">Click Here to Upload thumb image <i class="fas fa-upload"></i></button> </div> </form> --> <div class="col-sm-8"> <label>Product Preview Image</label><br> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="<?php echo $preview_image ?>" id="tpimg" width="50" height="50" > <input type="hidden" id='event_img' name="event_img" value="<?php echo $preview_image ?>"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="padding-bottom: 45px !important;display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="logofile" name="logofile" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div> <div class="audit_error" style="color:red;" id="thumb_imgErr"></div> </div> <div class="col-sm-4 mb-sm-0"> <?php // Assuming $product_id has a valid value // Fetch the category ID associated with the product $resultProductCategory = $con->query("SELECT brandid FROM products WHERE product_id = $product_id"); if (!$resultProductCategory) { // Query failed, handle the error die('Error in query: ' . $con->error); } // Check if there is a record with the specified product_id if ($resultProductCategory->num_rows > 0) { // Fetch the first row $rowProductCategory = $resultProductCategory->fetch_assoc(); $selectedSubCategoryId = $rowProductCategory['brandid']; } else { // Set a default value if the product ID is not found or there is no associated category $selectedSubCategoryId = ''; } // Fetch subcategories from the 'brand' table $resultSubCategories = $con->query("SELECT id, brandname, brandlogo, status FROM brand WHERE status='active'"); if (!$resultSubCategories) { // Query failed, handle the error die('Error in query: ' . $con->error); } ?> <label>Brand</label> <select class="form-control js-example-basic-single form-control-solid" name="brand" id="brand" onchange="updateImage()" > <option value="">Select</option> <?php /// Debug statement echo "Selected Category ID: $selectedSubCategoryId<br>"; // Reset the resultSubCategories pointer to the beginning of the result set $resultSubCategories->data_seek(0); // Initialize a variable to store the selected brand's image URL $selectedBrandImage = ''; // Iterate over the subcategories while ($rowSubCategory = $resultSubCategories->fetch_assoc()) { $subCategoryId = $rowSubCategory['id']; $subCategoryName = $rowSubCategory['brandname']; $brandlogo = $rowSubCategory['brandlogo']; // Debug statement echo "Comparing $subCategoryId with $selectedSubCategoryId - Result: " . (trim((string) $subCategoryId) === trim((string) $selectedSubCategoryId) ? 'Match' : 'No Match') . "<br>"; $selected = (trim((string) $subCategoryId) === trim((string) $selectedSubCategoryId)) ? 'selected="selected"' : ''; // Store the selected brand's image URL when there is a match if ($selected) { $selectedBrandImage = $brandlogo; } echo "<option value='$subCategoryId' data-image='$brandlogo' $selected>$subCategoryName</option>"; } ?> </select> <div> <img id="selectedImage" src=<?php echo $selectedBrandImage; ?> alt="Selected Brand Image"> </div> <div class="audit_error" style="color:red;" id="brandErr"></div> </div> </div> <div class="form-group row"> <div class="col-sm-8"> <label for="male">Product Gallery</label> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="padding-bottom: 45px !important; display: grid; grid-template-columns: 1fr auto;"> <input type="file" id="galfile" name="galfile[]" multiple /> <button type="button" class="btn btn-success" id="gal_upload">Upload Images <i class="fas fa-upload"></i></button> </div> <br> <div id='galimg'> <?php $nimg = ""; for ($i = 0; $i < count($gallery_array); $i++) { if ($gallery_array[$i] != "" && $gallery_array[$i] != ",") { echo "<div id='galimgdels$i' style='float: left;'><img class=btn-delete style='width:20px; height:20px; position: absolute;cursor: pointer;' src='img/remove-icon.png' onclick=deleteimg('" . $gallery_array[$i] . "','" . $i . "') /> <img src='" . $gallery_array[$i] . "' width=200px height=200px style='margin-right:20px;margin-bottom: 25px;' class='dele' ></div>"; $nimg .= $gallery_array[$i] . ","; } } echo "<input type='hidden' id='gallery_array' name='gallery_array[]' value='$nimg'>"; ?> </div> <div class="audit_error" style="color:red;" id="gal_imgErr"></div> </div> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Product Video Link</label> <textarea class="form-control form-control-solid" id="video_link" placeholder="Enter Youtube / Vimeo Link" name="video_link" rows="2"><?php echo $video_link; ?></textarea> <div class="audit_error" style="color:red;" id="video_linkErr"></div> </div> </div> <div class="form-group row"> <label>Product Description</label> <textarea class="form-control form-control-solid" id="description" placeholder="Description" name="description" rows="2"><?php echo $description ?></textarea> <div class="audit_error" style="color:red;" id="descriptionErr"></div> <!-- <div id="summernote"><?php echo $product_desc; ?></div> <div class="audit_error" style="color:red;" id="bcontentErr"></div> --> </div> <div class="form-group row"> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Feature 1</label> <input type="text" class="form-control form-control-solid" id="Ftitle1" name="feature1" value="<?php echo $feature1 ?>" placeholder="Feature Title1" style="margin-bottom:15px;"> <textarea class="form-control form-control-solid" id="fdescription1" placeholder="Description" name="description" rows="2"><?php echo $fdescription1 ?></textarea> <div class="audit_error" style="color:red;" id="descriptionErr"></div> </div> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Feature 2</label> <input type="text" class="form-control form-control-solid" id="Ftitle2" name="feature2" value="<?php echo $feature2 ?>" placeholder="Feature Title2" style="margin-bottom:15px;"> <textarea class="form-control form-control-solid" id="fdescription2" placeholder="Description" name="description" rows="2"><?php echo $fdescription2 ?></textarea> <div class="audit_error" style="color:red;" id="descriptionErr"></div> </div> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Feature 3</label> <input type="text" class="form-control form-control-solid" id="Ftitle3" name="feature3" value="<?php echo $feature3 ?>" placeholder="Feature Title3" style="margin-bottom:15px;"> <textarea class="form-control form-control-solid" id="fdescription3" placeholder="Description" name="description" rows="2"><?php echo $fdescription3 ?></textarea> <div class="audit_error" style="color:red;" id="descriptionErr"></div> </div> </div> <?php $s = "SELECT * FROM product_feature WHERE product_id='$product_id'"; $res = mysqli_query($con, $s); $num = mysqli_num_rows($res); if ($num == 0) { ?> <div class="form-group row"> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 1</label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature1" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg1" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img1' name="feature_img1"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature1" name="filefeature1" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature1"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc1"></div> </div> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 2</label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature2" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg2" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img2' name="feature_img2"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature2" name="filefeature2" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature2"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc2"></div> </div> </div> <div class="form-group row"> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 3</label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature3" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg3" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img3' name="feature_img3"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature3" name="filefeature3" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature3"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc3"></div> </div> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 4</label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature4" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg4" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img4' name="feature_img4"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature4" name="filefeature4" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature4"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc4"></div> </div> </div> <div class="form-group row"> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 5</label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature5" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg5" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img5' name="feature_img5"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature5" name="filefeature5" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature5"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc5"></div> </div> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features 6</label><br> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature6" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="" id="featureimg6" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img6' name="feature_img6"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature6" name="filefeature6" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature6"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc6"></div> </div> </div> <?php } else { ?> <div class="form-group row"> <?php $ifeat = "0"; $result_f = $con->query("SELECT * FROM product_feature WHERE product_id='$product_id' ORDER BY feature_order asc"); while ($row_f = $result_f->fetch_assoc()) { $feature_data = $row_f['feature_data']; $feature_image = $row_f['image']; $feature_order = $row_f['feature_order']; ?> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features <?php echo $feature_order; ?></label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="img/remove-icon.png" id="delete_feature<?php echo $feature_order; ?>" style="position: absolute; top: 49px; left: 21px; width: 17px; height: 17px; cursor: pointer;"> <img src="<?php echo $feature_image; ?>" id="featureimg<?php echo $feature_order; ?>" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img<?php echo $feature_order; ?>' name="feature_img<?php echo $feature_order; ?>" value="<?php echo $feature_image; ?>"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature<?php echo $feature_order; ?>" name="filefeature<?php echo $feature_order; ?>" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature<?php echo $feature_order; ?>"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc<?php echo $feature_order; ?>"><?php echo $feature_data; ?></div> </div> <?php if ($feature_order % 2 == 0) { echo "</div><div class='form-group row'>"; } $ifeat++; } ?> </div> <?php } ?> <?php if ($num < 6 && $num != 0) { echo '<div class="form-group row">'; $lval = $num + 1; for ($ff = $lval; $ff <= 6; $ff++) { ?> <div class="col-sm-6 mb-3 mb-sm-0"> <label>Features <?php echo $ff; ?></label> <div class="form-control form-control-solid" style="padding: 45px 15px !important; display: flex; align-items: center;"> <img src="" id="featureimg<?php echo $ff; ?>" width="50" height="50" style="margin-right:20px;" > <input type="hidden" id='feature_img<?php echo $ff; ?>' name="feature_img<?php echo $ff; ?>"> <form method="post" action="" enctype="multipart/form-data" id="myform"> <div class="form-control form-control-solid" style="display: grid;grid-template-columns: 1fr auto;"> <input type="file" id="filefeature<?php echo $ff; ?>" name="filefeature<?php echo $ff; ?>" /> <button type="button" class="btn btn-success" value="Upload" id="thumb_upload_feature<?php echo $ff; ?>"> Upload <i class="fas fa-upload"></i></button> </div> </form> </div><br> <div id="featuredesc<?php echo $ff; ?>"></div> </div> <?php } echo "</div>"; } ?> <div class="form-group row"> <div class="col-sm-4"> <label>Price Enable/Disable</label><br> <select class="form-control form-control-solid" name="price_status" id="price_status" > <option value="">Select</option> <option value="enable" <?php if ($price_status == 'enable') {?> selected="selected"<?php }?>>Enable</option> <option value="disable" <?php if ($price_status == 'disable') {?> selected="selected"<?php }?>>Disable</option> </select> </div> <div class="col-sm-4"> <label for="male">MRP (Rs.)</label> <input type="text" class="form-control form-control-solid" id="mrp" name="mrp" value="<?php echo $mrp ?>" placeholder="Product Modal"> </div> <div class="col-sm-4"> <label for="male">Selling Price (Rs.)</label> <input type="text" class="form-control form-control-solid" id="sellprice" name="selling price" value="<?php echo $selling_price ?>" placeholder="Product Modal"> </div> </div> <div class="form-group row"> <div class="col-sm-4"> <label>Product Status</label> <select class="form-control form-control-solid" name="status" id="status" > <!-- <option value="">Select</option> --> <option value="active" <?php if ($status == 'active') {?> selected="selected"<?php }?>>Active</option> <option value="inactive" <?php if ($status == 'inactive') {?> selected="selected"<?php }?>>Inactive</option> </select> <div class="audit_error" style="color:red;" id="statusErr"></div> </div> <div class="col-sm-4 mb-3 mb-sm-0"> <label>Display Order</label> <input type="text" class="form-control form-control-solid" id="display" name="display" value="<?php echo $display_order ?>" placeholder="Display Order"> <div class="audit_error" style="color:red;" id="displayErr"></div> </div> </div> </form> </div> </div> </div> </div> <div id="two" class=""> <div class="tab__title"> <button class="tab__button tab_button-active">Specification Details</button> <!-- <button class="tab__button" onclick="openTab('two')">Specifications</button> --> </div> <!-- <div class="col-lg-5 d-none d-lg-block bg-register-image"></div> --> <div class="col-lg-12"> <div class="ml-5"> <form class="user"> <div class="form-container" id="formContainer2"> <div class="form-group"> <div class="form-container" id="formContainer"> <div class="form-group" id="formGroup"> <?php $s = "SELECT * FROM specification WHERE product_id='$product_id'"; $res = mysqli_query($con, $s); $num = mysqli_num_rows($res); if ($num != 0) { $i = "1"; $result = $con->query("SELECT * FROM specification WHERE product_id='$product_id'"); while ($row = $result->fetch_assoc()) { $title_s = $row['title']; $id_s = $row['id']; ?> <div class="col-sm-5"> <div id="inputspecsGroup" class="title d-flex mb-20"> Title : <input type="text" class="form-control specification" name="specification" placeholder="Specification Title" value="<?php echo $title_s; ?>"> </div> </div> <?php $s_sp = "SELECT * FROM specification_value WHERE specs_id='$id_s'"; $res_sp = mysqli_query($con, $s_sp); $num_sp = mysqli_num_rows($res_sp); $result_sv = $con->query("SELECT * FROM specification_value WHERE specs_id='$id_s'"); while ($row_sv = $result_sv->fetch_assoc()) { $field1 = $row_sv['field1']; $field2 = $row_sv['field2']; $field3 = $row_sv['field3']; $field4 = $row_sv['field4']; ?> <div class="inputfield" id="inputFieldGroup" style="width: 100%;"> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name" value="<?php echo $field1; ?>"> <input type="text" class="form-control" name='unit' placeholder="Unit" value="<?php echo $field2; ?>"> <input type="text" class="form-control" name='val1' placeholder="Values 1" value="<?php echo $field3; ?>"> <input type="text" class="form-control" name='val2' placeholder="Values 2" value="<?php echo $field4; ?>"> </div> </div> <?php } if ($num_sp < 10) { $lvalspf = $num_sp + 1; for ($spf = $lvalspf; $spf <= 10; $spf++) { ?> <div class="inputfield" id="inputFieldGroup" style="width: 100%;"> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> </div> <?php } } // echo '<div class="add-fields-button" onclick="addRow()" style="color: #008D42; font-weight: bold;margin-top: 15px; cursor: pointer;">Add Fields (+)</div>'; } } else { ?> <div class="col-sm-5"> <div id="inputspecsGroup" class="title d-flex mb-20"> Title : <input type="text" class="form-control specification" name="specification" placeholder="Specification Title"> </div> </div> <div class="inputfield" id="inputFieldGroup" style="width: 100%;"> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <div class="form-row new-row"> <input type="text" class="form-control" name='parameter' placeholder="Parameter Name"> <input type="text" class="form-control" name='unit' placeholder="Unit"> <input type="text" class="form-control" name='val1' placeholder="Values 1"> <input type="text" class="form-control" name='val2' placeholder="Values 2"> </div> <!-- <div class="add-fields-button" onclick="addRow()" style="color: #008D42; font-weight: bold;margin-top: 15px; cursor: pointer;">Add Fields (+)</div> --> </div> <?php } ?> <!-- <span class="btn btn-primary add-fields-button mb-20" onclick="addRow()">Add More Parameters</span> --> <hr> </div> </div><br> <div class="btn btn-primary plus-button" onclick="duplicateForm()">Add More Specs</div> </form> </div> </div> </div><br> <div class=""> <div class="tab__title"> <button class="tab__button tab_button-active">Choose Related Accessories</button> <!-- <button class="tab__button" onclick="openTab('two')">Specifications</button> --> </div> <div class="col-lg-12 mt-5" style="height: 550px;overflow-y: scroll; border: 1px solid #aaa;"> <div class="ml-5"> <div class="form-container"> <div class="form-group"> <div class="col-sm-12"> <div class="d-flex mb-20"> <div class="grid-container"> <?php $productQuery = $con->query("SELECT * FROM products WHERE category='14' and status='active' order by product_id asc"); while ($productRow = $productQuery->fetch_assoc()) { $productName = $productRow['product_title']; $machineImg = $productRow['preview_image']; $brandproID = $productRow['brandid']; $productid = $productRow['product_id']; echo "<div class='grid-item'> <img src='{$machineImg}' class='position-relative w-90 img-shadow'> <h6>$productName</h6>"; $row1_r = mysqli_query($con, "select * from related_products where product_id='$product_id' and related_prod_id='$productid'"); $row2_r = mysqli_fetch_array($row1_r); $rid = $row2_r['id']; if ($rid == '') { echo "<input type='checkbox' name='related_acc' value='$productid' />"; } else { echo "<input type='checkbox' name='related_acc' value='$productid' checked />"; } echo "</div>"; } ?> </div> </div> </div> </div> </div> </div> </div> </div><br> <div class=""> <div class="tab__title"> <button class="tab__button tab_button-active">SEO TAGS</button> <!-- <button class="tab__button" onclick="openTab('two')">Specifications</button> --> </div> <div class="form-group row"> <div class="col-sm-10 mb-3 mb-sm-0"> <label>H1 Tag</label> <input type="text" class="form-control form-control-solid" id="h1tag" name="h1tag" placeholder="H1 Tag" value="<?php echo $h1_title; ?>"> <div class="audit_error" style="color:red;" id="h1tagErr"></div> </div> </div> <div class="form-group row"> <div class="col-sm-10 mb-3 mb-sm-0"> <label>Meta Title</label> <input type="text" class="form-control form-control-solid" id="page_title" name="page-title" placeholder="Meta Title" value="<?php echo $pagetitle; ?>"> <div class="audit_error" style="color:red;" id="pageErr"></div> </div> </div> <div class="form-group row"> <div class="col-sm-10 mb-3 mb-sm-0"> <label>Meta Description</label> <textarea class="form-control form-control-solid" id="meta-des" placeholder="Meta Description" name="meta-des" rows="2"><?php echo $metadescription; ?></textarea> <div class="audit_error" style="color:red;" id="meta-desErr"></div> </div> </div> <div class="form-group row"> <div class="col-sm-10 mb-3 mb-sm-0"> <label>Meta Keyword</label> <textarea class="form-control form-control-solid" id="meta-keyword" placeholder="Meta Keyword" name="meta-keyword" rows="2"><?php echo $metatags; ?></textarea> <div class="audit_error" style="color:red;" id="meta-tagErr"></div> </div> </div> </div> </div><br> <div class="form-group text-center"> <button type="button" onclick="validateclientForm()" id="client-submit" class="btn btn-primary" value="Update Product" data-keyboard="false">Update Product</button><br><br> <div id="succ-client-alert" style='color: green;'></div> <div id="fail-client-alert" style='color: red;'></div> </div> </div> </div> <style> .grid-container { display: grid; grid-template-columns: auto auto auto; padding: 10px; } .grid-item { border: 1px solid rgba(0, 0, 0, 0.8); /* padding: 50px;*/ font-size: 30px; text-align: center; margin-right: 10px; } .grid-item img { width: 200px; height: 200px; } .form-group .inputfield { display: flex; flex-wrap: wrap; width:50%; } .inputfield .form-control { width: calc(25% - 10px); margin-right: 10px; margin-bottom: 10px; box-sizing: border-box; padding: 8px; } .duplicate-button { margin-bottom: 20px; } .mt-15 .form-control{margin:15px;} .title-input { width: 100%; margin-bottom: 10px; padding: 8px; box-sizing: border-box; } </style> <script> function deletebrouchure() { if(confirm('Are you sure you want to delete?')) { $('#pdf_path').val(''); $("#my_resume").html(""); document.getElementById('pdfFile').value= null; } } $(document).ready(function(){ $('#delete_feature1').click(function(){ $('#featureimg1').attr('src', ''); $('#filefeature1').val(''); $('#feature_img1').val(''); $(this).hide(); }); }); $(document).ready(function(){ $('#delete_feature2').click(function(){ $('#featureimg2').attr('src', ''); $('#filefeature2').val(''); $('#feature_img2').val(''); $(this).hide(); }); }); $(document).ready(function(){ $('#delete_feature3').click(function(){ $('#featureimg3').attr('src', ''); $('#filefeature3').val(''); $('#feature_img3').val(''); $(this).hide(); }); }); $(document).ready(function(){ $('#delete_feature4').click(function(){ $('#featureimg4').attr('src', ''); $('#filefeature4').val(''); $('#feature_img4').val(''); $(this).hide(); }); }); $(document).ready(function(){ $('#delete_feature5').click(function(){ $('#featureimg5').attr('src', ''); $('#filefeature5').val(''); $('#feature_img5').val(''); $(this).hide(); }); }); $(document).ready(function(){ $('#delete_feature6').click(function(){ $('#featureimg6').attr('src', ''); $('#filefeature6').val(''); $('#feature_img6').val(''); $(this).hide(); }); }); </script> <script> for(var g=1;g<=6;g++) { $('#featuredesc'+g).summernote({ placeholder: 'Feature Description', tabsize: 2, height: 150, toolbar: [ ['style', ['style']], ['font', ['bold', 'underline', 'clear']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture', 'video']], ['view', ['fullscreen', 'codeview', 'help']] ] }); } function addRow() { // Clone the last form row var lastRow = document.querySelector('.new-row'); var newRow = lastRow.cloneNode(true); // Clear the input values in the new row var inputs = newRow.querySelectorAll('input'); inputs.forEach(function(input) { input.value = ''; }); // Append the new row to the form container document.getElementById('inputFieldGroup').appendChild(newRow); // Move the "Add Fields" button along with the new row var addButton = document.querySelector('.add-fields-button'); document.getElementById('inputFieldGroup').appendChild(addButton); } function duplicateForm() { var formContainer = document.getElementById('formContainer'); var formGroup = document.getElementById('formGroup'); // Clone the form group along with the title var newFormGroup = formGroup.cloneNode(true); // Reset values in the cloned form group newFormGroup.querySelectorAll('.form-control').forEach(function(input) { input.value = ''; }); // Append the cloned form group formContainer.appendChild(newFormGroup); } function updateImage() { var select = document.getElementById('brand'); var selectedOption = select.options[select.selectedIndex]; var image = document.getElementById('selectedImage'); image.src = selectedOption.getAttribute('data-image'); } </script> <script> function openTab(tabNumber) { var i; var x = document.getElementsByClassName("tab__inside"); /*Add or Remove Active class to buttons*/ $('.tab__button').removeClass('tab_button-active'); $('.tab__button').click(function() { $(this).addClass('tab_button-active'); }) /*Add active or remove class to tab contents*/ for (i = 0; i < x.length; i++) { x[i].classList.remove("tab__inside-active"); } document.getElementById(tabNumber).classList.add("tab__inside-active"); } </script> <script type="text/javascript"> $(document).ready(function(){ $("#pdf_upload").click(function(){ var fd = new FormData(); var files = $('#pdfFile')[0].files[0]; fd.append('pdfFile', files); $.ajax({ url: 'api/broucher-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ // Update the hidden input with the PDF path $("#pdf_path").val(response); $("#my_resume").html("<a target='_blank' href='"+response+"'>View Brouchure</a> [ <a style='width: 10%; height: 25px;' class='btn btn-danger btn-circle btn-sm' onclick='deletebrouchure()'><i class='fas fa-trash'></i></a> ]"); // You can also update other elements or display a success message console.log("PDF Response:", response); } else { // Display an error message or handle the error as needed $("#pdfFileErr").text('File not uploaded'); } }, error: function(xhr, status, error) { console.error('AJAX Error:', status, error); } }); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $("#thumb_upload").click(function(){ var fd = new FormData(); var files = $('#logofile')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/thumb-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#tpimg").attr("src",response); $("#event_img").val(response); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $("#gal_upload").click(function(){ // gallery = JSON.parse(gallery); var fd = new FormData(); var totalfiles = document.getElementById('galfile').files.length; for (var index = 0; index < totalfiles; index++) { fd.append("files[]", document.getElementById('galfile').files[index]); } $.ajax({ url: 'api/product-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ var response = JSON.parse(response); if(response != 0){ var nimg = ""; for (var index = 0; index < response.length; ++index) { var data= response[index]; $('#galimg').append("<div id='galimgdelss"+index+"' style='float: left;'><img class=btn-delete style='width:20px; height:20px; position: absolute;cursor: pointer;' src='img/remove-icon.png' onclick=deleteimgs('"+data+"','"+index+"') /><img src='"+data+"' width=200px height=200px style='margin-right:20px;margin-bottom: 25px;' class=dele></span>"); nimg+=","+data; } var gallery_array =$('#gallery_array').val(); var newVal = gallery_array + nimg; $('#gallery_array').val(newVal); }else{ alert('file not uploaded'); } }, }); }); }); </script> <script> $("#thumb_upload_feature1").click(function(){ var fd = new FormData(); var files = $('#filefeature1')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg1").attr("src",response); $("#feature_img1").val(response); $("#delete_feature1").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); $("#thumb_upload_feature2").click(function(){ var fd = new FormData(); var files = $('#filefeature2')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg2").attr("src",response); $("#feature_img2").val(response); $("#delete_feature2").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); $("#thumb_upload_feature3").click(function(){ var fd = new FormData(); var files = $('#filefeature3')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg3").attr("src",response); $("#feature_img3").val(response); $("#delete_feature3").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); $("#thumb_upload_feature4").click(function(){ var fd = new FormData(); var files = $('#filefeature4')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg4").attr("src",response); $("#feature_img4").val(response); $("#delete_feature4").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); $("#thumb_upload_feature5").click(function(){ var fd = new FormData(); var files = $('#filefeature5')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg5").attr("src",response); $("#feature_img5").val(response); $("#delete_feature5").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); $("#thumb_upload_feature6").click(function(){ var fd = new FormData(); var files = $('#filefeature6')[0].files[0]; fd.append('file',files); $.ajax({ url: 'api/product-feature-image-upload.php', type: 'post', data: fd, contentType: false, processData: false, success: function(response){ if(response != 0){ $("#featureimg6").attr("src",response); $("#feature_img6").val(response); $("#delete_feature6").show(); // $("#img").show(); // Display image element }else{ alert('file not uploaded'); } }, }); }); function deleteimg(data,ival) { if (confirm("Are you really want to delete ?")) { $("#galimgdels"+ival).hide(); var gallery_array =$('#gallery_array').val(); var nimg = gallery_array.replace(data,''); $('#gallery_array').val(nimg); } } function deleteimgs(data,ival) { if (confirm("Are you really want to delete ?")) { $("#galimgdelss"+ival).hide(); var gallery_array =$('#gallery_array').val(); var nimg = gallery_array.replace(data,''); $('#gallery_array').val(nimg); } } </script> <script type="text/javascript"> function printError(elemId, hintMsg) { document.getElementById(elemId).innerHTML = hintMsg; } function validateclientForm() { $('#succ-client-alert').html(''); $('#fail-client-alert').html(''); var id=$('#product_id').val(); var product_modal = $('#product_modal').val(); var product_name = $('#product_name').val(); var category = $('#category').val(); var subcategory = $('#subcategory').val(); var thumb_img = $('#event_img').val(); var description = $('#description').val(); var status = $('#status').val(); var gal_img = $('#gallery_array').val(); var brochure = $('#pdf_path').val(); var mrp = $('#mrp').val(); var brand = $('#brand').val(); var sellprice = $('#sellprice').val(); var displayorder = $('#display').val(); let product_price = $('input[name="price"]:checked').val(); var feature1 = $('#Ftitle1').val(); var feature2 = $('#Ftitle2').val(); var feature3 = $('#Ftitle3').val(); var fdescription1 = $('#fdescription1').val(); var fdescription2 = $('#fdescription2').val(); var fdescription3 = $('#fdescription3').val(); var video_link = $("#video_link").val(); var inputs = $(".note-editable"); var feature_img1 = $('#feature_img1').val(); var featuredesc1 = $(inputs[0]).html(); var feature_img2 = $('#feature_img2').val(); var featuredesc2 = $(inputs[1]).html(); var feature_img3 = $('#feature_img3').val(); var featuredesc3 = $(inputs[2]).html(); var feature_img4 = $('#feature_img4').val(); var featuredesc4 = $(inputs[3]).html(); var feature_img5 = $('#feature_img5').val(); var featuredesc5 = $(inputs[4]).html(); var feature_img6 = $('#feature_img6').val(); var featuredesc6 = $(inputs[5]).html(); var h1tag= $('#h1tag').val(); var pagetitle = $('#page_title').val(); var metadescription = $('#meta-des').val(); var metatags = $('#meta-keyword').val(); // console.log(brochure,"bropath") var productErr = thumb_imgErr = categoryErr = subcategoryErr = brandErr = descriptionErr = product_modalErr = statusErr = false; if (product_name === "") { printError("productErr", "Enter Product Name"); productErr = true; } else { printError("productErr", ""); } if (product_modal === "") { printError("product_modalErr", "Enter Modal Name"); product_modalErr = true; } else { printError("product_modalErr", ""); } if (category === "") { printError("categoryErr", "Select Category"); categoryErr = true; } else { printError("categoryErr", ""); } if (subcategory === "") { printError("subcategoryErr", "Enter Sub Category"); subcategoryErr = true; } else { printError("subcategoryErr", ""); } if (brand === "") { printError("brandErr", "Select Brand"); brandErr = true; } else { printError("brandErr", ""); } if(thumb_img == "") { printError("thumb_imgErr", "Upload Image"); } else { printError("thumb_imgErr", ""); thumb_imgErr = false; } if (description === "") { printError("descriptionErr", "Enter Description"); descriptionErr = true; } else { printError("descriptionErr", ""); } if (status === "") { printError("statusErr", "Select status"); statusErr = true; } else { printError("statusErr", ""); } var formData_tit = []; // Assuming each row has a class "new-row" $(".title").each(function () { var fieldsData_tit = $(this).find('input').map(function () { return $(this).val(); }).get(); formData_tit.push(fieldsData_tit); }); var formData = []; // Assuming each row has a class "new-row" $(".new-row").each(function () { var fieldsData = $(this).find('input').map(function () { return $(this).val(); }).get(); formData.push(fieldsData); }); var yourArray = []; $("input:checkbox[name=related_acc]:checked").each(function(){ yourArray.push($(this).val()); }); if (productErr || thumb_imgErr || categoryErr || subcategoryErr || brandErr || descriptionErr || product_modalErr || statusErr) { $("html, body").animate({ scrollTop: 0 }, "medium"); return false; } else { $.ajax({ url: 'api/admin-product.php', type: 'POST', data: { id:id, product_modal:product_modal, product_name: product_name, category: category, subcategory:subcategory, thumb_img:thumb_img, brouchure:brochure, status: status, description: description, images: gal_img, product_price:product_price, displayorder:displayorder, sellprice:sellprice, mrp:mrp, brand:brand, feature1:feature1, feature2:feature2, feature3:feature3, fdescription1:fdescription1, fdescription2:fdescription2, fdescription3:fdescription3, title: formData_tit, formData: formData, video_link:video_link, feature_img1:feature_img1, featuredesc1:featuredesc1, feature_img2:feature_img2, featuredesc2:featuredesc2, feature_img3:feature_img3, featuredesc3:featuredesc3, feature_img4:feature_img4, featuredesc4:featuredesc4, feature_img5:feature_img5, featuredesc5:featuredesc5, feature_img6:feature_img6, featuredesc6:featuredesc6, related_acc: yourArray, h1tag:h1tag, pagetitle:pagetitle, metadescription:metadescription, metatags:metatags, referer: "ezioaws", action: "updateproduct" }, success: function (data) { var data = JSON.parse(data); if (data.status == "success") { $('#succ-client-alert').html('Updated Successfully'); $('#fail-client-alert').html(''); setTimeout(function () { window.location.href = "products.php"; }, 2000); } else { $('#succ-client-alert').html(''); $('#fail-client-alert').html(data.message); } }, error: function (xhr, status, error) { // Handle AJAX error console.log("AJAX Error:", status, error); } }); return false; // Prevent form submission } } </script> <style> /* Style for the flex container */ .flex-container { display: flex; flex-wrap: wrap; /* Allows images to wrap to the next line when there's not enough space */ } /* Style for each image container within the flex container */ .image-container { margin: 5px; /* Adjust the margin as needed */ } </style> <?php include 'footer.php'?>