Skip to content

Commit

Permalink
Feature: "branch update"
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranzafar4343 committed Aug 28, 2024
1 parent 1514914 commit 41b0376
Show file tree
Hide file tree
Showing 14 changed files with 849 additions and 20 deletions.
29 changes: 18 additions & 11 deletions Branches.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
$sql = "SELECT * FROM branch WHERE compID_FK = $company_id";
$result = $conn->query($sql);

//2nd query to fetch the comp_name
$sql2 = "Select comp_name from compani where comp_id= $company_id";
$result2= $conn->query($sql2);

$comp_name= "";

if($result2->num_rows>0){
$row2 = $result2->fetch_assoc();
$comp_name=$row2['comp_name'];
}

?>

Expand Down Expand Up @@ -464,18 +474,15 @@

<div class="cardBranch recent-sales overflow-auto">
<div class="card-body">
<h5 class="card-title">Company branches</h5>
<h2 class="card-title fw-bold text-uppercase"><?php echo $comp_name; ?></h2>

<?php
if ($result->num_rows > 0) {
?>
<table class="table table-borderless datatable" style="table-layout: fixed;">
<thead>
<tr>

<th scope="col">Comp. Id</th>
<th scope="col">Branch Id</th>
<th scope="col">Branch Name</th>
<th scope="col">Branch Name</th>
<th scope="col">Contact Person</th>
<th scope="col">Phone</th>
<th scope="col">Contact Person Resignation</th>
Expand All @@ -492,8 +499,6 @@
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<tr>";
echo "<td>" . htmlspecialchars($row["compID_FK"]) . "</td>";
echo "<td>" . htmlspecialchars($row["branch_id"]) . "</td> ";
echo "<td>" . htmlspecialchars($row["branch_name"]) . "</td>";

echo "<td>" . htmlspecialchars($row["ContactPersonName"]) . "</td>";
Expand All @@ -505,11 +510,13 @@
echo "<td>" . htmlspecialchars($row["Country"]) . "</td>";
?>
<td>
<div>
<a type="button" class="btn btn-danger btn-floating d-flex justify-content-center" style="width:25px; height:28px" data-mdb-ripple-init onclick="return confirm('Are you sure you want to delete this record?');" href="branchDelete.php?id=<?php echo $row['branch_id']; ?>"> <i style="width: 20px;" class="fa-solid fa-trash"></i></a>
</div>
<div style="display: flex; gap: 10px;">
<a type="button" class="btn btn-success btn-info d-flex justify-content-center " style="width:25px; height: 28px;" href="branchUpdate.php?id=<?php echo $row['branch_id']; ?>"><i style="width: 20px;" class="fa-solid fa-pen-to-square"></i></a>

<a type="button" class="btn btn-danger btn-floating d-flex justify-content-center" style="width:25px; height:28px" data-mdb-ripple-init
onclick="return confirm('Are you sure you want to delete this record?');" href="branchDelete.php?id=<?php echo $row['branch_id']; ?>"> <i style="width: 20px;" class="fa-solid fa-trash"></i></a>
</div>
</td>

</tr>
<?php
}
Expand Down
9 changes: 4 additions & 5 deletions Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,14 @@
</colgroup>
<thead>
<tr>

<th scope="col" >Comp. Id</th>
<th scope="col" >Name</th>
<th scope="col" >Phone</th>
<th scope="col" >Email</th>
<th scope="col">Password</th>
<!-- <th scope="col">Password</th> -->
<th scope="col">City</th>
<th scope="col">Country</th>

<th scope="col"> Registration date</th>
<th scope="col" >Expiry</th>
<th scope="col" >Actions</th>
</tr>
Expand All @@ -471,12 +470,12 @@
<?php
echo "<td >" . htmlspecialchars($row["phone"]) . "</td> ";
echo "<td >" . htmlspecialchars($row["email"]) . "</td>";
echo "<td>" . htmlspecialchars($row["password"]) . "</td>";
// echo "<td>" . htmlspecialchars($row["password"]) . "</td>";
// echo "<td><button type='button' class='btn btn-light view-password' data-id='" . htmlspecialchars($row['comp_id']) . "'><i class='fa fa-eye'></i></button></td>";
echo "<td >" . htmlspecialchars($row["city"]) . "</td>";
// echo "<td>" . htmlspecialchars($row["state"]) . "</td>";
echo "<td >" . htmlspecialchars($row["country"]) . "</td>";
// echo "<td>" . htmlspecialchars($row["registration"]) . "</td>";
echo "<td>" . htmlspecialchars($row["registration"]) . "</td>";
echo "<td >" . htmlspecialchars($row["expiry"]) . "</td>";

?>
Expand Down
1 change: 1 addition & 0 deletions CompanyInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
box-shadow: 0px 0 30px rgba(1, 41, 112, 0.1);
background-color: white;
font-size: 0.8rem;
margin-top: 38px;
}

.container-card {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ input[type=date].form-control {

.card-title {
padding: 5px 0 0px 0;
font-size: 20px;
font-size: 23px;
font-weight: 500;
position: relative;
left: 11px;
Expand Down
Loading

0 comments on commit 41b0376

Please sign in to comment.