Oose Lab Manual New With Final
Oose Lab Manual New With Final
AIM:
To identify the software system that needs to be developed.
Software:
Software is a collection of instructions, data, or computer
programs that are used to run machines and carry out particular activities. It is the
antithesis of hardware, which refers to a computer’s external components. A
device’s running programs, scripts, and applications are collectively referred to as
“software”
Types of Software:
It is a collection of data that is given to the computer to
complete a particular task. The chart below describes the types of software
Before jumping into the software development process, you need to know exactly
what it should do and how it will be used.
The maintenance phase is all about keeping the software running smoothly and
addressing any issues that might arise.
Features:
Usability (User-friendly)
Efficiency
Flexibility
Reliability
Maintainability
Portability
Integrity
RESULT:
Thus the software system that needs to be developed was successfully identified.
AIM:
This project emphasizes about the Foreign Trade System which is an
interface between the Accountholder and the market. In the initial phase details
about the various currencies and the profit and loss of currency hold is collected.
PROBLEM STATEMENT:
The practice of currency trading is also commonly referred to as foreign exchange,
Forex or FX for short. All currency has a value relative to other currencies on the
planet. Currency trading system uses the purchase and sale of large quantities of
currency to leverage the shifts in relative value into profit. The online Foreign
Currency Trading system is almost entirely a "spot" market. A "spot" market
means that the trading is made immediately or "on the spot". The settlement of
those Foreign Currency Trading spot transactions is made within two working
days.
PROJECT SCOPE:
The online Foreign Currency Trading system enables you can have 24 hour
updates of your investment in currency from the convenience of your own home.
The Foreign Currency trading system involves no exchange fees, commissions and
payments of that sort. The margin and leverage trading allows you to increase your
earnings by up to 100times more than regular currency trading. This means larger
profits and can benefit some investors. Currency Converter gives you accurate and
instant foreign currency conversions. The options are varied for minimum currency
trading investments. There is also mini account wherewith a very small initial
investment in a leveraged foreign currency, you can reach a high reward through
minimal risk.
OVERALL DESCRIPTION:
Product Perspective:
The proposed foreign trading system is an on-line system. This system will provide
an online currency trading service for investors by taking in live feed in of
international currency status.
Product function
Generates working software quickly and early during the software life cycle.
More flexible-less costly to change scope and requirements.
Easier to test and debug during a smaller iteration. Easier to manage risk
during its Iteration.
Each iteration is an easily managed milestone.
Each component is delivered to the client when it is complete. This allows
partial utilization of product and avoids long development time.
USER CHARACTERISTICS:
There are various kinds of users for this product
Investors
Traders
Brokers
Banks.
DESIGN AND IMPLEMENTATION CONSTRAINTS:
Design Constraints:
LOGIN: The Login module contains the form which contain membership name
and member password. It includes Username and Password.
TRADING ACCOUNT DETAILS: This form contains the information about
accountholder, market status, currency held, trading histories, etc.
BUY: After the user logged in they can buy stocks online the user can buy stock
only it is available for buying.
BANK ACCOUNT DATABASE: After the trading is finished user has to select
the type of transaction whether credit card account.
FUNCTIONAL REQUIREMENTS:
External Interface Requirements:
Graphical User Interface for easy interaction with the customer. The system
maintains a relationship with the The system uses the GUI
Rational Rose Tool. According to the code generated by the Rose tool, the system
is developed. This gives more sequential access for the functions and the functions
can be coded easily.
User Interfaces:
GUI is used in generating forms. The credit card processing system provides a
good user interface. It is more interactive with the user that the user can easily
operate the system. This can be achieved by providing the snap shots describing
the functionality of the system. By viewing into the snap shots, the user can gain
better knowledge about the system.
Hardware Interfaces
Needed: Computers Hard Disk: 100-150 GBRAM: 512-1 GB required Internet
Connection required. Cables, wires, Network adapters are required.
Communication Interfaces
The local system must be connected to the server via Internet Connection. Email
and file transfer services are provided. E-Shopping is the key concept.
RESULT:
Thus the software requirement specification for the identical system was done
successfully.
EX.NO:3 IDENTIFY THE USE CASE AND DEVELOP THE USE
Date: CASE MODEL
AIM:
To draw a usecase diagram for foreign trading system.
Requirement Analysis:
Use case diagrams help in identifying and understanding the
functional requirements of a system by illustrating how users interact with
the system to achieve specific goals or tasks.
Communication:
They serve as a communication tool between stakeholders, including
developers, designers, clients, and end-users, by providing a high-level
overview of the system's functionality and user interactions.
System Design:
Use case diagrams aid in designing the system's architecture by
helping to identify the major components, interfaces, and interactions
between different parts of the system.
Scope Definition:
They assist in defining the scope of the system by identifying the
boundaries of its functionality and the actors involved in the system's
operation.
Requirements Validation:
Use case diagrams facilitate validation of system requirements by
ensuring that all necessary user interactions and system functions are
adequately represented.
User-Centered Design:
They emphasize the importance of understanding user needs and goals
by focusing on the specific
Basis for Testing:
Use case diagrams provide a basis for defining test cases and
scenarios to validate the functionality of the system from a user's
perspective.
Usecase Diagram for foreign trading system:
Primary Actors:
Investor, Market Authority
Secondary Actors:
Bank Authority, Trading Manager
System:
Account details, Database, Trading Account, Order, Sell, Market
Status, Cancel order, Generate report, Logout.
OUTPUT:
RESULT:
Thus the usecase diagram for the Foreign Trading System was done successful.
EX.NO.4 IDENTIFY THE CONCEPTUAL CLASS AND DEVELOP THE
Date: DOMAIN MODEL AND ALSO DERIVE A CLASS DIAGRAM
AIM:
To Identify the conceptual class and develop the domain model and also derive a
class diagram
CLASS DIAGRAM:
A class diagram in the Unified Modeling Language (UML) is a type of static
structure diagram that describes the structure of a system by showing the system's
classes, their attributes and operations.
Investor:
Represents an individual or entity participating in trading activities. It has an
aggregation relationship with the TradingManager, indicating that an
Investor can have a relationship with one or more TradingManagers. The
Investor class contains the login method.
TradingManager:
Manages trading activities and has an aggregation relationship with the
Investor class. It contains methods such as login.
Import:
Represents the importing activities in the trading system. It contains
methods like viewItem and placeOrder.
Export:
Represents the exporting activities in the trading system. It contains
methods like showItem and demand.
MarketAuthority:
Responsible for managing market-related activities such as updating market
status. It contains the method updateMarketStatus.
BankAuthority:
Handles banking and financial transactions, including authorizing payments.
It contains the method authorizePayment.
Authority:
An interface representing the authority of entities like MarketAuthority and
BankAuthority. Both MarketAuthority and BankAuthority implement this
interface.
Database:
Represents the database used in the system. Both MarketAuthority and
BankAuthority have a composition relationship with the Database,
indicating that they are composed of or depend on the Database component.
OUTPUT:
RESULT:
Thus the conceptual class was identified and class diagram for foreign trading
system was identified successfully.
EX.NO.5
Date: SEQUENCE AND COLLOBORATION
DIAGRAM
AIM:
To find the interaction between objects and represent them using
UML Sequence and Colloboration Diagram.
Colloboration diagram:
OUTPUT:
RESULT:
Thus the UML Sequence and collaboration diagram for foreign trading
system was successfully drawn.
EX.NO.6
Date: STATE CHART AND ACTIVITY DIAGRAM
AIM:
To draw a state chart and activity diagram for foreign trading system.
A State Machine Diagram is used to represent the condition of the system or part
of the system at finite instances of time. It’s a behavioral diagram and it represents
the behavior using finite state transitions.
PURPOSE:
Statechart diagram is one of the five UML diagrams used to model the dynamic
nature of a system. They define different states of an object during its lifetime and
these states are changed by events. Statechart diagrams are useful to model the
reactive systems. Reactive systems can be defined as a system that responds to
external or internal events.
Statechart diagram describes the flow of control from one state to another state.
States are defined as a condition in which an object exists and it changes when
some event is triggered. The most important purpose of Statechart diagram is to
model lifetime of an object from creation to termination.
Statechart diagrams are also used for forward and reverse engineering of a system.
However, the main purpose is to model the reactive system.
OUTPUT:
ACTIVITY DIAGRAM:
Activity Diagrams are used to illustrate the flow of control in a system and refer to
the steps involved in the execution of a use case. We can depict both sequential
processing and concurrent processing of activities using an activity diagram ie an
activity diagram focuses on the condition of flow and the sequence in which it
happens.
Activity diagrams can be used to describe the behavior of a system from the
perspective of specific use cases. They illustrate the sequence of actions performed
by actors or system components in response to various scenarios or user
interactions.
Activity diagrams can aid in system design by helping developers understand the
behavior and logic of a system before implementation. They serve as a blueprint
for designing software systems, enabling developers to define the structure and
flow of the system's functionality.
OUTPUT:
RESULT:
Thus the statechart and activity diagram for foreign trading systemwas
successfully drawn.
Ex.No.7
Date: IMPLEMENT THE SYSTEM AS PER THE DETAILED
DESIGN
AIM:
Implementation:
Requirement Analysis:
Design:
Based on the requirements, design the system architecture, database schema, user
interface, and other components.
Decide on the technologies and frameworks you will use for development.
Database Design:
Design the database schema to store information such as user data, trading
transactions, currency/commodity details, etc.
Backend Development:
Implement the backend logic of the system using a programming language like
Python, Java, or Node.js.
Frontend Development:
Design and develop the user interface (UI) for the trading system using HTML,
CSS, and JavaScript.
Implement features for user registration, login, trading dashboard, market data
display, etc.
Integration:
Integrate the backend and frontend components to ensure they work together
seamlessly.
Testing:
Conduct thorough testing of the system to identify and fix any bugs or issues.
Perform unit testing, integration testing, and system testing to ensure the system
functions correctly under various conditions.
Security Implementation:
Follow industry best practices and compliance standards (e.g., GDPR, PCI DSS)
for data security
Deployment:
Deploy the Foreign Trading System on a suitable hosting platform or server.
Configure the server environment and ensure it meets the system requirements.
Keep the system updated with the latest security patches and updates.
Documentation:
Document the system architecture, design decisions, codebase, APIs, user manuals,
etc., for future reference and maintenance.
Training:
Provide training to users and administrators on how to use the Foreign Trading
System effectively and efficiently.
bank.php
<?php
include "bank_check.php";
?>
<html>
<head>
</head>
<body background="queen.jpg">
<center>
<tr>
Account Number:
</td>
</td>
</tr>
<tr>
Bank Name:
</td>
</td>
</tr>
<tr>
Available Balance:
</td>
</td>
</tr>
<tr>
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
db.inc.php
<?php
include('db.inc.php');
include "session.php";
?>
db.inc.php
<?php
$conn = mysqli_connect("localhost","root","","fts");
// Check connection
if (mysqli_connect_errno())
index.html
<html>
<head>
</head>
<body background=king.jpg>
<table style="border-spacing:1em">
<tr>
<td>
<td>
</table>
</body>
</html>
</head>
<body background="queen.jpg">
<div class="center">
<center>
<table class="inp">
<tr>
<td>Email:</td>
</tr>
<tr>
<td>Password:</td>
</tr>
<tr>
</tr>
</table>
</center>
logout.php
<?php
unset($_SESSION['uid']); session_destroy();
echo "<script>window.location.assign('index.html')</script>"
?>
login.html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body background="queen.jpg">
<div class="center">
<center>
<table class="inp">
<tr>
<td>Email:</td>
</tr>
<tr>
<td>Password:</td>
</tr>
<tr>
</tr>
</table>
</center>
logout.php
<?php
unset($_SESSION['uid']); session_destroy();
echo "<script>window.location.assign('index.html')</script>";
logval.php
?php
session_start();
include "db.inc.php";
if (isset($_POST['submit'])){
$email = $_POST['uname'];
$pass = $_POST['upass'];
if (empty($email)||empty($pass)){
$empty = "";
if(empty($pass)){
if(empty($email)){
mysqli_close($conn);
else{
if (!filter_var($email,FILTER_VALIDATE_EMAIL)){
mysqli_close($conn);
}
else{
$result = mysqli_query($conn,$sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
if ($resultCheck == 1){
$_SESSION['uid'] = $row['uid'];
header("location: main.php");
}else {
echo "<script>alert('$error');window.location.assign('login.html');</script>";
else{
mysqli_close($conn);
?>
main.php
!DOCTYPE html>
<?php
include('session.php');
?>
<head>
<meta charset="utf-8">
</head>
<body background="queen.jpg">
<tr>
<td>
<td>
<td>
<a class="button"href="logout.php">Logout</a></td>
</tr>
</center>
</body>
sell.php
<html>
<head>
<title>Sell</title>
</head>
<body background="wiz.jpg">
<center>
<h1 class="inps">SELL</h1></font><br><br>
<tr>
ITEM NAME:
</td>
<td style="width: 65%;">
</td>
</tr>
<tr>
QUANTITY:
</td>
</td>
</tr>
<tr>
PRICE:
</td>
</td>
</tr>
<tr>
<td></td>
<td style="width: 65%;">
</td>
</tr>
</table>
</form>
</center>
</form>
</body>
</html>
sell_add.php
<?php
include "db.inc.php";
include "session.php";
$uid=$_SESSION['uid'];
if (isset($_POST['submit'])){
$iname = $_POST['iname'];
$quant = $_POST['quant'];
$price = $_POST['price'];
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$currency = $row['currency'];
if (empty($iname)||empty($quant)||empty($price)){
$empty = "";
if(empty($iname)){
if(empty($price)){
if(empty($quant)){
mysqli_close($conn);
Else{
if(mysqli_query($conn,$sql))
mysqli_close($conn);
}
else{
else{
mysqli_close($conn);
?>
session.php
@@ -0,0 +1,16 @@
<?php
include('db.inc.php');
session_start();
$user_check = $_SESSION['uid'];
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session = $row['name'];
if(!isset($_SESSION['uid'])){
echo "nein";
?>
signup.html
<html>
<head>
<script type="text/javascript">
function ValidateForm()
if (nameBox.value.length == 0)
return false;
var re = /^\w+(?:\s\w+){0,3}$/;
if (!nameBox.value.match (re))
return false;
}
var pwBox = document.getElementById ("password");
if (pwBox.value.length < 6)
return false;
return false;
re = /^\S{6,16}$/;
if (!pwBox.value.match (re))
return false;
re = /^\d{7,16}$/;
if (telBox.value.length > 0)
if (!telBox.value.match (re))
{
alert ("Invalid telephone number.");
return false;
re = /^\w+([\.\-\+]\w+)*@\w+(\-\w+)*\.\w+(\-\w+)*(\.\w+(\-\w+)*)*$/;
if (!emailBox.value.match (re))
return false;
return false;
alert("Successfull");
return true;
</script>
<title>Signup</title>
<link rel="stylesheet" href="style.css">
</head>
<body background="queen.jpg">
<center>
<tr>
@@ -92,52 +17,52 @@
NAME:
</td>
</td>
</tr>
<tr>
PASSWORD:
EMAIL:
</td>
</td>
</tr>
<tr>
EMAIL:
PASSWORD:
</td>
</td>
</tr>
<tr>
PHONE NO:
</td>
</td>
</tr>
<tr>
GENDER:
</td>
</td>
</tr>
<tr>
CURRENCY:
</td>
<td style = "width:35%;"><input type="radio" id="group3"
name="group3" value="INR" checked>INR<input type="radio" id="group3"
name="group3" value="usd">USD</td>
</tr>
<tr>
</td>
</tr>
</table>
</html>
signup_add.php
<?php
include "db.inc.php";
if (isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$pass = $_POST['password'];
$phone_no=$_POST['phone_no'];
$gender = $_POST['gender'];
$currency = $_POST['group3'];
if (empty($name)||empty($email)||empty($pass)||empty($phone_no)||
empty($gender)||empty($currency)){
$empty = "";
if(empty($name)){
if(empty($phone_no)){
if(empty($pass)){
if(empty($currency)){
if(empty($gender)){
if(empty($email)){
mysqli_close($conn);
echo' <script> alert("Fill out all the fields".$empty);</script>' ;
else{
if (!filter_var($email,FILTER_VALIDATE_EMAIL)){
mysqli_close($conn);
header("Location: index.php?invalid+email");
else{
mysqli_close($conn);
else{
$result = mysqli_query($conn,$sql);
$resultCheck = mysqli_num_rows($result);
mysqli_close($conn);
else{
$sql = "INSERT INTO fts.users (name, email, password, phone_no,
gender ,currency)
VALUES('$name','$email','$pass','$phone_no','$gender','$currency')";
if(mysqli_query($conn,$sql))
mysqli_close($conn);
else{
else{
mysqli_close($conn);
?>
style.css
.inp{
.button{
border-radius: 5px;
color: white;
font-weight: bold;
.button_main{
border-radius: 5px;
color: black;
font-weight: bold;
.inps{
transaction.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Transaction</title>
</head>
<body background=queen.jpg>
<center>
<table class="inp">
<tr>
<td>
<td>
</tr>
</table>
<center>
</body>
</html>
Result:
AIM:
Testing:
Testing the Foreign Trading System is crucial to ensure its functionality, reliability,
security, and performance. Here's a basic outline of how you can test the software
system:
Unit Testing:
Use testing frameworks like JUnit (for Java), pytest (for Python), or Jasmine (for
JavaScript) to automate unit tests.
Verify that each component behaves as expected and handles edge cases properly.
Integration Testing:
Verify that data is exchanged correctly between backend and frontend components.
Check the integration of third-party services or APIs (if any) used in the system.
Test the user interface to ensure it is intuitive, responsive, and visually appealing.
Verify that all UI elements are functional and display accurate information.
Functional Testing:
Verify that users can perform actions such as registration, login, placing orders,
executing trades, viewing account balances, etc.
Test different scenarios and edge cases to ensure all functionalities work correctly.
Security Testing:
Test for common security issues such as SQL injection, cross-site scripting (XSS),
cross-site request forgery (CSRF), etc.
Verify that user authentication, authorization, and data encryption mechanisms are
implemented correctly.
Performance Testing:
Conduct stress testing to determine how the system handles high volumes of
trading transactions.
Regression Testing:
Conduct regression testing to ensure that new changes or bug fixes do not
introduce new issues.
Re-run existing test cases to verify that previously tested functionalities still work
as expected.
Compliance Testing:
Test the system for compliance with regulatory requirements and industry
standards.
Ensure that the system adheres to relevant financial regulations, data privacy laws,
and security standards.
Gather feedback from users and make any necessary adjustments based on their
input.
Documentation Review:
Review the system documentation to ensure it accurately reflects the current state
of the system.
Verify that user manuals, installation guides, and technical documentation are
comprehensive and up-to-date.
Report any bugs or issues identified during testing using a bug tracking system
(e.g., Jira, Bugzilla).
Prioritize and track the resolution of reported bugs until they are fixed.
Final Validation:
Once all testing activities are completed, conduct a final validation to ensure that
the system meets the quality standards and requirements.
By following this testing process, you can identify and address any issues or
deficiencies in the Foreign Trading System before it is deployed to production.
RESULT:
Thus the testing for the foreign trading system was done successful.
EX.NO:9 IMPROVE THE REUSABILITY AND
DATE: MAINTAINABILITY OF THE SOFTWARE SYSTEM BY
APPLYING APPROPRIATE DESIGN PATTERNS
AIM:
Collaborate with UI/UX designers to create mockups and wireframes for the
improved interface.
Implement the design changes using HTML, CSS, and JavaScript frameworks such
as React or Angular.
Analyze requirements for advanced trading features such as limit orders, stop
orders, and margin trading.
Utilize frameworks like React Native or Flutter to build a single codebase for both
platforms.
Implement features consistent with the web platform, including real-time trading,
market data visualization, and account management.
Identify relevant financial data providers, news APIs, and analytics platforms for
integration.
Display integrated data within the trading interface, such as real-time market
prices, news articles, and financial indicators.
Performance Optimization:
Analyze performance bottlenecks and optimize critical components such as
database queries and API endpoints.
Implement caching strategies to reduce latency and improve response times for
frequently accessed data.
Scale the application horizontally by deploying additional instances and using load
balancers to distribute traffic evenly.
Store user preferences securely and ensure they persist across sessions.
Create educational content such as video tutorials, written guides, and interactive
courses.
Develop a simulated trading environment (demo account) where users can practice
trading with virtual funds.
Feedback Mechanism:
Add feedback forms, surveys, and suggestion boxes within the trading platform.
Implement analytics tools to track user interactions and gather usage data.
Regularly review user feedback and prioritize feature requests based on user needs
and preferences.
Set up automated testing frameworks to perform regression tests, unit tests, and
integration tests.
Conduct regular code reviews and quality assurance checks to maintain code
quality.
Engage with traders, financial analysts, and industry experts through forums,
webinars, and workshops.
RESULT:
Thus reusability and maintainability of the software system by applying
appropriate design patterns was improved.
AIM:
Implementation:
Requirement Analysis:
Design:
Based on the requirements, design the system architecture, database schema, user
interface, and other components.
Decide on the technologies and frameworks you will use for development.
Database Design:
Design the database schema to store information such as user data, trading
transactions, currency/commodity details, etc.
Backend Development:
Implement the backend logic of the system using a programming language like
Python, Java, or Node.js.
Develop functionalities such as user authentication, trade execution, order
management, transaction processing, etc.
Frontend Development:
Design and develop the user interface (UI) for the trading system using HTML,
CSS, and JavaScript.
Implement features for user registration, login, trading dashboard, market data
display, etc.
Integration:
Integrate the backend and frontend components to ensure they work together
seamlessly.
Testing:
Conduct thorough testing of the system to identify and fix any bugs or issues.
Perform unit testing, integration testing, and system testing to ensure the system
functions correctly under various conditions.
Security Implementation:
Follow industry best practices and compliance standards (e.g., GDPR, PCI DSS)
for data security
Deployment:
Configure the server environment and ensure it meets the system requirements.
Keep the system updated with the latest security patches and updates.
Documentation:
Document the system architecture, design decisions, codebase, APIs, user manuals,
etc., for future reference and maintenance.
Training:
Provide training to users and administrators on how to use the Foreign Trading
System effectively and efficiently.
Code:
bank.php
<?php
include "bank_check.php";
?>
<html>
<head>
</head>
<body background="queen.jpg">
<center>
<tr>
Account Number:
</td>
</td>
</tr>
<tr>
Bank Name:
</td>
</td>
</tr>
<tr>
<td style="width: 35%;">
Available Balance:
</td>
</td>
</tr>
<tr>
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
db.inc.php
<?php
include('db.inc.php');
include "session.php";
db.inc.php
<?php
$conn = mysqli_connect("localhost","root","","fts");
// Check connection
if (mysqli_connect_errno())
index.html
<html>
<head>
</head>
<body background=king.jpg>
<table style="border-spacing:1em">
<tr>
<td>
</table>
</body>
</html>
login.html
</head>
<body background="queen.jpg">
<div class="center">
<center>
<table class="inp">
<tr>
<td>Email:</td>
</tr>
<tr>
<td>Password:</td>
</tr>
<tr>
</tr>
</table>
</center>
logout.php
<?php
unset($_SESSION['uid']); session_destroy();
echo "<script>window.location.assign('index.html')</script>"
?>
login.html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Login</title>
<link rel="stylesheet" href="style.css">
</head>
<body background="queen.jpg">
<div class="center">
<center>
<table class="inp">
<tr>
<td>Email:</td>
</tr>
<tr>
<td>Password:</td>
</tr>
<tr>
</tr>
</table>
</center>
logout.php
<?php
unset($_SESSION['uid']); session_destroy();
echo "<script>window.location.assign('index.html')</script>";
logval.php
?php
session_start();
include "db.inc.php";
if (isset($_POST['submit'])){
$email = $_POST['uname'];
$pass = $_POST['upass'];
if (empty($email)||empty($pass)){
$empty = "";
if(empty($pass)){
if(empty($email)){
mysqli_close($conn);
echo' <script> alert("Fill out all the fields".$empty);</script>' ;
else{
if (!filter_var($email,FILTER_VALIDATE_EMAIL)){
mysqli_close($conn);
else{
$result = mysqli_query($conn,$sql);
$resultCheck = mysqli_num_rows($result);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
if ($resultCheck == 1){
$_SESSION['uid'] = $row['uid'];
header("location: main.php");
}else {
echo "<script>alert('$error');window.location.assign('login.html');</script>";
}
else{
mysqli_close($conn);
?>
main.php
!DOCTYPE html>
<?php
include('session.php');
?>
<head>
<meta charset="utf-8">
</head>
<body background="queen.jpg">
<tr>
<td>
<a class="button"href="transaction.html">New Transaction</a></td>
<td>
<td>
<td>
<a class="button"href="logout.php">Logout</a></td>
</tr>
</center>
</body>
sell.php
<html>
<head>
<title>Sell</title>
</head>
<body background="wiz.jpg">
<center>
<h1 class="inps">SELL</h1></font><br><br>
<tr>
<td style="width: 35%;">
ITEM NAME:
</td>
</td>
</tr>
<tr>
QUANTITY:
</td>
</td>
</tr>
<tr>
PRICE:
</td>
</td>
</tr>
<tr>
<td></td>
</td>
</tr>
</table>
</form>
</center>
</form>
</body>
</html>
sell_add.php
<?php
include "db.inc.php";
include "session.php";
$uid=$_SESSION['uid'];
if (isset($_POST['submit'])){
$iname = $_POST['iname'];
$quant = $_POST['quant'];
$price = $_POST['price'];
$ses_sql = mysqli_query($conn,"SELECT * FROM users WHERE uid= '$uid'
");
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$currency = $row['currency'];
if (empty($iname)||empty($quant)||empty($price)){
$empty = "";
if(empty($iname)){
if(empty($price)){
if(empty($quant)){
mysqli_close($conn);
else{
if(mysqli_query($conn,$sql))
{
mysqli_close($conn);
else{
else{
mysqli_close($conn);
?>
session.php
@@ -0,0 +1,16 @@
<?php
include('db.inc.php');
session_start();
$user_check = $_SESSION['uid'];
$login_session = $row['name'];
if(!isset($_SESSION['uid'])){
echo "nein";
?>
signup.html
<html>
<head>
<script type="text/javascript">
function ValidateForm()
if (nameBox.value.length == 0)
return false;
var re = /^\w+(?:\s\w+){0,3}$/;
if (!nameBox.value.match (re))
{
alert ("Invalid name.");
return false;
if (pwBox.value.length < 6)
return false;
return false;
re = /^\S{6,16}$/;
if (!pwBox.value.match (re))
return false;
re = /^\d{7,16}$/;
if (telBox.value.length > 0)
{
if (!telBox.value.match (re))
return false;
re = /^\w+([\.\-\+]\w+)*@\w+(\-\w+)*\.\w+(\-\w+)*(\.\w+(\-\w+)*)*$/;
if (!emailBox.value.match (re))
return false;
return false;
alert("Successfull");
return true;
}
</script>
<title>Signup</title>
</head>
<body background="queen.jpg">
<center>
<tr>
@@ -92,52 +17,52 @@
NAME:
</td>
</td>
</tr>
<tr>
PASSWORD:
EMAIL:
</td>
</td>
</tr>
<tr>
EMAIL:
PASSWORD:
</td>
</td>
</tr>
<tr>
PHONE NO:
</td>
<td style="width: 65%;">
</td>
</tr>
<tr>
GENDER:
</td>
</td>
</tr>
<tr>
CURRENCY:
</td>
</tr>
<tr>
</td>
</tr>
</table>
</html>
signup_add.php
<?php
include "db.inc.php";
if (isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$pass = $_POST['password'];
$phone_no=$_POST['phone_no'];
$gender = $_POST['gender'];
$currency = $_POST['group3'];
if (empty($name)||empty($email)||empty($pass)||empty($phone_no)||
empty($gender)||empty($currency)){
$empty = "";
if(empty($name)){
if(empty($phone_no)){
if(empty($pass)){
if(empty($currency)){
if(empty($gender)){
if(empty($email)){
}
mysqli_close($conn);
else{
if (!filter_var($email,FILTER_VALIDATE_EMAIL)){
mysqli_close($conn);
header("Location: index.php?invalid+email");
else{
mysqli_close($conn);
else{
$result = mysqli_query($conn,$sql);
$resultCheck = mysqli_num_rows($result);
mysqli_close($conn);
}
else{
if(mysqli_query($conn,$sql))
mysqli_close($conn);
else{
else{
mysqli_close($conn);
?>
style.css
.inp{
.button{
border-radius: 5px;
color: white;
font-weight: bold;
.button_main{
border-radius: 5px;
color: black;
font-weight: bold;
.inps{
transaction.html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Transaction</title>
</head>
<body background=queen.jpg>
<center>
<table class="inp">
<tr>
<td>
<td>
</tr>
</table>
<center>
</body>
</html>
RESULT: