
<?php
include('header.php');
include("dbcon.php");
error_reporting(0);
if(isset($_POST['submit']))
{
    
    $product_id=$_POST['product_id'];
    $name=$_POST['name'];
    
    $result="INSERT into `sub_products`(`pid`,`subname`)VALUES('$product_id','$name')";
    if (mysqli_query($con, $result)){
    header('Location: sub-products.php?id='.$product_id);

} 
 }   
?>




<div class="clearfix">
</div>
<!-- BEGIN CONTAINER -->
<div class="page-container">

    <!-- BEGIN SIDEBAR -->
    <div class="page-sidebar-wrapper">
        <div class="page-sidebar navbar-collapse collapse">
            <!-- BEGIN SIDEBAR MENU -->
            <ul class="page-sidebar-menu">
                <li class="sidebar-toggler-wrapper">
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                    <div class="sidebar-toggler hidden-phone">
                    </div>
                    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                </li>
                
                
                <!--SEARCH-->
                <li class="sidebar-search-wrapper">
                    <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->
                    <form class="sidebar-search" action="#" method="POST">
                        <div class="form-container">
                            <div class="input-box">
                                <a href="javascript:;" class="remove"></a>
                                <input type="text" placeholder="Search..."/>
                                <input type="button" class="submit" value=" "/>
                            </div>
                        </div>
                    </form>
                    <!-- END RESPONSIVE QUICK SEARCH FORM -->
                </li>
                <!--SEARCH-->
                
                <li class="">
        
                    <a href="dashboard.php">
                    <i class="fa fa-desktop"></i>
                    <span class="title">Dashboard</span>
                    <span class="selected"></span>
                    </a>
                </li>
                
                

                    <li class="">
                    <a href="banner.php">
                    <i class="fa fa-home" aria-hidden="true"></i>
                    <span class="title">HOME</span>
                    <span class="arrow "></span>
                    </a>
                    <ul class="sub-menu">
                        <li><a href="banner.php">Video Contents</a></li>
                        <li><a href="welcome-note.php">Welcome Note</a></li>
                        <li><a href="veneer.php">Veneer Collections</a></li>
                        
                    </ul>


                  </li>

                


                    <li class="">
                    <a href="aboutus.php">
                    <i class="fa fa-info-circle" aria-hidden="true"></i>
                    <span class="title">ABOUT US</span>
                    </a>
                </li>



                    <li class="">
                    <a href="javascript:;">
                    <i class="fa fa-tags" aria-hidden="true"></i>
                    <span class="title">SERVICES</span>
                    <span class="arrow "></span>
                    </a>

                    <ul class="sub-menu">
                        <li><a href="services-content.php">Services Content</a></li>
                        <li><a href="services.php">Add Services</a></li>
                        
                    </ul>


                  </li>
                
                    <li class="active">
                    <a href="javascript:;">
                    <i class="fa fa-tags" aria-hidden="true"></i>
                    <span class="title">PRODUCTS</span>
                    <span class="arrow "></span>
                    </a>

                    <ul class="sub-menu">
                        <li><a href="works.php">Add Products</a></li>
                        <li><a href="casestudy.php">Products Details List</a></li>
                        
                    </ul>


                </li>



                    <li class="">
                    <a href="gallery.php">
                    <i class="fa fa-picture-o" aria-hidden="true"></i>
                    <span class="title">GALLERY</span>
                    </a>
                </li>


                    <li class="">
                    <a href="contactus.php">
                    <i class="fa fa-envelope" aria-hidden="true"></i>
                    <span class="title">ENQUIRIES</span>
                    </a>
                  </li>

           
                    <li class="">
                    <a href="lock.php">
                    <i class="fa fa-lock" aria-hidden="true"></i>
                    <span class="title">Lock</span>
                    </a>
                </li>
                
                
                                </ul>
            <!-- END SIDEBAR MENU -->
        </div>
    </div>
    <!-- END SIDEBAR -->




            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                    <div class="row">
                        <div class="col-md-12">
                            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                            <h3 class="page-title"><STRONG></STRONG></h3>
                            <ul class="page-breadcrumb breadcrumb">
                                <li>
                                    <i class="fa fa-home"></i>
                                    <a href="banner.php"><B>PRODUCTS</B></a>
                                    <i class="fa fa-angle-right"></i>
                                    <?php
                                    $pid=$_GET['id'];
                                    
                                    $qry="SELECT * FROM products where pid='$pid'";
                                    $r=mysqli_query($con,$qry);
                                    while($res= mysqli_fetch_array($r))                       
                                    {
                                    ?>
                                    <a href=""><B><?php echo $res['pname'];?></B></a>
                                    <?php } ?>
                                    
                                   
                                </li>
                            </ul>
                            <!-- END PAGE TITLE & BREADCRUMB-->
                        </div>
                    </div>
                    <!-- END PAGE HEADER-->
                    <!-- BEGIN PAGE CONTENT-->
                    <div class="row profile">
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="row">
                                        <div class="col-md-6 ">
                                            <div class="portlet">
                                                <div class="portlet-title">
                                                    <div class="caption">
                                                       
    </div>
    <div class="tools">
    <a href="javascript:;" class="reload"></a>
    </div>
    </div>
    </div> 
    <div class="portlet-body form">

<?php 
$pid=$_GET['id'];
//echo $portid;
?>
    <!-- BEGIN FORM-->
     <div class="panel-body">
    <form  action="sub-products.php" class="form-horizontal form-bordered" method="post" enctype="multipart/form-data" >
    <div class="container-fluid">
    <!-- Begin media library sub toolbar -->
    <div class="row">
    
<div class="form-body">
<input type="hidden" class="form-control"  name="product_id" value="<?php echo $pid;?>"/>   

<div class="form-group">
<label class="control-label col-md-3"><b>Sub-Product Name<br>( Eg:Fixed Bollards )</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="title1" name="name" style="width:100%;"  autocomplete="off" />
</div>
</div>



</div>

    <br><br>
    <div class="col-sm-8 col-md-9">
    <div class="btn-toolbar" role="toolbar">
    <div class="btn-group">
    <button type="submit" class="btn green" name="submit"><i class="fa fa-check"></i> Save</button>
    </div>
    </div><!-- /.btn-toolbar -->
    </div><!-- /.col-sm-8 col-md-9 -->
    </div><!-- /.row -->
    </form>
    <hr />
    <!-- End media library sub toolbar -->
    </div><!-- /.container-fluid -->

</div>
</div></div>
<!-- END PORTLET-->
<div class="col-md-6">
<div id="dump">
<div id="loader"></div> 
<div class="portlet">
<div class="portlet-body">
<div class="scroller" data-height="700px" data-always-visible="1" data-rail-visible1="1">
<table class="table table-hover">
<thead>
<tr>
<td width="5%" class="hidden-xs text-center"><b>#</b></td>
<td width="20%" class="hidden-xs text-center"><b>Name</b></td>

<td width="20%" class="hidden-xs text-center"><b></b></td>

<td width="15%" class="text-right hidden-xs"><b>Action</b></td>
</tr>
</thead>
<?php
$pid=$_GET['id'];
$res="select * from sub_products where pid=$pid";
$rs=mysqli_query($con,$res);
$serial=1;
while($r=mysqli_fetch_array($rs))
{ 
?>  
    <tbody>
    <tr>
    <td class="hidden-xs text-center"><?php  echo $serial++;?></td>
    <td class="hidden-xs text-center"><?php echo $r['subname'];?></td>
    

     <td class="hidden-xs text-center">
        <a href="add-subpdt-details.php?pid=<?php  echo $r['pid'];?>&sid=<?php  echo $r['sid'];?>" class="btn default btn-xs blue">
        <i class="fa fa-plus-circle" aria-hidden="true"></i> Add Details</a>
        </td>

    
    <td class="text-right hidden-xs">
    <a href="sliderdelete.php?id=<?php  echo $r['id'];?>" class="btn default btn-xs red"><i class="fa fa-trash-o "></i></a></td>
    </tr>
    <?php
    }
    ?>   
    </tbody>
    </table>
    </div>
    </div>
    </div>
    </div>
   <!--end col-md-4-->
    </div>
    <!--end row-->
   </div>
    </div>
    </div>
    </div>
    </div>
    <!--END PAGE CONTENT-->
    </div>
    </div>
    <!-- END CONTENT -->
    </div>
        <!--END CONTAINER-->

<?php
include('footer.php');
?>
        <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
        <!-- BEGIN CORE PLUGINS -->
        <!--[if lt IE 9]>
        <script src="assets/plugins/respond.min.js"></script>
        <script src="assets/plugins/excanvas.min.js"></script> 
        <![endif]-->
        <script src="assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
        <script src="assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap/js/bootstrap2-typeahead.min.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
        <script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <script src="assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
        <script src="assets/plugins/jquery.cokie.min.js" type="text/javascript"></script>
        <script src="assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
        <!-- END CORE PLUGINS -->               
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <script type="text/javascript" src="assets/plugins/fuelux/js/spinner.min.js"></script>
        <script type="text/javascript" src="assets/plugins/ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-fileupload/bootstrap-fileupload.js"></script>
        <script type="text/javascript" src="assets/plugins/select2/select2.min.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
        <script type="text/javascript" src="assets/plugins/clockface/js/clockface.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-daterangepicker/moment.min.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
        <script type="text/javascript" src="assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
        <script type="text/javascript" src="assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"></script>
        <script type="text/javascript" src="assets/plugins/jquery.input-ip-address-control-1.0.min.js"></script>
        <script type="text/javascript" src="assets/plugins/jquery-multi-select/js/jquery.multi-select.js"></script>
        <script type="text/javascript" src="assets/plugins/jquery-multi-select/js/jquery.quicksearch.js"></script>
        <script src="assets/plugins/bootstrap-switch/static/js/bootstrap-switch.min.js" type="text/javascript"></script>
        <script src="assets/plugins/jquery-tags-input/jquery.tagsinput.min.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-markdown/js/bootstrap-markdown.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-markdown/lib/markdown.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js" type="text/javascript"></script>
        <script src="assets/plugins/bootstrap-touchspin/bootstrap.touchspin.js" type="text/javascript"></script>
        <!-- END PAGE LEVEL PLUGINS -->
        <!-- BEGIN PAGE LEVEL SCRIPTS -->
        <script src="assets/scripts/app.js"></script>
        <script src="assets/scripts/form-components.js"></script>
        <!-- END PAGE LEVEL SCRIPTS -->
        <script>
            jQuery(document).ready(function() {       
            // initiate layout and plugins
               App.init();
               FormComponents.init();
            });   
        </script>
        <!-- BEGIN GOOGLE RECAPTCHA -->
        <script type="text/javascript">
            var RecaptchaOptions = {
               theme : 'custom',
               custom_theme_widget: 'recaptcha_widget'
            };
        </script>
        <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6LcrK9cSAAAAALEcjG9gTRPbeA0yAVsKd8sBpFpR"></script>
        <!-- END GOOGLE RECAPTCHA -->
        <!-- END JAVASCRIPTS -->
    </body>
    <!-- END BODY -->
</html>