<?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">Contact US</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">Contact US</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 Contact Details</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 contact");
$rq1=mysqli_fetch_row($sq1);
?>
                        
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Address Title<span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="a" required><?php echo $rq1[1]?></textarea>
                            </div>
                        </div> 

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Address<span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="b" required><?php echo $rq1[2]?></textarea>
                            </div>
                        </div> 

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Map<span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="c" required><?php echo $rq1[3]?></textarea>
                            </div>
                        </div> 

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Contact Title<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="d" value="<?php echo $rq1[4]?>" required>
                            </div>
                        </div>

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Contact Number<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="e" value="<?php echo $rq1[5]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Whatsapp Number<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="f" value="<?php echo $rq1[6]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Email Title<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="g" value="<?php echo $rq1[7]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Email 1<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="h" value="<?php echo $rq1[8]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Email 2<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="i" value="<?php echo $rq1[9]?>" 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']))
{

    $a=addslashes($_POST['a']);
    $b=addslashes($_POST['b']);
    $c=addslashes($_POST['c']);
    $d=addslashes($_POST['d']);
    $e=addslashes($_POST['e']);
    $f=addslashes($_POST['f']);
    $g=addslashes($_POST['g']);
    $h=addslashes($_POST['h']);
    $i=addslashes($_POST['i']);
    
               $ins=mysqli_query($db,"update contact set a='$a',b='$b',c='$c',d='$d',e='$e',f='$f',g='$g',h='$h',i='$i' ");
    
               msg("Successfully updated","contact_us.php");
    
    
    }
?>


</div>
</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 Contact Page Details</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 contactpd");
$rq1=mysqli_fetch_row($sq1);
?>
                        
                        <div class="col-lg-3">
                            <div>  
                                <label for="labelInput" class="form-label">Image(width-386px & height-555px)<span class="red">*</span></label>
                                <input type="file" class="form-control" id="basiInput" name="a1" value="<?php echo $r[1]?>" > 
                                <img src="../images/contact/<?php echo $rq1[1]?>" width="200px" height="300px">            
                            </div>
                        </div>

                        <div class="col-lg-3">
                            <div>
                                <label for="labelInput" class="form-label">Title <span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="a" required><?php echo $rq1[2]?></textarea>
                            </div>
                        </div> 

                        <div class="col-lg-3">
                            <div>
                                <label for="labelInput" class="form-label">Description<span class="red">*</span></label>
                                <textarea  class="form-control" id="exampleInputdate" name="b" required><?php echo $rq1[3]?></textarea>
                            </div>
                        </div> 

                        <div class="col-lg-3">
                            <div>
                                <label for="labelInput" class="form-label">Button<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="c" value="<?php echo $rq1[4]?>" required>
                            </div>
                        </div>

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Form Title 1<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="d" value="<?php echo $rq1[5]?>" required>
                            </div>
                        </div> 
                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Form Title 2<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="e" value="<?php echo $rq1[6]?>" required>
                            </div>
                        </div> 

                        <div class="col-lg-4">
                            <div>
                                <label for="labelInput" class="form-label">Header Title<span class="red">*</span></label>
                                <input type="text"  class="form-control" id="exampleInputdate" name="f" value="<?php echo $rq1[7]?>" required>
                            </div>
                        </div> 
                        
                                                
                        <div class="mt-3">
                        <input type="submit" class="btn btn-primary"  name="sub2" value="Submit">
                        <!-- staticBackdrop Modal -->
                        </div>

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


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

<?php

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

    $a=addslashes($_POST['a']);
    $b=addslashes($_POST['b']);
    $c=addslashes($_POST['c']);
    $d=addslashes($_POST['d']);
    $e=addslashes($_POST['e']);

    $f=addslashes($_POST['f']);
    $fileName1=$_FILES['a1']['name'];







 if(isset($_FILES['a1']['name']) && $_FILES['a1']['name']!="")
    {
        $fileTmpPath1 = $_FILES['a1']['tmp_name'];
        
        $fileSize1 = $_FILES['a1']['size'];
        $fileType1 = $_FILES['a1']['type'];
        $fileNameCmps1 = explode(".", $fileName1);
        $fileExtension1 = strtolower(end($fileNameCmps1));
        
        
        
        $newFileName1 = md5(time() . $fileName1) . '.' . $fileExtension1;
        $allowedfileExtensions1 = array('jpg', 'gif', 'png','jpeg');
        if (in_array($fileExtension1, $allowedfileExtensions1))
        {
        $uploadFileDir1 = "../images/contact/"; 
        $dest_path1 = $uploadFileDir1 . $newFileName1;

        list($width, $height, $type, $attr) = getimagesize($fileTmpPath1);
           
        
        if($width=="386" && $height=="555")
        {
        
        
        move_uploaded_file($fileTmpPath1, $dest_path1);
      
        $res2=mysqli_query($db,"UPDATE contactpd SET img='$newFileName1' ");
        msg("Successfully updated","contact_us.php");
        }
        else
        {
        
        
            msg("Image Size should be in width - 386px & height - 555px", "contact_us.php");
        }

    }
    else
    {
    
    
        msg("Image extension should be jpg or png", "contact_us.php");
    }
}

   



$res=mysqli_query($db,"UPDATE contactpd SET  a='$a',b='$b',c='$c',d='$d',e='$e',f='$f'");

 msg("successfully updated","contact_us.php");
}

?>




<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>
