ok

Mini Shell

Direktori : /home/ngwcolle/www/mis/admin/
Upload File :
Current File : /home/ngwcolle/www/mis/admin/newuser_form.php

<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');

if(!empty($_POST["accounthead"])) {
  $accounthead= $_POST["accounthead"];
  
  $sql ="SELECT accounthead FROM tblaccount WHERE accounthead=:accounthead";
  $query= $dbh -> prepare($sql);
  $query-> bindParam(':accounthead', $accounthead, PDO::PARAM_STR);
  $query-> execute();
  $results = $query -> fetchAll(PDO::FETCH_OBJ);
  $cnt=1;
  if($query -> rowCount() > 0)
  {
    echo "<script>alert('Account Head already exists. try another one');</script>";
} else{
    if(isset($_POST['signup']))
    { 
        $accounthead=$_POST['accounthead'];
        $bankacc=$_POST['bankacc'];
        $branchname=$_POST['branchname'];
        $ifsc=$_POST['ifsc']; 
        $signatory=$_POST['signatory']; 
        $balance=$_POST['balance'];
        // $dignity=$_POST['dignity']; 
        // $password=md5($_POST['password']); 
        $sql="INSERT INTO  tblaccount(accounthead,bankacc,bankname,ifsc,signatory,amtbalance)
        VALUES(:accounthead,:bankacc,:bankname,:ifsc,:signatory,:amtbalance)";
        $query = $dbh->prepare($sql);
        $query->bindParam(':accounthead',$accounthead,PDO::PARAM_STR);
        $query->bindParam(':bankacc',$bankacc,PDO::PARAM_STR);
        $query->bindParam(':bankname',$branchname,PDO::PARAM_STR);
        $query->bindParam(':ifsc',$ifsc,PDO::PARAM_STR);
        $query->bindParam(':signatory',$signatory,PDO::PARAM_STR);
        $query->bindParam(':amtbalance',$balance,PDO::PARAM_STR);
        // $query->bindParam(':mobile',$mobile,PDO::PARAM_STR);
        // $query->bindParam(':password',$password,PDO::PARAM_STR);
        $query->execute();
        $lastInsertId = $dbh->lastInsertId();
        if($lastInsertId)
        {
            echo "<script>alert('Registration successfull. Now you can start transaction');</script>";
            echo "<script>window.location.href ='user_register.php'</script>";
        }
        else 
        {
            echo "<script>alert('Something went wrong. Please try again');</script>";
        }
    }
}
}

?>
<script>
    function checkAvailability() 
    {
        $("#loaderIcon").show();
        jQuery.ajax(
        {
            url: "check_availability.php",
            data:'emailid='+$("#emailid").val(),
            type: "POST",
            success:function(data)
            {
                $("#user-availability-status").html(data);
                $("#loaderIcon").hide();
            },
            error:function (){}
        });
    }
</script>

<script>
    function checkAvailability2() 
    {
        $("#loaderIcon").show();
        jQuery.ajax(
        {
            url: "check_availability.php",
            data:'fullname='+$("#accounthead").val(),
            type: "POST",
            success:function(data)
            {
                $("#user-availability-status2").html(data);
                $("#loaderIcon").hide();
            },
            error:function (){}
        });
    }
</script>
<!-- <script type="text/javascript">
    function valid()
    {
        if(document.signup.password.value!= document.signup.confirmpassword.value)
        {
            alert("Password and Confirm Password Field do not match  !!");
            document.signup.confirmpassword.focus();
            return false;
        }
        return true;
    }
</script> -->
<div class="card-body">
    <form  method="post" name="signup">
        <div class="row ">
            <div class="form-group col-md-6">
            <input type="text" class="form-control" name="accounthead" id="accounthead" placeholder="Account Head Name" required="required" onBlur="checkAvailability()">
            <span id="user-availability-status" style="font-size:12px;"></span>    
        </div>
            <div class="form-group col-md-6">
                <input type="text" class="form-control" name="bankacc" placeholder="Bank Account Number" required="required">
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-6">
                <input type="text" class="form-control" name="branchname"  placeholder="Branch Name of Bank" onBlur="checkAvailability2()" required="required">
                <span id="user-availability-status2" style="font-size:12px;"></span>
            </div>
            <div class="form-group col-md-6">
                <input type="text" class="form-control" name="ifsc" placeholder="IFSC Code" required="required">
            </div>
        </div>
        <div class="row">
            <div class="form-group col-md-6">
                <input type="text" class="form-control" name="signatory" placeholder="Signatory Name" required="required">
            </div>
            <div class="form-group col-md-6">
                <input type="text" class="form-control" name="balance" placeholder="Balance Till Date" maxlength="10" required="required">
            </div>
        </div>
        <!-- <div class="row">
            <div class="form-group col-md-6">
                <input type="email" class="form-control" name="emailid" id="emailid" onBlur="checkAvailability()" placeholder="Email Address" required="required">
                <span id="user-availability-status" style="font-size:12px;"></span> 
            </div>
            <div class="form-group col-md-6">
                <input type="password" class="form-control" name="password" placeholder="Password" required="required">
            </div>
        </div> -->
        <!-- <div class="row">
            <div class="form-group col-md-6">
                <input type="password"  class="form-control" name="confirmpassword" placeholder="Confirm Password" required="required">
            </div>
        </div> -->
        <div class="form-group">
            <input type="submit" value="Register" name="signup" id="submit" class="btn btn-info">
        </div>
    </form>
</div>

Zerion Mini Shell 1.0