
<div id="modal-overflow" uk-modal>
    <div class="uk-modal-dialog">


        <div class="uk-modal-header">
            <h3 ><?=lang('customize_list')?></h3>
        </div>
 <ul uk-tab uk-switcher class="no-print">
                <li><a href="#"><?=lang('customize')?> </a></li>
                <li><a href="#"><?=lang('saved_table_setts')?> <span class="uk-badge">{{table_setts.length }}</span></a></li>
            </ul>
            <ul class="uk-switcher uk-margin">
                <li>
        <div class="uk-modal-body" uk-overflow-auto>
		<input class="uk-input uk-margin"  type="text" v-model="col.sett.title" >
<div class="uk-grid-small uk-grid-divider  " uk-grid>
   <div class="uk-width-1-2 no-print  ">
   
               <h4><?=lang('show_hide_cols')?></h4>

            <div class="uk-padding-small uk-text-small"><ul class="uk-list uk-list-divider">
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.isbn"> <?=lang('isbn_no')?></label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.book_number"><?=lang('book_id')?></label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.des"> <?=lang('book_details')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.note"> <?=lang('note_line')?></label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.muallif_name"> <?=lang('muallif_or_musannif')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.muhaqqiq_name"><?=lang('muhaqqiq_or_mutarjim')?>  </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.qism_name"><?=lang('cat')?>  </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.nashir_name"><?=lang('publisher')?>  </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.lang"> <?=lang('lang')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.taba_no"> <?=lang('taba_no')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.sana_taba"> <?=lang('sana_taba')?>  </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.mujallad"><?=lang('mujallad_no')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.shelf_no"> <?=lang('customize')?> </label></li>
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.raff_no"><?=lang('raff_no')?>  </label></li>	
<li><label><input type="checkbox" class="uk-checkbox" v-model="col.book_stts"> <?=lang('book_stts')?>  </label></li>
			</ul></div>
</div>
    <div class="uk-width-expand@m ">   
	               
	               <h4><?=lang('customize_export_to_word_settings')?></h4>
				   
				   <form class="uk-form-stacked">
<label class="uk-form-label"><?=lang('title')?></label>
        <div class="uk-form-controls">
            <input class="uk-input"  type="text" v-model="col.heading">
        </div>
    <div class="uk-margin">
        <label class="uk-form-label" ><?=lang('top_table_text')?></label>
        <div class="uk-form-controls">
             <textarea class="uk-textarea" v-model="col.top_text" rows="5" ></textarea>
        </div>
<label class="uk-form-label" ><?=lang('bottom_table_text')?></label>
        <div class="uk-form-controls">
             <textarea class="uk-textarea" v-model="col.bottom_text" rows="5" ></textarea>
        </div>
    </div>

    

</form>
				    
				  

        </div>
        </div>
        </div>
		<div class="uk-modal-footer uk-text-right">
            <button class="uk-button uk-button-default uk-modal-close" type="button"><?=lang('close')?></button>
            <button class="uk-button uk-button-primary" type="button" @click="save_table_sett"><?=lang('seve_new_customize')?></button>
        </div>

        </li>
        <li>
		
		<table class="uk-table uk-table-hover uk-table-small uk-table-divider">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th><?=lang('view_title')?></th>
                                <th><?=lang('options')?></th>
                                <th><?=lang('delete')?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="cd,index in table_setts">
							
                                <td>{{index+1 }}</td>
                                <td><span >{{cd.title }}</span></td>
                                
                                <td>
                                    <a title="<?=lang('edit_customize')?>" href="#" uk-switcher-item="0" @click="to_crrnt_table_sett(cd.json)" class="uk-button uk-button-primary  uk-button-small" type="button" class="uk-icon-link" ><i class="fa fa-edit"></i></a>
									<a title="<?=lang('makit_dflt')?>" href="#"  @click="set_dflt_table_sett(cd.id,cd.json)" class="uk-button uk-button-default  uk-button-small" type="button" class="uk-icon-link" ><i v-if="cd.dflt==1" class="fa fa-check-circle fa-lg uk-text-success"></i><i v-else="" class="fa fa-check uk-text-muted"></i></a>

                                 
                                <td>
                                    <a @click="del_table_sett(cd.id,index); " type="button"  class="uk-button uk-button-danger uk-button-small"><i class="fa fa-close uk-text-default"></i></a>

                                </td>
                            </tr>
                        </tbody>
                    </table>
		
		
        </li>
        </ul>

        
    </div>
</div>

  <div class="uk-grid-small " uk-grid>
   <div class="uk-width-1-4 no-print ">
       <div class="uk-card uk-card-default uk-card-body uk-padding-small">
	   <div class=" uk-float-left" v-if="!fltrs.search.q==''"><a @click="fltrs.search.q=''; search_book()" class="uk-icon-link fa fa-close "></a></div>
  <div> <strong><?=sprintf(lang('search_by_'),'')?>: </strong>{{fltrs.search.name}} <i class="fa fa-caret-down"></i></div>
  <div uk-dropdown="mode: click" class=" uk-padding-small"> 


    <ul class="uk-nav uk-dropdown-nav">
        <li class="uk-active"><a href="#" @click="fltrs.search.in='all'; fltrs.search.name='<?=lang('all')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('all'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='title'; fltrs.search.name='<?=lang('book_name')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('book_name'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='id'; fltrs.search.name='<?=lang('book_id')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('book_id'))?></a></li>
        <li class="uk-nav-divider"></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='muallif_name'; fltrs.search.name='<?=lang('muallif_or_musannif')?>';fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('muallif_or_musannif'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='muhaqqiq_name'; fltrs.search.name='<?=lang('muhaqqiq_or_mutarjim')?>';fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('muhaqqiq_or_mutarjim'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='nashir_name'; fltrs.search.name='<?=lang('publisher')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('publisher'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='taba_no'; fltrs.search.name='<?=lang('taba_no')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('taba_no'))?></a></li>
        <li class="uk-active"><a href="#" @click="fltrs.search.in='lang'; fltrs.search.name='<?=lang('lang')?>'; fltrs.page=1; search_book()"><?=sprintf(lang('search_by_'),lang('lang'))?></a></li>

    </ul>
</div>
					<input type="text" class="uk-input  uk-form-small" v-model="fltrs.search.q"  v-on:keyup.enter="fltrs.page=1; search_book();" placeholder="<?=lang('search_word')?>">
				
					
	</div>

	<div class="uk-card uk-card-default uk-card-body">
    <ul class="uk-nav-default uk-nav-parent-icon"  uk-nav="multiple: true" >
	
	
         <li class="uk-nav-divider"></li>
       <li class="uk-parent uk-active uk-open">
            <div class=" uk-float-left" v-if="!fltrs.aqsam.ids.length==0"><a @click="fltrs.aqsam.ids=[]; fltrs.page=1; search_book()" class="uk-icon-link fa fa-close "></a></div>
			<a><b><?=lang('cats')?></b></a>
            <ul class="uk-nav-sub">
			
                <li v-for="qism,index in fltrs.aqsam.rows"><label ><input @change="fltrs.page=1; search_book()" :value="qism.id" class="uk-checkbox" type="checkbox" v-model="fltrs.aqsam.ids" > {{qism.name}} <span class="uk-text-muted">({{qism.num}})</span></label></li>
            </ul>
        </li>

		
		
        

    </ul>
</div>
   
  
   
   
   
	</div>
    <div class="uk-width-expand@m">
	<div class="uk-inline loading_search_aya" style='display:none;' ><span class="uk-position-top uk-text-center" ><i class=" fa fa-spinner fa-spin fa-lg"></i></span></div>
<h3 class="uk-heading-bullet">{{col.heading}}</h3>
<div class="uk-grid-small uk-child-width-expand@s uk-section-muted  no-print" uk-grid>
    <div>
        <div class="uk-flex-righ">
		<div class="uk-button-group">
    <button class="uk-button uk-button-default  uk-button-small"><?=lang('total')?>: {{search_books.total_rows}}</button>
	
	 <button class="uk-button uk-button-default  uk-button-small" type="button"><?=sprintf(lang('export_to_'),'')?> ... <i class="fa fa-caret-down"></i></button>
    <div uk-dropdown="mode: click">
        <ul class="uk-nav uk-dropdown-nav">
            
            <li><a :href="'<?=site_url()?>/ajax/books?q=' + fltrs.search.q + '&in=' + fltrs.search.in + '&aqsam=' + JSON.stringify(fltrs.aqsam.ids) +  '&cols=' + JSON.stringify(col) +
			'&sorts=' + JSON.stringify(fltrs.sorts) + '&page=' + fltrs.page+'&export=word'">Word</a></li>
<?php if(login()): ?>           
		   <li><a :href="'<?=site_url()?>/ajax/books?q=' + fltrs.search.q + '&in=' + fltrs.search.in + '&aqsam=' + JSON.stringify(fltrs.aqsam.ids) +  '&cols=' + JSON.stringify(col) +
			'&sorts=' + JSON.stringify(fltrs.sorts) + '&page=' + fltrs.page+'&export=csv'">CSV</a></li>
           <?php endif; ?>
        </ul>
    </div>
	  
	<span class="uk-button-group">
		<a class="uk-button uk-button-default uk-button-small" <?=is(login(),' href="#modal-overflow" uk-toggle','href="#"')?> ><i class="fa fa-table"></i> <?=lang('customize_list')?> </a>
		
		<a v-if="table_setts.length>0" class="uk-button uk-button-primary uk-button-small" ><i class="fa fa-caret-down"></i></a>
		<div uk-dropdown="mode: click" v-if="table_setts.length>0"><ul class="uk-nav uk-dropdown-nav ">
       	
	   <li v-for="cd,index in table_setts" ><a  @click="to_crrnt_table_sett(cd.json)"> {{cd.title}}</a></li>
	   
		         
    </ul></div>
		
 
	</span>

	

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


      
    </div>
    
</div>
<span v-html="col.top_text"></span>	
	
 <table class="uk-table uk-table-hover uk-table-small uk-table-divider">
        <thead>
            <tr>
<th><a class="uk-link-reset" @click="sortBooks('id')" >#</a> </th>
<th><a class="uk-link-reset" @click="sortBooks('title')" > <?=lang('book_name')?></a></th>
<th v-if="col.isbn==1"> <?=lang('isbn_no')?></th>
<th v-if="col.book_number==1"> <?=lang('book_id')?></th>
<th v-if="col.des==1"> <?=lang('book_details')?> </th>
<th v-if="col.muallif_name==1"><?=lang('muallif_or_musannif')?> </th>
<th v-if="col.muhaqqiq_name==1"> <?=lang('muhaqqiq_or_mutarjim')?> </th>
<th v-if="col.qism_name==1"> <?=lang('cat')?> </th>
<th v-if="col.nashir_name==1"><?=lang('publisher')?>  </th>
<th v-if="col.lang==1"><a class="uk-link-reset" @click="sortBooks('lang')"><?=lang('lang')?> </a> </th>
<th v-if="col.taba_no==1"> <a class="uk-link-reset" @click="sortBooks('taba_no')"><?=lang('taba_no')?></a> </th>
<th v-if="col.sana_taba==1"> <a class="uk-link-reset" @click="sortBooks('sana_taba')"><?=lang('sana_taba')?></a></th>
<th v-if="col.mujallad==1"><a class="uk-link-reset" @click="sortBooks('mujallad')"> <?=lang('mujallad')?></a></th>
<th v-if="col.shelf_no==1"> <a class="uk-link-reset" @click="sortBooks('shelf_no')"><?=lang('shelf_no')?></a> </th>
<th v-if="col.raff_no==1"> <a class="uk-link-reset" @click="sortBooks('raff_no')"><?=lang('raff_no')?></a> </th>	
<th v-if="col.book_stts==1"><a class="uk-link-reset" @click="sortBooks('book_stts')"><?=lang('book_stts')?></a> </th> 
<th class="no-print"><?=lang('istiara')?></th>
            </tr>
        </thead>
        <tbody>
            <tr v-for="b,index in search_books.rows">
			
 <td>{{b.id}}</td>
 <td class="uk-table-link uk-visible-toggle"><a  href="#bookModal" uk-toggle="target: #bookModal"  @click="bookInfo(b); bookIstiarat(book.id);" class="uk-link-reset">{{b.title}} <span v-if="col.note==1 && !b.note==''" class="uk-text-muted uk-table-small" v-html="b.note"></span><i class=" fa fa-ellipsis-h uk-invisible-hover"></i></a></td>
<td v-if="col.isbn==1">{{b.isbn}}</td>
<td v-if="col.book_number==1">{{b.book_number}} </td>
<td v-if="col.des==1">{{b.des}}</td>
<td v-if="col.muallif_name==1"><a @click="fltrs.search.in='muallif_name'; fltrs.search.name='<?=lang('muallif_or_musannif')?>';fltrs.page=1; fltrs.search.q=b.muallif_name; search_book()" class="uk-link-reset">{{b.muallif_name}}</a> </td>
<td v-if="col.muhaqqiq_name==1"><a @click="fltrs.search.in='muhaqqiq_name'; fltrs.search.name='<?=lang('muhaqqiq_or_mutarjim')?>';fltrs.page=1; fltrs.search.q=b.muhaqqiq_name; search_book()" class="uk-link-reset">{{b.muhaqqiq_name}}</a></td>
<td v-if="col.qism_name==1">{{b.qism_name}}  </td>
<td v-if="col.nashir_name==1"><a @click="fltrs.search.in='nashir_name'; fltrs.search.name='<?=lang('publisher')?>';fltrs.page=1; fltrs.search.q=b.nashir_name; search_book()" class="uk-link-reset">{{b.nashir_name}}</a></td>
<td v-if="col.lang==1">{{b.lang}}  </td>
<td v-if="col.taba_no==1">{{b.taba_no}}  </td>
<td v-if="col.sana_taba==1">{{b.sana_taba}} </td>
<td v-if="col.mujallad==1">{{b.mujallad}}  </td>
<td v-if="col.shelf_no==1">{{b.shelf_no}}  </td>
<td v-if="col.raff_no==1">{{b.raff_no}}  </td>	
<td v-if="col.book_stts==1">{{b.book_stts}} </td>
<td class="no-print">
<?php if(is_right('ist_add')): ?>
                    <span v-if="b.returnd==1">
         <a class="uk-button uk-button-small uk-text-center add" style="background-color:#4caf50; color: #fff" v-if="isAdedToCart(b.id)" v-bind:id="b.id"  @click="addToCart(b)"><i  class="fa fa-circle"></i></a>
		 <button  v-else class="uk-button uk-button-default uk-button-small uk-text-center" disabled> <i  class="fa fa-check-circle fa-lg  uk-animation-slide-top"></i></button>
		
         
		
                    </span>  <button  v-else class="uk-button uk-button-default uk-button-small uk-text-center" disabled> <i  class="fa fa-circle fa-lg  uk-animation-slide-top uk-text-danger"></i></button>
					<?php else : ?> 
					<span v-if="b.returnd==1" class="uk-text-success uk-text-center">
          <?=lang('exists')?></span> 
                    </span>  <span  v-else class="uk-text-center  uk-text-danger" > <?=lang('mustaar')?></span> 
					
					<?php endif; ?>
                </td>
            </tr>
        </tbody>
    </table>
	
<center><div class="uk-section-muted uk-text-large"><pagination :records="parseInt(search_books.total_rows)" v-model="fltrs.page" :per-page="search_books.limit" @paginate="booksPaging">

  </pagination></div></center>

	</div>	
</div>

<div style=" position: fixed;z-index:10;bottom: 0px;margin-right: auto;margin-left: auto;left: 50%;transform: translate(-50%, 0);">
<div class="uk-button-group uk-animation-slide-top" v-if="cart.items.length>=1 || cart.member.length!=0" >

    <a href="#/book_cart"  class="uk-button-small uk-button uk-button-primary  "  ><i  class="fa fa-list-alt"></i>
 <?=sprintf(lang('iara_selected_books'),'<span  class="uk-label" style="background-color: #e9f3fe; color: #000"> {{cart.items.length}}')?> 
 
 <span v-if="cart.member.length!=0"><?=sprintf(lang('for'),"{{cart.member['name']}}")?></span></span> </a><button @click="cartClear()" class="uk-button uk-button-small uk-button-danger " type="button"><i class="fa fa-close"></i></button>
    </div>
	

</div>