
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="partnerController.php?do=show">الشركاء</a></li>
            <li class="active">عرض الشركاء</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->

            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;">عرض الشركاء <br />
                    {if $message != ""}
                    {$message}
                    {/if}</h3>
                <a href="{$youtubes[6]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="partnerwithdrawalController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد"/></a>
            </div>


            <div class="panel-body">
                <div id="outputString" class="alert alert-block alert-success fade in hidden-print" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <p id="outputStringValue">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
                <form class="form-inline hidden-print" action="partnerwithdrawalController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">الشريك</label>
                        <select class="select2 wdt100"  name="partnerid" id="partnerid">
                            <option value="-1">اختر شريك</option>


                            {foreach $partnerData as $partner}


                            <option value="{$partner->partnerid}">{$partner->partnername}</option>


                            {/foreach}


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">الخزنة</label>
                        <select class="select2 wdt100" name="saveid" id="saveid" >
                            <option value="-1">اختر خزنة</option>


                            {foreach $saveData as $save}


                            <option value="{$save->saveid}">{$save->savename}</option>


                            {/foreach}


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">البنك</label>
                        <select class="select2 wdt100" name="bankid" id="bankid" >
                            <option value="-1">اختر البنك</option>


                            {foreach $bank as $data}


                            <option value="{$data->bankid}">{$data->bankname}</option>


                            {/foreach}


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">الحساب</label>
                        <select class="select2 wdt100" name="bankaccountid"  id="bankaccountid">
                            <option></option>
                        </select>
                    </div>

                    <div class="form-group">
                        <div class="radio-inline">
                            <label>
                                <input type="radio" name="partenrwithdrawaltype" id="partenrwithdrawaltype1" value="0" checked="checked" >
                                ايداع </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input type="radio" name="partenrwithdrawaltype" id="partenrwithdrawaltype2" value="1"  checked="checked"  >
                                سحب </label>
                        </div>

                        <div class="radio-inline">
                            <label>
                                <input type="radio" name="partenrwithdrawaltype" id="totalvalue" value="2"  checked="checked" >
                                ايداع / سحب </label>
                        </div>
                    </div>
                    <br/>
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <hr/>

            <!-- Table -->
            {literal}
            <form method="post" action="partnerwithdrawalController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                        return countChoosenProducts('partnerwithdrawalController');
                    } else {
                        return false;
                    }">
                {/literal}
                <div class="clearfix"></div>
                <div class="col-lg-offset-8 col-lg-4">

                    <div class="well well-sm">
                        <h4 class="text-center">الاجمالى {$totalall} {$currency}</h4>
                    </div>


                </div>
                <div class="clearfix"></div>
                <table class="table table-black">
                    <thead>
                        <tr>
                            <th class="hidden-print">
                                <input type="checkbox" name="checkAll" id="checkAll" />
                            </th>
                            <th>اسم الشريك</th>
                            <th>الخزنة / البنك</th>
                            <th> قيمه السحب / الايداع</th>
                            <th> نوع العمليه</th>
                            <th> قيمة الشريك قبل</th>
                            <th> قيمةالشريك بعد</th>
                            <th>التاريخ</th>
                            <th>التعليق</th>
                            <th class="hidden-print">قيد اليومية</th>
                            <th class="hidden-print">تعديل</th>
                            <th class="hidden-print">ايقاف</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $partnerwithdrawalData as $partnerwithdrawal}
                        {if {$partnerwithdrawal->conditions} eq 1}
                        <tr class="danger"> {elseif {$partnerwithdrawal->conditions} eq 0}

                        <tr>{/if}
                            {if {$partnerwithdrawal->partenrwithdrawaltype} eq 1 }
                        <tr style="background-color: aliceblue;" >{/if}
                            <td class="hidden-print">
                                <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$partnerwithdrawal->partnerwithdrawalid}" />

                            </td>
                            <td>{$partnerwithdrawal->partnername}</td>
                            <td>
                                {if $partnerwithdrawal->saveid > 0}
                                {$partnerwithdrawal->savename}
                                {else}
                                {$partnerwithdrawal->bankname} / {$partnerwithdrawal->accountname}
                                {/if}
                            </td>
                            <td>{$partnerwithdrawal->partnerwithdrawalvalue}</td>
                            {if {$partnerwithdrawal->partenrwithdrawaltype} eq 1 }
                            <td>سحب</td>
                            {else}
                            <td>ايداع</td>
                            {/if}
                            <td>{$partnerwithdrawal->partnerbefore}</td>
                            <td>{$partnerwithdrawal->partnerafter}</td>
                            <td>{$partnerwithdrawal->partnerwithdrawaldate}</td>
                            <td>{$partnerwithdrawal->comment}</td>
                            <td class="hidden-print"> <a href="dailyentry.php?id={$partnerwithdrawal->dailyentryid}" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                            <td class="hidden-print"> <a href="partnerwithdrawalController.php?do=edit&partnerwithdrawalid={$partnerwithdrawal->partnerwithdrawalid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                            <td class="hidden-print"> {if {$partnerwithdrawal->conditions} eq 0} <a href="partnerwithdrawalController.php?do=tempdelete&partnerwithdrawalid={$partnerwithdrawal->partnerwithdrawalid}&action={$partnerwithdrawal->dailyentryid}" type="button" class="btn btn-default btn-lg removeicon"></a> {elseif {$partnerwithdrawal->conditions} eq 1} <a href="partnerwithdrawalController.php?do=returndelete&partnerwithdrawalid={$partnerwithdrawal->partnerwithdrawalid}&action={$partnerwithdrawal->dailyentryid}" type="button" class="btn btn-default btn-lg correcticon"></a> {/if} </td>
                        </tr>
                        {/foreach}




                    </tbody>

                    <thead style="background:#ccc">
                        <tr>
                            <th class="hidden-print">
                                <input type="checkbox" name="checkAll" id="checkAll" />
                            </th>
                            <th>من  شريك   </th>
                            <th>الى  شريك   </th>
                            <th> قيمه </th>
                            <th> نوع العمليه</th>
                            <th> قيمة الشريك قبل</th>
                            <th> قيمةالشريك بعد</th>
                            <th>التاريخ</th>
                            <th>التعليق</th>

                            <th class="hidden-print">قيد اليومية</th>
                            <th class="hidden-print">ايقاف</th>
                            <th class="hidden-print">اضافة</th>
                        </tr>
                    </thead>
                    <tbody>

                        {foreach $partnertransferbetweenData as $partnertransferbetween}
                        {if {$partnertransferbetween->conditions} eq 1}
                        <tr class="danger"> {elseif {$partnertransferbetween->conditions} eq 0}

                        <tr >{/if}
                            <td class="hidden-print">
                                <input type="checkbox" class="choosenItem" value="{$partnertransferbetween->partnertransferbetweenid}" />

                            </td>

                            <td>{$partnertransferbetween->partneridformname}</td>
                            <td>{$partnertransferbetween->partneridtoname}</td>
                            <td>{$partnertransferbetween->partnervalue}</td>
                            <td>تحويل بين الشركاء</td>
                            <td>{$partnertransferbetween->partnerfrombefore} / {$partnertransferbetween->partnertobefore}</td>
                            <td>{$partnertransferbetween->partnerfromafter}  / {$partnertransferbetween->partnertoafter} </td>

                            <td>{$partnertransferbetween->partnerdate}</td>
                            <td>{$partnertransferbetween->comment}</td>

                            <!-- <td class="hidden-print"> {if {$partnertransferbetween->conditions} eq 0} <a href="partnerTransferBetweenController.php?do=edit&partnertransferbetweenid={$partnertransferbetween->partnertransferbetweenid}" type="button" class="btn btn-default btn-lg editicon"></a>{else} محذوف {/if}  </td> -->
                            <td class="hidden-print"> <a href="dailyentry.php?id={$partnertransferbetween->dailyentryid}" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                            <td class="hidden-print"> {if {$partnertransferbetween->conditions} eq 0} <a href="partnerTransferBetweenController.php?do=tempdelete&partnertransferbetweenid={$partnertransferbetween->partnertransferbetweenid}" type="button" class="btn btn-default btn-lg removeicon"></a> {else} محذوف {/if} </td>

                            <td><a href="partnerTransferBetweenController.php" target="_blank" type="button" class="btn btn-default btn-lm ">+</a></td>
                        </tr>
                        {/foreach}



                    </tbody>

                </table>

                <div class="clearfix"></div>
                <hr />
                <div  class="hidden-print">
                    <div class="col-lg-12">
                        <div class="well well-sm">
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <label for="operation"></label>
                                    <span id="spryselect1">
                                        <select name="operation" id="operation"  data-placeholder="اختر العملية" class="select2 wdt100">
                                            <option value="-1">اختر عملية</option>
                                            <option value="1">ايقاف</option>
                                            <option value="2">تشغيل </option>
                                        </select>
                                        <span class="selectInvalidMsg">*</span></span></div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <input name=""  class="hidden-print btn btn-primary" type="submit" value="تنفيذ"/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div id="noElementsError" class="alert alert-danger fade in" style="display:none;">
                                <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">×</button>
                                <p>يجب اختيار العناصر أولاً</p>
                                <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </form>
        </div>

    </div>

    <div  class="hidden-print">
        <div class="col-lg-12">
            <div class="form-group">
                <div class="col-lg-4">
                    <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">طباعة</button>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
    $("#bankid").live('change', function () {
        var id = $(this).val();
        $.post("projectControllerAjax.php?do=getbankaccount", {id: id}, function (data) {
            $("#bankaccountid").html(data);
        });
    });
</script>
{/literal}