Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
gokul-h authored May 20, 2021
1 parent c6fad25 commit 18b94f9
Show file tree
Hide file tree
Showing 72 changed files with 5,201 additions and 0 deletions.
67 changes: 67 additions & 0 deletions admin/admin_add_admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!-- include the basic files -->
<?php
include("../partials/header.php");
include("../partials/warning.php");
include("../partials/logo_label_top.php");
include("../partials/admin_navbar.php");
?>


<!-- Database Code to insert new admin -->
<?php
if(isset($_POST['submit']))
{
// Get Data from form
$_username = $_POST["username"];
$_password = md5($_POST["password"]);
// Check SQL Query
$sql = "INSERT INTO admin VALUES ('$_username', '$_password')";

if ($conn->query($sql) === TRUE)
{
$message = "Record inserted successfully";
}
else
{
$message = "Error: Duplicate Entry";
}
}
?>

<div>
<!-- Heading -->
<div class="conatiner wb" style="width:50%">
<div class="jumbotron jumbotron-fluid text-center" >
<div class="container ">
<h1 class="display-4">Add Admin</h1>
<p class="lead">Add New Admins</p>
</div>
</div>
</div>
<br>

<!-- Create the form -->
<div class="conatiner wbf">
<br>
<form method="post" action="" class="wc">
<input class="form-control " type="text" placeholder="<?php if (isset($message)) {echo $message;} ?>" aria-label="readonly input example" readonly>
<br>
<div class="form-group">
<label for="username">Username</label>
<input type="username" class="form-control" name="username" id="username" placeholder="Enter Username">
</div>
<br>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
</div>
<br>
<input name="submit" id="submit" name="submit" class="btn btn-block btn-success " type="submit" value="Submit">
</form>
<br>
</div>
<br>


<!-- Include footer -->
<?php include("../partials/footer.php");?>
63 changes: 63 additions & 0 deletions admin/admin_add_branch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!-- include the basic files -->
<?php
include("../partials/header.php");
include("../partials/warning.php");
include("../partials/logo_label_top.php");
include("../partials/admin_navbar.php");
?>


<?php
if(isset($_POST['submit']))
{
// Get Data from form
$branchname = $_POST["branch_name"];
$pincode = $_POST["pincode"];
$date = date("Y/m/d");
// Check SQL Query
$sql = "INSERT INTO branch (branch_name, pincode, opening_date) VALUES ('$branchname', '$pincode', '$date')";
if ($conn->query($sql) === TRUE)
{
$message = "Record inserted successfully";
}
else
{
$message = "Error: Duplicate Entry";
}
}
?>

<!-- Heading -->
<div class="conatiner wb" style="width:50%">
<div class="jumbotron jumbotron-fluid text-center" >
<div class="container ">
<h1 class="display-4">Add Branch</h1>
<p class="lead">Add New Branches</p>
</div>
</div>
</div>
<br>

<!-- Create the form -->
<div class="conatiner wbf">
<br>
<form method="post" action="" class="wc">
<input class="form-control " type="text" placeholder="<?php if (isset($message)) {echo $message;} ?>" aria-label="readonly input example" readonly>
<br>
<div class="form-group">
<label for="branch_name">Branch name</label>
<input type="branch_name" class="form-control" name="branch_name" id="branch_name" placeholder="Enter Branch name">
</div>
<br>
<div class="form-group">
<label for="pincode">Pincode</label>
<input type="pincode" class="form-control" name="pincode" id="pincode" placeholder="Pincode">
</div>
<br>
<input name="submit" id="submit" class="btn btn-block btn-success " type="submit" value="Submit">
</form>
<br>
</div>

<!-- Include footer -->
<?php include("../partials/footer.php")?>
81 changes: 81 additions & 0 deletions admin/admin_add_employee.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
include("../partials/header.php");
include("../partials/warning.php");
include("../partials/logo_label_top.php");
include("../partials/admin_navbar.php");
?>
<!-- heading -->
<div class="conatiner wb" style="width:50%">
<div class="jumbotron jumbotron-fluid text-center" >
<div class="container ">
<h1 class="display-4">Approve Employee</h1>
<p class="lead">View and approve all Employee applications</p>
</div>
</div>
</div>
<br>

<div class="wc">
<input class="form-control " type="text" placeholder="<?php if (isset($_SESSION['employe-status'])) {echo $_SESSION['employe-status'];}; unset($_SESSION['employe-status']); ?>" aria-label="readonly input example" readonly>
</div>
<br>

<!-- Table -->
<div class="conatiner wb">
<?php
// SQL Code
$sql="SELECT * FROM employee NATURAL JOIN employee_details WHERE employee_details.emp_id=employee.emp_id AND employee.application_status='Processing';";
// Execute and get result
$result = $conn->query($sql);
//Print in Table Format
if($result!== false & $result->num_rows >0)
{
echo "
<div class=\"card-body text-primary text-primary\">
<blockquote class=\"blockquote mb-0\">
<table class=\"table table-bordered table-info text-center table-responsive\" >
<tr>
<th scope=\"col\">Emp ID</th>
<th scope=\"col\">Employee Name</th>
<th scope=\"col\">Gender</th>
<th scope=\"col\">Username</th>
<th scope=\"col\">Position</th>
<th scope=\"col\">Branch ID</th>
<th scope=\"col\">Email ID</th>
<th scope=\"col\">Phone Number</th>
<th scope=\"col\">Approve</th>
<th scope=\"col\">Reject</th>
</tr>";
// Data
// Fetch-assoc takes result as an associative array
while($row = $result->fetch_assoc())
{
echo "
<tr>
<td>".$row["emp_id"]."</td>
<td>".$row["emp_name"]."</td>
<td>".$row["gender"]."</td>
<td>".$row["username"]."</td>
<td>".$row["position"]."</td>
<td>".$row["branch_id"]."</td>
<td>".$row["email_id"]."</td>
<td>".$row["phone_number"]."</td>
<td><a href=\"../admin/partials/admin_approve_employee.php?emp_id=".$row['emp_id']."\"><button class=\"btn btn-block btn-success\">Approve</button></a></td>
<td><a href=\"../admin/partials/admin_reject_employee.php?emp_id=".$row['emp_id']."\"><button class=\"btn btn-block btn-danger\">Reject</button></a></td>
</tr>";
}

echo " </blockquote>
</div>";
}
else
{
// Table is Empty since result is false
echo "<br><h2 class=\"text-center\">This table is empty<h2>";
}
?>
</div>

<!-- Include footer -->
<?php //include("../partials/footer.php") ?>

65 changes: 65 additions & 0 deletions admin/admin_add_loan_type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!-- include the basic files -->
<?php
include("../partials/header.php");
include("../partials/warning.php");
include("../partials/logo_label_top.php");
include("../partials/admin_navbar.php");
?>

<!-- Database Code -->
<?php
if(isset($_POST['submit']))
{
// Get Data from form
$_loan_name = $_POST["loan_name"];
$_interest = $_POST["interest"];

// Check SQL Query
$sql = "INSERT INTO loan_type VALUES ('$_loan_name', $_interest)";
if ($conn->query($sql) === TRUE)
{
$message = "Record inserted successfully";
}
else
{
$message = "Error: Duplicate Entry";
}
}
?>


<!-- Heading -->
<div class="conatiner wb" style="width:50%">
<div class="jumbotron jumbotron-fluid text-center" >
<div class="container ">
<h1 class="display-4">Add Loan Type</h1>
<p class="lead">Input the loan name and interest per annum in percentage</p>
</div>
</div>
</div>
<br>

<!-- Create the form -->
<div class="conatiner wbf">
<br>
<form method="post" action="" class="wc">
<input class="form-control " type="text" placeholder="<?php if (isset($message)) {echo $message;} ?>" aria-label="readonly input example" readonly>
<br>
<div class="form-group">
<label for="loan_name">Loan Name</label>
<input type="loan_name" class="form-control" name="loan_name" id="loan_name" placeholder="Enter Loan name">
</div>
<br>
<div class="form-group">
<label for="interest">Interest %</label>
<input type="interest" class="form-control" name="interest" id="interest" placeholder="Enter Interest percentage">
</div>
<br>
<input name="submit" id="submit" class="btn btn-block btn-success " type="submit" value="Submit">
</form>
<br>
</div>


<!-- Include footer -->
<?php include("../partials/footer.php")?>
68 changes: 68 additions & 0 deletions admin/admin_branch_info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
include("../partials/header.php");
include("../partials/warning.php");
include("../partials/logo_label_top.php");
include("../partials/admin_navbar.php");
?>

<!-- Heading -->
<div class="conatiner wb" style="width:50%">
<div class="jumbotron jumbotron-fluid text-center" >
<div class="container ">
<h1 class="display-4">Branch Info</h1>
<p class="lead">View all branches and details</p>
</div>
</div>
</div>
<br>
<!-- Table -->
<div class="conatiner wb">
<?php
// SQL Code
$sql="SELECT * FROM branch;";
// Execute and get result
$result = $conn->query($sql);
//Print in Table Format
if($result!== false & $result->num_rows >0)
{
echo "
<div class=\"card-body text-primary text-primary\">
<blockquote class=\"blockquote mb-0\">
<table class=\"table table-bordered table-info text-center table-responsive\" >
<tr>
<th scope=\"col\">Branch ID</th>
<th scope=\"col\">Branch Name</th>
<th scope=\"col\">Pincode</th>
<th scope=\"col\">Opening Date</th>
<th scope=\"col\">Modify</th>
<th scope=\"col\">Delete</th>
</tr>";
// Data
// Fetch-assoc takes result as an associative array
while($row = $result->fetch_assoc())
{
echo "
<tr>
<th scope=\"row\">".$row["branch_id"]."</th>
<td>".$row["branch_name"]."</td>
<td>".$row["pincode"]."</td>
<td>".$row["opening_date"]."</td>
<td><a href=\"../admin/admin_update_branch.php?branch_id=".$row['branch_id']."\"><button class=\"btn btn-block btn-info\">Update Branch</button></a></td>
<td><a href=\"../admin/partials/admin_delete_branch.php?branch_id=".$row['branch_id']."\"><button class=\"btn btn-block btn-danger\">Delete Branch</button></a></td>
</tr>";
}

echo " </blockquote>
</div>";
}
else
{
// Table is Empty since result is false
echo "<br><h2 class=\"text-center\">This table is empty<h2>";
}
?>
</div>

<!-- Footer -->
<?php //include("../partials/footer.php"); ?>

Loading

0 comments on commit 18b94f9

Please sign in to comment.