]]jkjjgdjffksdkdxmnvbcbcvbvcbbbbbbbbbvcbcbvcbmnmbnwqeqwewqskfgj
במ12[cvbnvbnvcvbcvbcvbvvvccccccccccccccvbcvbcvbnmnmqewv;'
/
home
/
u729855735
/
domains
/
stylebyou.com
/
public_html
/
admin
/
Upload FileeE
HOME
<?php require('inc/header.php'); ?> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"/> <section> <style> .btn{ outline:none !important; } .btn:hover{ color:#FFF; } .mdc-drawer-link{ font-size:14px !important; } .cat{ border: 1px solid #d9d6d6; padding: 20px 20px; margin-top: 83px; border-radius: 5px; } .cat_field{ height: 35px; padding-left: 10px; width: 220px; border-radius: 3px; border: 1px solid #d1cece; } .cat-btn{ font-size:14px !important; height:35px; } .import{ color:#00b67a; border:1px solid #00b67a; padding: 6px 20px; font-size: 15px; font-weight: 600; border-radius: 3px; } .import:hover{ color:#00b67a; text-decoration:none; border:1px solid #00b67a; } .cat-right{ margin-top:50px !important; background-color:#e5e5e5; padding:20px 20px 20px 20px } </style> <div class="container"> <div class="row"> <div class="col-sm-4"> <h4 class="text-left mt-5 mb-5"><strong>Add new category</strong></h4> <div style="display:flex;gap:0.5rem"><i style="display:none;color:red" class="fa-solid fa-triangle-exclamation"></i><p id="error-msg" style="color:red;font-size:14px"></p></div> <form method="POST" id="myForm" action="insert_cat.php" enctype="multipart/form-data"> <div class="row"> <div class="form-group col-sm-12"> <input type="text" class="form-control" id="cat_nm" name="cat_nm" placeholder="Enter category name.."> </div> <div class="form-group col-sm-12"> <input type="file" class="form-control" id="cat_img" name="file" placeholder="Enter category name.."> </div> <div class="form-group col-sm-12"> <input type="submit" id="create_product" class="mdc-button mdc-button--raised mdc-ripple-upgraded btn btn-md" name="create_cat" value="Create category"> </div> </div> </form> </div> <div class="col-sm-8"> <section class="cat-right"> <table class="table"> <thead> <tr> <th scope="col">#</th> <th scope="col">Image</th> <th>Action</th> <th scope="col">Name</th> </tr> </thead> <tbody> <?php $get_cat2 = "SELECT * FROM category ORDER BY cat_id DESC"; $run_cat2 = mysqli_query($conn,$get_cat2); while($row_cat2 = mysqli_fetch_assoc($run_cat2)){ ?> <tr> <th scope="row"><?php echo $row_cat2['cat_id']?></th> <td><img style="width:70px;height:70px" src="catimg/<?php echo $row_cat2['img']?>"></td> <td><a onclick="return confirm('Are you sure want to delete?');" style="color:red;font-size:12px" href="del_cate.php?cid=<?php echo $row_cat2['cat_id']?>">Delete</a></td> <td><?php echo $row_cat2['cat_nm']?></td> </tr> <?php } ?> </tbody> </table> </section> </div> </div> </section> <script src="ckeditor/ckeditor.js"></script> <script> CKEDITOR.replace('desc'); </script> <script> $(document).ready(function() { $("#myForm").submit(function (event) { var prnm = $('input[name="cat_nm"]').val(); var file = $('input[name="file"]').val(); if(prnm === ''){ $("#error-msg").text("Category name is required.").show(); $('.fa-triangle-exclamation').css('display', 'block'); event.preventDefault(); setTimeout(function() { $('#error-msg').fadeOut(); $('.fa-triangle-exclamation').fadeOut(); }, 3000); return false; } else if(file === ''){ $("#error-msg").text("Category image is required.").show(); $('.fa-triangle-exclamation').css('display', 'block'); event.preventDefault(); setTimeout(function() { $('#error-msg').fadeOut(); $('.fa-triangle-exclamation').fadeOut(); }, 3000); return false; } }); }); </script> <?php require('inc/footer.php'); ?>