<?php
include("../../header.php");
?>
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Edit Latest News</h2>
<div class="clearfix"></div>
</div>
<?php if(isset($_GET['msg']) && $_GET['msg']=='success'){ ?>
<div class="alert alert-success alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true" onClick="myfunc();">×</span>
</button>
<strong>Success!</strong> Form updated.
</div>
<?php }else if(isset($_GET['msg']) && $_GET['msg']=='error'){ ?>
<div class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true" onClick="myfunc();">×</span>
</button>
<strong>Error!</strong> Form not submitted.
</div>
<?php } ?>
<div class="x_content">
<br />
<!-- <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left">-->
<form id="from1" name="from1" enctype="multipart/form-data" action="<?php echo $home_path;?>/pages/master/action/editlatest.php" method="post" class="form-horizontal form-label-left" style="" autocomplete="off">
<input type="hidden" id="idD" name="idD" value="<?php echo $_GET['id']; ?>" >
<?php
$sql=mysqli_query($conn,"select * from latest where id='".$_GET['id']."'");
$rw=mysqli_fetch_array($sql);
?>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">Title<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" id="fname" name="title" required="required" class="form-control col-md-7 col-xs-12" value="<?php echo $rw['title']; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Link <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" id="fdesig" name="link" required="required" class="form-control col-md-7 col-xs-12" value="<?php echo $rw['link']; ?>">
</div>
</div>
<div class="form-group">
<label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">PDF</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="file" id="fdivision" name="pdf" class="form-control col-md-7 col-xs-12" type="text" name="middle-name" value="<?php echo $rw['pdf']; ?>">
<?php if($rw['pdf']!='') { ?>
<span id="att1"><?php echo $rw['pdf'];?></span>
<a href="#" onclick="selPDFDel('<?php echo $rw['id']; ?>','ctalumni');">Delete</a><br>
<?php } ?>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
<button type="submit" class="btn btn-success">Update</button>
<a href="<?php echo $home_path; ?>/pages/master/viewlatest.php"><button class="btn btn-primary" type="button">VIew</button></a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
<script>
function myfunc(){
document.location.href="<?php echo $home_path; ?>/pages/master/editlatest.php?id=<?php echo $_GET['id']; ?>"
}
function selPDFDel(a,b){
//alert(a);
$.ajax({
type:'GET',
url:'<?php echo $home_path; ?>/pages/master/action/seldellatest.php',
data:{
delid:a,
pge:b
},
success:function(data){
//alert(data);
if(data==1){
location.reload();
}else{
alert("Error!.");
}
}
});
}
</script>
<?php
include("../../footer.php");
?> |