« Back to History
mesr_jari_machine_config.php
|
20260921_175631.php
Initial Domain Snapshot
Copy Code
<?php require_once __DIR__.'/../modules/auth/page_acl.php'; $ctx = page_require_access('mesr_stock_entry'); $pdo = $ctx['pdo']; $company_id = (int)$ctx['company_id']; $machines = $pdo->query("SELECT id, machine_name FROM mesr_machine WHERE company_id=$company_id")->fetchAll(); $colors = $pdo->query("SELECT DISTINCT value FROM mesr_denier_data WHERE company_id=$company_id AND type='color'")->fetchAll(PDO::FETCH_COLUMN); require_once __DIR__.'/../partials/header.php'; ?> <div class="card"> <h3>Jari Machine Configuration</h3> <form method="post" action="mesr_jari_machine_entry.php"> <label>Date</label> <input type="date" name="entry_date" value="<?=date('Y-m-d')?>" required> <label>Machine</label> <select name="machine_id" required> <?php foreach($machines as $m): ?> <option value="<?=$m['id']?>"><?=$m['machine_name']?></option> <?php endforeach; ?> </select> <label>Total Raws</label> <input type="number" name="total_raws" min="1" required> <label>Color Mode</label> <select id="color_mode"> <option value="single">Single Color</option> <option value="multi">Multiple Color</option> </select> <div id="sections"> <?php for($i=1;$i<=4;$i++): ?> <div class="row"> <strong>Section <?=$i?></strong> <select name="sections[<?=$i?>][kasab]" class="color"> <?php foreach($colors as $c) echo "<option>$c</option>"; ?> </select> <select name="sections[<?=$i?>][metallic]" class="color"> <?php foreach($colors as $c) echo "<option>$c</option>"; ?> </select> </div> <?php endfor; ?> </div> <button type="submit" class="btn btn-success">Continue Entry</button> </form> </div> <script> document.getElementById('color_mode').onchange = e => { if(e.target.value === 'single'){ const first = document.querySelector('.color').value; document.querySelectorAll('.color').forEach(c=>c.value=first); } }; </script> <?php require_once __DIR__.'/../partials/footer.php'; ?>