]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include("header.php"); $ins_obj= new config(); ?> <?php @$delete=$_GET['delete']; if(isset($delete) AND !empty($delete)) { if($delete=="1") { @$post_id=$_GET['post_id']; if(isset($post_id) and !empty($post_id)) { $where1 = array('cat_id' => $_GET["post_id"]); $placeholder_img="25.jpg"; $upated_data= array('cat_banner_1' => $placeholder_img); if($ins_obj->update("category",$upated_data,$where1)) { ?> <script type="text/javascript">alert("Banner 1 Updated");</script> <?php $ins_obj->alert('all_category.php'); } } } elseif($delete=="2") { @$post_id=$_GET['post_id']; if(isset($post_id) and !empty($post_id)) { $where1 = array('cat_id' => $_GET["post_id"]); $placeholder_img2="25.jpg"; $upated_data= array('cat_banner_2' => $placeholder_img2); if($ins_obj->update("category",$upated_data,$where1)) { ?> <script type="text/javascript">alert("Banner 2 Updated ");</script> <?php $ins_obj->alert('all_category.php'); } } } } ?> <?php @$cat_id=$_GET['cat_id']; @$postaction=$_GET['edit']; if($postaction=='1') { $condition1="`cat_id`=".$_GET['cat_id']; $query=$ins_obj->display_rcd('category',$condition1); if(is_array($query) || !empty($query)) { foreach($query as $data) { } } } $condition_cat="`cat_id`=".$cat_id; $cat_query=$ins_obj->display_rcd('category',$condition_cat); if(is_array($cat_query) || !empty($cat_query)) { foreach($cat_query as $cat_data) { } } ?> <?php if($_SERVER['REQUEST_METHOD']=='POST') { if($_FILES["cateimg"]["name"]!='') { $file_type = $_FILES['cateimg']['type']; $temp=explode('.',$_FILES['cateimg']['name']); $file_ext=end($temp); $expensions= array("jpeg","jpg","png"); if(in_array($file_ext,$expensions)=== false) { ?> <script type='text/javascript'>alert('extension not allowed, please choose a JPEG or PNG file.'); </script> <script type='text/javascript'>window.location.href="cat_banner.php";</script> <?php return; ?> <?php } else { $filename = uniqid() . "-" . time(); $extension = pathinfo( $_FILES["cateimg"]["name"], PATHINFO_EXTENSION ); $basename = $filename . "." . $extension; $source = $_FILES["cateimg"]["tmp_name"]; $destination = "upload/".$basename; move_uploaded_file($source, $destination); } } else { $basename=$ins_obj->validation($_POST['old_img']); } // =================================================================== if($_FILES["cateimg1"]["name"]!='') { $file_type = $_FILES['cateimg1']['type']; $temp=explode('.',$_FILES['cateimg1']['name']); $file_ext=end($temp); $expensions= array("jpeg","jpg","png"); if(in_array($file_ext,$expensions)=== false) { ?> <script type='text/javascript'>alert('extension not allowed, please choose a JPEG or PNG file.'); </script> <script type='text/javascript'>window.location.href="cat_banner.php";</script> <?php return; ?> <?php } else { $filename = uniqid() . "-" . time(); $extension = pathinfo( $_FILES["cateimg1"]["name"], PATHINFO_EXTENSION ); $basename2 = $filename . "." . $extension; $source = $_FILES["cateimg1"]["tmp_name"]; $destination = "upload/".$basename2; move_uploaded_file($source, $destination); } } else { $basename2=$ins_obj->validation($_POST['old_img_1']); } $cat_link_1=$ins_obj->validation($_POST['cat_link_1']); $cat_link_2=$ins_obj->validation($_POST['cat_link_2']); $insertdata = array( 'cat_banner_1' => $ins_obj->validation($basename), 'cat_link_1' => $ins_obj->validation($cat_link_1), 'cat_banner_2' => $ins_obj->validation($basename2), 'cat_link_2' => $ins_obj->validation($cat_link_2), ); if(isset($_POST['submit'])) { $where_condition=array( 'cat_id'=> $cat_id ); $update_query=$ins_obj->update("category",$insertdata,$where_condition); if($update_query=='TRUE') { ?> <script type='text/javascript'>alert ('Update sucessfully') var timer = setTimeout(function() { window.location='all_category.php' }); </script> <?php } else { echo "error".mysqli_error($this->con); } } } ?> <!-- Main Sidebar Container --> <?php include("sidebar.php");?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1 class="m-0 text-dark">Banner</h1> </div><!-- /.col --> <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">Banner</li> </ol> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <!-- Main content --> <section class="content"> <div class="container-fluid"> <!-- Small boxes (Stat box) --> <!-- /.row --> <!-- Main row --> <div class="row"> <div class="col-md-12"> <div class="card card-primary card-tabs"> <div class="card-header p-0 pt-1"> <ul class="nav nav-tabs" id="custom-tabs-five-tab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="custom-tabs-five-normal-tab" data-toggle="pill" href="#general" role="tab" aria-controls="custom-tabs-five-normal" aria-selected="false">General</a> </li> </ul> </div> <form class="form-horizontal" action="#" method="post" enctype="multipart/form-data"> <div class="card-body"> <div class="tab-content" id="custom-tabs-five-tabContent"> <div class="tab-pane fade active show" id="general" > <div class="card-body"> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2 col-form-label">Category</label> <div class="col-sm-10"> <input type="text" name="name" readonly value="<?php echo @$cat_data['name'];?>" class="form-control" id="inputEmail3" placeholder="Title"> </div> </div> <div class="form-group row"> <label for="exampleInputEmail1" class="col-md-2">Banner 1</label> <input type="file" name="cateimg" class="form-control col-md-7"> <input type="hidden" value="<?php echo @$data['cat_banner_1'];?>" name="old_img"> <?php if(isset($data['cat_banner_1'])) { ?> <div class="col-md-3"> <img src="upload/<?php echo @$data['cat_banner_1'];?>" width="100%" height="100"> <br> <a href="cat_banner.php?delete=1&post_id=<?php echo $data['cat_id']; ?>" style="color:#fff;" class="btn btn-danger btn-sm delete_coupon" class="btn btn-danger"><i class="fa fa-trash"></i> Remove</a> </div> <?php } ?> </div> <div class="form-group row"> <label for="exampleInputEmail1" class="col-md-2">Banner 2</label> <input type="file" name="cateimg1" class="form-control col-md-7"> <input type="hidden" value="<?php echo @$data['cat_banner_2'];?>" name="old_img_1"> <?php if(isset($data['cat_banner_2'])) { ?> <div class="col-md-3"> <img src="upload/<?php echo @$data['cat_banner_2'];?>" width="100%" height="100"><br> <a href="cat_banner.php?delete=2&post_id=<?php echo $data['cat_id']; ?>" style="color:#fff;" class="btn btn-danger btn-sm delete_coupon" class="btn btn-danger"><i class="fa fa-trash"></i> Remove</a> </div> <?php } ?> </div> </div> <div class="card-body"> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2 col-form-label">Category Link 1 </label> <div class="col-sm-10"> <input type="text" name="cat_link_1" value="<?php echo @$cat_data['cat_link_1'];?>" class="form-control" id="inputEmail3" placeholder="Title"> </div> </div> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2 col-form-label">Category Link 2</label> <div class="col-sm-10"> <input type="text" name="cat_link_2" value="<?php echo @$cat_data['cat_link_2'];?>" class="form-control" id="inputEmail3" placeholder="Title"> </div> </div> </div> <!-- /.card-body --> </div> </div> </div> <div class="card-footer"> <button type="submit" name="submit" class="btn btn-primary">Update</button> </div> </form> </div> </div> </div> <!-- /.row (main row) --> </div><!-- /.container-fluid --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("footer.php");?> <script type="text/javascript"> $(document).on('click','.delete_coupon',function(){ var post_id = $(this).attr("id"); if(confirm("Are you sure you want to delete ?")) { return true; } else { return false; } }); </script>