Added codes and softcopy.
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Kshitij's Restaurant</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<header style="background-color: #333; color: #fff; padding: 20px; text-align: center;">
|
||||
<h1>Kshitij's Restaurant</h1>
|
||||
</header>
|
||||
|
||||
<nav class="nav-menu">
|
||||
<a href="#" style="color: #333; text-decoration: none; padding: 10px; margin: 5px;">Home</a>
|
||||
<a href="#" style="color: #333; text-decoration: none; padding: 10px; margin: 5px;">Menu</a>
|
||||
<a href="#" style="color: #333; text-decoration: none; padding: 10px; margin: 5px;">About</a>
|
||||
<a href="#" style="color: #333; text-decoration: none; padding: 10px; margin: 5px;">Contact</a>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<h2>Welcome to Kshitij's Restaurant</h2>
|
||||
<p>We offer a wide variety of delicious dishes made with fresh, high-quality ingredients.</p>
|
||||
|
||||
<h2>Our Menu</h2>
|
||||
<ul>
|
||||
<li>Appetizers</li>
|
||||
<li>Salads</li>
|
||||
<li>Entrees</li>
|
||||
<li>Desserts</li>
|
||||
</ul>
|
||||
|
||||
<h2>About Us</h2>
|
||||
<p>Our restaurant has been serving the community for over 10 years. We take pride in our commitment to providing excellent service and delicious food.</p>
|
||||
|
||||
<h2>Contact Us</h2>
|
||||
<form>
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
|
||||
<label for="message">Message:</label>
|
||||
<textarea id="message" name="message" required></textarea>
|
||||
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<footer style="background-color: #333; color: #fff; padding: 10px; text-align: center;">
|
||||
<p>© 2025 Kshitij's Restaurant. All rights reserved.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-menu {
|
||||
background-color: #f2f2f2;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-menu a:hover {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE employees [
|
||||
<!ELEMENT employees (employee+)>
|
||||
<!ELEMENT employee (id, name, position, department, salary)>
|
||||
<!ELEMENT id (#PCDATA)>
|
||||
<!ELEMENT name (#PCDATA)>
|
||||
<!ELEMENT position (#PCDATA)>
|
||||
<!ELEMENT department (#PCDATA)>
|
||||
<!ELEMENT salary (#PCDATA)>
|
||||
]>
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="employees.xsl"?>
|
||||
<employees>
|
||||
<employee>
|
||||
<id>1</id>
|
||||
<name>Kshitij K</name>
|
||||
<position>DevOps Engineer</position>
|
||||
<department>IT</department>
|
||||
<salary>6000000</salary>
|
||||
</employee>
|
||||
<employee>
|
||||
<id>2</id>
|
||||
<name>Ayush Kalas</name>
|
||||
<position>Project Manager</position>
|
||||
<department>IT</department>
|
||||
<salary>8000</salary>
|
||||
</employee>
|
||||
<employee>
|
||||
<id>3</id>
|
||||
<name>Ombase</name>
|
||||
<position>Frontend Developer</position>
|
||||
<department>IT</department>
|
||||
<salary>500</salary>
|
||||
</employee>
|
||||
</employees>
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="employees">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="employee" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="id" type="xs:integer"/>
|
||||
<xs:element name="name" type="xs:string"/>
|
||||
<xs:element name="position" type="xs:string"/>
|
||||
<xs:element name="department" type="xs:string"/>
|
||||
<xs:element name="salary" type="xs:decimal"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>Employee List</title>
|
||||
<style>
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Employee List</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Department</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
<xsl:for-each select="employees/employee">
|
||||
<tr>
|
||||
<td><xsl:value-of select="id"/></td>
|
||||
<td><xsl:value-of select="name"/></td>
|
||||
<td><xsl:value-of select="position"/></td>
|
||||
<td><xsl:value-of select="department"/></td>
|
||||
<td><xsl:value-of select="salary"/></td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Employee List</title>
|
||||
<style>
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Employee List</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Department</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Kshitij K</td>
|
||||
<td>DevOps Engineer</td>
|
||||
<td>IT</td>
|
||||
<td>6000000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Ayush Kalas</td>
|
||||
<td>Project Manager</td>
|
||||
<td>IT</td>
|
||||
<td>8000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Ombase</td>
|
||||
<td>Frontend Developer</td>
|
||||
<td>IT</td>
|
||||
<td>500</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Calculator</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="calculator">
|
||||
<h1>Calculator</h1>
|
||||
<p class="designer">(Designed by Kshitij)</p>
|
||||
<div class="display">
|
||||
<input type="text" id="result" readonly>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button onclick="clearDisplay()">C</button>
|
||||
<button onclick="calculate('/')">/</button>
|
||||
<button onclick="calculate('*')">*</button>
|
||||
<button onclick="calculate('-')">-</button>
|
||||
<button onclick="addToDisplay('7')">7</button>
|
||||
<button onclick="addToDisplay('8')">8</button>
|
||||
<button onclick="addToDisplay('9')">9</button>
|
||||
<button onclick="calculate('+')">+</button>
|
||||
<button onclick="addToDisplay('4')">4</button>
|
||||
<button onclick="addToDisplay('5')">5</button>
|
||||
<button onclick="addToDisplay('6')">6</button>
|
||||
<button onclick="calculate('=')">=</button>
|
||||
<button onclick="addToDisplay('1')">1</button>
|
||||
<button onclick="addToDisplay('2')">2</button>
|
||||
<button onclick="addToDisplay('3')">3</button>
|
||||
<button onclick="addToDisplay('0')">0</button>
|
||||
<button onclick="addToDisplay('.')">.</button>
|
||||
</div>
|
||||
</div>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
let currentValue = '';
|
||||
|
||||
function addToDisplay(value) {
|
||||
currentValue += value;
|
||||
document.getElementById('result').value = currentValue;
|
||||
}
|
||||
|
||||
function clearDisplay() {
|
||||
currentValue = '';
|
||||
document.getElementById('result').value = '';
|
||||
}
|
||||
|
||||
function calculate(operator) {
|
||||
if (operator === '=') {
|
||||
try {
|
||||
currentValue = eval(currentValue).toString();
|
||||
document.getElementById('result').value = currentValue;
|
||||
} catch (error) {
|
||||
alert('Invalid expression');
|
||||
clearDisplay();
|
||||
}
|
||||
} else {
|
||||
if (currentValue === '') {
|
||||
alert('Please enter a number');
|
||||
return;
|
||||
}
|
||||
currentValue += operator;
|
||||
document.getElementById('result').value = currentValue;
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.calculator {
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.designer {
|
||||
font-size: 14px;
|
||||
color: #888;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.display {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.display input {
|
||||
width: 100%;
|
||||
font-size: 24px;
|
||||
padding: 5px;
|
||||
text-align: right;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-gap: 5px;
|
||||
}
|
||||
|
||||
.buttons button {
|
||||
font-size: 18px;
|
||||
padding: 10px;
|
||||
background-color: #f0f0f0;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.buttons button:hover {
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 211 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 151 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Executable
+89
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// Database configuration
|
||||
$host = 'localhost'; // MySQL server host
|
||||
$dbname = 'connectivityDB'; // Database name
|
||||
$username = 'kshitij'; // MySQL username
|
||||
$password = 'Pass@123'; // MySQL password
|
||||
|
||||
try {
|
||||
// Create a connection
|
||||
$conn = new mysqli($host, $username, $password, $dbname);
|
||||
|
||||
// Check the connection
|
||||
if ($conn->connect_error) {
|
||||
throw new Exception("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
echo "Connected successfully<br>";
|
||||
|
||||
// CRUD Operations
|
||||
|
||||
// Create
|
||||
function createUser($conn, $name, $email) {
|
||||
$stmt = $conn->prepare("INSERT INTO users (name, email) VALUES (?, ?)");
|
||||
$stmt->bind_param("ss", $name, $email);
|
||||
if ($stmt->execute()) {
|
||||
echo "New user created successfully<br>";
|
||||
} else {
|
||||
echo "Error: " . $stmt->error . "<br>";
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
// Read
|
||||
function readUsers($conn) {
|
||||
$result = $conn->query("SELECT * FROM users");
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
echo "ID: " . $row["id"] . " - Name: " . $row["name"] . " - Email: " . $row["email"] . "<br>";
|
||||
}
|
||||
} else {
|
||||
echo "No users found.<br>";
|
||||
}
|
||||
}
|
||||
|
||||
// Update
|
||||
function updateUser($conn, $id, $name, $email) {
|
||||
$stmt = $conn->prepare("UPDATE users SET name = ?, email = ? WHERE id = ?");
|
||||
$stmt->bind_param("ssi", $name, $email, $id);
|
||||
if ($stmt->execute()) {
|
||||
echo "User updated successfully<br>";
|
||||
} else {
|
||||
echo "Error: " . $stmt->error . "<br>";
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
// Delete
|
||||
function deleteUser($conn, $id) {
|
||||
$stmt = $conn->prepare("DELETE FROM users WHERE id = ?");
|
||||
$stmt->bind_param("i", $id);
|
||||
if ($stmt->execute()) {
|
||||
echo "User deleted successfully<br>";
|
||||
} else {
|
||||
echo "Error: " . $stmt->error . "<br>";
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
// Example usage of CRUD operations
|
||||
createUser($conn, "John Doe", "john@example.com");
|
||||
createUser($conn, "Jane Smith", "jane@example.com");
|
||||
echo "<br>All Users:<br>";
|
||||
readUsers($conn);
|
||||
updateUser($conn, 1, "John Updated", "john.updated@example.com"); // Update user with ID 1
|
||||
echo "<br>All Users after update:<br>";
|
||||
readUsers($conn);
|
||||
deleteUser($conn, 2); // Delete user with ID 2
|
||||
echo "<br>All Users after deletion:<br>";
|
||||
readUsers($conn);
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
} finally {
|
||||
// Close the connection
|
||||
if (isset($conn)) {
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user