ok

Mini Shell

Direktori : /home2/selectio/public_html/obnovit-tracking/old/
Upload File :
Current File : /home2/selectio/public_html/obnovit-tracking/old/create-panel-info.php

<?php 
ob_start();
session_start();
$error_message='';
include"config/config.php";


if(isset($_POST['update_info'])) {
        
    if(empty($_POST['soft_name']) ) {
        $error_message = 'Software Name or Logo can not be empty';
    } else {
        $soft_name = strip_tags($_POST['soft_name']);
	        if(isset($_FILES['logo']['name']) && $_FILES['logo']['name']!=""){
            // create random image file name

			$extension1 = end(explode(".", $_FILES["logo"]["name"]));
			$menu_image1 = rand(10,1000000). "-" . date("Y-m-d H-i-s") . "." . $extension1;
			// upload new image
			$upload_logo = move_uploaded_file($_FILES['logo']['tmp_name'], 'images/' . $menu_image1);

			// insert new data to menu table
			$upload_logo_image = 'images/' . $menu_image1;
            }else{
                $upload_logo_image='images/default-img.png';
            }
     $statement = $pdo->prepare("INSERT INTO `tbl_setting`(`name`, `logo`) VALUES (?,?)");
            $result=$statement->execute(array($soft_name,$upload_logo_image));
                    
                    if($result){
                        header("location: login.php");
                    }else { $error_message= "failed";}
    }

    
}

$statement = $pdo->prepare("SELECT * FROM `tbl_setting`");
$statement->execute();
$totals = $statement->rowCount();
if($totals==1){ header("location: login.php"); }
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Update Software Panel Details </title>
    <link rel="shortcut icon" href="images/icon.png"/>
                <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes" name="viewport">
    <link href="assets/dist/css/styles.css" rel="stylesheet" type="text/css" />
    </head>
<body class="login-page login-page-light-green rtl rtl-inv" style="background-image: url('images/login-bg.jpg');background-repeat: no-repeat;background-attachment: fixed;  
  background-size: cover;">
    <div class="login-box">
        <!--<div class="login-logo">
            
        </div>-->
        <div class="login-box-body" style="background: #4e36367a;padding: 20px;border-top: 0;border-radius: 20px;color: white;">
            <form action="" enctype="multipart/form-data" method="post" accept-charset="utf-8">
              
            <div class="form-group has-feedback">
                <input type="text" name="soft_name" value="" class="form-control" placeholder="Software Name" required/>
                <span class="glyphicon glyphicon-cog form-control-feedback"></span>
            </div>
            
            <div class="form-group has-feedback">
                <input type="file" name="logo" value="" class="form-control" placeholder="Software Name" required />
                <span class="glyphicon glyphicon glyphicon-open-file form-control-feedback"></span>
            </div>
            
            <?php 
	    if( (isset($error_message)) && ($error_message!='') ):
	        echo '<div class="error" style="color:red;">'.$error_message.'</div>';
	    endif;
	    ?>

            <button type="submit" name="update_info" class="btn btn-primary btn-block btn-flat"><i class="glyphicon glyphicon-log-in"></i> &nbsp;Sign in</button>

            </form>
            </div>
        </div>

        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal"
        class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <form action="" method="post" accept-charset="utf-8">
                    <input type="hidden" name="spos_token" value="979cb0ee8c0288cd1c35a24d683ad9e1" />
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</i></button>
                    <h4 class="modal-title">Forgot Password?</h4>
                </div>
                <div class="modal-body">
                    <p>Enter your e-mail address below to reset your password.</p>
                    <input type="email" name="forgot_email" placeholder="Email" autocomplete="off"
                    class="form-control placeholder-no-fix">
                </div>
                <div class="modal-footer">
                    <button data-dismiss="modal" class="btn btn-default pull-left" type="button">Close</button>
                    <button class="btn btn-primary" type="submit" name="login">Submit</button>
                </div>
                </form>            </div>
        </div>
    </div>

    <script src="assets/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <script>
        $(function () {
            if ($('#identity').val())
                $('#password').focus();
            else
                $('#identity').focus();
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
            });
        });
    </script>
    
    <script>
$( document ).ready(function() {
    $('#btn_show').show();
    $('#btn_hide').hide();
    
});

    function show() {
      var obj = document.getElementById('myPassword');
      obj.type = "text";
      $('#btn_show').hide();$('#btn_hide').show();
    }
function hide() {
  var obj = document.getElementById('myPassword');
  obj.type = "password";
  $('#btn_show').show();$('#btn_hide').hide();
}
</script>
</body>
</html>















Zerion Mini Shell 1.0