<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 bodyitem">
    <div class="row no-padding">
        <div class="buttons">
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/general') ?>', '<?php echo $this->lang->line('gkpos_general_info') ?>')" class="btn btn-primary gradient text-center" style="font-size:90%;min-width: 90px;"><?php echo $this->lang->line('gkpos_general_info') ?></div>
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/vatsetup') ?>', '<?php echo $this->lang->line('gkpos_general_vat_setup') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 90px;"><?php echo $this->lang->line('gkpos_general_vat_setup') ?></div>
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/discountsetup') ?>', '<?php echo $this->lang->line('gkpos_discount') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 90px;"><?php echo $this->lang->line('gkpos_discount') ?></div>
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/delivery_time') ?>', '<?php echo $this->lang->line('gkpos_delivery_time') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 110px;"><?php echo $this->lang->line('gkpos_delivery_time') ?></div>
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/depliveryplan') ?>', '<?php echo $this->lang->line('gkpos_delivery_plan') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 110px;"><?php echo $this->lang->line('gkpos_delivery_plan') ?></div>
            <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/pagination') ?>', '<?php echo $this->lang->line('gkpos_pagination') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 90px;" ><?php echo $this->lang->line('gkpos_pagination') ?></div>
            <?php if ($this->config->item('gk_only_online_admin') == 'no'): ?>
                <div onclick="getSettingPage('<?php echo site_url('gkpos/settings/add_cc_fee') ?>', '<?php echo $this->lang->line('gkpos_add_cce_fee') ?>')" class="btn btn-primary gradient text-center" style="font-size: 90%;min-width: 90px;" ><?php echo $this->lang->line('gkpos_add_cce_fee') ?></div>
            <?php endif; ?>
        </div>
    </div>
    <div class="row no-padding">
        <?php echo form_open('gkpos/settings/save_discount/', array('id' => 'discount_form', 'enctype' => 'multipart/form-data', 'class' => 'form-horizontal')); ?>
        <fieldset id="config_info">
            <div style="border:2px solid #000;">
                <legend>Default Setting</legend>
                <div class="form-group form-group-sm">	
                    <?php echo form_label($this->lang->line('dkpos_default_discount'), 'gk_vat_percent', array('class' => 'control-label col-lg-5 col-md-5 col-sm-5 col-xs-5 text-capitalize')); ?>
                    <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
                        <div class="input-group">
                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                            <input name="gk_discount_percent" class="form-control input-sm required"  type="text" id="gk_discount_percent" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>" value="<?php echo $this->config->item('gk_discount_percent') ?>">
                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                        </div>
                    </div>
                </div>
                <div class="form-group form-group-sm">	
                    <label for="radio-inline" class="col-lg-5 col-md-5 col-sm-5 col-xs-5 control-label text-capitalize"><?php echo $this->lang->line('gkpos_auto_default_discount_applied') ?></label>
                    <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
                        <label class="radio-inline text-capitalize"><input type="radio" name="gk_discount_applied" id="gk_discount_applied1" value="yes" <?php ($this->config->item('gk_discount_applied') == "yes") ? print "checked" : '' ?> ><?php echo $this->lang->line('gkpos_yes') ?></label>
                        <label class="radio-inline text-capitalize"><input type="radio" name="gk_discount_applied" id="gk_discount_applied2" value="no" <?php ($this->config->item('gk_discount_applied') == "no") ? print "checked" : '' ?> ><?php echo $this->lang->line('gkpos_no') ?></label>
                    </div>
                </div>
                <div class="form-group form-group-sm">	
                    <?php echo form_label($this->lang->line('gkpos_discount_applied'), '', array('class' => 'text-capitalize control-label col-lg-5 col-md-5 col-sm-5 col-xs-5')); ?>
                    <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2 text-capitalize'>
                        <?php echo form_checkbox(array('name' => 'gk_discount_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $this->config->item('gk_discount_food'))); ?><span class="discount-lebel"><?php echo $this->lang->line('gkpos_food') ?></span>
                    </div>
                    <div class='col-lg-3 col-md-3 col-sm-3 col-xs-3 text-center text-capitalize '><?php echo form_checkbox(array('name' => 'gk_discount_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $this->config->item('gk_discount_nonfood'))); ?> <span class="discount-lebel"><?php echo $this->lang->line('gkpos_non_food') ?></span></div>
                </div>
                <div class="form-group form-group-sm">	
                    <?php echo form_label($this->lang->line('gkpos_minimum_order_to_apply_discount'), 'gk_discount_amount', array('class' => 'control-label col-lg-5 col-md-5 col-sm-5 col-xs-5 text-capitalize')); ?>
                    <div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
                        <div class="input-group">
                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                            <input name="gk_discount_min_order" class="form-control input-sm"  type="text" id="gk_discount_amount" value="<?php echo $this->config->item('gk_discount_min_order') ?>">
                        </div>
                    </div>
                </div>
            </div>
            <div class="clearfix"style="margin: 20px 0px 5px 0px"><legend>Overrides Default Discount Setup</legend></div>
            <?php if ($this->config->item('gk_only_online_admin') == 'no'): ?>
                <div class="form-group form-group-sm">
                    <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2 text-capitalize'style="margin-top: 5px;">
                        <input type="checkbox" name='gk_discount_dinein' class="checkbox-inline"  value='yes' <?php $this->config->item('gk_discount_dinein') == 'yes' ? print'checked="true"' : '' ?> id="dineInDiscountCheckbox" onclick="checkBlock(this.id, 'dineInDiscountOptionBlock')">
                        <span class="discount-lebel"><?php echo $this->lang->line('gkpos_menu_dine_in_price') ?></span>
                    </div>
                    <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 text-capitalize">
                        <div id="dineInDiscountOptionBlock" style="display: none;">
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                <div class="checkbox">
                                    <label class="text-capitalize"><input type="checkbox" name="table" value="yes" <?php $plans['table']->is_applied == 'yes' ? print'checked="true"' : '' ?> id="tableDiscountFieldOpener" onclick="checkBlock(this.id, 'tableDiscountField')"><?php echo $this->lang->line('gkpos_table') ?></label>
                                    <div  id="tableDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                            <input name="tab_number" class="form-control input-sm" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>"  type="text" id="tab_number" value="<?php echo $plans['table']->number ?>">
                                        </div>
                                        <div>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="tab_func" id="table_func1" value="1" <?php ($plans['table']->func == "1") ? print "checked" : '' ?> >percent</label>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="tab_func" id="table_func2" value="2" <?php ($plans['table']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                        </div>
                                        <div class=" checkbox checkbox-inline">
                                            <?php echo form_checkbox(array('name' => 'tab_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['table']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                            <?php echo form_checkbox(array('name' => 'tab_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['table']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                            <input name="tab_min_order" class="form-control input-sm"  type="text" id="tab_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['table']->min_order ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                <div class="checkbox">
                                    <label class="text-capitalize"><input type="checkbox" name="bar" id="barDiscountFieldOpener" value="yes" <?php $plans['bar']->is_applied == 'yes' ? print'checked="true"' : '' ?>  onclick="checkBlock(this.id, 'barDiscountField')"><?php echo $this->lang->line('gkpos_bar') ?></label>
                                    <div id="barDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                        <div class="input-group" >
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                            <input name="bar_number"  placeholder="<?php echo $this->lang->line('gkpos_discount') ?>"class="form-control input-sm"  type="text" id="gk_discount_percent" value="<?php echo $plans['bar']->number ?>">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                                        </div>
                                        <div>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="bar_func" id="dinein_bar_amount_func1" value="1" <?php ($plans['bar']->func == "1") ? print "checked" : '' ?> >percent</label>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="bar_func" id="dinein_bar_amount_func2" value="2" <?php ($plans['bar']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                        </div>
                                        <div class=" checkbox checkbox-inline">
                                            <?php echo form_checkbox(array('name' => 'bar_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['bar']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                            <?php echo form_checkbox(array('name' => 'bar_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['bar']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                            <input name="bar_min_order" class="form-control input-sm"  type="text" id="bar_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['bar']->min_order ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>	
                <div class="form-group form-group-sm">
                    <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2 text-capitalize' style="margin-top: 5px;">
                        <input type="checkbox" name='gk_discount_dineout' class="checkbox-inline"  value='yes' <?php $this->config->item('gk_discount_dineout') == 'yes' ? print'checked="true"' : '' ?> id="dineOutDiscountCheckbox" onclick="checkBlock(this.id, 'dineOutDiscountOptionBlock')">
                        <span class="discount-lebel"><?php echo $this->lang->line('gkpos_takeaway') ?></span>
                    </div>
                    <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 text-capitalize">
                        <div id="dineOutDiscountOptionBlock" style="display: none;">
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
                                <div class="checkbox">
                                    <label class="text-capitalize"><input type="checkbox" name="delivery" value="yes"  id="deliveryDiscountFieldOpener" <?php $plans['delivery']->is_applied == 'yes' ? print'checked="true"' : '' ?>  onclick="checkBlock(this.id, 'deliveryDiscountField')"><?php echo $this->lang->line('gkpos_delivery') ?></label>
                                    <div id="deliveryDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                            <input name="del_number" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>" class="form-control input-sm"  type="text" id="gk_discount_percent" value="<?php echo $plans['delivery']->number ?>">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                                        </div>
                                        <div>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="del_func" id="del_func1" value="1" <?php ($plans['delivery']->func == "1") ? print "checked" : '' ?> >percent</label>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="del_func" id="del_func2" value="2" <?php ($plans['delivery']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                        </div>
                                        <div class=" checkbox checkbox-inline">
                                            <?php echo form_checkbox(array('name' => 'del_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['delivery']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                            <?php echo form_checkbox(array('name' => 'del_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['delivery']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                            <input name="del_min_order" class="form-control input-sm"  type="text" id="del_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['delivery']->min_order ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
                                <div class="checkbox">
                                    <label class="text-capitalize"><input type="checkbox" name="collection"  id="collectionDiscountFieldOpener" value="yes" <?php $plans['collection']->is_applied == 'yes' ? print'checked="true"' : '' ?> onclick="checkBlock(this.id, 'collectionDiscountField')"><?php echo $this->lang->line('gkpos_collection') ?></label>
                                    <div id="collectionDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                            <input name="col_number" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>" class="form-control input-sm"  type="text" id="col_number" value="<?php echo $plans['collection']->number ?>">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                                        </div>
                                        <div>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="col_func" id="col_func1" value="1" <?php ($plans['collection']->func == "1") ? print "checked" : '' ?> >percent</label>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="col_func" id="col_func2" value="2" <?php ($plans['collection']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                        </div>
                                        <div class=" checkbox checkbox-inline">
                                            <?php echo form_checkbox(array('name' => 'col_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['collection']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                            <?php echo form_checkbox(array('name' => 'col_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['collection']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                            <input name="col_min_order" class="form-control input-sm"  type="text" id="col_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['collection']->min_order ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
                                <div class="checkbox">
                                    <label class="text-capitalize"><input type="checkbox" name="waiting"  id="waitingDiscountFieldOpener" onclick="checkBlock(this.id, 'waitingDiscountField')" value="yes" <?php $plans['waiting']->is_applied == 'yes' ? print'checked="true"' : '' ?>><?php echo $this->lang->line('gkpos_waiting') ?></label>
                                    <div id="waitingDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                            <input name="wai_number" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>" class="form-control input-sm"  type="text" id="wai_number" value="<?php echo $plans['waiting']->number ?>">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                                        </div>
                                        <div>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="wai_func" id="wai_func1" value="1" <?php ($plans['waiting']->func == "1") ? print "checked" : '' ?> >percent</label>
                                            <label class="radio-inline text-capitalize"><input type="radio" name="wai_func" id="wai_func2" value="2" <?php ($plans['waiting']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                        </div>
                                        <div class=" checkbox checkbox-inline">
                                            <?php echo form_checkbox(array('name' => 'wai_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['waiting']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                            <?php echo form_checkbox(array('name' => 'wai_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['waiting']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                            <input name="wai_min_order" class="form-control input-sm"  type="text" id="gk_discount_amount" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['waiting']->min_order ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>  
            <?php endif; ?>
            <div class="form-group form-group-sm">
                <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2 text-capitalize'style="margin-top: 5px;">
                    <input type="checkbox" name='gk_discount_online' class="checkbox-inline"  value='yes' <?php $this->config->item('gk_discount_online') == 'yes' ? print'checked="true"' : '' ?> id="onlineDiscountCheckbox" onclick="checkBlock(this.id, 'onlineDiscountOptionBlock')">
                    <span class="discount-lebel"><?php echo $this->lang->line('gkpos_online') ?></span>
                </div>
                <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 text-capitalize">
                    <div id="onlineDiscountOptionBlock" style="display: none;">
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                            <div class="checkbox">
                                <label class="text-capitalize"><input type="checkbox" name="online_collection" value="yes" <?php $plans['online_collection']->is_applied == 'yes' ? print'checked="true"' : '' ?> id="onlineCollectionDiscountFieldOpener" onclick="checkBlock(this.id, 'onlineCollectionDiscountField')"><?php echo $this->lang->line('gkpos_collection') ?></label>
                                <div  id="onlineCollectionDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                    <div class="input-group">
                                        <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                        <input name="online_col_number" class="form-control input-sm" placeholder="<?php echo $this->lang->line('gkpos_discount') ?>"  type="text" id="online_col_number" value="<?php echo $plans['online_collection']->number ?>">
                                    </div>
                                    <div>
                                        <label class="radio-inline text-capitalize"><input type="radio" name="online_col_func" id="online_col_func1" value="1" <?php ($plans['online_collection']->func == "1") ? print "checked" : '' ?> >percent</label>
                                        <label class="radio-inline text-capitalize"><input type="radio" name="online_col_func" id="online_col_func2" value="2" <?php ($plans['online_collection']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                    </div>
                                    <div class=" checkbox checkbox-inline">
                                        <?php echo form_checkbox(array('name' => 'online_col_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['online_collection']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                        <?php echo form_checkbox(array('name' => 'online_col_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['online_collection']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                    </div>
                                    <div class="input-group">
                                        <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                        <input name="online_col_min_order" class="form-control input-sm"  type="text" id="online_col_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['online_collection']->min_order ?>">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                            <div class="checkbox">
                                <label class="text-capitalize"><input type="checkbox" name="online_delivery" id="onlineDeliveryDiscountFieldOpener" value="yes" <?php $plans['online_delivery']->is_applied == 'yes' ? print'checked="true"' : '' ?>  onclick="checkBlock(this.id, 'onlineDeliveryDiscountField')"><?php echo $this->lang->line('gkpos_delivery') ?></label>
                                <div id="onlineDeliveryDiscountField" style="display: none;  border: 2px solid #ffffff; border-radius: 5px;   padding: 3px;">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-table" aria-hidden="true"></i></a></span>
                                        <input name="online_del_number"  placeholder="<?php echo $this->lang->line('gkpos_discount') ?>"class="form-control input-sm"  type="text" id="online_delivery_number" value="<?php echo $plans['online_delivery']->number ?>">
                                        <span class="input-group-addon" style="background-color: #FF0000;"><a href="#"><i class="fa fa-percent" aria-hidden="true"></i></a></span>
                                    </div>
                                    <div>
                                        <label class="radio-inline text-capitalize"><input type="radio" name="online_del_func" id="online_del_func1" value="1" <?php ($plans['online_delivery']->func == "1") ? print "checked" : '' ?> >percent</label>
                                        <label class="radio-inline text-capitalize"><input type="radio" name="online_del_func" id="online_del_func2" value="2" <?php ($plans['online_delivery']->func == "2") ? print "checked" : '' ?> >Fixed</label>
                                    </div>
                                    <div class=" checkbox checkbox-inline">
                                        <?php echo form_checkbox(array('name' => 'online_del_food', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['online_delivery']->food)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_food') ?></span>
                                        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>   
                                        <?php echo form_checkbox(array('name' => 'online_del_nonfood', 'class' => 'checkbox-inline', 'value' => 'yes', 'checked' => $plans['online_delivery']->nonfood)); ?><span class="text-capitalize"><?php echo $this->lang->line('gkpos_non_food') ?></span>
                                    </div>
                                    <div class="input-group">
                                        <span class="input-group-addon" style="background-color: #FF0000;"><i class="fa" aria-hidden="true"><?php echo $this->config->item('currency_symbol') ?></i></span>
                                        <input name="online_del_min_order" class="form-control input-sm"  type="text" id="online_del_min_order" placeholder="<?php echo $this->lang->line('gkpos_minimum_order') ?>" value="<?php echo $plans['online_delivery']->min_order ?>">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>	
            <div class="form-group form-group-md">	
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <ul id="discount_error_message_box" class="error_message_box"></ul>
                    <?php
                    echo form_submit(array(
                        'name' => 'submit_form',
                        'id' => 'submit_form',
                        'value' => $this->lang->line('gkpos_numpad_key_enter'),
                        'class' => 'btn btn-block btn-danger round btn-sm'));
                    ?>
                </div>
            </div>
            <div class="clearfix pages-height"></div>
        </fieldset>

        <?php echo form_close(); ?>
        <script type='text/javascript'>
            $(document).ready(function () {
                showBlocksOnDocumentLoad();
                $('#discount_form').validate({
                    submitHandler: function () {
                        var myform = document.getElementById('discount_form');
                        var formdata = new FormData(myform);
                        $.ajax({
                            url: $('#discount_form').attr('action'),
                            data: formdata,
                            cache: false,
                            processData: false,
                            contentType: false,
                            type: 'POST',
                            dataType: 'json',
                            success: function (response) {
                                if (response.success) {
                                    ALERT_TITLE = "Success!";
                                    alert(response.message);
                                } else {
                                    ALERT_TITLE = "Error!";
                                    alert(response.message);
                                }
                            }
                        });
                    },
                    errorClass: "has-error",
                    errorLabelContainer: "#discount_error_message_box",
                    wrapper: "li",
                    highlight: function (e) {
                        $(e).closest('.form-group').addClass('has-error');
                    },
                    unhighlight: function (e) {
                        $(e).closest('.form-group').removeClass('has-error');
                    },
                    rules: {
                        gk_discount_percent: {
                            number: true,
                            required: true
                        },
                        gk_discount_applied: "required",
                    },
                    messages: {
                        gk_discount_percent: "<?php echo $this->lang->line('gkpos_discount_percent_required') ?>",
                        gk_discount_applied: "<?php echo $this->lang->line('gkpos_discount_auto_applied_required') ?>"
                    }
                });
            });
            function showBlocksOnDocumentLoad() {
                if ($("#dineInDiscountCheckbox").is(":checked")) {
                    if ($("#dineInDiscountOptionBlock").show()) {
                        if ($('#tableDiscountFieldOpener').is(":checked")) {
                            $('#tableDiscountField').show();
                        } else {
                            $('#tableDiscountField').hide();
                        }
                        if ($('#barDiscountFieldOpener').is(":checked")) {
                            $('#barDiscountField').show();
                        } else {
                            $('#barDiscountField').hide();
                        }
                    }
                } else {
                    $("#dineInDiscountOptionBlock").hide();
                }
                if ($("#dineOutDiscountCheckbox").is(":checked")) {
                    if ($("#dineOutDiscountOptionBlock").show()) {
                        if ($('#deliveryDiscountFieldOpener').is(":checked")) {
                            $('#deliveryDiscountField').show();
                        } else {
                            $('#deliveryDiscountField').hide();
                        }
                        if ($('#collectionDiscountFieldOpener').is(":checked")) {
                            $('#collectionDiscountField').show();
                        } else {
                            $('#collectionDiscountField').hide();
                        }
                        if ($('#waitingDiscountFieldOpener').is(":checked")) {
                            $('#waitingDiscountField').show();
                        } else {
                            $('#waitingDiscountField').hide();
                        }
                    }

                } else {
                    $("#dineOutDiscountOptionBlock").hide();
                }
                if ($("#onlineDiscountCheckbox").is(":checked")) {
                    if ($("#onlineDiscountOptionBlock").show()) {
                        if ($('#onlineDeliveryDiscountFieldOpener').is(":checked")) {
                            $('#onlineDeliveryDiscountField').show();
                        } else {
                            $('#onlineDeliveryDiscountField').hide();
                        }
                        if ($('#onlineCollectionDiscountFieldOpener').is(":checked")) {
                            $('#onlineCollectionDiscountField').show();
                        } else {
                            $('#onlineCollectionDiscountField').hide();
                        }
                    }

                } else {
                    $("#onlineDiscountOptionBlock").hide();
                }
            }
        </script>
    </div>
</div>
