crjnew:beta added

This commit is contained in:
mikx
2026-01-06 16:05:54 -05:00
parent 7e3d423809
commit b29219bbd3
5 changed files with 183 additions and 0 deletions

91
crjnew/css/gen.css Normal file
View File

@@ -0,0 +1,91 @@
a {
color: #96afffff;
text-decoration: none;
}
:root {
--bg: #0f172a;
--card: #1e293b;
--accent: #38bdf8;
--text: #f8fafc;
--input: #334155;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg);
color: var(--text);
display: flex;
justify-content: center;
padding: 40px 20px;
}
.container {
background-color: var(--card);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
max-width: 600px;
width: 100%;
}
h2 {
color: var(--accent);
margin-top: 0;
}
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-bottom: 20px;
}
label {
display: block;
font-size: 0.85rem;
margin-bottom: 5px;
color: #94a3b8;
}
select,
input {
width: 100%;
padding: 10px;
background: var(--input);
border: 1px solid #475569;
color: white;
border-radius: 6px;
outline: none;
}
.output-box {
background: #000;
padding: 15px;
border-left: 4px solid var(--accent);
font-family: 'Courier New', monospace;
margin-top: 20px;
position: relative;
}
button {
background-color: var(--accent);
color: #0f172a;
border: none;
padding: 12px 20px;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
width: 100%;
transition: opacity 0.2s;
}
button:hover {
opacity: 0.9;
}
.hint {
font-size: 0.75rem;
color: #64748b;
margin-top: 5px;
}

0
crjnew/css/index.html Normal file
View File

0
crjnew/img/index.html Normal file
View File

92
crjnew/index.php Normal file
View File

@@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PHP Cron Generator</title>
<link rel="stylesheet" href="css/gen.css">
</head>
<body>
<div class="container">
<h5><a href="https://gen.mxdev.ovh">Back to Gen. List</a></h5>
<h1>Cron Job Generator</h1>
<h2>Language: HTML / PHP</h2>
<h4>Developper: mikx</h4>
<h4>Sources: <a href="https://mxgit.ovh/mikx/MxGen/src/branch/main/crjnew">MxGit</a></h4>
<h5>Version: 0.1.0</h5>
</div>
<br><br>
<div class="container">
<h2>Cron Job Generator</h2>
<form method="POST">
<div class="grid">
<div>
<label>Minute</label>
<input type="text" name="min" placeholder="*" value="<?php echo $_POST['min'] ?? '*'; ?>">
<div class="hint">0-59 or *</div>
</div>
<div>
<label>Hour</label>
<input type="text" name="hour" placeholder="*" value="<?php echo $_POST['hour'] ?? '*'; ?>">
<div class="hint">0-23 or *</div>
</div>
<div>
<label>Day of Month</label>
<input type="text" name="dom" placeholder="*" value="<?php echo $_POST['dom'] ?? '*'; ?>">
<div class="hint">1-31 or *</div>
</div>
<div>
<label>Month</label>
<select name="month">
<option value="*">Every Month (*)</option>
<?php
for($m=1; $m<=12; $m++) {
$sel = (isset($_POST['month']) && $_POST['month'] == $m) ? 'selected' : '';
echo "<option value='$m' $sel>".date('F', mktime(0,0,0,$m,1))."</option>";
}
?>
</select>
</div>
<div style="grid-column: span 2;">
<label>Day of Week</label>
<select name="dow">
<option value="*">Every Day (*)</option>
<option value="0" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '0') ? 'selected' : ''; ?>>Sunday</option>
<option value="1" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '1') ? 'selected' : ''; ?>>Monday</option>
<option value="2" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '2') ? 'selected' : ''; ?>>Tuesday</option>
<option value="3" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '3') ? 'selected' : ''; ?>>Wednesday</option>
<option value="4" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '4') ? 'selected' : ''; ?>>Thursday</option>
<option value="5" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '5') ? 'selected' : ''; ?>>Friday</option>
<option value="6" <?php echo (isset($_POST['dow']) && $_POST['dow'] == '6') ? 'selected' : ''; ?>>Saturday</option>
</select>
</div>
<div style="grid-column: span 2;">
<label>Command to execute</label>
<input type="text" name="command" placeholder="php /path/to/script.php" value="<?php echo $_POST['command'] ?? ''; ?>">
</div>
</div>
<button type="submit" name="generate">Generate Cron Line</button>
</form>
<?php
if (isset($_POST['generate'])) {
$min = $_POST['min'] ?: '*';
$hour = $_POST['hour'] ?: '*';
$dom = $_POST['dom'] ?: '*';
$month = $_POST['month'];
$dow = $_POST['dow'];
$cmd = $_POST['command'] ?: '[command]';
$cron_string = "{$min} {$hour} {$dom} {$month} {$dow} {$cmd}";
echo "<div class='output-box'>";
echo "<strong>Result:</strong><br><br>";
echo "<code>" . htmlspecialchars($cron_string) . "</code>";
echo "</div>";
}
?>
</div>
</body>
</html>

0
crjnew/lib/index.html Normal file
View File