![]() Server : LiteSpeed System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : claqxcrl ( 523) PHP Version : 8.1.32 Disable Function : NONE Directory : /home/claqxcrl/www/ondjoweb/admin/ |
<?php session_start(); include('includes/config.php'); error_reporting(0); if(strlen($_SESSION['login'])==0) { header('location:index.php'); } else{ if(isset($_POST['sucatdescription'])) { $subcatid=intval($_GET['scid']); $categoryid=$_POST['category']; $subcatname=$_POST['subcategory']; $subcatdescription=$_POST['sucatdescription']; $query=mysqli_query($con,"update tblsubcategoria set CategoryId='$categoryid',Subcategory='$subcatname',SubCatDescription='$subcatdescription' where SubCategoryId='$subcatid'"); if($query) { $msg="Sub-Categoria criada "; } else{ $error="Algo deu errado . Por favor tente outra vez."; } } ?> <!DOCTYPE html> <html lang="pt"> <head> <title>OndjoWEB | Actualizar Sub Categoria</title> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/core.css" rel="stylesheet" type="text/css" /> <link href="assets/css/components.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.css" rel="stylesheet" type="text/css" /> <link href="assets/css/pages.css" rel="stylesheet" type="text/css" /> <link href="assets/css/menu.css" rel="stylesheet" type="text/css" /> <link href="assets/css/responsive.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="../plugins/switchery/switchery.min.css"> <script src="assets/js/modernizr.min.js"></script> </head> <body class="fixed-left"> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include('includes/topheader.php');?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <?php include('includes/leftsidebar.php');?> <!-- Left Sidebar End --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="page-title-box"> <h4 class="page-title">Actualizar Sub-Categoria</h4> <ol class="breadcrumb p-0 m-0"> <li> <a href="#">Admin</a> </li> <li> <a href="#">Categoria </a> </li> <li class="active"> Actualizar Sub-Categoria </li> </ol> <div class="clearfix"></div> </div> </div> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <div class="card-box"> <h4 class="m-t-0 header-title"><b>Actualizar Sub-Categoria </b></h4> <hr /> <div class="row"> <div class="col-sm-6"> <!---Success Message---> <?php if($msg){ ?> <div class="alert alert-success" role="alert"> <strong>Sucesso!</strong> <?php echo htmlentities($msg);?> </div> <?php } ?> <!---Error Message---> <?php if($error){ ?> <div class="alert alert-danger" role="alert"> <strong>Oh pá!</strong> <?php echo htmlentities($error);?></div> <?php } ?> </div> </div> <?php //fetching Category details $subcatid=intval($_GET['scid']); $query=mysqli_query($con,"Select tblcategoria.CategoryName as catname,tblcategoria.id as catid,tblsubcategoria.Subcategory as subcatname,tblsubcategoria.SubCatDescription as SubCatDescription,tblsubcategoria.PostingDate as subcatpostingdate,tblsubcategoria.UpdationDate as subcatupdationdate,tblsubcategoria.SubCategoryId as subcatid from tblsubcategoria join tblcategoria on tblsubcategoria.CategoryId=tblcategoria.id where tblsubcategoria.Is_Active=1 and SubCategoryId='$subcatid'"); $cnt=1; while($row=mysqli_fetch_array($query)) { ?> <div class="row"> <div class="col-md-6"> <form class="form-horizontal" name="category" method="post"> <div class="form-group"> <label class="col-md-2 control-label">Categoria</label> <div class="col-md-10"> <select class="form-control" name="category" required> <option value="<?php echo htmlentities($row['catid']);?>"><?php echo htmlentities($row['catname']);?></option> <?php // Feching active categories $ret=mysqli_query($con,"select id,CategoryName from tblcategoria where Is_Active=1"); while($result=mysqli_fetch_array($ret)) { ?> <option value="<?php echo htmlentities($result['id']);?>"><?php echo htmlentities($result['CategoryName']);?></option> <?php } ?> </select> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Sub-Categoria</label> <div class="col-md-10"> <input type="text" class="form-control" value="<?php echo htmlentities($row['subcatname']);?>" name="subcategory" required> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">Descrição</label> <div class="col-md-10"> <textarea class="form-control" rows="5" name="sucatdescription" required><?php echo htmlentities($row['SubCatDescription']);?></textarea> </div> </div> <?php } ?> <div class="form-group"> <label class="col-md-2 control-label"> </label> <div class="col-md-10"> <button type="submit" class="btn btn-custom waves-effect waves-light btn-md" name="submitsubcat"> Actualizar </button> </div> </div> </form> </div> </div> </div> </div> </div> <!-- end row --> </div> <!-- container --> </div> <!-- content --> <?php include('includes/footer.php');?> </div> </div> <!-- END wrapper --> <script> var resizefunc = []; </script> <!-- jQuery --> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/detect.js"></script> <script src="assets/js/fastclick.js"></script> <script src="assets/js/jquery.blockUI.js"></script> <script src="assets/js/waves.js"></script> <script src="assets/js/jquery.slimscroll.js"></script> <script src="assets/js/jquery.scrollTo.min.js"></script> <script src="../plugins/switchery/switchery.min.js"></script> <!-- App js --> <script src="assets/js/jquery.core.js"></script> <script src="assets/js/jquery.app.js"></script> </body> </html> <?php } ?>