HOME


sh-3ll 1.0
DIR:/chroot/home/laughingplants/laughingplants.com/html/admin/
Upload File :
Current File : /chroot/home/laughingplants/laughingplants.com/html/admin/manage_social_media.php
<?php include 'header.php';
$social_id=1;
$select_social_media = $con->prepare("SELECT * FROM tbl_social_media WHERE id=:social_id");
$select_social_media ->bindPAram(":social_id", $social_id);
$select_social_media ->execute();
$fetch_social_media= $select_social_media ->fetch(PDO::FETCH_ASSOC);

?>

<div class="col-md-10 content">
  <div class="col-md-12" style=" z-index:99;">
    <div class="alert" id="success_message"> <a href="#" class="close" data-dismiss="alert" aria-label="close" style="color:white;opacity: 1;">&times;</a> Record has been saved successfully </div>
  </div>
  <div class="row">
    <div class="col-md-10 ">
      <div class="panel panel-primary">
        <div class="panel-heading">
          <h3>Edit Profile</h3>
        </div>
        <div class="panel-body">
          <form method="POST" id="profile_form" enctype="multipart/form-data">
            <div class="row">
              <div class="col-md-6">
                <div class="form-group">
                  <label>Name</label>
                  <input type="text" class="form-control" name="f_link" value="<?php echo $fetch_social_media['f_link'];  ?>" placeholder="Facebook" >
                </div>
              </div>
              <div class="col-md-6">
                <div class="form-group">
                  <label>Last Name</label>
                  <input type="text" class="form-control" name="g_link" value="<?php echo $fetch_social_media['g_link']; ?>" placeholder="Google Plus" >
                </div>
              </div>
            </div>
            <div class="row">  
              <div class="col-md-6">
                <div class="form-group">
                  <label>Email ID</label>
                  <input type="text" class="form-control" name="t_link" value="<?php echo $fetch_social_media['t_link'];  ?>" placeholder="Twitter" >
                </div>
              </div>
              <div class="col-md-6">
                <div class="form-group">
                  <label>Mobile Number</label>
                  <input type="text" class="form-control" name="l_link" value="<?php echo $fetch_social_media['l_link'];  ?>" placeholder="Linkedin " >
                </div>
              </div>
               </div>   
                       <div class="row">  
              <div class="col-md-12">
                <div class="form-group">
                  <input type="submit" class="btn btn-primary" name="update_password" value="Update It" >
                </div>
              </div>
            </div>
          </form>
         
        </div>
      </div>
    </div>
  </div>
</div>
<?php include 'footer.php'; ?>
 
<?php 
if(isset($_POST['update_password']))
{
 
	$f_link= $_POST['f_link'];
	$g_link= $_POST['g_link'];
	$t_link= $_POST['t_link'];
        $l_link= $_POST['l_link'];
        $so_id=1;
	$update_social = $con->prepare("UPDATE tbl_social_media SET f_link=:f_link, g_link=:g_link, t_link=:t_link, l_link=:l_link WHERE id=:so_id");
	$update_social ->bindParam(":f_link", $f_link);
	$update_social ->bindParam(":g_link", $g_link);
        $update_social ->bindParam(":t_link", $t_link);
	$update_social ->bindParam(":l_link", $l_link);
        $update_social ->bindParam(":so_id", $so_id); 
	if($update_social ->execute())
	{
	      echo "<meta http-equiv='refresh' content='0'>";	 
	}
	else
	{
		echo "<script> alert('Something went wrong'); </script>";
	}
}
 

?>