
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>JSFL</title>

<!-- Fav Icon -->
<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600;1,700;1,800&display=swap" rel="stylesheet">

<!-- Stylesheets -->
<link href="assets/css/font-awesome-all.css" rel="stylesheet">
<link href="assets/css/flaticon.css" rel="stylesheet">
<link href="assets/css/owl.css" rel="stylesheet">
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/jquery.fancybox.min.css" rel="stylesheet">
<link href="assets/css/animate.css" rel="stylesheet">
<link href="assets/css/nice-select.css" rel="stylesheet">
<link href="assets/css/color/theme-color.css" id="jssDefault" rel="stylesheet">
<link href="assets/css/switcher-style.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/responsive.css" rel="stylesheet">
  
    <script>

        function showcategory(str) {
    if (str == "") {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else { 
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
            }
        };
        xmlhttp.open("GET","sortbycategory.php?q="+str,true);
        xmlhttp.send();
    }
}


        function showcategory2(str) {
    if (str == "") {
        document.getElementById("txtHint2").innerHTML = "";
        return;
    } else { 
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("txtHint2").innerHTML = xmlhttp.responseText;
            }
        };
        xmlhttp.open("GET","sortbysubcategory.php?q="+str,true);
        xmlhttp.send();
    }
}
</script>
</head>


<!-- page wrapper -->
<body>

    <div class="boxed_wrapper">
        <!-- Preloader -->
        <div class="loader-wrap">
            <div class="preloader"><div class="preloader-close">Preloader Close</div></div>
            <div class="layer layer-one"><span class="overlay"></span></div>
            <div class="layer layer-two"><span class="overlay"></span></div>        
            <div class="layer layer-three"><span class="overlay"></span></div>        
        </div>


        <!-- main header -->
        <header class="main-header style-one">
            <div class="header-top">
                <div class="top-inner clearfix">
                    <div class="top-left pull-left">
                        <ul class="info clearfix">
                            <li><i class="fa fa-user"></i>Welcome To Administrator </li>
                          
                        </ul>
                    </div>
                    <div class="top-right pull-right">
                        <ul class="social-links clearfix">
                              <li><i style="color: #f00;" class="fa fa-lock"></i> <a href="logout.php"> Logout</a></li>
                            
                          
                        </ul>
                    </div>
                </div>
            </div>
            <div class="header-upper">
                <div class="outer-container">
                    <div class="outer-box clearfix">
                        <div class="upper-left pull-left">
                            <figure class="logo-box"><a href="index.php"><img src="assets/images/logo.png" alt=""></a></figure>
                           
                        </div>
                        <div class="menu-area pull-right">
                            <!--Mobile Navigation Toggler-->
                            <div class="mobile-nav-toggler">
                                <i class="icon-bar"></i>
                                <i class="icon-bar"></i>
                                <i class="icon-bar"></i>
                            </div>
                            <nav class="main-menu navbar-expand-md navbar-light">
                                <div class="collapse navbar-collapse show clearfix" id="navbarSupportedContent">
                                    <ul class="navigation clearfix">
                                        <li  class="current"><a href="addproduct.php">Add New Product</a> </li> 
                                        <li><a href="products.php">Product List</a></li>               
                                    </ul>
                                </div>
                            </nav>
                            <div class="menu-right-content clearfix pull-left">
                                
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!--sticky Header-->
            <div class="sticky-header">
                <div class="auto-container">
                    <div class="outer-box clearfix">
                        <div class="logo-box pull-left">
                            <figure class="logo"><a href="index.php"><img src="assets/images/small-logo.png" alt=""></a></figure>
                        </div>
                        <div class="menu-area pull-right">
                            <nav class="main-menu clearfix">
                                <!--Keep This Empty / Menu will come through Javascript-->
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        <!-- main-header end -->

        <!-- Mobile Menu  -->
        <div class="mobile-menu">
            <div class="menu-backdrop"></div>
            <div class="close-btn"><i class="fas fa-times"></i></div>
            <nav class="menu-box">
                <div class="nav-logo"><a href="index.php"><img src="assets/images/logo.png" alt="" title=""></a></div>
                <div class="menu-outer"><!--Here Menu Will Come Automatically Via Javascript / Same Menu as in Header--></div>
                <div class="contact-info">
                    <h4>Contact Info</h4>
                    <ul>
                        <li>SCO#105, District Shopping Centre, Ranjit Avenue, Amritsar</li>
                        <li><a href="tel:+919878000331">+91-98780-00331, 98760-50044</a></li>
                        <li><a href="mailto:apply@roshniconsultant.com">apply@roshniconsultant.com</a></li>
                    </ul>
                </div>
                <div class="social-links">
                    <ul class="clearfix">
                           <li><a href="https://www.facebook.com/99trc"><i class="fa fa-facebook-f"></i></a></li>
                          
                            <li><a href="https://www.instagram.com/the.roshni.consultant/"><i class="fa fa-instagram"></i></a></li>
                            <li><a href="https://www.youtube.com/channel/UCISJ5ExmGjWNK5z279O4tSw"><i class="fa fa-youtube"></i></a></li>
                          
                    </ul>
                </div>
            </nav>
        </div><!-- End Mobile Menu -->

 <!--Page Title-->
        <section class="page-title" style="background-color: #808080;    padding: 135px 0px 2px 0px;">
            <div class="auto-container">
                <div class="content-box">
                    <div class="title-box">
                        <h1>Product</h1>
                        <div class="dotted-box">
                            <span class="dotted"></span>
                            <span class="dotted"></span>
                            <span class="dotted"></span>
                        </div>
                    </div>
                    
                </div>
            </div>
        </section>
        <!--End Page Title-->


        <!-- sidebar-page-container -->
        <div class="sidebar-page-container">
            <div class="auto-container">
                <div class="row clearfix">
                    <div class="col-lg-7 col-md-12 col-sm-12">
                        <div class="sidebar">
                          
                            <div class="sidebar-widget sidebar-assessment">
                                <div class="widget-title">
                                    <h3>Modify Product</h3>
                                    <div class="dotted-box">
                                        <span class="dotted"></span>
                                        <span class="dotted"></span>
                                        <span class="dotted"></span>
                                    </div>
                                </div>
                                <div class="widget-content">
                                     <?php
include("connection.php");
$productkey=$_GET['productkey'];

$query="SELECT * FROM products inner join category on products.categorykey=category.categorykey inner join subcategory on products.subcategorykey=subcategory.subcategorykey inner join subsubcategory on products.subsubcategorykey=subsubcategory.subsubcategorykey where products.productkey=".$productkey;
$records=$records=mysqli_query($connection,$query);

 $row2=mysqli_fetch_array($records);

  
      
?>
                                    <form action="modifyproductprocess.php" method="post" class="assessment-form" enctype="multipart/form-data">
                                        
                                        <div class="form-group">
                   <input type="hidden" autocomplete="off"  class="form-control" name="productkey" value="<?php echo  $row2["productkey"];   ?>" />
                 
                 <?php
include("connection.php");
$query="select * from category";
$records=$records=mysqli_query($connection,$query);
?>
 <select class="form-control" required name="categorykey" onchange="showcategory(this.value)">
     
  
    
 <?php
    while($row=mysqli_fetch_array($records))    
    {
 
       
         if($row2['categorykey']==$row['categorykey'])
        {
            echo "<option   value='".$row["categorykey"]."' >".$row["categoryname"]."</option>";
        }
        else 
        {
             echo "<option value='".$row["categorykey"]."'>".$row["categoryname"]."</option>";
        }

               
 
    }
 
    ?>


 
</select>   

                                    
                                        </div>

                                       <div class="form-group">

                                             <?php
include("connection.php");
$query="select * from subcategory";
$records=$records=mysqli_query($connection,$query);
?>
 <select class="form-control" required name="subcategorykey" onchange="showcategory(this.value)">
     
  
    
 <?php
    while($row=mysqli_fetch_array($records))    
    {
 
       
         if($row2['subcategorykey']==$row['subcategorykey'])
        {
            echo "<option   value='".$row["subcategorykey"]."' >".$row["subcategoryname"]."</option>";
        }
        else 
        {
             echo "<option value='".$row["subcategorykey"]."'>".$row["subcategoryname"]."</option>";
        }

               
 
    }
 
    ?>


 
</select>   
                                        </div>
                                     <div class="form-group">

                                             <?php
include("connection.php");
$query="select * from subsubcategory";
$records=$records=mysqli_query($connection,$query);
?>
 <select class="form-control" required name="subsubcategorykey" onchange="showcategory(this.value)">
     
  
    
 <?php
    while($row=mysqli_fetch_array($records))    
    {
 
       
         if($row2['subsubcategorykey']==$row['subsubcategorykey'])
        {
            echo "<option   value='".$row["subsubcategorykey"]."' >".$row["subsubcategoryname"]."</option>";
        }
        else 
        {
             echo "<option value='".$row["subsubcategorykey"]."'>".$row["subsubcategoryname"]."</option>";
        }

               
 
    }
 
    ?>


 
</select>   
                                        </div>
                                         <div class="form-group">
                                            <input type="text" name="productname" class="form-control"  value="<?php echo $row2['productname']; ?>" placeholder="Product Name" required>
                                        </div>
                                        <div class="form-group">
                                          Existing Pic 1 <img style="width: 60px;" src="item1/<?php  echo   $row2['pic1']; ?>"  alt="image"/>
                                        </div>
                                         <div class="form-group">
                                            <input type="file" class="form-control" name="pic1" >
                                        </div>
                                        <div class="form-group">
                                          Existing Pic 2 <img style="width: 60px;" src="item2/<?php  echo   $row2['pic2']; ?>"  alt="image"/>
                                        </div>
                                         <div class="form-group">
                                            <input type="file"  class="form-control" name="pic2" >
                                        </div>
                                        <div class="form-group">
                                          Existing Pic 3 <img style="width: 60px;" src="item3/<?php  echo   $row2['pic3']; ?>"  alt="image"/>
                                        </div>
                                         <div class="form-group">
                                            <input type="file" class="form-control" name="pic3" >
                                        </div>

                                       <div class="form-group">
                                            <textarea name="description" class="form-control" maxlength="350" placeholder="Description"><?php echo $row2['description']; ?></textarea>
                                        </div>
                                        <div class="form-group">
                                            <button type="submit" class="theme-btn-two"><i class="flaticon-send"></i>SUBMIT</button>
                                        </div>
                                    </form>


                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-8 col-md-12 col-sm-12 content-side">
                      
                    </div>
                </div>
            </div>
        </div>
        <!-- sidebar-page-container end -->

      
        <!-- main-footer -->
        <footer class="main-footer bg-color-2">
            <div class="auto-container">
                
                <div class="footer-bottom clearfix">
                    <div class="copyright pull-left"><p>Copyright &copy;2022 <a href="index.php">JSFL</a>. All rights reserved.</p></div>
                    <div class="footer-nav pull-right clearfix"> 
                       <p style="color: #fff">Website Designed with <i style="color: #f00;" class="fa fa-heart-o"></i> by <a style="color: #fff" href="angelinfotech.in">Angel Infotech</a></p>
                      
                    </div>
                </div>
            </div>
        </footer>
        <!-- main-footer end -->



        <!--Scroll to top-->
        <button class="scroll-top scroll-to-target" data-target="html">
            <i class="fas fa-long-arrow-alt-up"></i>
        </button>
    </div>


    <!-- jequery plugins -->
  <script src="assets/js/jquery.js"></script>
    <script src="assets/js/popper.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/owl.js"></script>
    <script src="assets/js/wow.js"></script>
    <script src="assets/js/validation.js"></script>
    <script src="assets/js/jquery.fancybox.js"></script>
    <script src="assets/js/TweenMax.min.js"></script>
    <script src="assets/js/appear.js"></script>
    <script src="assets/js/scrollbar.js"></script>
   
    <script src="assets/js/jQuery.style.switcher.min.js"></script>

    <!-- main-js -->
    <script src="assets/js/script.js"></script>
</body><!-- End of .page_wrapper -->
</html>

