WebShell: t.me/oghbnz
<?php require("header.php"); ?>
<?php require("sub_header.php");
$completed_id=$_GET['completed_id'];
$id=$_GET['id'];
$query=$conn->query("SELECT * FROM completed_salient_features WHERE id='$id' ");
$title2=$query->fetch(PDO::FETCH_ASSOC);
?>
<div class="main">
<div class="container">
<div class="row">
<div class="span12"> <!-- there are 1 to 12 spans we can use for size according to size -->
<div class="widget stacked ">
<div class="widget-header" align="center">
<a href="completed_salient_features_settings.php?completed_id=<?php echo $completed_id; ?>" style="float: left;margin-top: 5px;margin-left:5px" class="btn btn-success"><< Back</a>
<h3>Add/Alter Prjoect Salient Features</h3>
</div> <!-- /widget-header -->
<div class="widget-content">
<div class="tabbable">
<div class="tab-content">
<div class="tab-pane active" id="profile">
<form name="form" id="form" action="" method="POST" class="form-horizontal" enctype='multipart/form-data'>
<div class="login-fields">
<?php if($_GET['msg']=='error'){?>
<h3 style="color: green" style="padding-left: 182px;">Unable to update please try again</h3>
<?php } ?>
<div class="control-group">
<label class="control-label" for="title">Features :</label>
<div class="controls">
<input type="text" id="title" name="title" value="<?php echo $title2['title']; ?>" class="span5" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="icon_id">Icon Id :</label>
<div class="controls">
<input type="text" id="icon_id" name="icon_id" value="<?php echo $title2['icon_id']; ?>" class="span5" /> For More Icon-Id's <a href="https://fontawesome.com/icons?d=gallery&s=solid&m=free" target='_blank'><b>Click Here For Icons</b></a>
</div>
</div>
<!-- <div class="control-group">
<label class="control-label" for="description">Context :</label>
<div class="controls">
<textarea class="ckeditor" id="description" class="login username-field" name="description"><?php echo $title['description']; ?></textarea>
</div>
</div> -->
<div class=class="controls" style="padding-left: 182px; ">
<button class="btn btn-primary" name='update'>Update</button>
</div>
</div> <!-- /login-fields -->
</form>
</div><!-- /tab-pane active -->
</div><!-- /tab-content -->
</div><!-- /tabbable -->
</div> <!-- /widget-content -->
</div> <!-- /widget -->
</div> <!-- /span8 -->
</div> <!-- /row -->
</div> <!-- /container -->
</div> <!-- /main -->
<?php include_once("foter.php"); ?>
<?php
$query=$conn->query("SELECT * FROM completed_salient_features WHERE id='$id' ");
$noid=$query->fetch(PDO::FETCH_ASSOC);
$link=$noid['id'];
extract($_POST);
// $with_h=[" ","&"];
// $replace_h=["_","and"];
// $p_link=str_replace($with_h,$replace_h, $heading);
// if(isset($_FILES['image1']) && $_FILES['image1']['size']>0){
// $tmp = $_FILES['image1']['tmp_name'];
// if(is_uploaded_file($tmp)){
// $oname=$_FILES['image1']['name'];
// $name=getRand().'-'.$oname; //use this if you want to randamise the name write a function to it.
// $desc="../images/completed_salient_features_images/".$name;
// move_uploaded_file($tmp,$desc);
// }
// }else{
// $name= $noid['image1'];
// }
if(isset($_POST['update']) && $_GET['id'] != ''){
$sql1 = $conn->prepare("UPDATE completed_salient_features SET title=:title, icon_id=:icon_id WHERE id='$id' ");
$sql1->bindValue(':title',$title, PDO::PARAM_STR);
$sql1->bindValue(':icon_id',$icon_id, PDO::PARAM_STR);
// $sql1->bindValue(':description',$description, PDO::PARAM_STR);
if($sql1->execute()){
echo "<script>document.location.href='completed_salient_features_settings.php?completed_id=$completed_id&msg=update'</script>";
}else{
echo "<script>document.location.href='completed_salient_features_settings.php?completed_id=$completed_id&msg=error'</script>";
}
}
if(isset($_POST['update']) && $_GET['id'] == '') {
$sql1 = $conn->prepare("INSERT INTO completed_salient_features ( title, icon_id, completed_id) VALUES (:title, :icon_id, :completed_id) ");
$sql1->bindValue(':title',$title, PDO::PARAM_STR);
$sql1->bindValue(':icon_id',$icon_id, PDO::PARAM_STR);
// $sql1->bindValue(':description',$description, PDO::PARAM_STR);
$sql1->bindValue(':completed_id',$completed_id, PDO::PARAM_STR);
// $sql1->bindValue(':specifications_id',$specifications_id, PDO::PARAM_STR);
if($sql1->execute()){
echo "<script>document.location.href='completed_salient_features_settings.php?completed_id=$completed_id&msg=update'</script>";
}else{
echo "<script>document.location.href='completed_salient_features_settings.php?completed_id=$completed_id&msg=error'</script>";
}
}
function getRand(){
$str=str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890$%@^");
return sha1(str_shuffle(crypt($str)));
}
?>
<?php include_once("foter.php"); ?>
<script type="text/javascript">
$(function()
{
$("#form").validate(
{
// Rules for form validation
rules:
{
phone:
{
required : true,
minlength : 10,
maxlength : 50
},
completed_salient_features:
{
required : true
},
specifications:
{
required : true
},
email:
{
required: true,
email : true
}
},
// Messages for form validation
messages:
{
phone:
{
required: 'Please enter phone number',
minlength : 'Enter a valid phone number',
maxlength : 'Enter a valid phone number'
},
completed_salient_features:
{
required: 'Please enter completed_salient_features'
},
specifications:
{
required: 'Please enter Specifications'
},
email:
{
required: 'Please enter email',
email : 'Please enter a valid email'
}
},
// Do not change code below
errorPlacement: function(error, element)
{
error.appendTo(element.parent());
}
});
});
</script>