<style>
    .solidgraytop{
        border-top-style:solid;
        border-top-color:#ddd;
    }
    .solidgrayleft{
        border-left:solid;
        border-left-width:3px;
        border-color: #ddd;
    }
    .solidgrayright{
        border-right-style:solid;
        border-right-color:#ddd;
    }
    .solidgraybottom{
        border-top-style:solid;
        border-top-color:#ddd;
    }
    .hidetop{
        border-top:hidden !important;
    }
    .fromaccountstyle{
        font-weight:bold;
        font-size:17px;
        color:blue;
    }
    .toaccountstyle
    {
        font-weight:bold;
        font-size:17px;
        color:purple;
    }
    .mytotal{
        background-color:#ddd;
        font-weight:bold;
    }
    .nodata{
        background-color: #72B4EC;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 24px;
        text-align: center;
        padding: 5px;
    }

</style>
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><strong>الارصدة الافتتاحية</strong></h3>
                <a href="{$youtubes[219]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            <div class="panel-body">
                <form class="nameToBeChecked form-horizontal" action="" method="post" id="dailyEntry_Form">
                    <table class="table table-black" >
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>اسم الحساب</th>
                                <th>مدين</th>
                                <th>دائن</th>
                            </tr>
                        </thead>
                        <tbody id="DE_Table">
                            {assign var=i value=1}
                            {foreach $allLastLeafs as $data}
                            <tr class="clearit">
                                <td class="rowNo" style="font-weight: bold">{$i}</td>
                                <td>{$data->layingOrder} {$data->customName}
                                    <input type="hidden" id="E_parent{$i}" name="E_parent{$i}" data-placeholder="اختر" class="dailyParent wdt100 select2-offscreen" value="{$data->id}"></td>
                                <td> <input name="valueFrom{$i}" type="text" id="valueFrom{$i}" data-itr="{$i}" data-id="{$data->id}" class="form-control positivefloat valueFrom updateVal" value="" placeholder="0"></td>
                                <td> <input name="valueTo{$i}" type="text" id="valueTo{$i}" data-itr="{$i}" data-id="{$data->id}" class="form-control positivefloat valueTo updateVal" value="" placeholder="0"></td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                        </tbody>
                    </table><input type="hidden" id="itr" name="itr" value="{$i}" />

                    <br/>

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



    </div>
</div>

{literal}
<script>
    $(function () {
        $('.positivefloat').forcepositivefloat();
        $('.updateVal').live('blur', function () {
            var thisIs = $(this);
            var thisid = thisIs.attr('id');
            var itr = thisIs.data('itr');
            var id = thisIs.data('id');
            var valueFrom = $('#valueFrom' + itr).val();
            var valueTo = $('#valueTo' + itr).val();
            $.ajax({
                type: 'POST',
                data: {id: id, valueFrom: valueFrom, valueTo: valueTo},
                url: 'dailyentryajax.php?do=setopeningbalance',
                success: function (data)
                {
                    if (data == 1)
                    {
                        thisIs.attr('style', 'background-color: #c5f9c5');
                    } else {
                        thisIs.attr('style', 'background-color: #ffd6d6');
                    }
                    setTimeout(function () {
                        thisIs.attr('style', 'background-color: #9be8ff');
                    }, 2000)
                }
            });
        })
    }
    )

</script>
{/literal}
