<?php
include('header.php');
include("dbcon.php");
error_reporting(0);
if(isset($_POST['submit']))
{
    
    $page=htmlspecialchars($_POST['page'], ENT_QUOTES);
    $titletag=htmlspecialchars($_POST['titletag'], ENT_QUOTES);
    $meta=htmlspecialchars($_POST['meta'], ENT_QUOTES);
    $keywords=htmlspecialchars($_POST['keywords'], ENT_QUOTES);
    $ga=htmlspecialchars($_POST['ga'], ENT_QUOTES);
    $ss=htmlspecialchars($_POST['ss'], ENT_QUOTES);
    $fb=htmlspecialchars($_POST['fb'], ENT_QUOTES);
    $insta=htmlspecialchars($_POST['insta'], ENT_QUOTES);
    $twit=htmlspecialchars($_POST['twit'], ENT_QUOTES);
    $link=htmlspecialchars($_POST['link'], ENT_QUOTES);
    $youtube=htmlspecialchars($_POST['youtube'], ENT_QUOTES);
    
     
    $result="INSERT into `seo`(`page_name`,`title_tag`,`meta_content`,`meta_keywords`,`google_analytics`,`schema_script`,`fb`,`insta`,`linkedin`,`twit`,`youtube`)VALUES('$page','$titletag','$meta','$keywords','$ga','$ss','$fb','$insta','$link','$twit','$youtube')";
    if (mysqli_query($con, $result)){
    header("location:seo.php?message=success");
} 
 }   
?>


<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">Banner</a></li>
                        <li><a href="welcome-note.php">Welcome Note</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="projects.php">
                    <i class="fa fa-info-circle" aria-hidden="true"></i>
                    <span class="title">PROJECTS</span>
                    </a>
                </li>
                
                    <li class="">
                    <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="">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="active">
                    <a href="seo.php">
                    <i class="fa fa-globe" aria-hidden="true"></i>
                    <span class="title">SEO</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>HOME</B></a>
                                    <i class="fa fa-angle-right"></i>
                                    <a href=""><B>SEO</B></a>
            					</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">
                                                        <?php 
  if( $_GET['message'] == 'success' ) 
  { ?>
                    <p style="color:green;">
      <?php 
    echo "Record Added successfully"; ?>
                    </p>
 
    <?php
  } ?> 

    </div>
    <div class="tools">
    <a href="javascript:;" class="reload"></a>
    </div>
    </div>
    </div> 
    <div class="portlet-body form">
    <!-- BEGIN FORM-->
<?php
 $bannerid=$_GET['id'];
 if($id==$bannerid)
{
?>
<form action="seo.php" class="form-horizontal form-bordered" method="post"  enctype="multipart/form-data" name="slider">
<div class="form-body">

<div class="form-group">
<label class="control-label col-md-3"><b>Select Page</b></label>
<div class="col-md-9">

<select class="form-control select2me" id="page" name="page" style="width:100%;"  autocomplete="off">
<option>---select page---</option>    
<option value="home">Home</option>  
<option value="aboutus">About us</option>  
<option value="bollards">Bollards</option>  
<option value="tactileindicators">Tactile Indicators</option>  
<option value="stairnoses">Stair Noses</option>
<option value="vinylproducts">PVC & Vinyl Products</option>  
<option value="trafficsafetyproducts">Traffic Safety Products</option> 
<option value="gallery">Gallery</option>  
<option value="contactus">Contact us</option>  

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


<div class="form-group">
<label class="control-label col-md-3"><b>Title Tag</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="titletag" name="titletag" style="width:100%;height:100px;"  autocomplete="off"></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Meta Content</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="meta" name="meta" style="width:100%;height:100px;"  autocomplete="off"></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Meta Keywords</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="keywords" name="keywords" style="width:100%;height:100px;"  autocomplete="off"></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Google Analytics</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="ga" name="ga" style="width:100%;height:100px;"  autocomplete="off"></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Schema Script</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="ss" name="ss" style="width:100%;height:100px;"  autocomplete="off"></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Facebook</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="fb" name="fb" style="width:100%;"  autocomplete="off" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Instagram</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="insta" name="insta" style="width:100%;"  autocomplete="off" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>LinkedIn</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="link" name="link" style="width:100%;"  autocomplete="off" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Twitter</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="twit" name="twit" style="width:100%;"  autocomplete="off" />

</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Youtube</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="youtube" name="youtube" style="width:100%;"  autocomplete="off" />

</div>
</div>

</div>
<div class="form-actions fluid">
<div class="row">
<div class="col-md-12">
<div class="col-md-offset-3 col-md-9">
<input type="submit" class="btn green" name="submit" value="Save">
<a href="seo.php" class="btn default" >Reset</a>
</div>
</div>
</div>
</div>
</form>
     <?php 
    }
    else
    { 
    ?>
<form action="update-seo.php" class="form-horizontal form-bordered" method="post"  enctype="multipart/form-data" name="slider">
<?php
$seoid=$_GET['id'];
$results="SELECT * FROM `seo` WHERE seo_id =$seoid";
$res=mysqli_query($con,$results);
$r=mysqli_fetch_array($res);
?>
<div class="form-body">
<input type="hidden" name="id" value="<?php echo $r['seo_id'];?>">

 <div class="form-group">
<label class="control-label col-md-3"><b>Page Name</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="page_name" name="page_name" style="width:100%;"  autocomplete="off" value="<?php echo $r['page_name'];?>" readonly/>
</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Title Tag</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="title_tag" name="title_tag" style="width:100%;height:100px;"  autocomplete="off"><?php echo $r['title_tag'];?></textarea>
</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Meta Content</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="meta_content" name="meta_content" style="width:100%;height:100px;"  autocomplete="off"><?php echo $r['meta_content'];?></textarea>
</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Meta Keywords</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="meta_keywords" name="meta_keywords" style="width:100%;height:100px;"  autocomplete="off"><?php echo $r['meta_keywords'];?></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Google Analytics</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="google_analytics" name="google_analytics" style="width:100%;height:100px;"  autocomplete="off"><?php echo html_entity_decode($r['google_analytics']);?></textarea>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Schema Script</b></label>
<div class="col-md-9">
<textarea class="form-control select2me" id="schema_script" name="schema_script" style="width:100%;height:100px;"  autocomplete="off"><?php echo html_entity_decode($r['schema_script']);?></textarea>
</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Facebook</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="fb1" name="fb1" style="width:100%;"  autocomplete="off" value="<?php echo $r['fb'];?>" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Instagram</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="insta1" name="insta1" style="width:100%;"  autocomplete="off"  value="<?php echo $r['insta'];?>" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>LinkedIn</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="link1" name="link1" style="width:100%;"  autocomplete="off"  value="<?php echo $r['linkedin'];?>" />

</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"><b>Twitter</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="twit1" name="twit1" style="width:100%;"  autocomplete="off" value="<?php echo $r['twit'];?>" />

</div>
</div>


<div class="form-group">
<label class="control-label col-md-3"><b>Youtube</b></label>
<div class="col-md-9">
<input type="text" class="form-control select2me" id="youtube1" name="youtube1" style="width:100%;"  autocomplete="off"  value="<?php echo $r['youtube'];?>"/>

</div>
</div>


</div>
<div class="form-actions fluid">
<div class="row">
<div class="col-md-12">
<div class="col-md-offset-3 col-md-9">
<button type="submit" class="btn green" ><i class="fa fa-check"></i> Update</button>
<a href="seo.php" class="btn default" >Reset</a>
</div>
</div>
</div>
</div>
</form>  
<!--END FORM-->
<?php
}
?>
</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="600px" 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>Page</b></td>
<td width="20%" class="hidden-xs text-center"><b>Title Tage</b></td>
<td width="15%" class="text-right hidden-xs"><b>Action</b></td>
</tr>
</thead>
<?php
$res="select * from seo";
$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['page_name'];?></td>
    <td class="hidden-xs text-center"><?php echo $r['title_tag'];?></td>
    <td class="text-right hidden-xs"><a href="seo.php?id=<?php echo $r['seo_id']; ?>" class="btn default btn-xs blue"><i class="fa fa-edit "></i></a>
    <a href="seodelete.php?id=<?php  echo $r['seo_id'];?>" class="btn default btn-xs red" onClick="return confirm('Are you sure you want to delete this Image?');"><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>