Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
devsojitra777 committed May 21, 2024
0 parents commit f2a2942
Show file tree
Hide file tree
Showing 674 changed files with 29,784 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
session_start();
session_destroy();

echo "<script>window.location.href='index.html';</script>";
?>
49 changes: 49 additions & 0 deletions PHPMailerAutoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* PHPMailer SPL autoloader.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
* PHPMailer SPL autoloader.
* @param string $classname The name of the class to load
*/
function PHPMailerAutoload($classname)
{
//Can't use __DIR__ as it's only in PHP 5.3+
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
if (is_readable($filename)) {
require $filename;
}
}

if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
}
} else {
/**
* Fall back to traditional autoload for old PHP versions
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Mu_Canteen
# Mu_Canteen
110 changes: 110 additions & 0 deletions addbalance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
include("connection.php");
$aid = ! empty($_SESSION['aid']) ? $_SESSION['aid'] : ' ';
if($aid==" ")
{
echo "<script>window.location.href='homepage.php'</script>";
}
else
{
include("adminmenu.php");

?>
<script>

function showHint(str) {

if (str.length == 0) {
document.getElementById("txtHint").innerHTML = "";
return;
} else {

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};

xmlhttp.open("GET", "getdd_addbalance.php?userid="+str, true);
xmlhttp.send();
}
}


</script>
<div class="row">

<div class="col-md-4 col-md-offset-4">
<br>
<center><h2 class="font-alt">Add Balance</h2></center>
<br>
<form action="" class="form contact-form" enctype="multipart/form-data" method="post">
<div class="clearfix">

<div class="form-group">
<label for="dd_foodid" style="float: left;">User ID:</label>
<select id="dd_studentid" onchange="showHint(this.value)" class="input-md form-control" name="dd_studentid" required>
<option value="">Select UserId</option>

<?php



$sel = "select uid from mmstores";

$rel=$con->query($sel);

if(mysqli_num_rows($rel)==0)
{
echo "<option value='nodata'>--No records to display--</option>";
}
else
{
while($data=mysqli_fetch_array($rel))
{
echo "<option value='".$data['uid']."'>".$data['uid']."</option>";

}
}

?>

</select>
</div>

<div id="txtHint">

</div>
</div>
</div>

</div>

<?php
if(isset($_POST['btn_update']))
{
$userid = $_POST['dd_studentid'];
$name = $_POST['name'];
$st_walletamt = $_POST['st_walletamt'];
$amt_update = $_POST['amt_update'];

$totalamt_update = ($st_walletamt + $amt_update);


$sql_update = "Update mmstores set Bal='$totalamt_update' where
uid='$userid'";

if(mysqli_query($con, $sql_update))
{
echo "<script>alert('Amount updated successfully');</script>";
}
else
{
echo "<script>alert('Please Try again');</script>";
}

}
}
?>
</form>
122 changes: 122 additions & 0 deletions additems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?php
include("connection.php");
$aid = ! empty($_SESSION['aid']) ? $_SESSION['aid'] : ' ';
if($aid==" ")
{
echo "<script>window.location.href='homepage.php'</script>";
}
else
{
include("adminmenu.php");
?>
<div class="row">

<div class="col-md-4 col-md-offset-4">
<br>
<center><h2 class="font-alt">Add Food Items</h2></center>
<br>
<form action="" class="form contact-form" enctype="multipart/form-data" method="post">
<div class="clearfix">

<div class="form-group">
<input type="text" name="foodname" class="input-md round form-control" placeholder="Enter Food Name" required>
</div>

<div class="form-group">
<select name="category" id="category" class="input-md form-control" required>
<option value="">Select Category</option>
<option value="Breakfast">Breakfast</option>
<option value="Starter">Starter</option>
<option value="Meal">Meal</option>
<option value="Beverages">Beverages</option>
<option value="Desert">Desert</option>
<option value="Rice">Rice</option>
<option value="Snacks">Snacks</option>
</select>
</div>

<div class="form-group">
<input type="file" name="image" class="form-control" placeholder='Food Image' required>
</div>

<!-- Password -->
<div class="form-group">
<textarea name="description" class="input-md round form-control" placeholder="Enter Food Description" style='height:70px' required></textarea>
</div>

<!-- Phone No.-->
<div class="form-group">
<input type="text" name="price" class="input-md round form-control" placeholder="Enter Price" pattern="[0-9]*$" title='Please Enter In numbers only' required>
</div>

<div class="form-group">
<input type="text" name="time" style='width:85%' class="input-md round form-control" placeholder="Enter Preparation time" required> Minutes
</div>


</div>

<!-- Send Button -->
<div class="pt-10">
<!---- <button class="submit_btn btn btn-mod btn-medium btn-round btn-full" id="reg-btn">Register</button>
--->
<input type="submit" name='add' class="btn btn btn-mod btn-medium btn-round btn-full"/>
</div>
<?php

if(isset($_POST['add']))
{
$file=$_FILES['image']['tmp_name'];
echo $iname=$_FILES['image']['name'];
if(isset($iname))
{
if(!empty($iname))
{
$location = 'images/';
if(move_uploaded_file($file, $location.$iname))
{

}
}
}
else
{

}

$var="select max(id) as max from products";
$res=$con->query($var);
$row = mysqli_fetch_assoc($res);
$pid = $row['max'] + 1;

$category = $_POST['category'];
$foodname = $_POST['foodname'];
$description = $_POST['description'];
$price = $_POST['price'];
$time = $_POST['time'];
$image=$iname;

$sql = "Insert into products values('$pid','$foodname',
'$image','$description','$price','$category','$time')";

if(mysqli_query($con, $sql))
{
echo "<script>alert('FoodItem added successfully');</script>";
echo "<script>window.location.href='additems.php'</script>";
}
else
{
echo "<script>alert('Please Try again');</script>";
}
}
?>
</form>

</div>
</div>


<?php
include("footer.php");
}
?>
Loading

0 comments on commit f2a2942

Please sign in to comment.