]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include("header.php"); $ins_obj= new config(); @$postaction=$_GET['edit']; if($postaction=='1') { $condition1="`id`=".$_GET['post_id']; $query=$ins_obj->display_rcd('offer_category',$condition1); if(is_array($query) || !empty($query)) { foreach($query as $data) { } } } ?> <?php if($_SERVER['REQUEST_METHOD']=='POST') { if($_FILES["image"]["name"]!='') { $file_type = $_FILES['image']['type']; $temp=explode('.',$_FILES['image']['name']); $file_ext=end($temp); $expensions= array("jpeg","jpg","png", "webm", "mp4", "ogv", "gif"); 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="offer_category.php";</script> --> <?php return; ?> <?php } else { $filename = uniqid() . "-" . time(); $extension = pathinfo( $_FILES["image"]["name"], PATHINFO_EXTENSION ); $basename = $filename . "." . $extension; $source = $_FILES["image"]["tmp_name"]; $destination = "upload/offer_category/".$basename; move_uploaded_file($source, $destination); } } else { $basename=$ins_obj->validation($_POST['old_img']); } $insertdata = array( 'category_id' => $ins_obj->validation($_POST['category_id']), 'title' => $ins_obj->validation($_POST['title']), 'description' => $ins_obj->validation($_POST['description']), 'image' => $ins_obj->validation($basename), 'status' => $ins_obj->validation($_POST['status']) ); if(isset($_POST['submit'])) { $action=$_GET['action']; if($action!= "1") { $data= $ins_obj->insert("offer_category", $insertdata); if($data=='TRUE') { ?> <script type='text/javascript'>alert ('Add sucessfully') var timer = setTimeout(function() { window.location.href="offer_category.php" } ); </script> <?php } else { echo "error".mysqli_error($this->con); } // =============================update========================== } else { $where_condition=array( 'id'=> $postaction ); $update_query=$ins_obj->update("offer_category",$insertdata,$where_condition); if($update_query=='TRUE') { ?> <script type='text/javascript'>alert ('Update sucessfully') var timer = setTimeout(function() { window.location='offer_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">Offer Category</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">Offer Category</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="?action=<?php echo @$postaction;?>&&edit=<?php echo @$data['id'];?>" 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="exampleInputEmail1" class="col-md-2">Uplaod Image</label> <input type="file" name="image" class="form-control col-md-7" <?php if(!isset($data['image'])){echo " required";} ?>> <p>(Image size should be <b>400 X 200</b>)</p> <input type="hidden" value="<?php echo @$data['image'];?>" name="old_img"> <?php $extension = pathinfo( $data['image'], PATHINFO_EXTENSION ); if($extension=="mp4" || $extension=="webm" || $extension=="ogv"){ ?> <video width="400" controls class="col-md-3"> <source src="upload/offer_category/<?php echo @$data['image'];?>" type="video/mp4"> </video> <?php } ?> <?php if($extension=="jpeg" || $extension=="jpg" || $extension=="png" || $extension=="gif") { ?> <img src="upload/offer_category/<?php echo @$data['image'];?>" class="col-md-3" width="150"> <?php } ?> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Category </label> <div class="col-sm-10"> <select class="form-control" name="category_id" required> <?php $condition2="`status`= 1"; $query2=$ins_obj->display_rcd('category',$condition2); if(is_array($query2) || !empty($query2)) { foreach ($query2 as $data2 ) { ?> <option <?php if(@$data2['cat_id']==$data['category_id']){?> selected <?php }?> value="<?php echo $data2['cat_id'] ?>"><?php echo $data2['name'] ?></option> <?php } } ?> </select> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Title</label> <div class="col-sm-10"> <input type="text" name="title" value="<?php echo @$data['title'];?>" class="form-control"> </div> </div> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2 col-form-label">Description</label> <div class="col-sm-10"> <textarea class="form-control" name="description"><?php echo @$data['description'];?></textarea> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Status </label> <div class="col-sm-10"> <select class="form-control" name="status" required> <option <?php if(@$data['status']=='1'){?> selected <?php }?> value="1">Yes</option> <option <?php if(@$data['status']=='0'){?> selected <?php }?>value="0">No</option> </select> </div> </div> </div> <!-- /.card-body --> </div> </div> </div> <div class="card-footer"> <?php if($postaction=='1') { ?> <button type="submit" name="submit" class="btn btn-primary">Update</button> <?php } else { ?> <button type="submit" name="submit" class="btn btn-primary">Submit</button> <?php } ?> </div> </form> </div> </div> </div> <!-- /.row (main row) --> </div> <!-- /.container-fluid --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("footer.php");?>