]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include("header.php"); $ins_obj= new config(); ?> <?php include("sidebar.php");?> <?php @$postaction=$_GET['edit']; if($postaction=='1') { $condition1="`cat_id`=".$_GET['post_id']; $query=$ins_obj->display_rcd('category',$condition1); if(is_array($query) || !empty($query)) { foreach($query as $data) { } } } $related_condition="`cat_id`=".$_GET['post_id']; $rel_query=$ins_obj->display_rcd('multi_order_cat',$related_condition); if(is_array($rel_query) || !empty($rel_query)) { foreach($rel_query as $rel_update) { $rel_array[]=$rel_update['o_id']; } } ?> <?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",'webp'); 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="category.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']); } $placeholder_img="25.jpg"; $parent_id=0; $insertdata = array( 'name' => $ins_obj->validation($_POST['categoryname']), 'image' => $ins_obj->validation($basename), 'cat_banner_1' => $ins_obj->validation($placeholder_img), 'cat_banner_2' => $ins_obj->validation($placeholder_img), 'parent_id' => $ins_obj->validation($parent_id), 'type' => $ins_obj->validation($_POST['type']), 'meta_title' => $ins_obj->validation($_POST['metatitle']), 'meta_description' => $ins_obj->validation($_POST['metadesc']), 'meta_keyword' => $ins_obj->validation($_POST['metakeyword']), 'short_order' => $ins_obj->validation($_POST['short_order']), 's_home' => $ins_obj->validation($_POST['s_home']), 'featured' => $ins_obj->validation($_POST['featured']), 'status' => $ins_obj->validation($_POST['status']), ); if(isset($_POST['submit'])) { $action=$_GET['action']; if($action!= "1") { $data= $ins_obj->insert("category", $insertdata); if($data=='TRUE') { $last_id=$ins_obj->last_id($ins_obj->con); $rel_pro[]=$_POST['rel_product']; $relnumcount=count($rel_pro); for($rel=0; $rel< $relnumcount; $rel++) { foreach($rel_pro=$_POST['rel_product'] as $relvalue) { $rel_ar = array( 'o_id' => $ins_obj->validation($relvalue), 'cat_id' => $ins_obj->validation($last_id), ); $rel_data= $ins_obj->insert("multi_order_cat", $rel_ar); } } ?> <script type='text/javascript'>alert ('Add sucessfully') var timer = setTimeout(function() { window.location.href="all_category.php" } ); </script> <?php } else { echo "error".mysqli_error($this->con); } // =============================update========================== } else { $where_condition=array( 'cat_id'=> $postaction ); $update_query=$ins_obj->update("category",$insertdata,$where_condition); if($update_query=='TRUE') { $relwhere_condition=array('cat_id'=> $postaction ); $delrel_pro=$ins_obj->delete('multi_order_cat',$relwhere_condition); if($delrel_pro=='true') { $rel_pro[]=$_POST['rel_product']; $relnumcount=count($rel_pro); for($rel=0; $rel< $relnumcount; $rel++) { foreach($rel_pro=$_POST['rel_product'] as $relvalue) { $rel_ar = array( 'o_id' => $ins_obj->validation($relvalue), 'cat_id' => $ins_obj->validation($postaction), ); $rel_data= $ins_obj->insert("multi_order_cat", $rel_ar); } } } ?> <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); } } } } ?> <!-- 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">Dashboard</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">Dashboard</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['cat_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="inputEmail3" class="col-sm-2 col-form-label">Category Name</label> <div class="col-sm-10"> <input type="text" name="categoryname" value="<?php echo @$data['name'];?>" class="form-control" placeholder="Category Name" required> </div> </div> <div class="form-group"> <div class="row"> <label for="exampleInputEmail1" class="col-md-2">Uplaod Image</label> <input type="file" name="cateimg" class="form-control col-md-7"> <p>(Image size should be <b>300 X 200</b>)</p> <input type="hidden" value="<?php echo @$data['image'];?>" name="old_img"> <?php if(isset($data['image'])) { ?> <img src="upload/<?php echo @$data['image'];?>" class="col-md-3" width="150" height="100"> <?php } ?> </div> </div> <div class="form-group row"> <label for="inputEmail3" class="col-sm-2 col-form-label"> Choose Brand</label> <div class="col-sm-10"> <div class="form-group"> <div class="select2-purple"> <select class="select2" name="rel_product[]" multiple="multiple" data-placeholder="Related Brand" autocomplete="false" data-dropdown-css-class="select2-purple" style="width: 100%;"> <?php $rel_query=$ins_obj->select('all_brands'); foreach($rel_query as $rupdate) { ?> <option <?php if(@in_array($rupdate['id'], $rel_array)){?> selected<?php }?> value="<?php echo $rupdate['id'];?>"> <?php echo $rupdate['name'];?> </option> <?php } ?> </select> </div> </div> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Meta Tag Title</label> <div class="col-sm-10"> <input type="text" class="form-control" value="<?php echo @$data['meta_title'];?>" name="metatitle" placeholder="Meta Tag Title"> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Meta Tag Description</label> <div class="col-sm-10"> <textarea class="form-control" value="" name="metadesc" placeholder="Meta Tag Description"><?php echo @$data['meta_description'];?></textarea> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Meta Tag Keywords</label> <div class="col-sm-10"> <textarea class="form-control" name="metakeyword" placeholder="Meta Tag Keywords"><?php echo @$data['meta_keyword'];?></textarea> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Sort Order</label> <div class="col-sm-10"> <input type="text" class="form-control" value="<?php echo @$data['short_order'];?>" name="short_order" placeholder="sort order"> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Show Home</label> <div class="col-sm-10"> <select class="form-control" name="s_home"> <option <?php if(@$data['s_home']=='1'){?> selected <?php }?> value="1">Yes</option> <option <?php if(@$data['s_home']=='0'){?> selected <?php }?>value="0">No</option> </select> </div> </div> <div class="form-group row"> <label for="inputPassword3" class="col-sm-2 col-form-label">Featured</label> <div class="col-sm-10"> <select class="form-control" name="featured"> <option <?php if(@$data['featured']=='0'){?> selected <?php }?>value="0">No</option> <option <?php if(@$data['featured']=='1'){?> selected <?php }?> value="1">Yes</option> </select> </div> </div> <input type="hidden" name="type" value="1"> <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"> <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"> <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> </div> </form> </div> </div> </div> <!-- /.row (main row) --> </div><!-- /.container-fluid --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("footer.php");?>