<?php require_once "atp.header.php" ?>

<section class="content-wrapper" data-heading="settings" id="firmware">

    <!--Heading-->
    <div class="page-title">
        <h1>Firmware Upgrade</h1>
        <p>
            Update firmware of individual boards from a .zip file provided by A+T, including external boards connected via ethernet.
            <em class="warning">Use this function with care, do not power down the system whilst devices are updating.</em>
        </p>
    </div>
    
    <!--Upload Box-->
    <div class="top-wrapper box">
        <form action="" method="post" enctype="multipart/form-data" id="upload-form">
            <fieldset>
                <legend><h2>Upload Firmware</h2></legend>
                <div class="flex-row">
                    <div class="flex-heading">
                        Select file to upload:
                    </div>
                    <input type="file" id="file-to-upload">
                    <input type="submit" class="button button-gray button-medium" value="Upload" id="upload-button">
                </div>
                <div class="flex-row">
                    <div class="flex-heading">
                        BFD Firmware:
                    </div>
                    <div id="file-container-bfd">
                        
                    </div>
                    <div class="file-check" id="file-check-bfd" hidden>
                        <i class="fa fa-check" aria-hidden="true"></i>
                    </div>
                </div>
                <div class="flex-row">
                    <div class="flex-heading">
                        QBD Firmware:
                    </div>
                    <div id="file-container-qbd">
                        
                    </div>
                    <div class="file-check" id="file-check-qbd" hidden>
                        <i class="fa fa-check" aria-hidden="true"></i>
                    </div>
                </div>
                <div class="flex-row">
                    <div class="flex-heading">
                        Board Firmware:
                    </div>
                    <div id="file-container-board">
                        
                    </div>
                    <div class="file-check" id="file-check-board" hidden>
                        <i class="fa fa-check" aria-hidden="true"></i>
                    </div>
                </div>
                <div class="flex-row">
                    <div class="flex-heading">
                        Display Firmware:
                    </div>
                    <div id="file-container-display">
                        
                    </div>
                    <div class="file-check" id="file-check-display" hidden>
                        <i class="fa fa-check" aria-hidden="true"></i>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    
    <!--Board Container-->
    <div class="top-wrapper box">
        <fieldset>
            <legend><h2>Boards</h2></legend>
            <div id="board-container" class="firmware-grid">
            
            </div>
        </fieldset>
    </div>

    <!--Display Container-->
    <div class="top-wrapper box">
        <fieldset>
            <legend><h2>Displays</h2></legend>
            <div id="display-container" class="firmware-grid">

            </div>
        </fieldset>
    </div>
</section>

<script type="text/javascript" src="js/inputmask.min.js" defer></script>
<script type="text/javascript" src="js/jquery.inputmask.min.js" defer ></script>
<script type="text/javascript" src="js/atp.firmware-update.js" defer></script>
<script>
$(document).ready(function() {
    var model = new FirmwareUpdateModel();
	var controller = new FirmwareUpdateController(model);
	var view = new FirmwareUpdateView(controller);	
});
</script>

<?php require_once "footer.php"?>