tidal-students

byRuturaj kumbhar

<?php include 'db.php'; session_start(); $stream = $_GET['stream'] ?? ""; $message = ""; // Fetch students $students = []; if($stream != ""){ $stmt = $conn->prepare("SELECT * FROM students WHERE stream=? ORDER BY name ASC"); if($stmt){ $stmt->bind_param("s", $stream); $stmt->execute(); $result = $stmt->get_result(); $students = $result->fetch_all(MYSQLI_ASSOC); } } // SAVE MARKS if(isset($_POST['submit'])){ $student_id = $_POST['student_id']; $stream = $_POST['stream']; // Save function function saveMark($conn, $student_id, $subject, $marks){ $stmt = $conn->prepare("SELECT id FROM marks WHERE student_id=? AND subject=?"); $stmt->bind_param("is", $student_id, $subject); $stmt->execute(); $res = $stmt->get_result(); if($res->num_rows > 0){ $stmt2 = $conn->prepare("UPDATE marks SET marks=? WHERE student_id=? AND subject=?"); $stmt2->bind_param("sis", $marks, $student_id, $subject); $stmt2->execute(); } else { $stmt2 = $conn->prepare("INSERT INTO marks (student_id, subject, marks) VALUES (?, ?, ?)"); $stmt2->bind_param("iss", $student_id, $subject, $marks); $stmt2->execute(); } } // đŸ”Ŧ SCIENCE if($stream == "Science"){ saveMark($conn, $student_id, "English", $_POST['english']); saveMark($conn, $student_id, "Physics", $_POST['physics']); saveMark($conn, $student_id, "Chemistry", $_POST['chemistry']); saveMark($conn, $student_id, $_POST['language_science'], $_POST['lang_marks_science']); saveMark($conn, $student_id, $_POST['optional1'], $_POST['opt1_marks']); saveMark($conn, $student_id, $_POST['optional2'], $_POST['opt2_marks']); } // 🎨 ARTS if($stream == "Arts"){ saveMark($conn, $student_id, "English", $_POST['english']); saveMark($conn, $student_id, $_POST['language'], $_POST['language_marks']); saveMark($conn, $student_id, $_POST['sub1'], $_POST['m1']); saveMark($conn, $student_id, $_POST['sub2'], $_POST['m2']); saveMark($conn, $student_id, $_POST['sub3'], $_POST['m3']); saveMark($conn, $student_id, $_POST['sub4'], $_POST['m4']); } // đŸ’ŧ COMMERCE if($stream == "Commerce"){ saveMark($conn, $student_id, "English", $_POST['english']); saveMark($conn, $student_id, $_POST['language'], $_POST['language_marks']); saveMark($conn, $student_id, "Economics", $_POST['economics']); saveMark($conn, $student_id, "Co-operation", $_POST['cooperation']); saveMark($conn, $student_id, "Book Keeping & Account", $_POST['bk']); saveMark($conn, $student_id, "Org. of Commerce", $_POST['org']); } // 🌱 EVS + PE (FIXED) $evs = $_POST['evs'] ?? null; $pe = $_POST['pe'] ?? null; if($evs !== null){ saveMark($conn, $student_id, "EVS", $evs); } if($pe !== null){ saveMark($conn, $student_id, "PE", $pe); } $message = "✅ Marks Saved Successfully!"; } ?> <!DOCTYPE html> <html> <head> <title>Add Marks</title> <style> body { font-family: Arial; background: linear-gradient(135deg, #667eea, #764ba2); margin: 0; } .container { width: 500px; margin: 40px auto; background: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); } h2 { text-align: center; } .tabs { text-align: center; margin-bottom: 20px; } .tabs a { padding: 8px 15px; margin: 5px; border: 1px solid #333; text-decoration: none; border-radius: 5px; color: #333; } .tabs a.active { background: #333; color: white; } input, select { width: 100%; padding: 8px; margin: 6px 0 15px; border-radius: 5px; border: 1px solid #ccc; } button { width: 100%; padding: 10px; background: green; color: white; border: none; border-radius: 5px; } .message { background: #d4edda; padding: 10px; text-align: center; margin-bottom: 10px; } </style> </head> <body> <div class="container"> <h2>Add Marks</h2> <div class="tabs"> <a href="?stream=Science" class="<?= ($stream=="Science")?'active':'' ?>">Science</a> <a href="?stream=Arts" class="<?= ($stream=="Arts")?'active':'' ?>">Arts</a> <a href="?stream=Commerce" class="<?= ($stream=="Commerce")?'active':'' ?>">Commerce</a> </div> <?php if($message): ?> <div class="message"><?= $message ?></div> <?php endif; ?> <?php if($stream && !empty($students)): ?> <form method="POST"> <input type="hidden" name="stream" value="<?= $stream ?>"> <label>Select Student</label> <select name="student_id" required> <?php foreach($students as $s): ?> <option value="<?= $s['id'] ?>"> <?= $s['name'] ?> (<?= $s['roll_no'] ?>) </option> <?php endforeach; ?> </select> <!-- SCIENCE --> <?php if($stream=="Science"): ?> <input type="number" name="english" placeholder="English" required> <input type="number" name="physics" placeholder="Physics" required> <input type="number" name="chemistry" placeholder="Chemistry" required> <select name="language_science"> <option value="Marathi">Marathi</option> <option value="IT">IT</option> </select> <input type="number" name="lang_marks_science" placeholder="Marks" required> <select name="optional1"> <option value="Biology">Biology</option> <option value="Computer Science">Computer Science</option> </select> <input type="number" name="opt1_marks" placeholder="Marks" required> <select name="optional2"> <option value="Mathematics">Mathematics</option> <option value="Geography">Geography</option> </select> <input type="number" name="opt2_marks" placeholder="Marks" required> <?php endif; ?> <!-- ARTS --> <?php if($stream=="Arts"): ?> <input type="number" name="english" placeholder="English" required> <select name="language"> <option value="Marathi">Marathi</option> <option value="Hindi">Hindi</option> </select> <input type="number" name="language_marks" required> <input type="text" name="sub1" placeholder="Subject 1" required> <input type="number" name="m1" required> <input type="text" name="sub2" required> <input type="number" name="m2" required> <input type="text" name="sub3" required> <input type="number" name="m3" required> <input type="text" name="sub4" required> <input type="number" name="m4" required> <?php endif; ?> <!-- COMMERCE --> <?php if($stream=="Commerce"): ?> <input type="number" name="english" placeholder="English" required> <select name="language"> <option value="Marathi">Marathi</option> <option value="IT">IT</option> </select> <input type="number" name="language_marks" required> <input type="number" name="economics" placeholder="Economics" required> <input type="number" name="cooperation" placeholder="Co-operation" required> <input type="number" name="bk" placeholder="Book Keeping" required> <input type="number" name="org" placeholder="Org. of Commerce" required> <?php endif; ?> <!-- EVS + PE (FIXED) --> <label>Environmental Education</label> <select name="evs" required> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <label>Physical Education</label> <select name="pe" required> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <button type="submit" name="submit">Save Marks</button> </form> <?php else: ?> <p style="text-align:center;">Select stream</p> <?php endif; ?> </div> </body> </html>as pr provide code give view result php code

No preview

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document

System Requirements Document (SRD)

Title: tidal-students

1. Introduction

The tidal-students project is designed to streamline the process of managing student marks across different academic streams (Science, Arts, Commerce) in educational institutions. This system will enable administrators and educators to efficiently input, update, and retrieve student marks while maintaining a user-friendly interface. The project is tailored for Ruturaj Kumbhar in India, ensuring compatibility with locale-specific defaults such as INR currency, IST timezone, and regional academic structures.

2. System Overview

The tidal-students system is a web-based application that provides functionality for managing student marks based on their academic streams. It includes features for selecting students, entering marks for various subjects, and saving them securely in a database. The system supports dynamic forms based on the selected stream and ensures data integrity through validation and error handling.

Key Features:

  • Stream-specific mark entry forms.
  • Dynamic student selection dropdown.
  • Secure database operations for saving and updating marks.
  • Fixed subjects (EVS and PE) across all streams.
  • Responsive and intuitive user interface.
Page 1 of 6

3. Functional Requirements

Story Points

  • As Admin, I should be able to select a stream (Science, Arts, Commerce) and view students associated with that stream.
  • As Admin, I should be able to input marks for fixed subjects (EVS and PE) for all streams.
  • As Admin, I should be able to input marks for stream-specific subjects dynamically.
  • As Admin, I should be able to save marks securely in the database.
  • As Admin, I should receive a confirmation message upon successful saving of marks.
  • As Admin, I should be able to update marks if they already exist for a student and subject.
  • As Admin, I should be able to view a user-friendly interface with tabs for stream selection.

4. User Personas

Admin

  • Role: Administrator or Educator
  • Responsibilities: Managing student marks, selecting streams, entering marks, and saving them securely.
  • Needs: A responsive and intuitive interface for efficient mark entry and management.
Page 2 of 6

Student

  • Role: End-user whose marks are being managed.
  • Responsibilities: None (passive role).
  • Needs: Accurate representation of their marks in the system.

5. Visuals Colors and Theme

Color Palette

The color palette for tidal-students is designed to evoke professionalism and clarity while maintaining a modern aesthetic. The following hex codes define the theme:

  • Background: #667eea (Gradient start) and #764ba2 (Gradient end)
  • Surface: #ffffff (White for forms and containers)
  • Text: #333333 (Dark gray for readability)
  • Accent: #4caf50 (Green for buttons and success messages)
  • Muted Tones: #d4edda (Light green for confirmation messages)

6. Signature Design Concept

The tidal-students homepage will feature a dynamic stream selector interface that visually represents each stream as a floating card. These cards will hover slightly when the user moves their cursor over them, creating a tactile and engaging experience. Upon clicking a card, the interface will transition with a smooth zoom animation into the selected stream's mark entry form.

Page 3 of 6

Details:

  • Animation: Cards will have a hover effect with a subtle shadow and scale-up animation.
  • Transitions: Smooth zoom-in effect when a stream is selected.
  • Micro-interactions: Buttons will have ripple effects when clicked.
  • Visuals: The background will feature a gradient that subtly shifts colors based on the selected stream (e.g., blue for Science, orange for Arts, green for Commerce).
  • User Experience: The interface will feel alive and responsive, ensuring users are engaged and focused.

7. Non-Functional Requirements

  • Performance: The system should load pages and forms within 2 seconds.
  • Scalability: The database should support up to 10,000 students and their marks.
  • Security: All database operations must use prepared statements to prevent SQL injection.
  • Accessibility: The interface should be compatible with screen readers and keyboard navigation.
  • Responsiveness: The system should be fully functional on mobile devices and tablets.

8. Tech Stack

Frontend

  • React for Web
Page 4 of 6

Backend

  • Python
  • FastAPI

Database

  • MySQL (preferred) or MariaDB
  • Alembic for migrations

AI Models

  • GPT 5.4 for user-friendly responses
  • Claude 4.6 Opas for academic or coding work

AI Tools

  • Litellm for LLM Routing
  • Langchain

Local Orchestration

  • Docker
  • docker-compose

Server-side Orchestration

  • Kubernetes

9. Assumptions and Constraints

Page 5 of 6

Assumptions

  • The system will primarily be used by administrators in educational institutions.
  • Students will not directly interact with the system.
  • The database schema includes tables for students, marks, and streams.

Constraints

  • The system must adhere to locale-specific academic structures in India.
  • The system must support only three streams: Science, Arts, Commerce.
  • The system must use prepared statements for all database operations.

10. Glossary

  • Stream: Academic category (Science, Arts, Commerce) under which students are grouped.
  • EVS: Environmental Education, a fixed subject across all streams.
  • PE: Physical Education, a fixed subject across all streams.
  • Admin: The user responsible for managing student marks.
  • Prepared Statement: A database query that prevents SQL injection by separating query structure from data.

This concludes the updated System Requirements Document for tidal-students. Let me know if further refinements are needed!

Page 6 of 6

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.