Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

LOGIN PAGE <form method="POST"

action="">
<?php include('session.php'); ?> <?php
<?php include('header.php'); ?> $total=0;

<?php include('side_nav_bar.php'); ?> $query=mysqli_query($conn,"select *


<?php include('top_nav_bar.php'); ?> from consumed_item left join supply on
<?php include'sidebar.php';?> supply.supply_id=consumed_item.supply_id
<style type="text/css"> where table_id='".$_SESSION['id']."'");
body {
font-size: 17px; while($row=mysqli_fetch_array($query
} )){
</style> ?>
<!-- Modal --> <tr>
<div id="myModal" class="modal fade" <td></td>
role="dialog">
<div class="modal-dialog"> <td><?php echo $row['supply_type'];
?> <?php echo $row['supply_desc']; ?></td>
<!-- Modal content-->
<div class="modal-content"> <!-- <td><?php echo $row['quantity'];
<div class="modal-header"> ?></td>-->
<button type="button" class="close" data-
dismiss="modal">&times;</button> <td align="right"><?php echo
</div> number_format($row['supply_total_amount'],2
<div class="modal-body"> ); ?></td>

<td>
</tr>
<div class="panel-body"> <?php echo $row['consumed_qty'];?>

<table class="table table-bordered table- </td>


hover" border="1" cellpadding="4"
cellspacing="0" style="font-family: arial; font- <td align="right"><strong><span
size: 12px; text-align:left;" > class="subt">
<thead>
<th></th> <?php
<th>Product
Name</th>
<th>Product $subtotal=$row['consumed_qty']*$row
Price</th> ['supply_total_amount'];

<th>Quantity</th> echo
number_format($subtotal,2);
<th>SubTotal</th>
</thead> $total+=$subtotal;
<tbody>
</DIV> ?>

45
?>
</span></strong></td> </tr> <?php
<?php if(isset($_POST['add'])){
} $income = $_POST['income'];
?> $tincome = $_POST['tin'];
<tr> $month = date('m Y');
<tr> $months = date('F Y');
<td if(preg_match("/^[0-9,]+$/", $total,
colspan="4"><span class="pull- $amount)){
right"><strong>Grand $new=$total;
Total</strong></span></td>
<td }
align="right"><strong><span id="total">Php else{
<?php echo number_format($total,2); $new = str_replace(',', '', $total,
?></span><strong></td> $amount);
</tr> }

</tr>
if ($income < $total){
echo "<script>alert('Insuffecient
</tbody> Cash!')</script>";
}else
</table> {
mysqli_query($conn,"insert into sales (table_id,
<form method="POST" action=""> sales_total, sales_income, sales_tincome,
Month, months, sales_date) values
Income <br> <input ('".$_SESSION['id']."', '$new', '$income',
type="number" name="income" id="income" '$tincome','$month', '$months', NOW())");
class="form control" required> $sid=mysqli_insert_id($conn);
<br>
<br> $query=mysqli_query($conn,"select
<input type="hidden" * from consumed_item where
name="tot" id="tot" value="<?php echo $total; table_id='".$_SESSION['id']."'");
?>"> while($row=mysqli_fetch_array($query
Total Income(Swine )){
Raiser/Owner) <br><input type="number" mysqli_query($conn,"insert
name="tin" id="tin" class="form control" into sales_detail (salesid, supply_id, sales_qty,
readonly> sales_income, sales_tincome, table_id) values
</strong> ('$sid', '".$row['supply_id']."',
<br> '".$row['consumed_qty']."', '$income',
<input type="submit" '$tincome','".$_SESSION['id']."' )");
name="add">
mysqli_query($conn,"UPDATE
<?php swine_raiser SET swine_qty = '0' where table_id
$subtotal=$row['qty']*$row['supply_tot = '".$_SESSION['id']."'");
al_amount'];
$pro=mysqli_query($conn,"select *
$total+=$subtotal;

46
from supply where target="#myModal">Proceed to
supply_id='".$row['supply_id']."'"); Payment</button>

$prorow=mysqli_fetch_array($pro);
</div>
} </div>
</center>
mysqli_query($conn,"delete from
consumed_item where
table_id='".$_SESSION['id']."'"); <div class="col-lg-12"
style="width: 50%; margin-left: 199px; margin-
} top: -677px; ">
} <div class="panel panel-default"; height:
400px;" style="background-color: pink;">
?> <div class="panel-heading"
</form> style="background-color: #337ab7;">
</div> <font size="5px"
</div> color="white"><b>Consumables</b></font>

</div> </div>
<div class="panel-body"
</div> style="background-color:pink">
</div> <a href="indexxx.php" class="btn btn-
<!-- End Modal --> danger" style="background-color: #337ab7;"><i
class="fa "></i> Medicine</a>
<body> <a href="index.php" class="btn btn-
<?php include('navbar.php'); ?> danger" style="background-color: #c2c1c1;"><i
<center> class="fa "></i> Feeds</a>
<div class="navbar-default sidebar"
role="navigation" style="max-height: 100%; <a href="historyy.php" class="btn
width: 34%; border: solid gray 1px; margin-left: btn-danger" style="float: right; background-
962px; margin-top: -676px;"> color: #337ab7;"><i class="fa " ></i>
<div class="sidebar-nav navbar- History</a>
collapse" > </div>
<table class="table table-bordered
table-hover" border="1" cellpadding="4"
<div style="height: 10px;"></div> cellspacing="0" style="font-family: arial; font-
size: 14px; text-align:left; width: 90%;
<div id="checkout_area" style="margin: background-color: #ffe6ea; margin-left: 40px;
10px;"></div> margin-top: -1%;">
<thead
<div style="height:20px;"></div> style="background-color:#337ab7;">
<th>Product
Name</th>
<!-- Trigger the modal with a button --> <th>Product
<button type="button" class="btn btn-info btn- Price</th>
lg" data-toggle="modal" data-

47
<th>Quantity</th> </span></strong></td>

<th>SubTotal</th> <td align="center">


</thead>
<tbody >
</DIV>
<form method="POST" <div id="cart<?php echo
action=""> $row['supply_id']; ?>">
<?php <input
$inc=4; type="number" class = "hidden"
style="width:40px;" id="qty<?php echo
$query=mysqli_query($conn,"select * $row['supply_id']; ?>" value=1>
from `supply` where supply_quantity > 0 and <a
supply_type = 'Feeds' "); href=""><button type="button" class="btn btn-
primary btn-sm concart" value="<?php echo
while($row=mysqli_fetch_array($query $row['supply_id']; ?>">
)){ ADD

$inc = ($inc == 4) ? 1 : </button></a>


$inc+1; </div>
if($inc == 1) echo "<div
class='row'>"; </td>
</tr>
?> <?php
}
<tr> ?>

<td><?php echo $row['supply_desc'];


?></td> </tbody>

<!-- <td><?php echo </table>


$row['supply_quantity']; ?></td>-->

</div>
<td align="right"> <!-- /.panel-body -->
</div>
<?php echo number_format <!-- /.panel -->
($row['supply_total_amount'],2);?> </div>
<!-- /.col-lg-12 -->
</td> </div>
<!-- /.row -->
<td align="right"><strong><span </div>
class="subt"> <!-- /#page-wrapper -->

<?php echo $row['supply_quantity'];?> </div>


<!-- /#wrapper -->

48
<div class="container" style="width: 45%; float: include "expired.php";?>
left; margin-top: -676px; border: #4c84b3; <head>
margin-left: 233px;" > <?php include('header.php'); ?>
<div class="modal-footer">
<?php include('side_nav_bar.php'); ?>
<!-- Morris Charts CSS -->
<?php include('script.php'); ?> <link href="../vendor/morrisjs/morris.css"
<?php include('modal.php'); ?> rel="stylesheet">
<script src="custom.js"></script> </head>
<script> <style type="text/css">
body {
$(document).ready(function(){
showCheckout(); background-color: white;
font-size: 15px;
}); }

</script>
</style>
<script type="text/javascript"> <body>
$(document).ready(function(){
$('#income').change(function(){; <div class="navbar-header" style="margin-left: -
var num = $('#income').val(); 500px;">
var nums = $('#tot').val();
<img src="img/logo.png" width="60px"
var TIncome = 0; height="60px" >
<font size="5px" color="#337ab7"> Swine
Raising Management System </font>
TIncome = (num - nums)/2; </div>
// alert(TIncome) <!-- /.navbar-header -->
$('#tin').val(TIncome); <ul class="nav navbar-top-links navbar-right"
style="margin-top: -56px">
<a href="../index.php">
}); Logout
}); </a></button>
</script> </div>

</body> <!-- /.dropdown-user -->


</li>
<style> .foot{text-align: center; border: 2px <!-- /.dropdown -->
solid black;}</style> </ul>
</html>

DASHBOARD PAGE <div id="wrapper">


<!-- Navigation -->
<!DOCTYPE html> <nav class="navbar navbar-default navbar-
<html lang="en"> static-top" role="navigation" style="margin-
<?php ob_start(); include "connection.php"; bottom: 0">

49
<?php include('top_nav_bar.php'); ?> </div>
<!-- /.navbar-top-links -->
<?php include('side_nav_bar.php'); ?> </div>
<!-- /.navbar-static-side --> </div>
</nav> <br>
<div class="col-lg-3 col-md-6"
<div id="page-wrapper"> style=" color: white; width: 260px; margin-left: -
<div class="row"> 15px; margin-top: -4px;">
<?php if (isset($_SESSION['success'])) : ?> <div class="panel panel-white">
<div class="error success" > <div class="panel-heading"
<?php unset($_SESSION['success']); ?> style="background-color: #337ab7;">
</div> <div class="row">
<?php endif ?> <div class="col-xs-3">
<!-- <div class="col-lg-12"> <i class="fa fa-file fa-5x"></i>
<h2 class="page- </div>
header"><center><br><h6><strong>Date:</stro <div class="col-xs-9 text-right" style="
ng> <?php echo date("l M d, Y"); color: white;" >
?></h6></small></center></h2> <div class="huge" >
</div> --> <?php

<div class="col-lg-3 col-md-6" $datenow = date('Y-m-d');


style=" color: white; width: 245px; margin-top: $select1 = "select SUM(swine_qty) as
20px;"> swine_qty from `swine_raiser`";
<div class="panel "> $result1 = mysqli_query($conn,$select1);
<div class="panel-heading"
style="background-color: #337ab7; margin-top: $row = mysqli_fetch_array($result1);
10px;"> echo $row['swine_qty'];
?>
<div class="row">
<div class="col-xs-3"> </div>
<i class="fa fa-file fa-5x"></i> <div style=" margin-left: 7px;">No. of
</div> Swine</div>
<div class="col-xs-9 text-right"> </div>
<div class="huge" font-size="33px"> </div>
<?php </div>

$q = </div>
mysqli_query($conn,"SELECT * from </div>
swine_raiser WHERE swine_qty > 0");
$num_rows =
mysqli_num_rows($q);
echo $num_rows; <div class="row" style="width: 815px;
?> height:190px; margin-left: 490px">
<div class="col-lg-12">
</div> <div class="panel panel-default"
<div>Swine Raiser</div> style="background-color:#ffe6ea; ">
</div>
</div>

50
<div class="panel-heading" size: 3px; color: text-align:left;"
style="background-color: #337ab7; width="30px" id="invTable">
color:white;">
<i class="fa fa-bar-chart-o fa-fw"></i> <thead style="background-color: pink;
<font size="5"> <b> Monthly Report of Feeds font-size: 20px;">
Consumption</b> </font> <tr >
</div> <th>Product Name</th>
<!-- /.panel-heading -->
<div class="panel-body"> <th>Quantity</th>
<div id="feeds"></div>
</div> <th>Status</th>
</div> </tr>
</div> </thead>
</div> <tbody>
<?php
<div class="row" style="width: 800px;
height:190px; margin-left: 500px"> $connect=mysqli_query($conn,"select *
<div class="col-lg-12"> from supply where supply_type != 'Swine' order
by supply_quantity");
</div>
</div> while
($row=mysqli_fetch_array($connect)) {
$qty =
$row['supply_quantity'];
$name =
$row['supply_desc'];
</div>
if ($qty <= 0){
?>
<tr>
<!-- /.col-lg-12 --> <td> <?php echo
</div> $row['supply_desc'];?></td>
<div style="width: 10%"> <td> <?php echo
<div class="card mb-3" style="width: $row['supply_quantity'];?></td>
459px; margin-left: 230px; margin-top: -500px ;
margin-bottom: -100px;"> <?php
if ($qty <= 0){
<div class="panel-heading" ?>
style="background-color: #337ab7; color: white; <td
margin-top: 25%;"> font-size="5%"> <?php echo "Out Of
<font size="5px"><b> <center>Out of Stock"?></td>
Stocks </center></b> </font> <?php
}

<table class="table table-bordered else{


table-hover" style="background-color:#ffe6ea; ?>
color: black; " border="1" cellpadding="3" <td>
cellspacing="0" style="font-family: arial; font- <?php echo "Available"?></td>

51
<?php <div class="panel-heading"
} style="background-color: #337ab7; width:
?> 800px;">
</tr> <font size="5px"
<?php color="white"><center><b>Swine Schedule for
} Vaccination</b></center></font>
}
?>
</div>
</tbody> <!-- /.panel-heading -->
</table>
<div class="panel-body"
</div> style="background-color: #337ab7; width:
800px;">
<table width="100%" class="table table-
bordered table-hover dataTables-example
<div class="row" style="width:1308px; recordsTable" id="recordsTable">
height:190px; " > <thead style="background-color: pink;
font-size: 20px;">
<div class="col-lg-12"> <tr>
<div class="panel panel-default" <th>Swine Raiser Name</th>
style="background-color:#ffe6ea; "> <th>Address</th>
<div class="panel-heading" <th>Date Release</th>
style="background-color: #337ab7; <th>Date Scheduled</th>
color:white;"> <th>Action</th>
<i class="fa fa-bar-chart-o fa-fw" ></i>
<font size="5"> <b>Monthly Sales
Report</b></font> </tr>
</div> </thead>
<tbody style="background-
<!-- /.panel-heading --> color:#ffe6ea;">
<div class="panel-body"> <?php
<div id="barChart"></div> include_once('Connection.php');
$today = date('Y-m-d');
$sql="SELECT * FROM `swine_raiser`, `schedule`
</div> where swine_raiser.table_id= schedule.table_id
and schedule_status = 'To Visit' group by
</div> schedule.table_id order by schedule_status";
</div> $result=mysqli_query($conn,$sql);
<div class="card-footer small text- if(mysqli_num_rows($result) > 0){
muted"></div> while($row=mysqli_fetch_assoc($result)){
</div>
?>
</div> <tr>
</div>
<div class="col-lg-12" style="width: 491px; <td><?php echo
margin-top: 4px; margin-left: 215px "> $row['swine_raiser_name']; ?></td>
<div class="panel panel-default">

52
<td><?php echo else{
$row['swine_raiser_address']; ?></td> $_SESSION['duplicate'] = 1;
<td><?php echo date("M d, Y", header ('location: edit_profile.php');
strtotime($row['swine_raiser_year'])); ?></td> }
<td><?php echo date("M d, Y", }
strtotime($row['schedule_date_time'])); ?> ?>
</td>

<td> </tbody>
</table>
</div>
<form method="POST" <!-- /.panel-body -->
action="scheduled.php">
<input type="hidden" </div>
name="schedule_id" value="<?php echo <!-- /.panel -->
$row['schedule_id'];?>">
<button name="done"
style="background-color: #609dd2;" class="btn
btn-success btn-sm"><i class="fa fa-edit">
Done</i></button>

</form>

</td>
</td>
</tr>
<?php } } ?>

<div class="card-footer small text-


<?php include 'connection.php'; muted"></div>
if(isset($_POST['done'])) { </div>

$schedule_id = $_POST['schedule_id']; </div>


$table_id = $_POST['table_id']; </div>
$consumed_date =
$_POST['consumed_date'];
$sched_date = $_POST['sched_date']; <div class="col-lg-12" style="width: 450px;
margin-top: 4px; margin-left: 335px ">
<div class="panel panel-default">
$query = mysqli_query($conn,"UPDATE <div class="panel-heading"
schedule SET schedule_status = 'Visited' where style="background-color: #337ab7; width:
schedule_id = '".$schedule_id."'"); 450px;">
if($query == true){ <font size="5px"
$_SESSION['edit'] = 1; color="white"><center><b>Expired
Products</b></center></font>
header ('location: schedule.php');
}

53
</div>
<!-- /.panel-heading --> <!-- jQuery -->
<script
<div class="panel-body" src="../vendor/jquery/jquery.min.js"></script>
style="background-color: #337ab7; width:
450px;"> <!-- Bootstrap Core JavaScript -->
<table width="100%" class="table <script
table-bordered table-hover dataTables-example src="../vendor/bootstrap/js/bootstrap.min.js">
recordsTable" id="recordsTable"> </script>
<thead style="background-color:
pink;"> <!-- Metis Menu Plugin JavaScript -->
<tr> <script
<th>Product Name</th> src="../vendor/metisMenu/metisMenu.min.js">
<th>Expiration Date</th> </script>

</tr> <!-- Morris Charts JavaScript -->


</thead> <script
<tbody style="background- src="../vendor/raphael/raphael.min.js"></script
color:#ffe6ea;"> >
<?php <script
include_once('Connection.php'); src="../vendor/morrisjs/morris.min.js"></script
$today = date('Y-m-d'); >
$sql="SELECT * FROM supply where <script src="../data/morris-data.js"></script>
supply_type = 'Medicine' and supply_status =
'Expired'"; <!-- Custom Theme JavaScript -->
$result=mysqli_query($conn,$sql); <script src="../dist/js/sb-admin-2.js"></script>
if(mysqli_num_rows($result) > 0){
while($row=mysqli_fetch_assoc($result)){
</body>
?>
<tr> </html>

<td><?php echo $row['supply_desc'];


?></td>
<td><?php echo date("M d, Y",
strtotime($row['supply_exp_date'])); ?></td>

<?php } } ?>
</tbody>
</table>
</div>
<!-- /.panel-body -->

</div>
<!-- /.panel -->

</div>
<!-- /#wrapper -->

54

You might also like