<?php echo $this->load->view('settings/partials/header') ?>
<?php
$typeOptions = array('kitchen' => $this->lang->line('kitchen'), 'bar' => $this->lang->line('bar'), 'bakery' => $this->lang->line('bakery'), 'drinks' => $this->lang->line('drinks'));
$taxOptions = array('0' => 'None', '2' => 'Default', '3' => 'Category', '4' => 'Menu', '5' => 'Selection');
$discountOptions = array('0' => 'None', '2' => 'Default', '3' => 'Disc Plan', '4' => 'Category', '5' => 'Menu', '6' => 'Selection');
$statusOptions = array('3' => $this->lang->line('active'), '2' => $this->lang->line('inactive'));
$onlineOptions = array('3' => $this->lang->line('yes'), '2' => $this->lang->line('no'));
$printOption = array('1' => 'Papadam & Chutney', '2' => 'Appetizer', '3' => 'Starters', '4' => 'Tandoori Dish', '5' => 'Main Dish', '6' => 'Kids Meals', '7' => 'Side Dishes', '8' => 'Sundries', '9' => 'Rice', '10' => 'Naan', '11' => 'Set Meals', '12' => 'English Dish', '13' => 'Desserts', '14' => 'Drinks','16'=>'Kebab','17'=>'Pizza','18'=>'Noodles','19'=>'Soup','20'=>'Sandwiches','21'=>'Burgers','22'=>'Wrap');
?>
<div class="window-content">
    <div class="page-loader" style="display: none;"></div>
    <div class="pane-group">

        <?php if (!empty($categories)): ?>
            <table class="report-table text-center">
                <?php if ($this->session->userdata('group') <= 4): ?>
                    <caption><?php echo $this->lang->line('menu_quick_edit') ?></caption>
                <?php else: ?>
                    <caption onclick="zamanEposNavigator('', '<?php echo $refresh ?>', 'menuIndex')"><?php echo $this->lang->line('menu') ?></caption>
                <?php endif; ?>
                <tr class="table-bg">
                    <th class="text-left" style="padding-left: 10px;"><?php echo $this->lang->line('title') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('code') ?></th> 
                    <th class="text-center"><?php echo $this->lang->line('type') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('unit') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('tax') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('discount') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('in') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('out') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('status') ?></th>
                    <th class="text-center"><span class="icon icon-eye"></span><span><?php echo $this->lang->line('menu') ?></span></th>
                </tr>
                <?php foreach ($categories as $acategory): ?>
                    <?php $mymenus = $menus[$acategory->id] ?>
                    <tr>
                        <td class="text-left" style="padding-left: 10px;">
                            <?php if ($this->session->userdata('group') <= 4): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_title" . $acategory->id ?>')" data-type="text" id="category_title<?php echo $acategory->id ?>" data-name="title" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update title">
                                    <?php echo $acategory->title ?>
                                </a>
                            </td>
                        <?php else: ?>
                            <?php echo $acategory->title ?>
                        <?php endif; ?>
                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_code" . $acategory->id ?>')" data-type="text" id="category_code<?php echo $acategory->id ?>" data-name="code" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Code">
                                    <?php echo $acategory->code ? $acategory->code : '---' ?>
                                </a>
                            <?php else: ?>
                                <?php echo $acategory->code ? $acategory->code : '---' ?>
                            <?php endif; ?>
                        </td> 

                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_type" . $acategory->id ?>')" data-type="select" id="category_type<?php echo $acategory->id ?>" data-name="type" data-value="<?php echo $acategory->type ?>" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Type">
                                    <?php echo $typeOptions[$acategory->type] ?>
                                </a>
                            <?php else: ?>
                                <?php echo $typeOptions[$acategory->type] ?>
                            <?php endif; ?>
                        </td>

                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_unit" . $acategory->id ?>')" data-type="select" id="category_unit<?php echo $acategory->id ?>" data-name="unit" data-value="<?php echo $acategory->unit ?>" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Unit">
                                    <?php echo $acategory->unit ?>
                                </a>
                            <?php else: ?>
                                <?php echo $acategory->unit ?>
                            <?php endif; ?>
                        </td>
                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_tax" . $acategory->id ?>')" data-type="text" id="category_tax<?php echo $acategory->id ?>" data-name="tax" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Tax">
                                    <?php echo $acategory->tax ?>
                                </a><span>%</span>
                            <?php else: ?>
                                <?php echo $acategory->tax ?><span>%</span>
                            <?php endif; ?>
                        </td>
                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_discount" . $acategory->id ?>')" data-type="text" id="category_discount<?php echo $acategory->id ?>" data-name="discount" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Discount">
                                    <?php echo $acategory->discount ?>
                                </a><span>%</span>
                            <?php else: ?>
                                <?php echo $acategory->discount ?><span>%</span>
                            <?php endif; ?>
                        </td>

                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_inline" . $acategory->id ?>')" data-type="select" id="category_inline<?php echo $acategory->id ?>" data-name="inline" data-value="<?php echo $acategory->inline ?>" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update show">
                                    <?php echo $onlineOptions[$acategory->inline] ?>
                                </a>
                            <?php else: ?>
                                <?php echo $onlineOptions[$acategory->inline] ?>
                            <?php endif; ?>
                        </td>

                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_online" . $acategory->id ?>')" data-type="select" id="category_online<?php echo $acategory->id ?>" data-name="online" data-value="<?php echo $acategory->online ?>" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Discount">
                                    <?php echo $onlineOptions[$acategory->online] ?>
                                </a>
                            <?php else: ?>
                                <?php echo $onlineOptions[$acategory->online] ?>
                            <?php endif; ?>
                        </td>



                        <td class="text-center">
                            <?php if ($this->session->userdata('group') <= 5): ?>
                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"category_status" . $acategory->id ?>')" data-type="select" id="category_status<?php echo $acategory->id ?>" data-name="status" data-value="<?php echo $acategory->status ?>" data-pk="<?php echo $acategory->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menucategory') ?>" data-title="Update Discount">
                                    <?php echo $statusOptions[$acategory->status] ?>
                                </a>
                            <?php else: ?>
                                <?php echo $statusOptions[$acategory->status] ?>
                            <?php endif; ?>
                        </td>
                        <td class="text-center">
                            <a>
                                <?php if (!empty($mymenus)): ?>
                                    <span class="icon icon-eye" onclick="zamanEposBlockHideAndShow('categoryBlock-<?php echo $acategory->id ?>')"></span>
                                <?php else: ?>
                                    <span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_menus_yet_assigned') ?>', '<?php echo $this->lang->line('close') ?>')"></span>
                                <?php endif; ?>
                            </a>
                        </td>
                    </tr>
                    <?php if (!empty($mymenus)): ?>
                        <tr id="categoryBlock-<?php echo $acategory->id ?>" style="display: none;">
                            <td colspan="10" class="booking-bg">
                                <table class="report-table text-center">
                                    <caption onclick="zamanEposBlockHideAndShow('categoryBlock-<?php echo $acategory->id ?>')"><?php echo $acategory->title . '-' . $this->lang->line('menus') ?>&nbsp;&nbsp;<span class="icon icon-cancel"></span></caption>
                                    <tr class="table-bg">
                                        <th class="text-left" style="padding-left: 10px;"><?php echo $this->lang->line('title') ?></th>
                                        <th class="text-center">Print inside</th>
                                        <th class="text-center"><?php echo $this->lang->line('code') ?></th> 
                                        <th class="text-center"><?php echo $this->lang->line('base') ?></th>
                                        <th class="text-left"><?php echo $this->lang->line('in') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('out') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('discount') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('d_plan') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('tax') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('t_plan') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('in') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('out') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('status') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('toppings') ?></th>
                                        <th class="text-center"><?php echo $this->lang->line('modifiers') ?></th>
                                        <th class="text-center"><span class="icon icon-eye"></span><span><?php echo $this->lang->line('selection') ?></span></th>
                                    </tr>
                                    <?php foreach ($mymenus as $amenu): ?>
                                        <?php $myselections = $selections[$amenu->id] ?>
                                        <tr>
                                            <td class="text-left" style="padding-left: 10px;">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_title" . $amenu->id ?>')" data-type="text" id="menu_title<?php echo $amenu->id ?>" data-name="title" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update title">
                                                        <?php echo $amenu->title ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->title ?>
                                                <?php endif; ?>
                                            </td>
                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_printat" . $amenu->id ?>')" data-type="select" id="menu_printat<?php echo $amenu->id ?>" data-name="printat" data-value="<?php echo $amenu->printat ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $printOption[$amenu->printat] ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $printOption[$amenu->printat] ?>
                                                <?php endif; ?>
                                            </td>
                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_code" . $amenu->id ?>')" data-type="text" id="menu_code<?php echo $amenu->id ?>" data-name="code" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->code ? $amenu->code : '---' ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->code ? $amenu->code : '---' ?>
                                                <?php endif; ?>
                                            </td> 
                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_base_price" . $amenu->id ?>')" data-type="text" id="menu_base_price<?php echo $amenu->id ?>" data-name="base_price" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->base_price ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->base_price ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-left">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_in_price" . $amenu->id ?>')" data-type="text" id="menu_in_price<?php echo $amenu->id ?>" data-name="in_price" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->in_price ?> 
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->in_price ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_out_price" . $amenu->id ?>')" data-type="text" id="menu_out_price<?php echo $amenu->id ?>" data-name="out_price" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->out_price ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->out_price ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_disocunt" . $amenu->id ?>')" data-type="text" id="menu_disocunt<?php echo $amenu->id ?>" data-name="discount" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->discount ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->discount ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menudiscount_option" . $amenu->id ?>')" data-type="select" id="menudiscount_option<?php echo $amenu->id ?>" data-name="discount_option" data-value="<?php echo $amenu->discount_option ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update Discount">
                                                        <?php echo $discountOptions[$amenu->discount_option] ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $discountOptions[$amenu->discount_option] ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_tax" . $amenu->id ?>')" data-type="text" id="menu_tax<?php echo $amenu->id ?>" data-name="tax" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $amenu->tax ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $amenu->tax ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menutax_option" . $amenu->id ?>')" data-type="select" id="menutax_option<?php echo $amenu->id ?>" data-name="tax_option" data-value="<?php echo $amenu->tax_option ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update Tax">
                                                    <?php echo $taxOptions[$amenu->tax_option] ?>
                                                </a>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_inline" . $amenu->id ?>')" data-type="select" id="menu_inline<?php echo $amenu->id ?>" data-name="inline" data-value="<?php echo $amenu->inline ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $onlineOptions[$amenu->inline] ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $onlineOptions[$amenu->inline] ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_online" . $amenu->id ?>')" data-type="select" id="menu_online<?php echo $amenu->id ?>" data-name="online" data-value="<?php echo $amenu->online ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $onlineOptions[$amenu->online] ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $onlineOptions[$amenu->online] ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($this->session->userdata('group') <= 5): ?>
                                                    <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"menu_status" . $amenu->id ?>')" data-type="select" id="menu_status<?php echo $amenu->id ?>" data-name="status" data-value="<?php echo $amenu->status ?>" data-pk="<?php echo $amenu->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menu') ?>" data-title="Update code">
                                                        <?php echo $statusOptions[$amenu->status] ?>
                                                    </a>
                                                <?php else: ?>
                                                    <?php echo $statusOptions[$amenu->status] ?>
                                                <?php endif; ?>
                                            </td>

                                            <td class="text-center">
                                                <?php if ($amenu->has_topping == 3): ?>
                                                    <span class="icon icon-eye" onclick="attrPopup('menuToppingPopup', '75%', '<?php echo $amenu->category ?>', '<?php echo $amenu->id ?>', '0', '0', '<?php echo site_url('menu/topping') ?>')"></span>
                                                <?php else: ?>
                                                    <span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_toppings_yet_assigned') ?>', '<?php echo $this->lang->line('close') ?>')"></span>
                                                <?php endif; ?>
                                            </td>
                                            <td class="text-center">
                                                <?php if ($amenu->has_modifier == 3): ?>
                                                    <span class="icon icon-eye" onclick="attrPopup('menuModifierPopup', '75%', '<?php echo $amenu->category ?>', '<?php echo $amenu->id ?>', '0', '0', '<?php echo site_url('menu/itemmodifier') ?>')"></span>
                                                <?php else: ?>
                                                    <span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_modifiers_yet_assigned') ?>', '<?php echo $this->lang->line('close') ?>')"></span>
                                                <?php endif; ?>
                                            </td>
                                            <?php if (!empty($myselections)): ?>
                                                <td class="text-center"><span class="icon icon-eye" onclick="zamanEposBlockHideAndShow('<?php echo 'menuBlock-' . $amenu->id ?>')"></span></td>
                                            <?php else: ?>
                                                <td class="text-center"><span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_selections_yet_assigned') ?>', '<?php echo $this->lang->line('ok') ?>')"></span></td>
                                            <?php endif; ?>
                                        </tr>
                                        <?php if (!empty($myselections)): ?>
                                            <tr id="menuBlock-<?php echo $amenu->id ?>" style="display: none;">
                                                <td colspan="16">
                                                    <table class="report-table text-center">
                                                        <caption onclick="zamanEposBlockHideAndShow('menuBlock-<?php echo $amenu->id ?>')"><?php echo $amenu->title . '-' . $this->lang->line('selections') ?>&nbsp;&nbsp;<span class="icon icon-cancel"></span></caption>
                                                        <tr class="table-bg">
                                                            <th class="text-left"><?php echo $this->lang->line('title') ?></th>
                                                            <th class="text-center">Print inside</th>
                                                            <th class="text-center"><?php echo $this->lang->line('code') ?></th> 
                                                            <th class="text-center"><?php echo $this->lang->line('base') ?></th>
                                                            <th class="text-left"><?php echo $this->lang->line('in') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('out') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('discount') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('d_plan') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('tax') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('t_plan') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('in') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('show') . ' ' . $this->lang->line('out') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('status') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('toppings') ?></th>
                                                            <th class="text-center"><?php echo $this->lang->line('modifiers') ?></th>
                                                        </tr>
                                                        <?php foreach ($myselections as $asel): ?>
                                                            <tr>
                                                                <td class="text-left">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_title" . $asel->id ?>')" data-type="text" id="sel_title<?php echo $asel->id ?>" data-name="title" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update title">
                                                                            <?php echo $asel->title ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->title ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_printat" . $asel->id ?>')" data-type="select" id="sel_printat<?php echo $asel->id ?>" data-name="printat" data-value="<?php echo $asel->printat ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $printOption[$asel->printat] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $printOption[$asel->printat] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_code" . $asel->id ?>')" data-type="text" id="sel_code<?php echo $asel->id ?>" data-name="code" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->code ? $asel->code : '---' ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->code ? $asel->code : '---' ?>
                                                                    <?php endif; ?>
                                                                </td> 
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_base_price" . $asel->id ?>')" data-type="text" id="sel_base_price<?php echo $asel->id ?>" data-name="base_price" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->base_price ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->base_price ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-left">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_in_price" . $asel->id ?>')" data-type="text" id="sel_in_price<?php echo $asel->id ?>" data-name="in_price" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->in_price ?> 
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->in_price ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_out_price" . $asel->id ?>')" data-type="text" id="sel_out_price<?php echo $asel->id ?>" data-name="out_price" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->out_price ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->out_price ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_disocunt" . $asel->id ?>')" data-type="text" id="sel_disocunt<?php echo $asel->id ?>" data-name="discount" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->discount ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->discount ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"seldiscount_option" . $asel->id ?>')" data-type="select" id="seldiscount_option<?php echo $asel->id ?>" data-name="discount_option" data-value="<?php echo $asel->discount_option ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update Discount">
                                                                            <?php echo $discountOptions[$asel->discount_option] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $discountOptions[$asel->discount_option] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_tax" . $asel->id ?>')" data-type="text" id="sel_tax<?php echo $asel->id ?>" data-name="tax" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $asel->tax ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $asel->tax ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"seltax_option" . $asel->id ?>')" data-type="select" id="seltax_option<?php echo $asel->id ?>" data-name="tax_option" data-value="<?php echo $asel->tax_option ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update Tax">
                                                                            <?php echo $taxOptions[$asel->tax_option] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $taxOptions[$asel->tax_option] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_inline" . $asel->id ?>')" data-type="select" id="sel_inline<?php echo $asel->id ?>" data-name="inline" data-value="<?php echo $asel->inline ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $onlineOptions[$asel->inline] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $onlineOptions[$asel->inline] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_online" . $asel->id ?>')" data-type="select" id="sel_online<?php echo $asel->id ?>" data-name="online" data-value="<?php echo $asel->online ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $onlineOptions[$asel->online] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $onlineOptions[$asel->online] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($this->session->userdata('group') <= 5): ?>
                                                                        <a href="javascript:void(0)" onclick="quickeditcell('<?php echo"sel_status" . $asel->id ?>')" data-type="select" id="sel_status<?php echo $asel->id ?>" data-name="status" data-value="<?php echo $asel->status ?>" data-pk="<?php echo $asel->id ?>" data-url="<?php echo site_url('menu/quickeditcell/menuselection') ?>" data-title="Update code">
                                                                            <?php echo $statusOptions[$asel->status] ?>
                                                                        </a>
                                                                    <?php else: ?>
                                                                        <?php echo $onlineOptions[$asel->online] ?>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($asel->has_topping == 3): ?>
                                                                        <span class="icon icon-eye" onclick="attrPopup('menuToppingPopup', '75%', '<?php echo $asel->category ?>', '<?php echo $asel->menu ?>', '<?php echo $asel->id ?>', '0', '<?php echo site_url('menu/topping') ?>')"></span>
                                                                    <?php else: ?>
                                                                        <span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_toppings_yet_assigned') ?>', '<?php echo $this->lang->line('close') ?>')"></span>
                                                                    <?php endif; ?>
                                                                </td>
                                                                <td class="text-center">
                                                                    <?php if ($asel->has_modifier == 3): ?>
                                                                        <span class="icon icon-eye" onclick="attrPopup('menuModifierPopup', '75%', '<?php echo $asel->category ?>', '<?php echo $asel->menu ?>', '<?php echo $asel->id ?>', '0', '<?php echo site_url('menu/itemmodifier') ?>')"></span>
                                                                    <?php else: ?>
                                                                        <span class="icon icon-eye" onclick="warning('<?php echo $this->lang->line('warning') ?>', '<?php echo $this->lang->line('no_modifiers_yet_assigned') ?>', '<?php echo $this->lang->line('close') ?>')"></span>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>
                                                        <?php endforeach; ?>
                                                    </table>
                                                </td>
                                            </tr>
                                        <?php endif; ?>
                                    <?php endforeach; ?>
                                </table>
                            </td>
                        </tr>
                    <?php endif; ?>
                <?php endforeach; ?>
            </table>
        <?php endif; ?>
    </div>
</div>
<?php if ($this->session->userdata('group') <= 4): ?>
    <?php $this->load->view('menu/menu/menunav') ?>
<?php else: ?>
    <?php $this->load->view('settings/partials/footer') ?>
<?php endif; ?>
<div id="popupContentHolder"></div>
<script>
    function quickeditcell(field) {
        $('#' + field).editable({
            mode: 'inline',
            source: function () {
                if (field.includes("type")) {
                    return [
                        {value: 'kitchen', text: '<?php echo $this->lang->line('kitchen') ?>'},
                        //{value: 'bar', text: '<?php echo $this->lang->line('bar') ?>'},
                        //{value: 'bakery', text: '<?php echo $this->lang->line('bakery') ?>'},
                        {value: 'drinks', text: '<?php echo $this->lang->line('drinks') ?>'}
                    ];
                }
                if (field.includes("unit")) {
                    return [
                        {value: '<?php echo $this->lang->line('pc') ?>', text: '<?php echo $this->lang->line('pc') ?>'},
                        {value: '<?php echo $this->lang->line('mg') ?>', text: '<?php echo $this->lang->line('mg') ?>'},
                        {value: '<?php echo $this->lang->line('g') ?>', text: '<?php echo $this->lang->line('g') ?>'},
                        {value: '<?php echo $this->lang->line('kg') ?>', text: '<?php echo $this->lang->line('kg') ?>'},
                        {value: '<?php echo $this->lang->line('mt') ?>', text: '<?php echo $this->lang->line('mt') ?>'},
                        {value: '<?php echo $this->lang->line('inch') ?>', text: '<?php echo $this->lang->line('inch') ?>'},
                        {value: '<?php echo $this->lang->line('ft') ?>', text: '<?php echo $this->lang->line('inch') ?>'},
                        {value: '<?php echo $this->lang->line('yard') ?>', text: '<?php echo $this->lang->line('yard') ?>'},
                        {value: '<?php echo $this->lang->line('metre') ?>', text: '<?php echo $this->lang->line('metre') ?>'},
                    ];
                }
                if (field.includes("printat")) {
                    return [
                        {value: 1, text: 'Papadam & Chutney'},
                        {value: 2, text: 'Appetizer'},
                        {value: 3, text: 'Starters'},
                        {value: 4, text: 'Tandoori Dish'},
                        {value: 5, text: 'Main Dish'},
                        {value: 6, text: 'Kids Meals'},
                        {value: 7, text: 'Side Dishes'},
                        {value: 8, text: 'Sundries'},
                        {value: 9, text: 'Rice'},
                        {value: 10, text: 'Naan'},
                        {value: 11, text: 'Set Meals'},
                        {value: 12, text: 'English Dish'},
                        {value: 13, text: 'Desserts'},
                        {value: 14, text: 'Drinks'},
                        {value: 16, text: 'Kebab'},
                        {value: 17, text: 'Pizza'},
                        {value: 18, text: 'Noodles'},
                        {value: 19, text: 'Soup'},
                        {value: 20, text: 'Sandwiches'},
                        {value: 21, text: 'Burgers'},
                        {value: 22, text: 'Wrap'}
                    ];
                }

                if (field.includes("online")) {
                    return [
                        {value: 3, text: '<?php echo $this->lang->line('yes') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('no') ?>'}
                    ];
                }
                if (field.includes("inline")) {
                    return [
                        {value: 3, text: '<?php echo $this->lang->line('yes') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('no') ?>'}
                    ];
                }
                if (field.includes("status")) {
                    return [
                        {value: 3, text: '<?php echo $this->lang->line('active') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('inactive') ?>'}
                    ];
                }
                if (field.includes("menutax_option")) {
                    return [
                        {value: 0, text: '<?php echo $this->lang->line('no_plan') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('default_plan') ?>'},
                        {value: 3, text: '<?php echo $this->lang->line('category_plan') ?>'},
                        {value: 4, text: '<?php echo $this->lang->line('menu') ?>'}
                    ];
                }
                if (field.includes("menudiscount_option")) {
                    return [
                        {value: 0, text: '<?php echo $this->lang->line('no_plan') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('default_plan') ?>'},
                        {value: 3, text: '<?php echo $this->lang->line('discount_plan') ?>'},
                        {value: 4, text: '<?php echo $this->lang->line('category_plan') ?>'},
                        {value: 5, text: '<?php echo $this->lang->line('menu') ?>'}
                    ];
                }
                if (field.includes("seltax_option")) {
                    return [
                        {value: 0, text: '<?php echo $this->lang->line('no_plan') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('default_plan') ?>'},
                        {value: 3, text: '<?php echo $this->lang->line('category_plan') ?>'},
                        {value: 4, text: '<?php echo $this->lang->line('menu') ?>'},
                        {value: 5, text: '<?php echo $this->lang->line('selection') ?>'}
                    ];
                }
                if (field.includes("seldiscount_option")) {
                    return [
                        {value: 0, text: '<?php echo $this->lang->line('no_plan') ?>'},
                        {value: 2, text: '<?php echo $this->lang->line('default_plan') ?>'},
                        {value: 3, text: '<?php echo $this->lang->line('discount_plan') ?>'},
                        {value: 4, text: '<?php echo $this->lang->line('category_plan') ?>'},
                        {value: 5, text: '<?php echo $this->lang->line('menu') ?>'},
                        {value: 6, text: '<?php echo $this->lang->line('selection') ?>'}
                    ];
                }
                if (field.includes("rel")) {
                    return [
                        {value: 'mono', text: '<?php echo strtolower($this->lang->line('mono')) ?>'},
                        {value: 'poly', text: '<?php echo strtolower($this->lang->line('poly')) ?>'}
                    ];
                }
            }
        });
    }
</script>

