Skip to content

Commit

Permalink
configration
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadeemasghar committed Jan 22, 2021
1 parent ab874a3 commit 4138f80
Show file tree
Hide file tree
Showing 29 changed files with 209 additions and 173 deletions.
41 changes: 32 additions & 9 deletions createslips.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,40 @@

</form>
<?php
if($_POST["submit"]){
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
if(isset($_POST["submit"])){
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}


$month = $_POST["month"]. "-" . $_POST["year"];
$x = 0;
$result = mysql_query("SELECT * FROM iphs.students WHERE active = 'Y' GROUP BY faimlynum",$con);
$result = mysqli_query($con,"SELECT * FROM iphs.students WHERE active = 'Y' GROUP BY faimlynum");

while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$faimlynum = $row["faimlynum"];
$sum = mysql_fetch_array(mysql_query("SELECT SUM( admission ) AS admission,SUM( tuition ) AS tuition,SUM( sports ) AS sports,SUM( building ) AS building,SUM( medical ) AS medical,SUM( recreation ) AS recreation,SUM( examination ) AS examination,SUM( buscharge ) AS buscharge FROM iphs.students WHERE faimlynum = $faimlynum",$con));
$sum = mysqli_fetch_array(
mysqli_query(
$con,
"SELECT
SUM( admission ) AS admission,
SUM( tuition ) AS tuition,
SUM( sports ) AS sports,
SUM( building ) AS building,
SUM( medical ) AS medical,
SUM( recreation ) AS recreation,
SUM( examination ) AS examination,
SUM( buscharge ) AS buscharge
FROM iphs.students
WHERE faimlynum = $faimlynum"));
$total = $sum["admission"] + $sum["tuition"] + $sum["sports"] + $sum["building"] + $sum["medical"] + $sum["recreation"] + $sum["examination"] + $sum["buscharge"];

$stnum = mysql_fetch_array(mysql_query("SELECT count( faimlynum ) AS faimlynum FROM iphs.students WHERE faimlynum = $faimlynum",$con));
$stnum = mysqli_fetch_array(
mysqli_query(
$con,
"SELECT
count( faimlynum ) AS faimlynum
FROM iphs.students
WHERE faimlynum = $faimlynum"));

$stnum = $stnum["faimlynum"];
$faimlynum = $faimlynum;
Expand All @@ -57,8 +76,12 @@
$buscharge = $sum["buscharge"];
$total = $total;

$insert = mysql_query("INSERT INTO iphs.slips (stnum, faimlynum, month, admission, tuition, sports, building, medical, recreation, examination, buscharge, total)VALUES ('$stnum', '$faimlynum', '$month', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge', '$total')",$con);
if($insert){$x=$x+1;}else{echo "Data not entered ". mysql_error();}
$insert = mysqli_query(
$con,
"INSERT INTO iphs.slips
(stnum, faimlynum, month, admission, tuition, sports, building, medical, recreation, examination, buscharge, total)
VALUES ('$stnum', '$faimlynum', '$month', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge', '$total')");
if($insert){$x=$x+1;}else{echo "Data not entered ". mysqli_error();}
}
echo $x. " New Slips Created";
}
Expand Down
8 changes: 4 additions & 4 deletions edtstd.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

if ($_POST["submit"]=='Update'){

$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}


$id = $_POST["id"];
Expand All @@ -37,9 +37,9 @@
$buscharge = $_POST["buscharge"];
$active = $_POST["active"];

$update = mysql_query("UPDATE iphs.students SET name = '$name', class = '$class', regnum = '$regnum', faimlynum = '$faimlynum', admission = '$admission', tuition = '$tuition', sports = '$sports', building = '$building', medical = '$medical', recreation = '$recreation', examination = '$examination', buscharge = '$buscharge', active = '$active' WHERE id = $id ",$con);
$update = mysqli_query($con,"UPDATE iphs.students SET name = '$name', class = '$class', regnum = '$regnum', faimlynum = '$faimlynum', admission = '$admission', tuition = '$tuition', sports = '$sports', building = '$building', medical = '$medical', recreation = '$recreation', examination = '$examination', buscharge = '$buscharge', active = '$active' WHERE id = $id ");

if($update){ echo "Data Updated <a href=viewstd.php>View All Students</a>";}else {echo "Data not Updated <br> ". mysql_error();}
if($update){ echo "Data Updated <a href=viewstd.php>View All Students</a>";}else {echo "Data not Updated <br> ". mysqli_error();}

}

Expand Down
10 changes: 5 additions & 5 deletions newfaimly.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@

</form>
<?php
if($_POST["submit"]){
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
if(isset($_POST["submit"])){
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}
/*
$_SESSION["email"] =
$_SESSION["password"] = */

$fname = $_POST["fname"];
$faimlynum = $_POST["faimlynum"];

$insert = mysql_query("INSERT INTO iphs.faimly (fname, faimlynum)VALUES('$fname','$faimlynum')",$con);
if($insert){echo "Data Entered";}else{echo "Data not Entered<br>".mysql_error();}
$insert = mysqli_query($con,"INSERT INTO iphs.faimly (fname, faimlynum)VALUES('$fname','$faimlynum')");
if($insert){echo "Data Entered";}else{echo "Data not Entered<br>".mysqli_error();}
}
?>
</div>
Expand Down
8 changes: 4 additions & 4 deletions newstd.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
</form>
<?php
if(isset($_POST["submit"])){
$con = mysqli_connect("localhost","root","","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}
/*
$_SESSION["email"] =
$_SESSION["password"] = */
Expand All @@ -119,11 +119,11 @@
$buscharge = $_POST["buscharge"];
$active = $_POST["active"];

$insert = mysqli_query(
$insert = mysqli_query($con,
"INSERT INTO
iphs.students (name, class, regnum, faimlynum, admission, tuition, sports, building, medical, recreation, examination, buscharge, active)
VALUES(
'$name', '$class', '$regnum', '$faimlynum', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge', '$active')",$con);
'$name', '$class', '$regnum', '$faimlynum', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge', '$active')");
if($insert){echo "Data Entered";}
else{echo "Data not Entered<br>".mysqli_error();}
}
Expand Down
38 changes: 25 additions & 13 deletions payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,34 @@
</form>
<?php

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

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

if($_POST["submit"]=='View'){ $id = $_POST["id"];} else {$id = $_GET["slip"];}
if($submit='View'){
if (isset($_POST["id"])) {
$id = $_POST["id"];
}
else {
if (isset($_GET["slip"])) {
$id = $_GET["slip"];
}
}}

$slipdata = mysql_query("SELECT * FROM iphs.slips WHERE id = $id",$con);
$slipdata = mysqli_query($con,"SELECT * FROM iphs.slips WHERE id = $id");

while($row = mysql_fetch_array($slipdata)){
while($row = mysqli_fetch_array($slipdata)){

$faimlynum = $row["faimlynum"];
$total = $row["total"];
$month = $row["month"];

echo "<table><tr><td class=sprt >";
$paid = mysql_fetch_array(mysql_query("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"));



Expand All @@ -68,9 +80,9 @@
echo "<h3>Payment History</h3>";
echo "<table border=1><tr><td>Date</td><td>Amount</td></tr>";

$paymentdata = mysql_query("SELECT * FROM iphs.payments WHERE srno = $id",$con);
$paymentdata = mysqli_query($con,"SELECT * FROM iphs.payments WHERE srno = $id");

while($payment = mysql_fetch_array($paymentdata)){
while($payment = mysqli_fetch_array($paymentdata)){

echo "<tr><td>";
echo date("d-m-y",$payment["date"]);
Expand All @@ -85,14 +97,14 @@
echo "</td></tr></table>";
}
if($_POST["submit"]=='Receive'){
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}
$amount = $_POST["amount"];
$srno = $_POST["srno"];
$date = time();

$insert = mysql_query("INSERT INTO iphs.payments (srno, amount, date)VALUES ('$srno', '$amount', '$date')",$con);
if($insert){echo "Amount Recorded";}else{echo "Amount not recorded ".mysql_error();}
$insert = mysqli_query($con,"INSERT INTO iphs.payments (srno, amount, date)VALUES ('$srno', '$amount', '$date')");
if($insert){echo "Amount Recorded";}else{echo "Amount not recorded ".mysqli_error();}
}
?>
</div>
Expand Down
36 changes: 18 additions & 18 deletions printslips.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
<html>
<head>
<title>Islamic Public School Fee System</title>
<?php if($_GET["submit"]) { echo "<link href=head.css rel=stylesheet type= text/css >"; } else { echo "<link href=style.css rel=stylesheet type= text/css >";}?>
<?php if(isset($_GET["submit"])) { echo "<link href=head.css rel=stylesheet type= text/css >"; } else { echo "<link href=style.css rel=stylesheet type= text/css >";}?>
</head>
<body>
<div class=wraper>
<?php
if($_GET["submit"]){
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
if(isset($_GET["submit"])){
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}


$month = $_GET["month"]. "-" . $_GET["year"];

$slips = mysql_query("SELECT * FROM iphs.slips WHERE month LIKE '$month' ",$con);
while($row = mysql_fetch_array($slips))
$slips = mysqli_query($con,"SELECT * FROM iphs.slips WHERE month LIKE '$month' ");
while($row = mysqli_fetch_array($slips))
{
$id = $row["id"];
$class = $row["class"];
$regnum = $row["regnum"];
//$class = $row["class"];
//$regnum = $row["regnum"];
$faimlynum = $row["faimlynum"];
$admission = $row["admission"];
$tuition = $row["tuition"];
Expand All @@ -45,18 +45,18 @@
echo "<tr><td>Sr. No: </td><td>".$id."</td>";
echo "<td>Fee Month: </td><td>".$month."</td></tr>";

$name = mysql_query("SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ",$con);
$name = mysqli_query($con,"SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ");

echo "<tr><td>Name: </td><td>";

while($std = mysql_fetch_array($name)){ echo $std["name"].", ";}
while($std = mysqli_fetch_array($name)){ echo $std["name"].", ";}

echo "</td>";
echo "<td>Class: </td><td>";

$name = mysql_query("SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ",$con);
$name = mysqli_query($con,"SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ");

while($std = mysql_fetch_array($name)){ echo $std["class"].", ";}
while($std = mysqli_fetch_array($name)){ echo $std["class"].", ";}

echo "</td></tr>";
echo "</table>";
Expand All @@ -82,18 +82,18 @@
echo "<tr><td>Sr. No: </td><td>".$id."</td>";
echo "<td>Fee Month: </td><td>".$month."</td></tr>";

$name = mysql_query("SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ",$con);
$name = mysqli_query($con,"SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ");

echo "<tr><td>Name: </td><td>";

while($std = mysql_fetch_array($name)){ echo $std["name"].", ";}
while($std = mysqli_fetch_array($name)){ echo $std["name"].", ";}

echo "</td>";
echo "<td>Class: </td><td>";

$name = mysql_query("SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ",$con);
$name = mysqli_query($con,"SELECT * FROM iphs.students WHERE faimlynum = '$faimlynum' ");

while($std = mysql_fetch_array($name)){ echo $std["class"].", ";}
while($std = mysqli_fetch_array($name)){ echo $std["class"].", ";}

echo "</td></tr>";
echo "</table>";
Expand All @@ -114,8 +114,8 @@
}

/*
$insert = mysql_query("INSERT INTO iphs.students (name, class, regnum, faimlynum, admission, tuition, sports, building, medical, recreation, examination, buscharge)VALUES('$name', '$class', '$regnum', '$faimlynum', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge')",$con);
if($insert){echo "Data Entered";}else{echo "Data not Entered<br>".mysql_error();}*/
$insert = mysqli_query($con,"INSERT INTO iphs.students (name, class, regnum, faimlynum, admission, tuition, sports, building, medical, recreation, examination, buscharge)VALUES('$name', '$class', '$regnum', '$faimlynum', '$admission', '$tuition', '$sports', '$building', '$medical', '$recreation', '$examination', '$buscharge')");
if($insert){echo "Data Entered";}else{echo "Data not Entered<br>".mysqli_error();}*/
}
else{
echo "<a href=index.php>Home</a> - View/Print Slips
Expand Down
10 changes: 5 additions & 5 deletions updateallbuilding.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<h2>Update All Students Building Fund</h2>

<?php
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}

if($_POST["update"]=='update'){
if(isset($_POST["update"])){
$data = $_POST["data"];

$update = mysql_query("UPDATE iphs.students SET building = '$data' WHERE students.active = 'Y'",$con);
$update = mysqli_query($con,"UPDATE iphs.students SET building = '$data' WHERE students.active = 'Y'");
if($update){

echo "Data Updated";
Expand All @@ -31,7 +31,7 @@
else
{

echo "Data not updated<br>". mysql_error();
echo "Data not updated<br>". mysqli_error();

}

Expand Down
10 changes: 5 additions & 5 deletions updateallbuscharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<h2>Update All Students Bus Charges</h2>

<?php
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}

if($_POST["update"]=='update'){
if(isset($_POST["update"])){
$data = $_POST["data"];

$update = mysql_query("UPDATE iphs.students SET buscharge = '$data' WHERE students.active = 'Y'",$con);
$update = mysqli_query($con,"UPDATE iphs.students SET buscharge = '$data' WHERE students.active = 'Y'");
if($update){

echo "Data Updated";
Expand All @@ -31,7 +31,7 @@
else
{

echo "Data not updated<br>". mysql_error();
echo "Data not updated<br>". mysqli_error();

}

Expand Down
10 changes: 5 additions & 5 deletions updateallexamination.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<h2>Update All Students Examination Fee</h2>

<?php
$con = mysql_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysql_error();}
$con = mysqli_connect("localhost","root","root","iphs");
if(!$con){echo "Unable to Connect". mysqli_error();}

if($_POST["update"]=='update'){
if(isset($_POST["update"])){
$data = $_POST["data"];

$update = mysql_query("UPDATE iphs.students SET examination = '$data' WHERE students.active = 'Y'",$con);
$update = mysqli_query($con,"UPDATE iphs.students SET examination = '$data' WHERE students.active = 'Y'");
if($update){

echo "Data Updated";
Expand All @@ -31,7 +31,7 @@
else
{

echo "Data not updated<br>". mysql_error();
echo "Data not updated<br>". mysqli_error();

}

Expand Down
Loading

0 comments on commit 4138f80

Please sign in to comment.