Skip to content

Commit

Permalink
nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadeemasghar committed Jan 22, 2021
1 parent 4138f80 commit 37b3583
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 13 additions & 7 deletions payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
</form>
<?php

if (isset($_POST["submit"])) {
$submit = $_POST["submit"];
}

if($submit='View' || isset($_GET["slip"])){
if(isset($_POST["submit"]) || isset($_GET["slip"])){
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}

Expand Down Expand Up @@ -96,11 +93,20 @@

echo "</td></tr></table>";
}
if($_POST["submit"]=='Receive'){
if(isset($_POST["submit"])){
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}
$amount = $_POST["amount"];
$srno = $_POST["srno"];

if (isset($_POST["amount"])) {
$amount = $_POST["amount"];
}else{$amount = 0;}


if (isset($_POST["srno"])) {
$srno = $_POST["srno"];
}else{$srno=0;}


$date = time();

$insert = mysqli_query($con,"INSERT INTO iphs.payments (srno, amount, date)VALUES ('$srno', '$amount', '$date')");
Expand Down
6 changes: 3 additions & 3 deletions viewpaymentbyfn.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}

if($_POST["submit"]=='View' || $_GET["fn"]){
if(isset($_POST["submit"]) || isset($_GET["fn"])){

if($_POST["submit"]=='View'){ $fn = $_POST["fn"];} else {$fn = $_GET["fn"]; $slip = $_GET["slip"]; echo "<a href=payment.php?slip=".$_GET["slip"].">Back to Slip</a>";}
if(isset($_POST["submit"])){ $fn = $_POST["fn"];} else {$fn = $_GET["fn"]; $slip = $_GET["slip"]; echo "<a href=payment.php?slip=".$_GET["slip"].">Back to Slip</a>";}

$fndata = mysqli_query($con,"SELECT * FROM iphs.slips WHERE faimlynum = $fn");

Expand All @@ -30,7 +30,7 @@

$id = $row["id"];

$paid = mysqli_fetch_array(mysqli_query($con,"SELECT SUM(amount) AS amount FROM iphs.payments WHERE srno = $id",$con);
$paid = mysqli_fetch_array(mysqli_query($con,"SELECT SUM(amount) AS amount FROM iphs.payments WHERE srno = $id"));

if($row["total"] - $paid["amount"]>0){echo "<tr class=unpaid >";} else {echo "<tr>";}

Expand Down

0 comments on commit 37b3583

Please sign in to comment.