sourcecodes
sourcecodes
Source Code:
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <ctime>
#include <iomanip>
#include <map>
#include <limits>
struct Order {
int orderID;
string customerName;
string pizzaType;
int quantity;
double totalPrice;
string paymentMethod;
string orderTime;
};
struct InventoryItem {
string ingredient;
int quantity;
};
// Inventory Management
map<string, int> inventory = {
{"cheese", 100},
{"dough", 100},
{"sauce", 100}
};
string getCurrentTime() {
tm *ltm = localtime(&now);
char buffer[20];
return string(buffer);
// Update inventory
inventory[ingredient] -= quantityUsed;
return true;
return false;
// Process Order
void processOrder(int orderID, const string& customerName, const string& pizzaType, int quantity, double pricePerPizza,
const string& paymentMethod) {
// Check inventory
if (!ordersFile.is_open()) {
return;
ordersFile << orderID << "," << customerName << "," << pizzaType << "," << quantity << ","
<< totalPrice << "," << paymentMethod << "," << orderTime << endl;
ordersFile.close();
cout << "Order processed successfully for " << customerName << ". Total: PHP " << fixed << setprecision(2) <<
totalPrice << endl;
} else {
// Show Inventory
void showInventory() {
cout << item.first << ": " << item.second << endl;
// Customer Personalization
void suggestPizzas() {
}
// Real-Time Sales Report
void salesReport() {
ifstream ordersFile("orders.txt");
if (!ordersFile.is_open()) {
return;
string line;
vector<string> tokens;
size_t pos = 0;
tokens.push_back(line.substr(0, pos));
tokens.push_back(line);
if (tokens.size() != 7) {
cout << "Skipping malformed line: " << line << endl;
continue;
try {
salesData[pizzaType].second += totalPrice;
cout << "Error parsing line: " << line << ". Skipping this line.\n";
continue;
ordersFile.close();
cout << "Pizza Type: " << data.first << ", Total Sold: " << data.second.first
<< ", Total Revenue: PHP " << fixed << setprecision(2) << data.second.second << endl;
void deleteSalesReport() {
if (remove("orders.txt") == 0) {
} else {
cout << "\nError: Could not delete the sales report. File may not exist.\n";
// Main Function
int main() {
while (true) {
if (choice == 1) {
int quantity;
double pricePerPizza;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
getline(cin, customerName);
getline(cin, pizzaType);
cout << "Invalid input. Please enter a positive number for quantity: ";
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "Invalid input. Please enter a positive number for price: ";
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cin.ignore(numeric_limits<streamsize>::max(), '\n');
getline(cin, paymentMethod);
paymentMethod = "Cash";
} else if (choice == 2) {
showInventory();
} else if (choice == 3) {
suggestPizzas();
} else if (choice == 4) {
salesReport();
} else if (choice == 5) {
deleteSalesReport();
} else if (choice == 6) {
break;
} else {
return 0;
}
Web System and Technologies
Source Code:
Login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login Form</title>
<style>
body {
margin: 0;
background-color: #c4e1b9;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
.container {
background-color: #accfaf;
padding: 20px;
width: 350px;
border-radius: 8px;
text-align: center;
}
img {
width: 80px;
margin-bottom: 10px;
.input-field {
display: block;
width: 100%;
margin: 10px 0;
padding: 10px;
border-radius: 4px;
font-size: 16px;
button {
background-color: #308be3;
color: white;
border: none;
font-size: 16px;
cursor: pointer;
border-radius: 4px;
margin-top: 10px;
button:hover {
background-color: #2669b8;
</style>
</head>
<body>
<div class="container">
<img src="http://localhost/onlineenrolmentsystem/onlineenrolmentsystem/img/school_seal_100X100.png"
alt="Logo">
</div>
</body>
</html>
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Administrator Panel</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
body {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f9f9f9;
}
/* Top Header */
.header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f8f9fa;
.header .logo {
font-weight: bold;
font-size: 20px;
color: #333;
text-align: left;
.header .user {
font-size: 14px;
color: #666;
/* Main Content */
.main-container {
display: flex;
height: 100%;
/* Sidebar */
.sidebar {
width: 220px;
background-color: #f8f9fa;
border-right: 1px solid #ddd;
padding: 10px 0;
.sidebar ul {
list-style: none;
.sidebar li {
font-size: 14px;
color: #333;
cursor: pointer;
.sidebar li:hover {
background-color: #e2e6ea;
.sidebar li .badge {
background-color: #007bff;
color: #fff;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
/* Content Area */
.content {
flex: 1;
padding: 20px;
}
.content .notification {
background-color: #d4edda;
color: #155724;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
.content h1 {
font-size: 24px;
font-weight: bold;
color: #333;
</style>
</head>
<body>
<div class="header">
</div>
<div class="main-container">
<div class="sidebar">
<ul>
<li>🏠 Home</li>
<li>🧑🎓 New Enrollees</li>
<li>📘 Subjects</li>
<li>🏢 Department</li>
<li>📚 Courses</li>
<li>📅 Schedule</li>
<li>👥 Students</li>
<li>👨🏫 Instructor</li>
<li>📊 Report</li>
<li>👤 Users</li>
</ul>
</div>
<div class="content">
<div class="notification">
</div>
</div>
</div>
</body>
</html>