<style>
    li.table-block a{
        height: 185px;
    }
    .smallimg{
        width: 14px!important;
        height: 14px!important;
    }
    .select2-drop , .select2-with-searchbox, .select2-drop-active{
        z-index: 99999;
    }
    .dangerBorder{
        border: 5px solid red !important;
    }
    .offline{
        border-top: 20px solid red !important;
        <!-- color: white; -->
    }
    .online{
        background-color: #eaffe8 !important;
        border-top: 20px solid darkgreen !important;
        <!-- color: white; -->
    }
</style>

<div class="row">
    <div class="col-md-12">

        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="well well-lg wall-cgpadding resturant p0 m0 ">
            <!----Start Title Table------>

            <div class="portlet-title ">
                <div class="caption p5">
                    <img src="{$path}/assets/img/resturant/logops.ico" width="47" height="45">
                    <span class="caption-subject font  ">Playstation </span>
                    <!--<a>
                     <img src="../views/default/assets/img/resturant/exit.png" class="exit-icon" >
                    </a>-->
                    <div class="logbutton pull-right">
                        <a class=" btn-primary mgtp3 linkpad movePS">نقل بلايستيشن </a> <span class="">&nbsp;</span>
                        <a  href="sellbillController.php?do=addresBill" class=" btn-primary mgtp3 linkpad">فاتورة </a> <span class="">&nbsp;</span>
                        <a  href="savedailyController.php" class=" btn-primary mgtp3 linkpad">يومية الخزنة </a> <span class="">&nbsp;</span>
                        <!--a  href="#" class=" btn-primary mgtp3 linkpad">إضافة فاتورة </a> <span class="">&nbsp;</span-->
                        <a  href="logout.php" class=" btn-danger mgtp3 linkpad">خروج </a> <span class="">&nbsp;</span>
                        {if $Usergroupdata->homePageIcon == 1}
                        <a  href="index.php"><img src="{$path}/assets/img/whieHomePage.jpg" style="height: 22px;width: 22px"/></a> <span class="">&nbsp;</span>
                        {/if}
                    </div>
                </div>
            </div>

            <div class="portlet-body ">

                <!--======================Start table-screen=====================-->
                <div class="table-screen">
                    <div class="row">
                        <div class="col-xs-12">
                            <ul id="allPlaystationsUL">
                                <!--{*$ps->startsysDate|date_format:'%Y-%m-%d %H:%M:%S'*}-->
                                {foreach $allRestaurantPlaystation as $ps}

                                {if $ps->del == 0}
                                <!--table-->
                                <li class="table-block table-active {if $ps->beingUsed == 1}closePlayStation statusIsOpen{else}openPlayStation statusIsClosed{/if}" id="ps{$ps->id}" data-id="{$ps->id}" data-name="{$ps->name}" data-hour-price="{$ps->hourPrice}" data-beingused="{$ps->beingUsed}" data-type="{$ps->reservationType}" data-end="{$ps->reservationEndDateTime}" data-identification="{$ps->deviceIdentification}" data-sub-identification="{$ps->subDeviceIdentification}" data-use-sub-identification="{$ps->useSubIdentification}" data-priceis="{$ps->priceIs}">
                                    <!-- <button onclick="switchon('{$ps->subDeviceIdentification}','{$ps->deviceIdentification}' , '{$ps->id}')">ON</button> -->
                                    <!-- <button onclick="switchOFF('{$ps->subDeviceIdentification}','{$ps->deviceIdentification}','{$ps->id}')">OFF</button> -->
                                    <a {if $ps->beingUsed == 1 && $ps->reservationType == 1 && $now > $ps->reservationEndDateTime}class="dangerBorder"{/if}>


                                        <!-- <div style="font-size:11px;color:green">online</div> -->
                                        {if $ps->beingUsed == 1}

                                        <img src="../views/default/assets/img/resturant/ps-active.png" id="img{$ps->id}">
                                        {else}
                                        <img src="../views/default/assets/img/resturant/ps-deactive.png" id="img{$ps->id}">

                                        {/if}
                                        <h5 id="title{$ps->id}">{if $ps->beingUsed != 1&&$ps->id >0}فتح{/if} {$ps->name}</h5>
                                        <h5 id="hourPrice{$ps->id}" style="direction: ltr">
                                            <span id="priceIs{$ps->id}">{if $ps->priceIs == 0}{$ps->hourPrice}/h
                                                {else}{$ps->hourPriceMulti}/h {/if}
                                            </span>
                                            <img id="timerImage{$ps->id}" class="smallimg" src="../views/default/assets/img/stopwatch.png" style="{if $ps->reservationType == 1}{else}display: none;{/if}"/>
                                            <img id="multiImage{$ps->id}" class="smallimg" src="../views/default/assets/img/2person.png" style="{if $ps->priceIs == 1}{else}display: none;{/if}"/>
                                        </h5>
                                        <h5>&nbsp<span id="startTime{$ps->id}">{$ps->startsysDate|date_format:'%H:%M'}</span></h5>
                                        <h5>&nbsp<span id="timer{$ps->id}"></span></h5>

                                    </a>

                                </li>


                                {/if}
                                <!--table-->
                                {/foreach}
                            </ul>
                        </div>
                    </div>

                </div>
                <!--======================End table-screen=====================-->

                <!--======================Start home-screen=====================-->
                <!---start product-menu-->

                <div id="printPlaystationPlayDiv" style="display: none">

                </div>
                <!--======================End home-screen=====================-->

            </div>

        </div>
    </div>
</div>
<!-- ======================= accountstree Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="openPlayModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">
                    <label id="openPlayModalTitle"></label>
                </h4>
            </div>
            <div class="modal-body" style="max-height: 400px;">
                <form id="reservationInfo" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-lg-3 control-label">الحجز</label>
                        <div class="col-lg-6">
                            <div class="radio-inline">
                                <label>  <input value="0" checked class="priceIs" name="priceIs" id="priceIs0" type="radio">
                                    فردى</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="priceIs" name="priceIs" id="priceIs1" type="radio">
                                    زوجى</label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">النوع</label>
                        <div class="col-lg-6">
                            <div class="radio-inline">
                                <label>  <input value="0" checked class="theType" name="theType" id="theType0" type="radio">
                                    مفتوح</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="theType" name="theType" id="theType1" type="radio">
                                    بوقت</label>
                            </div>
                        </div>
                    </div>
                    <div id="reservationTime" style="display:none">
                        <div class="form-group">
                            <label class="col-lg-3 control-label">عدد الساعات</label>
                            <div class="col-lg-6">
                                <input type="number" name="hoursResrvation" id="hoursResrvation" value="" class="form-control positiveNo" autocomplete="off">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">عدد الدقائق</label>
                            <div class="col-lg-6">
                                <input type="number" name="minutesResrvation" id="minutesResrvation" value="" class="form-control positiveNo" autocomplete="off">
                            </div>
                        </div>
                    </div>
                    <input type="hidden" name="openPSid" id="openPSid" value=""/>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary" id="startReservation">بدء الحجز</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->
<!-- ======================= accountstree Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="endPlayModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">
                    <label id="endPlayModalTitle"></label>
                </h4>
            </div>
            <div class="modal-body" style="max-height: 400px;">
                <form id="endPlayInfo" action="restaurantplaystationpaly.php?do=endplaystationplay" method="post" class="form-horizontal">

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">اغلاق</button>
                <button type="button" class="btn btn-primary endbill" data-print="0" data-end-restaurant-table="0" id="endbill">حفظ</button>
                <button type="button" class="btn btn-primary endbill" data-print="1" data-end-restaurant-table="0" id="endbillandprint">حفظ و طباعة</button>
                <button type="button" class="btn btn-primary endbill" data-print="1" data-end-restaurant-table="1" id="endbillAndRestaurantTableandprint">حفظ البلايستيشن والطاولة</button>
                <a class="btn btn-success" id="endbillWithCard">دفع بالكارت</a>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->
<!-- ======================= accountstree Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="movePlayModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">
                    <label id="movePlayModalTitle">نقل بلاى ستيشن</label>
                </h4>
            </div>
            <div class="modal-body" style="max-height: 400px;">
                <form id="movePlayInfo" action="restaurantplaystationpaly.php?do=moveplaystationplay" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-lg-3 control-label">من</label>
                        <div class="col-lg-6">
                            <input type="hidden" name="fromDevice" id="fromDevice" value=""/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">الى</label>
                        <div class="col-lg-6">
                            <input type="hidden" name="toDevice" id="toDevice" value=""/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">الحجز</label>
                        <div class="col-lg-6">
                            <input type="hidden" name="oldFromDevicePriceIs" id="oldFromDevicePriceIs" value=""/>
                            <div class="radio-inline">
                                <label>  <input value="0" checked="" class="newFromDevicePriceIs" name="newFromDevicePriceIs" id="newFromDevicePriceIs0" type="radio">
                                    فردى</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="newFromDevicePriceIs" name="newFromDevicePriceIs" id="newFromDevicePriceIs1" type="radio">
                                    زوجى</label>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="cancel" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary" id="movePSNow">نقل</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->
<div class="modal fade in" id="myclientModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left savemodel2" onclick="closeClientForm()" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">اضافة عميل</h4>
            </div>
            <div class="modal-body" style="max-height: 370px;">
                <form id="clientInfomain" action="#" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label for="newclientName" class="col-lg-2 control-label">اسم العميل</label>
                        <div class="col-lg-4">
                            <input class="form-control" placeholder="اسم العميل" id="newclientName" name="newclientName" type="text" required="required" autocomplete="off">


                            <div id="nameError"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientphone" class="col-lg-2 control-label">رقم التليفون</label>
                        <div class="col-lg-4">
                            <input value="" class="form-control numberinput" placeholder="رقم التليفون" {if $Programsettingdata->clientfieldrequired eq 1} required="required"  {/if} id="clientphone" name="clientphone" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientmobile" class="col-lg-2 control-label">رقم الموبايل</label>
                        <div class="col-lg-4">
                            <input class="form-control " placeholder="رقم الموبايل"  {if $Programsettingdata->clientfieldrequired eq 1} required="required"  {/if} id="clientmobile" name="clientmobile" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientaddress" class="col-lg-2 control-label">العنوان</label>
                        <div class="col-lg-4">
                            <input class="form-control" placeholder="العنوان" id="clientaddress" {if $Programsettingdata->clientfieldrequired eq 1} required="required"  {/if} name="clientaddress" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientdetails" class="col-lg-2 control-label">عنوان 2 </label>
                        <div class="col-lg-4">
                            <textarea class="form-control" rows="3" name="clientdetails" {if $Programsettingdata->clientfieldrequired eq 1} required="required"  {/if}  id="clientdetails"></textarea>
                        </div>
                    </div>


                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default savemodel2" onclick="closeClientForm()" data-dismiss="modal">لا</button>
                <button type="button" class="btn btn-primary savemodel1" >نعم</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<div class="modal fade in" id="myclientDataModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left savemodel2" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">بيانات العميل للفاتورة</h4>
            </div>
            <div class="modal-body">
                <form id="clientInfoDatamain" action="#" method="post" class="form-horizontal">
                    <table style="width: 100%">
                        <thead>
                            <tr>
                                <td>الدين الحالى</td>
                                <td style="width:10%"></td>
                            </tr>
                        </thead>
                        <tbody id="clientdebtTBody">
                            <tr>
                                <td id="clientdebtCell"></td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>
                    <table style="width: 100%">
                        <thead>
                            <tr>
                                <td>التليفونات</td>
                                <td style="width:10%"></td>
                            </tr>
                        </thead>
                        <tbody id="clientphoneTBody">

                        </tbody>
                    </table>
                    <table style="width: 100%">
                        <thead>
                            <tr>
                                <td>العناوين</td>
                                <td style="width:10%"></td>
                            </tr>
                        </thead>
                        <tbody id="clientAddressTBody">

                        </tbody>
                    </table>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default savemodel2" data-dismiss="modal">اغلاق</button>
                <button type="button" class="btn btn-primary savemodel1Data" >نعم</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<input type="hidden" name="printPlaystationPlay" id="printPlaystationPlay" value="{$printPlaystationPlay}"/>
<input type="hidden" name="printPlaystationPlayOrderId" id="printPlaystationPlayOrderId" value="{$printPlaystationPlayOrderId}"/>
