

    <div class="col-md-12">
        {if $smarty.session.role_id eq 3 || $smarty.session.role_id eq 1 || $smarty.session.role_id eq 12 || $smarty.session.role_id eq 5 || $smarty.session.role_id neq 0}
        <div class="col-md-6">
            <a class="btn red-soft addnewindex wds97 fright" id="pulsate-regular" href="{$hosturl}/controllers/patients.php">إضافة مريضة جديدة</a>
        </div>
        <div class="col-md-6">
            <a class="btn btn-success addnewindex wds97 fright" href="{$hosturl}/controllers/visits.php">إضافة زيارة جديدة</a>
        </div>
        {/if}

        <div class="clearfix"></div>

        <div class="portlet box blue wds98 fright">
            <div class="portlet-title">
                <div class="caption txtc fright">
                    زيارات  اليوم
                </div>
            </div>
            {if $programesetting->entryorder == 1 }
            <div class="portlet-body mp0">
                <div class=" mxhitx_new" data-always-visible="1" data-rail-visible="0">
                    {if $allvisit}
                    <u id="sortable" class="list-group">
                        {assign var=i value=1}
                        {foreach $allvisit as $key=>$value}
                        {if $value->view == 1}
                        <li id="item_{$value->id}"  class="ainli blue visitDone">
                            {else}
                        <li id="item_{$value->id}">

                            {/if}

                            <span  style="float: right; width: 50px; font-weight: bold">  {$i}</span>
                            <span  class="vtype">{$value->detectionType}</span>

                            <span  class="vtype">{$value->statusno}</span>
                            <a data-id="{$value->id}"   {if $loginPosition != 3} class="visitviewed"   href="{$hosturl}/controllers/{if !empty($value->go)}{$value->go}.php?ac=index&{else}patienthistory.php?ac=show&{/if}patientid={$value->patientID}" {/if}>{$value->patientName}</a>


                        </li>

                        {capture assign=i}{$i+1}{/capture}
                        {/foreach}
                        <div class="clearfix"></div>
                    </u>
                    {else}
                    <p class="novisitlonger">    لا توجد زيارات بعد</p>
                    {/if}

                </div>
            </div>
            {else}
            {/if}
            {if $smarty.session.role_id eq 3 || $smarty.session.role_id eq 1}


            <div class="portlet-body mp0">
                <div class=" mxhitx_new" data-always-visible="1" data-rail-visible="0">
                    {if $allvisit|@count gt 0}

                    <a href="javascript:;" class="btn green show_only_his" data-no="0">الكل</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="4">عياده النساء</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="8">عياده الذكوره</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="5">معمل الاشعه</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="11">معمل الاجنه</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="12">معمل التحاليل</a>
                    <a href="javascript:;" class="btn green show_only_his" data-no="13">عمليات اليوم</a>

                    <div class="clearfix"></div>

                    <ul class="list-group">
                        {assign var=i value=1}{assign var=link_is value='index.php?'}
                        {foreach $allvisit as $key=>$value}


                        {if $value->for_department eq 3}
                        {capture assign=link_is}patients.php?ac=edit&{/capture}
                        {else}

                        <!--{if $value->for_husband eq 1}
                                        {capture assign=link_is}and_history.php?ac=index&{/capture}
                                        {else}
                                        {capture assign=link_is}patienthistory.php?ac=show&{/capture}
                                        {/if}-->
                        {capture assign=link_is}patients.php?ac=edit&{/capture}


                        {/if}



                        {if $value->for_department eq 4}

                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_4 vi_all">
                            <div class="col-md-1 text-center">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>

                        </li>

                        {else}



                        <li class="entervisitors dep_for_4 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}

                        {elseif $value->for_department eq 5}

                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_5 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {else}

                        <li class="entervisitors dep_for_5 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}

                        {elseif $value->for_department eq 8}


                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_8 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {else}

                        <li class="entervisitors dep_for_8 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}

                        {elseif $value->for_department eq 11}

                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_11 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {else}

                        <li class="entervisitors dep_for_11 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}

                        {elseif $value->for_department eq 12}

                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_12 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {else}

                        <li class="entervisitors dep_for_12 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}


                        {elseif $value->for_department eq 13}

                        {if $value->view == 1}
                        <li class="entervisitors visitDone dep_for_13 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {else}

                        <li class="entervisitors dep_for_13 vi_all">
                            <div class="col-md-1 text-center hidden">
                                <span  style="font-weight: bold;"> {$i}</span>
                            </div>
                            <div class="col-md-4">
                                <a data-id="{$value->id}" class="visitviewed"   href="{$hosturl}/controllers/{$link_is}id={$value->patientID}">{$value->patientName}</a>
                            </div>
                            <div class="col-md-1">
                                <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                            </div>
                            <div class="col-md-3">
                                <span  class="vtype">{$value->detectionType}</span>
                            </div>
                        </li>

                        {/if}


                        {/if}


                        {capture assign=i}{$i+1}{/capture}
                        {/foreach}
                    </ul>
                    {else}
                    <p class="novisitlonger">    لا توجد زيارات بعد</p>
                    {/if}
                </div>
            </div>
        </div>

        {else}
        <div class="portlet-body mp0">
            {if $allvisit_for|@count gt 0}

            {if $smarty.session.role_id eq 4}
            <a href="javascript:;" class="btn green show_only_his" data-no="4">عياده النسا</a>
            <a href="javascript:;" class="btn green show_only_his" data-no="13">عمليات اليوم</a>
            <div class="clearfix"></div>
            {/if}

            <ul class="list-group">
                {assign var=i value=1}{assign var=link_is value='index.php?'}
                {foreach $allvisit_for as $key=>$value}

                {if $value->for_department eq 12}
                {capture assign=link_is}invsdept.Php?ac=index&patientid={/capture}
                {elseif $value->for_department eq 5}
                <!--raysdept.php?ac=index&patientid=-->
                {capture assign=link_is}raysdept.php?ac=index&patientid={/capture}
                {elseif $value->for_department eq 8}
                {capture assign=link_is}and_visits.php?ac=index&patientid={/capture}
                {elseif $value->for_department eq 4}
                {capture assign=link_is}patienthistory.php?ac=show&patientid={/capture}
                {elseif $value->for_department eq 13}
                {capture assign=link_is}patienthistory.php?ac=show&patientid={/capture}
                {elseif $value->for_department eq 11}
                {capture assign=link_is}patienthistory.php?ac=show&patientid={/capture}
                {elseif $value->for_department eq 2}
                {capture assign=link_is}receipt.php?ac=show&patientid={/capture}
                {/if}



                {if $value->for_department eq 13}
                <!-- operation department -->

                {if $value->view == 1}
                <li class="entervisitors visitDone dep_for_{$value->for_department} vi_all" style="display: none;">
                    <div class="col-md-1 text-center hidden">
                        <span  style="font-weight: bold;"> {$i}</span>
                    </div>
                    <div class="col-md-4">
                        <a data-id="{$value->id}"   class="visitviewed"   href="{$hosturl}/controllers/{$link_is}{$value->patientID}" >{$value->patientName}</a>
                    </div>
                    <div class="col-md-1">
                        <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->detectionType}</span>
                    </div>
                </li>

                {else}
                <li class="entervisitors dep_for_{$value->for_department} vi_all" style="display: none;">
                    <div class="col-md-1 text-center hidden">
                        <span  style="font-weight: bold;"> {$i}</span>
                    </div>
                    <div class="col-md-4">
                        <a data-id="{$value->id}"  class="visitviewed"   href="{$hosturl}/controllers/{$link_is}{$value->patientID}" >{$value->patientName}</a>
                    </div>
                    <div class="col-md-1">
                        <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->for_department_name} {if !empty($value->operation_time) }<!--({$value->operation_time})-->{/if}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->detectionType}</span>
                    </div>

                </li>

                {/if}

                {else}


                {if $value->view == 1}
                <li class="entervisitors visitDone dep_for_{$value->for_department} vi_all">
                    <div class="col-md-1 text-center hidden">
                        <span  style="font-weight: bold;"> {$i}</span>
                    </div>
                    <div class="col-md-5">
                        <a data-id="{$value->id}"   class="visitviewed" href="{$hosturl}/controllers/{$link_is}{$value->patientID}" >{$value->patientName}</a>
                    </div>
                    <div class="col-md-2">
                        <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->detectionType}</span>
                    </div>

                </li>

                {else}
                <li class="entervisitors dep_for_{$value->for_department} vi_all">
                    <div class="col-md-1 text-center hidden">
                        <span  style="font-weight: bold;"> {$i}</span>
                    </div>
                    <div class="col-md-5">
                        <a data-id="{$value->id}"   class="visitviewed"   href="{$hosturl}/controllers/{$link_is}{$value->patientID}">{$value->patientName}</a>
                    </div>
                    <div class="col-md-2">
                        <span  class="vtype" style="border-radius: 0; border-right: 1px solid #333; border-left: 1px solid #333; ">{$value->statusno}</span>
                    </div>
                    <div class="col-md-3">
                        <span  class="vtype">{$value->detectionType}</span>
                    </div>

                </li>

                {/if}


                {/if}
                {capture assign=i}{$i+1}{/capture}
                {/foreach}
            </ul>
            {else}
            <p class="novisitlonger">    لا توجد زيارات بعد</p>
            {/if}
        </div>
    </div>
    {/if}


