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

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

1
$subtotal=$row['qty']*$row['supply_total_amo
?> unt'];

</span></strong></td> </tr> $total+=$subtotal;


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

</tbody> if ($income < $total){


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

2
mysqli_query($conn,"UPDATE
swine_raiser SET swine_qty = '0' where table_id
= '".$_SESSION['id']."'"); <!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-
$pro=mysqli_query($conn,"select * lg" data-toggle="modal" data-
from supply where supply_id='". target="#myModal">Proceed to
$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;">

3
<th>Product <td align="right"><strong><span
Name</th> class="subt">
<th>Product
Price</th> <?php echo
$row['supply_quantity'];?>
<th>Quantity</th>
</span></strong></td>
<th>SubTotal</th>
</thead> <td align="center">
<tbody >
</DIV>
<form method="POST"
action=""> <div id="cart<?php echo
<?php $row['supply_id']; ?>">
$inc=4; <input
type="number" class = "hidden"
$query=mysqli_query($conn,"select * style="width:40px;" id="qty<?php echo
from `supply` where supply_quantity > 0 and $row['supply_id']; ?>" value=1>
supply_type = 'Feeds' "); <a
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 :
$inc+1; </button></a>
if($inc == 1) echo "<div </div>
class='row'>";
</td>
?> </tr>
<?php
<tr> }
?>

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


></td>
</tbody>
<!-- <td><?php echo
$row['supply_quantity']; ?></td>--> </table>

<td align="right"> </div>


<!-- /.panel-body -->
<?php echo number_format </div>
($row['supply_total_amount'],2);?> <!-- /.panel -->
</div>
</td> <!-- /.col-lg-12 -->
</div>
<!-- /.row -->

4
</div> DASHBOARD PAGE
<!-- /#page-wrapper -->
<!DOCTYPE html>
</div> <html lang="en">
<!-- /#wrapper --> <?php ob_start(); include "connection.php";
<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>

5
<div id="wrapper">
<!-- Navigation --> </div>
<nav class="navbar navbar-default navbar- <div>Swine Raiser</div>
static-top" role="navigation" style="margin- </div>
bottom: 0"> </div>
<?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">

6
<div class="col-lg-12"> <table class="table table-bordered
<div class="panel panel-default" table-hover" style="background-color:#ffe6ea;
style="background-color:#ffe6ea; "> color: black; " border="1" cellpadding="3"
<div class="panel-heading" cellspacing="0" style="font-family: arial; font-
style="background-color: #337ab7; size: 3px; color: text-align:left;"
color:white;"> width="30px" id="invTable">
<i class="fa fa-bar-chart-o fa-fw"></i>
<font size="5"> <b> Monthly Report of Feeds <thead style="background-color: pink;
Consumption</b> </font> font-size: 20px;">
</div> <tr >
<!-- /.panel-heading --> <th>Product Name</th>
<div class="panel-body">
<div id="feeds"></div> <th>Quantity</th>
</div>
</div> <th>Status</th>
</div> </tr>
</div> </thead>
<tbody>
<div class="row" style="width: 800px; <?php
height:190px; margin-left: 500px">
<div class="col-lg-12"> $connect=mysqli_query($conn,"select *
from supply where supply_type != 'Swine' order
</div> by supply_quantity");
</div>
while
($row=mysqli_fetch_array($connect)) {
$qty =
$row['supply_quantity'];
$name =
</div> $row['supply_desc'];

if ($qty <= 0){


?>
<!-- /.col-lg-12 --> <tr>
</div> <td> <?php echo
<div style="width: 10%"> $row['supply_desc'];?></td>
<div class="card mb-3" style="width: <td> <?php echo
459px; margin-left: 230px; margin-top: -500px ; $row['supply_quantity'];?></td>
margin-bottom: -100px;">
<?php
<div class="panel-heading" if ($qty <= 0){
style="background-color: #337ab7; color: white; ?>
margin-top: 25%;"> <td
<font size="5px"><b> <center>Out of font-size="5%"> <?php echo "Out Of Stock"?
Stocks </center></b> </font> ></td>
<?php
}

7
else{ </div>
?> <div class="col-lg-12" style="width: 491px;
<td> <? margin-top: 4px; margin-left: 215px ">
php echo "Available"?></td> <div class="panel panel-default">
<?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>

8
<td><?php echo header ('location: schedule.php');
$row['swine_raiser_name']; ?></td> }
<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){
$_SESSION['edit'] = 1;

9
<font size="5px" </div>
color="white"><center><b>Expired <!-- /.panel -->
Products</b></center></font>
</div>
<!-- /#wrapper -->
</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 -->

10

You might also like