hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
b4h4ej4a6kj6
/
public_html
/
kitsandcleats.in
/
admin
/
Upload FileeE
HOME
<?php include('functions.php'); $obj = new Operations(); if($_GET['mode'] == 'edit'){ $w = "where id = '".$_GET['id']."'"; $rs = $obj->getSingle('terms_condition',$w); } if($_POST){ function format_uri( $string, $separator = '-' ) { $string=trim($string); $accents_regex = '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i'; $special_cases = array( '&' => 'and', "'" => ''); $string = mb_strtolower( trim( $string ), 'UTF-8' ); $string = str_replace( array_keys($special_cases), array_values( $special_cases), $string ); $string = preg_replace( $accents_regex, '$1', htmlentities( $string, ENT_QUOTES, 'UTF-8' ) ); $string = preg_replace("/[^a-z0-9]/u", "$separator", $string); $string = preg_replace("/[$separator]+/u", "$separator", $string); return $string; } $page_title=$_POST['page_title']; $page_title= format_uri($page_title); $page_background= $_FILES['page_background']['name']; move_uploaded_file($_FILES['page_background']['tmp_name'],'images/'.$page_background); if(empty($page_background)){ $page_background=$rs['page_background']; } $data = array( // page Information 'page_title'=>$_POST['page_title'], 'slug_url'=>$page_title, 'meta_title'=>$_POST['meta_title'], 'meta_description'=>$_POST['meta_description'], 'page_background'=>$page_background, 'page_description'=>$_POST['page_description'], 'action'=>$_POST['action'] ); if($_GET['mode'] != 'edit'){ $obj->insert('terms_condition',$data); header('location:view-terms-condition.php?mode=success'); }else{ $obj->update('terms_condition',$data,$rs['id']); header('location:view-terms-condition.php?mode=update'); } } include 'header.php'?> <?php require_once 'sidebar.php'?> <!--== SIDEBAR ENDS ==--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ var mode = '<?php echo $_GET['mode']; ?>'; if(mode == 'success'){ $('#insert_msg').slideDown(); $('#insert_msg').delay(1500).fadeOut(); } if(mode == 'update'){ $('#update_msg').slideDown(); $('#update_msg').delay(1500).fadeOut(); window.location = 'view-terms-condition.php'; } }); </script> <!-- Main Content --> <div class="main-content"> <section class="section"> <div class="section-body"> <div class="row"> <div class="col-md-12"> <div class="card"> <form method="post" enctype="multipart/form-data"> <div class="card-header"> <h4>Manage Terms and Condition</h4> </div> <div class="alert alert-success" style="text-align:center;font-size:25px;display:none;" id="insert_msg">Data Inserted Succesfully</div> <div class="alert alert-success" style="text-align:center;font-size:25px;display:none;" id="update_msg">Data Updated Succesfully</div> <div class="card-body"> <div class="form-group"> <label>Page Title</label> <input type="text" class="form-control" name="page_title" value="<?php echo $rs['page_title'];?>" placeholder="page_title" required=""> </div> <div class="form-group"> <label>Meta Title</label> <input type="text" class="form-control" name="meta_title" value="<?php echo $rs['meta_title'];?>" placeholder="meta_title" required=""> </div> <div class="form-group"> <label>Meta Description</label> <input type="text" class="form-control" name="meta_description" value="<?php echo $rs['meta_description'];?>" placeholder="meta_description" required=""> </div> <div class="form-group"> <label>Background Image</label> <input type="file" class="form-control" name="page_background" value="<?php echo $rs['page_background'];?>" placeholder="page_background"> </div> <?php if($_GET['mode'] == 'edit'){ ?> <img src="./images/<?php echo $rs['page_background'] ?>" width="100"> <?php } ?> <div class="form-group mb-3"> <label for="password">Action</label> <select class="form-control" name="action" autocomplete="off" placeholder=""> <option value="Disabeld" <?php if ($rs['action']=='Disabeld'){echo "selected";} ?>>Disabeld</option> <option value="Active" <?php if ($rs['action']=='Active'){echo "selected";} ?>>Active</option> </select> </div> <div class="form-group mb-3"> <script src="https://cdn.ckeditor.com/4.6.2/standard-all/ckeditor.js"></script> <textarea name="page_description" id="content" class="form-control ckeditor"><?php echo $rs['page_description'] ?></textarea> <script> CKEDITOR.replace( 'content', { height: 300, filebrowserUploadUrl: "upload.php" }); </script> </div> </div> <div class="card-footer text-right"> <button class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> </div> </section> </div> <?php require_once 'footer.php' ?>