ok
Direktori : /proc/self/root/proc/self/root/home/ngwcolle/public_html/mis/admin/ |
Current File : //proc/self/root/proc/self/root/home/ngwcolle/public_html/mis/admin/newemployee_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=strtoupper($_POST['empname']); $bankacc=$_POST['designation']; $branchname=$_POST['emptype']; $ifsc=$_POST['empdept']; $signatory=$_POST['basicpay']; $balance=$_POST['mobile']; // $dignity=$_POST['dignity']; // $password=md5($_POST['password']); $sql="INSERT INTO tblemployee(empname,designation,mobilno,basicpay,emptype,empdept) 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',$balance,PDO::PARAM_STR); $query->bindParam(':ifsc',$signatory,PDO::PARAM_STR); $query->bindParam(':signatory',$branchname,PDO::PARAM_STR); $query->bindParam(':amtbalance',$ifsc,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('Employee Registration successfull. Now you can start transaction');</script>"; echo "<script>window.location.href ='employee_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="empname" id="accounthead" placeholder="Employee Name" required="required"> <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="designation" placeholder="Designation" required="required"> </div> </div> <div class="row"> <div class="form-group col-md-6"> <select name="emptype" id="" class="form-control" required> <option value="">--Employee Type--</option> <option value="Regular">Regular</option> <option value="Adhoc">Adhoc</option> <option value="Contractual">Contractual</option> <option value="Outsourcing">Outsourcing</option> <option value="Guest">Guest</option> </select> <!-- <input type="text" 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"> <select name="empdept" id="" class="form-control" required> <option value="">--Employee Role--</option> <option value="Teaching">Teaching</option> <option value="Non-Teaching">Non-Teaching</option> <!-- <option value="Contractual">Contractual</option> <option value="Outsourcing">Outsourcing</option> <option value="Guest">Guest</option> --> </select> <!-- <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="number" class="form-control" name="basicpay" placeholder="Basic Salary" required="required"> </div> <div class="form-group col-md-6"> <input type="number" class="form-control" name="mobile" placeholder="Mobile No." maxlength="10" required="required"> </div> </div> <div class="row"> <div class="form-group col-md-12"> <select name="empstatus" id="" class="form-control" required> <option value="">--Employee Status--</option> <option value="1" selected>Active</option> <option value="0">Exit</option> <!-- <option value="Contractual">Contractual</option> <option value="Outsourcing">Outsourcing</option> <option value="Guest">Guest</option> --> </select> </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>