<?php
include 'header.php';

require 'permission.php';
requireView('services');

include('xcrud/xcrud.php');
$xcrud = Xcrud::get_instance();
echo Xcrud::load_css(); 
?>

<div class="content-wrapper">

	<section class="content-header"><div class="container-fluid"></div></section>

	<section class="content">
		<div class="container-fluid">
			<div class="col-lg-12">
            <div class="card">
              
              <div class="card-body">
                
                <?php
				$xcrud->table('service');

				$xcrud->relation('branch_id','branch','id','name');
				$xcrud->relation('product_id','products','id','name');
				$xcrud->relation('city_id','city','id','name');				
				$xcrud->relation('institute_id','institute','id','name');
				$xcrud->relation('financer_id','financer','id','name');
				
				$xcrud->label('branch_id','Branch');
				$xcrud->label('product_id','Product');
				$xcrud->label('city_id','City');
				$xcrud->label('institute_id','Institute');
				$xcrud->label('financer_id','Financer');
				
				//$xcrud->column_callback('address', 'nowrap_column');
				
				$xcrud->column_width('address','400px');
				$xcrud->column_width('customer_name','300px');
				$xcrud->column_width('product_id,institute_id,financer_id','300px');


				$xcrud->unset_title();
				$xcrud->unset_add();
				if($_SESSION['user_type']!='admin'){
					$xcrud->unset_remove();
				}
				echo $xcrud->render();
			  ?>

                
              </div>
            </div>

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

</div>

<?php
include 'footer.php';
echo Xcrud::load_js();
?>