2025-05-16 20:02:49 -04:00
|
|
|
<?php
|
|
|
|
|
// This file contains the HTML template for creating a new ticket
|
|
|
|
|
?>
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>Create New Ticket</title>
|
|
|
|
|
<link rel="icon" type="image/png" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/images/favicon.png">
|
|
|
|
|
<link rel="stylesheet" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/css/dashboard.css">
|
|
|
|
|
<link rel="stylesheet" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/css/ticket.css">
|
|
|
|
|
<script src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/dashboard.js"></script>
|
2026-01-09 15:05:20 -05:00
|
|
|
<script>
|
|
|
|
|
// CSRF Token for AJAX requests
|
|
|
|
|
window.CSRF_TOKEN = '<?php
|
|
|
|
|
require_once __DIR__ . '/../middleware/CsrfMiddleware.php';
|
|
|
|
|
echo CsrfMiddleware::getToken();
|
|
|
|
|
?>';
|
|
|
|
|
</script>
|
2025-05-16 20:02:49 -04:00
|
|
|
</head>
|
|
|
|
|
<body>
|
2026-01-07 10:52:10 -05:00
|
|
|
<div class="user-header">
|
|
|
|
|
<div class="user-header-left">
|
|
|
|
|
<a href="/" class="back-link">← Dashboard</a>
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
<div class="user-header-right">
|
|
|
|
|
<?php if (isset($GLOBALS['currentUser'])): ?>
|
|
|
|
|
<span class="user-name">👤 <?php echo htmlspecialchars($GLOBALS['currentUser']['display_name'] ?? $GLOBALS['currentUser']['username']); ?></span>
|
|
|
|
|
<?php if ($GLOBALS['currentUser']['is_admin']): ?>
|
|
|
|
|
<span class="admin-badge">Admin</span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- OUTER FRAME: Create Ticket Form Container -->
|
|
|
|
|
<div class="ascii-frame-outer">
|
|
|
|
|
<span class="bottom-left-corner">╚</span>
|
|
|
|
|
<span class="bottom-right-corner">╝</span>
|
|
|
|
|
|
|
|
|
|
<!-- SECTION 1: Form Header -->
|
|
|
|
|
<div class="ascii-section-header">Create New Ticket</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="ticket-header">
|
|
|
|
|
<h2>New Ticket Form</h2>
|
|
|
|
|
<p style="color: var(--terminal-green); font-family: var(--font-mono); font-size: 0.9rem; margin-top: 0.5rem;">
|
|
|
|
|
Complete the form below to create a new ticket
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-05-16 20:02:49 -04:00
|
|
|
<?php if (isset($error)): ?>
|
2026-01-07 10:52:10 -05:00
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
|
|
|
|
<!-- ERROR SECTION -->
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="error-message" style="color: var(--priority-1); border: 2px solid var(--priority-1); padding: 1rem; background: rgba(231, 76, 60, 0.1);">
|
|
|
|
|
<strong>⚠ Error:</strong> <?php echo $error; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-05-16 20:02:49 -04:00
|
|
|
<?php endif; ?>
|
2026-01-07 10:52:10 -05:00
|
|
|
|
|
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
2025-05-16 20:02:49 -04:00
|
|
|
<form method="POST" action="<?php echo $GLOBALS['config']['BASE_URL']; ?>/ticket/create" class="ticket-form">
|
2026-01-01 19:00:42 -05:00
|
|
|
|
2026-01-07 10:52:10 -05:00
|
|
|
<!-- SECTION 2: Template Selection -->
|
|
|
|
|
<div class="ascii-section-header">Template Selection</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="detail-group">
|
|
|
|
|
<label for="templateSelect">Use Template (Optional)</label>
|
|
|
|
|
<select id="templateSelect" class="editable" onchange="loadTemplate()">
|
|
|
|
|
<option value="">-- No Template --</option>
|
|
|
|
|
<?php if (isset($templates) && !empty($templates)): ?>
|
|
|
|
|
<?php foreach ($templates as $template): ?>
|
|
|
|
|
<option value="<?php echo $template['template_id']; ?>">
|
|
|
|
|
<?php echo htmlspecialchars($template['template_name']); ?>
|
|
|
|
|
</option>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
2025-05-16 20:02:49 -04:00
|
|
|
</select>
|
2026-01-07 10:52:10 -05:00
|
|
|
<p style="color: var(--terminal-green); font-size: 0.85rem; margin-top: 0.5rem; font-family: var(--font-mono);">
|
|
|
|
|
Select a template to auto-fill form fields
|
|
|
|
|
</p>
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
|
|
|
|
<!-- SECTION 3: Basic Information -->
|
|
|
|
|
<div class="ascii-section-header">Basic Information</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="detail-group">
|
|
|
|
|
<label for="title">Ticket Title *</label>
|
|
|
|
|
<input type="text" id="title" name="title" class="editable" required placeholder="Enter a descriptive title for this ticket">
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
|
|
|
|
<!-- SECTION 4: Ticket Metadata -->
|
|
|
|
|
<div class="ascii-section-header">Ticket Metadata</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="detail-group status-priority-row">
|
|
|
|
|
<div class="detail-quarter">
|
|
|
|
|
<label for="status">Status</label>
|
|
|
|
|
<select id="status" name="status" class="editable">
|
|
|
|
|
<option value="Open" selected>Open</option>
|
|
|
|
|
<option value="Closed">Closed</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-quarter">
|
|
|
|
|
<label for="priority">Priority</label>
|
|
|
|
|
<select id="priority" name="priority" class="editable">
|
|
|
|
|
<option value="1">P1 - Critical Impact</option>
|
|
|
|
|
<option value="2">P2 - High Impact</option>
|
|
|
|
|
<option value="3">P3 - Medium Impact</option>
|
|
|
|
|
<option value="4" selected>P4 - Low Impact</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-quarter">
|
|
|
|
|
<label for="category">Category</label>
|
|
|
|
|
<select id="category" name="category" class="editable">
|
|
|
|
|
<option value="Hardware">Hardware</option>
|
|
|
|
|
<option value="Software">Software</option>
|
|
|
|
|
<option value="Network">Network</option>
|
|
|
|
|
<option value="Security">Security</option>
|
|
|
|
|
<option value="General" selected>General</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-quarter">
|
|
|
|
|
<label for="type">Type</label>
|
|
|
|
|
<select id="type" name="type" class="editable">
|
|
|
|
|
<option value="Maintenance">Maintenance</option>
|
|
|
|
|
<option value="Install">Install</option>
|
|
|
|
|
<option value="Task">Task</option>
|
|
|
|
|
<option value="Upgrade">Upgrade</option>
|
|
|
|
|
<option value="Issue" selected>Issue</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
|
|
|
|
<!-- SECTION 5: Detailed Description -->
|
|
|
|
|
<div class="ascii-section-header">Detailed Description</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="detail-group full-width">
|
|
|
|
|
<label for="description">Description *</label>
|
|
|
|
|
<textarea id="description" name="description" class="editable" rows="15" required placeholder="Provide a detailed description of the ticket..."></textarea>
|
|
|
|
|
</div>
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
|
|
|
|
|
<!-- DIVIDER -->
|
|
|
|
|
<div class="ascii-divider"></div>
|
|
|
|
|
|
|
|
|
|
<!-- SECTION 6: Form Actions -->
|
|
|
|
|
<div class="ascii-section-header">Form Actions</div>
|
|
|
|
|
<div class="ascii-content">
|
|
|
|
|
<div class="ascii-frame-inner">
|
|
|
|
|
<div class="ticket-footer">
|
|
|
|
|
<button type="submit" class="btn primary">Create Ticket</button>
|
|
|
|
|
<button type="button" onclick="window.location.href='<?php echo $GLOBALS['config']['BASE_URL']; ?>/'" class="btn back-btn">Cancel</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-05-16 20:02:49 -04:00
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
|
2025-05-16 20:02:49 -04:00
|
|
|
</form>
|
|
|
|
|
</div>
|
2026-01-07 10:52:10 -05:00
|
|
|
<!-- END OUTER FRAME -->
|
2025-05-16 20:02:49 -04:00
|
|
|
</body>
|
2026-01-07 10:52:10 -05:00
|
|
|
</html>
|