MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.68
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/www/export/Admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/www/export/Admin/product_add.php
<?php
session_start();
$se = $_SESSION["id"];
if (!isset($_SESSION['id'])) {
    header("Location: login.php");
}
include("Includes/db.php");;
 
?>

<!doctype html>
<html lang="en">
<head>
        
     <?php include 'Includes/head.php'; ?>
     <link href="assets/libs/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
    </head>

    <body data-sidebar="dark">

    <!-- <body data-layout="horizontal" data-topbar="dark"> -->

        <!-- Begin page -->
        <div id="layout-wrapper">

            
            <?php include 'Includes/header.php'; ?>

            <!-- ========== Left Sidebar Start ========== -->
            <div class="vertical-menu">

                <div data-simplebar class="h-100">

                    <!--- Sidemenu -->
                   <?php include 'Includes/sidebar.php'; ?>
                    <!-- Sidebar -->
                </div>
            </div>
            <!-- Left Sidebar End -->

            

            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="main-content">

                <div class="page-content">
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    <h4 class="mb-sm-0 font-size-18">Add Product</h4>

                                  

                                </div>
                            </div>
                        </div>
                        <!-- end page title -->

                       <div class="row">
                    
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title"></h4>
                               
                                <form class="needs-validation" method="POST" action="action/add_product.php" enctype="multipart/form-data">

                                        <div class="row">

                                                        <div class="col-md-2">
                                                            <label class="form-check-label" for="formCheck1">
                                                                Type
                                                            </label>
                                                        </div>

                                                        <div class="col-md-4">
                                                             <input type="radio" id="goods" name="itype" value="alllindia" >
                                                            <label class="form-check-label" for="formCheck1">
                                                                All India
                                                            </label>
                                                        </div>

                                                        <div class="col-md-4">
                                                            <input type="radio" id="services" name="itype" value="city">
                                                            <label class="form-check-label" for="formCheck1">
                                                                City
                                                            </label>
                                                        </div>
                                                         
                                                      </div>

                                                      <br>

                                                      <div class="row cs">





                                                         <div class="col-md-4">
                                                           <label class="form-check-label" for="formCheck1">
                                                             State
                                                         </label>
                                                         <select class="form-select select2" id="state" name="state">
                                                            <option value="">Choose</option>
                                                            <?php
                                                            $sql = "select * from states where country_id='101'  ";
                                                            $sql_res = mysqli_query($con, $sql) or die(mysqli_error($con));
                                                            while ($marriage = mysqli_fetch_assoc($sql_res)){                                             
                                                              ?>
                                                              <option value="<?php echo $marriage['id'];?>"><?php echo $marriage['name'];?></option>

                                                          <?php } ?>

                                                      </select>

                                                  </div>

                                                  <div class="col-md-4">
                                                   <label class="form-check-label" for="formCheck1">
                                                     City
                                                 </label>
                                                 
                                                 <select class="form-select select2" id="citys" name="citys">

                                                    <option value="">Select First State</option>

                                                  </select>

                                             </div>

                                         </div>


                                        <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="validationCustom01" class="form-label"> Category </label>
                                             <select class="form-select" id="cat" name="cat">

                                        <option value="">Choose</option>
                                                                <?php
                                                                  $sql = "select * from tbl_categories  ";
                                                                  $sql_res = mysqli_query($con, $sql) or die(mysqli_error($con));
                                                                  while ($marriage = mysqli_fetch_assoc($sql_res)){                                             
                                                                  ?>
                                                                    <option value="<?php echo $marriage['id'];?>"><?php echo $marriage['name'];?></option>
                                                                    
                                                                    <?php } ?>

                                      </select>
                                                
                                                
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="validationCustom01" class="form-label"> Sub Category </label>
                                             <select class="form-select" id="subcat" name="subcat">

                                       <option value="">Select First Category</option>

                                      </select>
                                                
                                                
                                            </div>
                                        </div>

                                    <div class="row">
                                    <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="validationCustom01" class="form-label"> Name </label>
                                             <input type="text"  class="form-control "  name="name" id="name"  required="">
                                                
                                                
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                    <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="validationCustom01" class="form-label"> Price </label>
                                             <input type="text"  class="form-control "  name="price" id="price"  required="">
                                                
                                                
                                            </div>
                                        </div>
                                    </div>


                                    <div class="col-md-12">
                                            <div class="mb-3">
                                                <label for="validationCustom01" class="form-label"> Image</label>
                                                <input name="ho_photo[]" type="File" id="image" value="" class="form-control" multiple="" required/>
                                                <div id="thumb" class="col-md-4"></div>
                                                <div id="thumb-error" style="color: red; margin: 10px 0px 0 10px; display: none;">Please upload file having extensions .jpeg / .jpg / .png only.
                                                </div>
                                                
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="validationCustom01" class="form-label"> Description </label>
                                             <textarea class="form-control "  name="desc" id="desc"  required=""></textarea>
                                                
                                                
                                            </div>
                                        </div>

                                         <div class="row">
                                            <div class="col-md-12">
                                                <label for="validationCustom01" class="form-label"> Goodies </label><br>
                                                <?php 

                                                $records = mysqli_query($con,"select * from tbl_goodies ");  



                                        while($data = mysqli_fetch_array($records))

                                        {

                                        ?>

                                    <input type="checkbox" id="color" name="goodies[]" value="<?php echo $data['id']; ?>">

                                      <label for="vehicle1"><?php echo $data['name']; ?></label><br>

                                      <?php } ?>

                                            </div>
                                        </div>

                                         

                                       


                                    </div>

                                    </div>

                                    

                                    
                                    
                                   
                                    
                                  
                                     
                                        
                                    </div>

                                  
           
                                    
                                    <div>
                                        <button class="btn btn-primary" type="submit">Submit </button>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <!-- end card -->
                     <!-- end col -->

                   
                </div>
                        <!-- end row -->

                       
                        <!-- end row -->

                       
                        <!-- end row -->
                    </div>
                    <!-- container-fluid -->
                </div>
                <!-- End Page-content -->

                

                <footer class="footer">
                     <?php include 'Includes/footer.php'; ?>
                </footer>
            </div>
            <!-- end main content-->

        </div>
        <!-- END layout-wrapper -->

        <!-- Right Sidebar -->
        
        <!-- /Right-bar -->

        <!-- Right bar overlay-->
        <div class="rightbar-overlay"></div>

     
        <?php include 'Includes/bscript.php'; ?>
          <script src="assets/libs/select2/js/select2.min.js"></script>
        <script src="assets/js/pages/form-advanced.init.js"></script>
    </body>
    <script type="text/javascript">
    function readThumb(input, error) {
            document.getElementById(error).style.display = "none";
            var filePath = input.value;
            var allowedExtensions = /(\.jpg|\.jpeg|\.png)$/i;
            if(!allowedExtensions.exec(filePath)){
                document.getElementById(error).style.display = "block";
                input.value = '';
                document.getElementById("thumb").innerHTML = "";
                return false;
            } else if(input.files && input.files[0]) {
                document.getElementById("thumb").innerHTML = "";
                
                var total = input.files.length;
                for(i=0; i<total; i++ ) {
                    var reader = new FileReader();
                    reader.onload = function(e) {

                        var newimg = document.createElement("img");
                        newimg.setAttribute("src", e.target.result);
                        newimg.setAttribute("height", "70px");
                        document.getElementById("thumb").appendChild(newimg);
                        }
                    reader.readAsDataURL(input.files[i]);
                }
            }
        }
</script>
<script type="text/javascript">
    function readImages(input, errorClass) {
            document.getElementById(errorClass).style.display = "none";
            var len = input.files.length;
            var error = false;
            for(var i=0; i<len; i++) {
                var filePath = input.files[i].name;
                var allowedExtensions = /(\.jpg|\.jpeg|\.png)$/i;
                if(!allowedExtensions.exec(filePath)){
                    document.getElementById(errorClass).style.display = "block";
                    input.value = '';
                    document.getElementById("img-container").innerHTML = "";
                    error = true;
                    break;
                }
            }
            if(error == true) {
                return false;
            } else if(input.files && input.files[0]) {
                document.getElementById("img-container").innerHTML = "";
                
                var total = input.files.length;
                for(i=0; i<total; i++ ) {
                    var reader = new FileReader();
                    reader.onload = function(e) {

                        var newimg = document.createElement("img");
                        newimg.setAttribute("src", e.target.result);
                        newimg.setAttribute("height", "50px");
                        document.getElementById("img-container").appendChild(newimg);
                        }
                    reader.readAsDataURL(input.files[i]);
                }
            }
        }
</script>

<!-- pdf -->

<script type="text/javascript">
    function readThumb1(input, error) {
            document.getElementById(error).style.display = "none";
            var filePath = input.value;
            var allowedExtensions = /(\.pdf)$/i;
            if(!allowedExtensions.exec(filePath)){
                document.getElementById(error).style.display = "block";
                input.value = '';
                document.getElementById("thumb1").innerHTML = "";
                return false;
            } else if(input.files && input.files[0]) {
                document.getElementById("thumb1").innerHTML = "";
                
                var total = input.files.length;
                for(i=0; i<total; i++ ) {
                    var reader = new FileReader();
                    reader.onload = function(e) {

                        var newimg = document.createElement("img");
                        newimg.setAttribute("src", "download.jpg");
                        newimg.setAttribute("height", "70px");
                        document.getElementById("thumb1").appendChild(newimg);
                        }
                    reader.readAsDataURL(input.files[i]);
                }
            }
        }
</script>
<script type="text/javascript">
    function readImages(input, errorClass) {
            document.getElementById(errorClass).style.display = "none";
            var len = input.files.length;
            var error = false;
            for(var i=0; i<len; i++) {
                var filePath = input.files[i].name;
                var allowedExtensions = /(\.pdf)$/i;
                if(!allowedExtensions.exec(filePath)){
                    document.getElementById(errorClass).style.display = "block";
                    input.value = '';
                    document.getElementById("img-container").innerHTML = "";
                    error = true;
                    break;
                }
            }
            if(error == true) {
                return false;
            } else if(input.files && input.files[0]) {
                document.getElementById("img-container").innerHTML = "";
                
                var total = input.files.length;
                for(i=0; i<total; i++ ) {
                    var reader = new FileReader();
                    reader.onload = function(e) {

                        var newimg = document.createElement("img");
                        newimg.setAttribute("src", e.target.result);
                        newimg.setAttribute("height", "50px");
                        document.getElementById("img-container").appendChild(newimg);
                        }
                    reader.readAsDataURL(input.files[i]);
                }
            }
        }
</script>
<script type="text/javascript">
     $(".cs").hide();
  $("#services").click(function() {
    if($(this).is(":checked")) {
        // alert('abc');
        $(".cs").show();
        

    } else {
       // alert('abcd');
       
    }

});
</script>

<script type="text/javascript">
     $(".cs").hide();
  $("#goods").click(function() {
    if($(this).is(":checked")) {
        
        
           $(".cs").hide();
       
    } else {
      
       
    }

});
</script>
<script type="text/javascript">
     $(document).ready(function() {
            $('#state').on('change', function() {
                var stateID = $(this).val();
                // alert(conID);
                $.ajax({  
                    type: 'POST',  
                    url: 'get_state.php', 
                    data: {city: stateID },
                    success: function(response) {
                        // alert(response);
                         $('#citys').html(response);
        // content.html(response);
    }
});
            });
        });
</script>

<script type="text/javascript">
     $(document).ready(function() {
            $('#cat').on('change', function() {
                var stateID = $(this).val();
                // alert(conID);
                $.ajax({  
                    type: 'POST',  
                    url: 'get_sub_cate.php', 
                    data: {city: stateID },
                    success: function(response) {
                        // alert(response);
                         $('#subcat').html(response);
        // content.html(response);
    }
});
            });
        });
</script>
</html>

MMCT - 2023