<?php
include("topmenu.php");

?>

<div class="main_content_iner overly_inner ">
<div class="container-fluid p-0 ">

<div class="row">
<div class="col-12">
<div class="page_title_box d-flex align-items-center justify-content-between">
<div class="page_title_left">
<h3 class="f_s_30 f_w_700 text_white">Product & Service</h3>
<ol class="breadcrumb page_bradcam mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0);">Al Barsha Electronics LLC </a></li>
<li class="breadcrumb-item"><a href="javascript:void(0);">Dashboard</a></li>
<li class="breadcrumb-item active">Product & Service</li>
<li class="breadcrumb-item active">Lighting Service </li>
</ol>

</div>
</div>

<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header align-items-center d-flex card-header2">
                <h4 class="card-title mb-0 flex-grow-1">Update Lighting Services</h4>
                
            </div><!-- end card header -->

            
            <div class="card-body">
                <div class="live-preview">
                <form method="post" enctype="multipart/form-data">
                    <div class="row gy-4">
                    
                        
                        <!--end col-->
                        <?php
$sq1=mysqli_query($db,"select * from lyt_ser");
$rq1=mysqli_fetch_row($sq1);
?>
                        
                           <div class="col-lg-6 ">
                            <div>
                                <label for="labelInput" class="form-label">Image(width-625px & height-650px)<span class="red">*</span></label>
                                <input type="file"  class="form-control" id="exampleInputdate" name="photo" >
                                <img src="../images/<?php echo $rq1[1]?>" width="150" height="150">
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Title<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a1" value="<?php echo $rq1[2]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Heading<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a2" value="<?php echo $rq1[3]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Description<span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="a3" required><?php echo $rq1[4]?></textarea>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 1<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a4" value="<?php echo $rq1[5]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 2<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a5" value="<?php echo $rq1[6]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 3<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a6" value="<?php echo $rq1[7]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 4<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a7" value="<?php echo $rq1[8]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 5<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a8" value="<?php echo $rq1[9]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 6<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a9" value="<?php echo $rq1[10]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 7<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a10" value="<?php echo $rq1[11]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 8<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a11" value="<?php echo $rq1[12]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 9<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a12" value="<?php echo $rq1[13]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 10<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a13" value="<?php echo $rq1[14]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-6">
                            <div>
                                <label for="labelInput" class="form-label">Content 11<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="a14" value="<?php echo $rq1[15]?>" required>
                            </div>
                        </div> 
                        
                        
                        
                        
                        
                        
                        
                        <div class="mt-3">
                        <input type="submit" class="btn btn-primary"  name="sub1" value="Submit">
                        <!-- staticBackdrop Modal -->
                        </div>

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

    <?php


if(isset($_POST['sub1']))
{

    $a1=addslashes($_POST['a1']);
    $a2=addslashes($_POST['a2']);
    $a3=addslashes($_POST['a3']);
    $a4=addslashes($_POST['a4']);
    $a5=addslashes($_POST['a5']);
    $a6=addslashes($_POST['a6']);
    $a7=addslashes($_POST['a7']);
    $a8=addslashes($_POST['a8']);
    $a9=addslashes($_POST['a9']);
    $a10=addslashes($_POST['a10']);
    $a11=addslashes($_POST['a11']);
    $a12=addslashes($_POST['a12']);
    $a13=addslashes($_POST['a13']);
    $a14=addslashes($_POST['a14']);
   
    $fileName=$_FILES['photo']['name'];
   
    if($fileName=="")
    {
    
               $ins=mysqli_query($db,"update lyt_ser set t='$a1',h='$a2',des='$a3',c1='$a4',c2='$a5',c3='$a6',c4='$a7',c5='$a8',c6='$a9',c7='$a10',c8='$a11',
               c9='$a12',c10='$a13',c11='$a14' ");
    
               msg("Successfully updated","lighting_services.php");
    
    
    
    }
    
    
    else
	{
        $fileTmpPath = $_FILES['photo']['tmp_name'];
       
        $fileSize = $_FILES['photo']['size'];
        $fileType = $_FILES['photo']['type'];
        $fileNameCmps = explode(".", $fileName);
        $fileExtension = strtolower(end($fileNameCmps));
        $newFileName = md5(time() . $fileName) . '.' . $fileExtension;
        
        
        $newFileName = md5(time() . $fileName) . '.' . $fileExtension;
        $allowedfileExtensions = array('jpg', 'gif', 'png','jpeg');
        if (in_array($fileExtension, $allowedfileExtensions))
         {
        $uploadFileDir = "../images/"; 
        $dest_path = $uploadFileDir . $newFileName;
        //$pd=date("d/m/y");
        
        
        list($width, $height, $type, $attr) = getimagesize($fileTmpPath);
           
        
      if($width=="625" && $height=="650")
       {
        
        
            CompressImage($_FILES['photo']['tmp_name'],  $dest_path,80);

               $ins=mysqli_query($db,"update lyt_ser set t='$a1',h='$a2',des='$a3',c1='$a4',c2='$a5',c3='$a6',c4='$a7',c5='$a8',c6='$a9',c7='$a10',c8='$a11',
               c9='$a12',c10='$a13',c11='$a14',image='$newFileName'");
    
               msg("Successfully updated","lighting_services.php");
		  
		  
	  }
      else
      {
      
      
          msg("Image Size should be in width - 625px & height - 650px", "lighting_services.php");
     }
  }
  else
      {
      
      
          msg("Image extension should be jpg or png", "lighting_services.php");
      }
      
  
  
  } 

}


?>


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









<div id="back-top" style="display: none;">
<a title="Go to Top" href="#">
<i class="ti-angle-up"></i>
</a>
</div>

<div class="footer_part">
                <div class="container-fluid">
                <div class="row">
                <div class="col-lg-12">
                <div class="footer_iner text-center">
                <p>2023 © Al Barsha Electronics LLC  - Designed by <a href="https://www.oracuz.com/">Oracuz</a></p>
                </div>
                </div>
                </div>
                </div>
                </div>
                </section>

<script src="js/jquery1-3.4.1.min.js"></script>

<script src="js/popper1.min.js"></script>

<script src="js/bootstrap.min.php"></script>

<script src="js/metisMenu.js"></script>

<script src="vendors/count_up/jquery.waypoints.min.js"></script>

<script src="vendors/chartlist/Chart.min.js"></script>

<script src="vendors/count_up/jquery.counterup.min.js"></script>

<script src="vendors/niceselect/js/jquery.nice-select.min.js"></script>

<script src="vendors/owl_carousel/js/owl.carousel.min.js"></script>

<script src="vendors/datatable/js/jquery.dataTables.min.js"></script>
<script src="vendors/datatable/js/dataTables.responsive.min.js"></script>
<script src="vendors/datatable/js/dataTables.buttons.min.js"></script>
<script src="vendors/datatable/js/buttons.flash.min.js"></script>
<script src="vendors/datatable/js/jszip.min.js"></script>
<script src="vendors/datatable/js/pdfmake.min.js"></script>
<script src="vendors/datatable/js/vfs_fonts.js"></script>
<script src="vendors/datatable/js/buttons.php5.min.js"></script>
<script src="vendors/datatable/js/buttons.print.min.js"></script>

<script src="vendors/datepicker/datepicker.js"></script>
<script src="vendors/datepicker/datepicker.en.js"></script>
<script src="vendors/datepicker/datepicker.custom.js"></script>
<script src="js/chart.min.js"></script>
<script src="vendors/chartjs/roundedBar.min.js"></script>

<script src="vendors/progressbar/jquery.barfiller.js"></script>

<script src="vendors/tagsinput/tagsinput.js"></script>

<script src="vendors/text_editor/summernote-bs4.js"></script>
<script src="vendors/am_chart/amcharts.js"></script>

<script src="vendors/scroll/perfect-scrollbar.min.js"></script>
<script src="vendors/scroll/scrollable-custom.js"></script>

<script src="vendors/vectormap-home/vectormap-2.0.2.min.js"></script>
<script src="vendors/vectormap-home/vectormap-world-mill-en.js"></script>

<script src="vendors/apex_chart/apex-chart2.js"></script>
<script src="vendors/apex_chart/apex_dashboard.js"></script>
<script src="vendors/echart/echarts.min.js"></script>
<script src="vendors/chart_am/core.js"></script>
<script src="vendors/chart_am/charts.js"></script>
<script src="vendors/chart_am/animated.js"></script>
<script src="vendors/chart_am/kelly.js"></script>
<script src="vendors/chart_am/chart-custom.js"></script>

<script src="js/dashboard_init.js"></script>
<script src="js/custom.js"></script>
</body>

<!-- Mirrored from demo.dashboardpack.com/sales.php/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 15 Feb 2023 12:12:37 GMT -->
</html>
