<commit_before><?=form_open(site_url('quartz_chem/add_split_weights'))?>

<input type=hidden name="batch_id" value="<?=$batch->id?>">
<input type=hidden name="is_refresh" value="true">

<table width=800 class=arial10>
    <tr>
        <td>
        <h3>Batch information:</h3><p/>
        Batch ID: <?=$batch->id?><br>
        Batch start date: <?=$batch->start_date?><br>
        Batch owner: <?=$batch->owner?><br>
        Batch description: <?=$batch->description?><p/>
        </td>
    </tr>
    <tr>
        <td colspan=4>
            Batch notes:<br>
            <center>
                <textarea name="notes" rows=5 cols=100><?=$batch->notes?></textarea>
            </center>
        </td>
    </tr>
    <tr><td><hr></td></tr>
</table>

<?php if ($errors): ?>
    <?=validation_errors()?>
<?php endif; ?>

<table width="800" class="arial8">
    <tr>
        <td colspan="4" class="arial12">Sample information:</td>
        <td colspan="4" class="arial8">
            <input type="button" id="setBkrSeq" value="Set Beaker&#10;Sequence"></p>
        </td>
    </tr>
    <tr>
        <td>Analysis ID</td>
        <td>Sample name</td>
        <td>Dissolution bottle ID</td>
        <td>Split number</td>
        <td>Split beaker ID</td>
        <td>Beaker tare wt.</td>
        <td>Beaker + split wt.</td>
        <td>Split wt.</td>
    </tr>

<?php for ($i = 0; $i < $numsamples; $i++): // main sample loop ?>

    <tr><td colspan="8"><hr></td></tr>

        <?php for ($s = 0; $s < $batch->Analysis[$i]->Split->count(); $s++): ?>
            <tr>

            <?php if ($s == 0): ?>

                <td><?=$batch->Analysis[$i]->id?></td>
                <td>
                    <?php
                    if ($batch->Analysis[$i]->Sample->name != NULL) {
                        echo $batch->Analysis[$i]->Sample->name;
                    } else {
                        echo $batch->Analysis[$i]->sample_name;
                    }
                    ?>
                </td>
                <td><?=$batch->Analysis[$i]->DissBottle->bottle_number?></td>

            <?php elseif ($s == $batch->Analysis[$i]->Split->count() - 1): ?>

                <td colspan="2"></td>
                <td>
                    <!-- <input type="submit" value="Add a split" name="addsplit"> -->
                </td>

            <?php else: ?>

                <td colspan=3></td>

            <?php endif; ?>

            <td>Split <?=$s+1?>:</td>
            <td>
                <select name="split_bkr[]" class="bkr_select" 
                 onClick="javascript:setBeakerSequence();">
                    <?php
                    foreach ($bkr_list as $b) {
                        echo "<option value=$b->id ";
                        if ($b->id == $batch->Analysis[$i]->Split[$s]->split_bkr_id) {
                            echo 'selected';
                        }
                        echo "> $b->bkr_number </option>\n";
                    }
                    ?>
                </select>
            </td>

            <td>
                <?=form_input('bkr_tare[]', $batch->Analysis[$i]->Split[$s]->wt_split_bkr_tare)?>
            </td>
            <td>
                <?=form_input('bkr_split[]', $batch->Analysis[$i]->Split[$s]->wt_split_bkr_split)?>
            </td>
            <td>
                <?php
                // calculate and print split weight
                $split_wt = $batch->Analysis[$i]->Split[$s]->wt_split_bkr_split
                          - $batch->Analysis[$i]->Split[$s]->wt_split_bkr_tare;
                printf('%.4f', $split_wt);
                ?>
            </td>
        </tr>

        <?php endfor; // split loop ?>

<?php endfor; // sample loop ?>

    <tr><td colspan=8><hr></td></tr>
</table>

<table width=800>
    <tr>
    <td align=center>
    <input type=submit value="Save and refresh">
    </td>
    </tr>
    <tr><td><hr></td></tr>
</table>

<?=form_close()?>

<?=$this->load->view('quartz_chem/bottom_links')?><commit_msg>Line breaks in buttons don't work in safari, adjusted.<commit_after><?=form_open(site_url('quartz_chem/add_split_weights'))?>

<input type=hidden name="batch_id" value="<?=$batch->id?>">
<input type=hidden name="is_refresh" value="true">

<table width=800 class=arial10>
    <tr>
        <td>
        <h3>Batch information:</h3><p/>
        Batch ID: <?=$batch->id?><br>
        Batch start date: <?=$batch->start_date?><br>
        Batch owner: <?=$batch->owner?><br>
        Batch description: <?=$batch->description?><p/>
        </td>
    </tr>
    <tr>
        <td colspan=4>
            Batch notes:<br>
            <center>
                <textarea name="notes" rows=5 cols=100><?=$batch->notes?></textarea>
            </center>
        </td>
    </tr>
    <tr><td><hr></td></tr>
</table>

<?php if ($errors): ?>
    <?=validation_errors()?>
<?php endif; ?>

<table width="800" class="arial8">
    <tr>
        <td colspan="3" class="arial12">Sample information:</td>
        <td colspan="5" class="arial8">
            <input type="button" id="setBkrSeq" value="Set Beaker Sequence"></p>
        </td>
    </tr>
    <tr>
        <td>Analysis ID</td>
        <td>Sample name</td>
        <td>Dissolution bottle ID</td>
        <td>Split number</td>
        <td>Split beaker ID</td>
        <td>Beaker tare wt.</td>
        <td>Beaker + split wt.</td>
        <td>Split wt.</td>
    </tr>

<?php for ($i = 0; $i < $numsamples; $i++): // main sample loop ?>

    <tr><td colspan="8"><hr></td></tr>

        <?php for ($s = 0; $s < $batch->Analysis[$i]->Split->count(); $s++): ?>
            <tr>

            <?php if ($s == 0): ?>

                <td><?=$batch->Analysis[$i]->id?></td>
                <td>
                    <?php
                    if ($batch->Analysis[$i]->Sample->name != NULL) {
                        echo $batch->Analysis[$i]->Sample->name;
                    } else {
                        echo $batch->Analysis[$i]->sample_name;
                    }
                    ?>
                </td>
                <td><?=$batch->Analysis[$i]->DissBottle->bottle_number?></td>

            <?php elseif ($s == $batch->Analysis[$i]->Split->count() - 1): ?>

                <td colspan="2"></td>
                <td>
                    <!-- <input type="submit" value="Add a split" name="addsplit"> -->
                </td>

            <?php else: ?>

                <td colspan=3></td>

            <?php endif; ?>

            <td>Split <?=$s+1?>:</td>
            <td>
                <select name="split_bkr[]" class="bkr_select" 
                 onClick="javascript:setBeakerSequence();">
                    <?php
                    foreach ($bkr_list as $b) {
                        echo "<option value=$b->id ";
                        if ($b->id == $batch->Analysis[$i]->Split[$s]->split_bkr_id) {
                            echo 'selected';
                        }
                        echo "> $b->bkr_number </option>\n";
                    }
                    ?>
                </select>
            </td>

            <td>
                <?=form_input('bkr_tare[]', $batch->Analysis[$i]->Split[$s]->wt_split_bkr_tare)?>
            </td>
            <td>
                <?=form_input('bkr_split[]', $batch->Analysis[$i]->Split[$s]->wt_split_bkr_split)?>
            </td>
            <td>
                <?php
                // calculate and print split weight
                $split_wt = $batch->Analysis[$i]->Split[$s]->wt_split_bkr_split
                          - $batch->Analysis[$i]->Split[$s]->wt_split_bkr_tare;
                printf('%.4f', $split_wt);
                ?>
            </td>
        </tr>

        <?php endfor; // split loop ?>

<?php endfor; // sample loop ?>

    <tr><td colspan=8><hr></td></tr>
</table>

<table width=800>
    <tr>
    <td align=center>
    <input type=submit value="Save and refresh">
    </td>
    </tr>
    <tr><td><hr></td></tr>
</table>

<?=form_close()?>

<?=$this->load->view('quartz_chem/bottom_links')?>
{'fraction_non_alphanumeric': 0.20037383177570092, 'fraction_numerical': 0.008722741433021807, 'mean_word_length': 1.5358609794628753, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 0, '>': 367, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '374521', 'n_tokens_mistral': 2628, 'n_tokens_neox': 2464, 'n_words': 456}