<?php
ob_start();require __DIR__.'/student_projects_workspace.php';$graduationView=ob_get_clean();
$graduationView=str_replace(['Students Projects','← Student projects','Submit, explore and refine your coursework in one organised workspace.'],['Way to graduate','← Way to graduate','First project, second project and final project: submit, defend and earn approval.'],$graduationView);
$requirements='<section class="graduation-panel" id="graduationRequirements"><div class="section-heading"><div><span class="section-kicker">THREE MILESTONES · ONE JOURNEY</span><h2>Graduation project requirements</h2><p>Complete each stage through submission, verification, defence and approval.</p></div><button id="graduationCreateOpen" class="button" hidden>Create requirements</button></div><div id="graduationRequirementCards" class="graduation-cards"></div></section>';
$graduationView=str_replace('<section class="panel projects-library"',$requirements.'<section class="panel projects-library"',$graduationView);
$workflow='<section id="graduationWorkflow" class="graduation-workflow" hidden><a id="graduationFilesLink" class="button secondary">← Project files</a><div class="graduation-flow-head"><h3>Verification & defence</h3><strong id="graduationStatus"></strong></div><div id="graduationRequirementText"></div><div id="graduationHistory" class="graduation-history"></div><form id="graduationReviewForm" hidden><div class="graduation-form-grid"><label>Review action<select id="graduationDecision" required></select></label><label id="graduationDefenceLabel">Actual defence date and time<input id="graduationDefenceAt" type="datetime-local"></label><label class="wide">Reason / verification or defence notes<textarea id="graduationReason" rows="3" minlength="10" maxlength="5000" required placeholder="Explain the evidence reviewed, defence outcome, or valid reason for approval/rejection."></textarea></label></div><button class="button" type="submit">Record decision & notify student</button></form><p id="graduationReviewNotice" role="status"></p></section>';
$graduationView=str_replace('<p id="projectDescription"></p>','<p id="projectDescription"></p><a id="graduationReviewLink" class="button secondary">Verification &amp; defence →</a>',$graduationView);$graduationView=str_replace('</main>',$workflow.'<section id="graduationDetail" class="panel" hidden></section></main>',$graduationView);$graduationView=str_replace('Choose the course and technologies used.','Select the technologies used. Your department is assigned automatically.',$graduationView);echo $graduationView;
?>
<div class="modal fade slps-modal" id="graduationCreateModal" tabindex="-1" aria-labelledby="graduationCreateTitle" aria-hidden="true"><div class="modal-dialog modal-lg modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h2 id="graduationCreateTitle" class="modal-title fs-5">Publish graduation project requirements</h2><button class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><form id="graduationCreateForm" class="graduation-form-grid"><label>Milestone<select name="stage"><option value="1">First project</option><option value="2">Second project</option><option value="3">Final project</option></select></label><label>Academic period<input name="academic_period" required maxlength="100" placeholder="e.g. 2026 · Term 3"></label><label class="wide">Project / requirement title<input name="title" required maxlength="160"></label><label class="wide">Department<select id="graduationDepartment" name="department_id" required></select></label><fieldset class="wide"><legend>Target study years · All campuses</legend><label><input type="checkbox" name="years" value="1"> Year 1</label><label><input type="checkbox" name="years" value="2"> Year 2</label><label><input type="checkbox" name="years" value="3"> Year 3</label><label><input type="checkbox" name="years" value="4"> Year 4</label></fieldset><label>Submission deadline (Zambia time)<input id="graduationDeadline" name="deadline" type="datetime-local" required></label><label class="wide">Full requirements, deliverables and defence expectations</label><div class="wide guideline-editor-wrap"><div id="graduationToolbar" class="guideline-toolbar" aria-label="Document formatting">
 <span class="ql-formats"><select class="ql-header" aria-label="Heading"><option selected></option><option value="1"></option><option value="2"></option><option value="3"></option><option value="4"></option><option value="5"></option><option value="6"></option></select><select class="ql-font" aria-label="Font"><option selected></option><option value="serif"></option><option value="monospace"></option></select><select class="ql-size" aria-label="Text size"><option value="small"></option><option selected></option><option value="large"></option><option value="huge"></option></select></span>
 <span class="ql-formats"><button type="button" class="ql-bold" aria-label="Bold"></button><button type="button" class="ql-italic" aria-label="Italic"></button><button type="button" class="ql-underline" aria-label="Underline"></button><button type="button" class="ql-strike" aria-label="Strikethrough"></button><button type="button" class="ql-script" value="sub" aria-label="Subscript"></button><button type="button" class="ql-script" value="super" aria-label="Superscript"></button></span>
 <span class="ql-formats"><select class="ql-color" aria-label="Text colour"></select><select class="ql-background" aria-label="Highlight colour"></select></span>
 <span class="ql-formats"><button type="button" class="ql-list" value="ordered" aria-label="Numbered list"></button><button type="button" class="ql-list" value="bullet" aria-label="Bullet list"></button><button type="button" class="ql-list" value="check" aria-label="Checklist"></button><button type="button" class="ql-indent" value="-1" aria-label="Decrease indent"></button><button type="button" class="ql-indent" value="+1" aria-label="Increase indent"></button><select class="ql-align" aria-label="Alignment"></select><button type="button" class="ql-direction" value="rtl" aria-label="Right-to-left text"></button></span>
 <span class="ql-formats"><button type="button" class="ql-blockquote" aria-label="Block quote"></button><button type="button" class="ql-code-block" aria-label="Code block"></button><button type="button" class="ql-link" aria-label="Insert link"></button><button type="button" class="ql-clean" aria-label="Clear formatting"></button></span>
 <span class="guideline-custom-tools"><button id="graduationEditorUndo" type="button" title="Undo">↶</button><button id="graduationEditorRedo" type="button" title="Redo">↷</button><button id="graduationEditorCode" type="button">Insert code</button><button id="graduationEditorTable" type="button">Table</button><select id="graduationEditorTableAction" aria-label="Table actions"><option value="">Table actions</option><option value="insertRowAbove">Row above</option><option value="insertRowBelow">Row below</option><option value="insertColumnLeft">Column left</option><option value="insertColumnRight">Column right</option><option value="deleteRow">Delete row</option><option value="deleteColumn">Delete column</option><option value="deleteTable">Delete table</option></select></span>
 </div><div id="graduationEditor" aria-label="Graduation requirements editor"></div><small id="graduationWordCount" aria-live="polite">0 words</small></div><label class="wide" hidden></label><p class="wide">All students in the selected years and department receive these requirements across all campuses. Use the same department and academic period for all three milestones.</p><p id="graduationCreateNotice" class="wide" role="status"></p><button class="button" type="submit">Publish requirements & notify students</button></form></div></div></div></div>

<div class="modal fade slps-modal" id="graduationDeleteModal" tabindex="-1" aria-labelledby="graduationDeleteTitle" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h2 id="graduationDeleteTitle" class="modal-title fs-5">Delete graduation project</h2><button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close"></button></div><form id="graduationDeleteForm"><div class="modal-body"><p id="graduationDeleteDescription"></p><label for="graduationDeleteReason">Reason for deletion</label><textarea id="graduationDeleteReason" class="form-control" required minlength="10" maxlength="1000" rows="3"></textarea><p id="graduationDeleteNotice" role="status"></p></div><div class="modal-footer"><button type="button" class="button secondary" data-bs-dismiss="modal">Cancel</button><button class="button graduation-delete-button" type="submit">Delete project</button></div></form></div></div></div>
