<?php
/**
 * Created by PhpStorm.
 * User: Pablo García Sanz
 * Date: 12/01/2018
 * Time: 17:35
 */

?>
<main>
    <div class="row">
        <div class="col xl8 s12">
            <span style="font-weight: bold"> <?php echo $timekeeper_text['timekeeper_list_combats_without_score']?></span>
            <?php $number_of_combats = sizeof($combats )?>
            <?php foreach ($combats as $combat){ ?>
                <?php if($combat -> ippon_w == null) { ?>
                    <ul class="collapsible" data-collapsible="accordion">
                        <li>
                            <div class="collapsible-header">
                                <div class="row">
                                    <div class="col s12">
                                        <span style="font-weight: bold">[<?php echo $timekeeper_text['timekeeper_phase']?> : <?php echo $combat -> fase?>]</span>
                                    </div>
                                    <div class="col s6 ">
                                        <?php echo $combat-> nombre_w .',' . $combat-> apellido1_w .' '. $combat-> apellido2_w ?>
                                    </div>
                                    <div class="col s6 indigo lighten-3">
                                        <?php echo $combat-> nombre_b .',' . $combat-> apellido1_b .' '. $combat-> apellido2_b ?>
                                    </div>
                                </div>
                            </div>
                            <div class="collapsible-body">
                                <div class="row">
                                    <form action="<?php echo base_url()?>score/addScoreTimekeeper/<?php echo $combat -> idCombate?>" method="post">
                                        <input type="hidden" name="idMat" value="<?php echo $combat -> idTatami?>">
                                        <input type="hidden" name="dniWhite" value="<?php echo $combat -> dni_w?>">
                                        <input type="hidden" name="dniBlue" value="<?php echo $combat -> dni_b?>">
                                        <div class="col s12">
                                            <div class="row">
                                                <div class="col s3"> I </div>
                                                <div class="col s3"> W </div>
                                                <div class="col s3"> S </div>
                                                <div class="col s3"> H </div>
                                            </div>
                                            <div class="row">

                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="ippon_white">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="wazari_white">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="2" name="shido_white">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="hansoku_white">
                                                </div>


                                            </div>
                                        </div>
                                        <div class="col s12 indigo lighten-3">
                                            <div class="row ">
                                                <div class="col s3"> I </div>
                                                <div class="col s3"> W </div>
                                                <div class="col s3"> S </div>
                                                <div class="col s3"> H </div>
                                            </div>
                                            <div class="row ">

                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="ippon_blue">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="wazari_blue">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="2" name="shido_blue">
                                                </div>
                                                <div class="input-field col s3">
                                                    <input type="number" min ="0" max="1" name="hansoku_blue">
                                                </div>


                                            </div>
                                        </div>


                                </div>
                                <div class="row">

                                    <div class="col s3 offset-s9">
                                        <button  class="btn btn-large waves-effect indigo"><?php echo $timekeeper_text['timekeeper_btn_score']?></button>
                                    </div>
                                </div>

                                </form>
                            </div>
                        </li>

                    </ul>
                <?php }?>
            <?php }?>

        </div>
        <div class="col xl4 s12">
            <span style="font-weight: bold"> <?php echo $timekeeper_text['timekeeper_list_with_score']?></span>
            <?php foreach($combats as $combat){ ?>
                <?php if($combat -> ippon_w != null) { ?>
                    <ul class="collapsible" data-collapsible="accordion">
                        <li>
                            <div class="collapsible-header">
                                <span style="font-weight: bold"> [<?php echo $timekeeper_text['timekeeper_phase']?>: <?php echo $combat -> fase; ?>]</span>
                                <br>
                                <div class="row">
                                    <div class="col s6">
                                        <?php echo $combat-> nombre_w .',' . $combat-> apellido1_w .' '. $combat-> apellido2_w ?>
                                    </div>
                                    <div class="col s6  indigo lighten-3">
                                        <?php echo $combat-> nombre_b .',' . $combat-> apellido1_b .' '. $combat-> apellido2_b ?>
                                    </div>
                                </div>
                            </div>
                            <div class="collapsible-body">
                                <div class="row">
                                    <div class="col s6">
                                        <table class="responsive-table">
                                            <thead>
                                            <tr>
                                                <th>I</th>
                                                <th>W</th>
                                                <th>S</th>
                                                <th>H</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td> <?php echo $combat -> ippon_w?></td>
                                                <td> <?php echo $combat -> waza_ari_w?></td>
                                                <td> <?php echo $combat -> shido_w?></td>
                                                <td> <?php echo $combat -> hansokumake_w?></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="col s6  indigo lighten-3 ">
                                        <table class="responsive-table">
                                            <thead>
                                            <tr>
                                                <th>I</th>
                                                <th>W</th>
                                                <th>S</th>
                                                <th>H</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td> <?php echo $combat -> ippon_b?></td>
                                                <td> <?php echo $combat -> waza_ari_b?></td>
                                                <td> <?php echo $combat -> shido_b?></td>
                                                <td> <?php echo $combat -> hansokumake_b?></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </li>

                    </ul>
                <?php }?>
            <?php }?>
        </div>
    </div>
</main>






