<script type="text/javascript" src="<?php echo base_url();?>assets/js/category.js"></script>
<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <h1 class="major_txt_color">Category Edit</h1>
            <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
        </div>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <form action="<?php echo $form_action;?>" method="post" name="category_form" enctype="multipart/form-data">    
                    <input type="hidden" name="hidden_category_id" value="<?php echo $category->id;?>" />
                    <div class="box box-danger">
                        <div class="box-body">
                            <ul class="error_container"></ul>
                            <div class="col-xs-12">
                                <div class="col-md-6">
                                    <div class="form-group float-clear">
                                        <label>Name<span class="required">*</span></label>
                                        <input type="text" class="form-control" name="category_name" placeholder="Name" value="<?php echo $category->category_name;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Category Order<span class="required">*</span></label>
                                        <input type="text" class="form-control integer_value" name="category_order" maxlength="50" value="<?php echo $category->category_order;?>" />
                                    </div>
                                    
                                    <div class="form-group form_group_div">
                                        <label>Color (Top)</label>
                                        <div class="input-group colorpicker" style="padding-left: 12px;">
                                            <input type="text" class="form-control my-colorpicker1" name="color_top" value="<?php echo $category->color_top; ?>" style="width: 258px;" />
                                            <div class="input-group-addon"><i></i></div>
                                        </div><!-- /.input group -->
                                    </div>
                                    
                                    <div class="form-group form_group_div">
                                        <label>Color (Bottom)</label>
                                        <div class="input-group colorpicker" style="padding-left: 12px;">
                                            <input type="text" class="form-control my-colorpicker1" name="color_bottom" value="<?php echo $category->color_bottom; ?>" style="width: 258px;" />
                                            <div class="input-group-addon"><i></i></div>
                                        </div><!-- /.input group -->
                                    </div>
                                    
                                    
                                    <div class="form-group">
                                        <label class="leftcol">Status</label>
                                        <div>
                                            <label for="status" style="width: 32%;"><input type="radio" name="status" value="1" <?php echo $category->status == "1" ? 'checked' : ''; ?>/> &nbsp;&nbsp;Active</label> 
                                            <label for="status" style="width: 32%;"><input type="radio" name="status" value="0" <?php echo $category->status == "0" ? 'checked' : ''; ?> /> &nbsp;&nbsp;Inactive</label> 
                                        </div>
                                    </div>
                                    
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group float-clear">
                                        <label>Name (T)</label>
                                        <div class="input-group">
                                            <input class="form-control multi tamil-name input-tamil" type="text" name="tamil_category_name" placeholder="jkpH;bgah;" onclick="set_tamil_keypad(this);" value="<?php echo $category->tamil_name;?>" />
                                            <div class="input-group-addon"><i class="fa fa-keyboard-o"></i></div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Receipt Prefix</label>
                                        <input type="text" class="form-control" name="cat_prefix" placeholder="Example: FT" value="<?php echo $category->cat_prefix; ?>" />
                                    </div>
                                    
                                    <div class="form-group m-h30">
                                        <label class="leftcol">Grouping<span class="required">*</span></label>
                                        <label for="grouping"><input type="radio" name="grouping" value="1" <?php echo ($category->grouping == 1) ? 'checked': '';?>/> &nbsp;&nbsp;Yes</label> 
                                        <label for="grouping"><input type="radio" name="grouping" value="0" <?php echo ($category->grouping == 0) ? 'checked': '';?> /> &nbsp;&nbsp;No</label> 
                                    </div>
                                        
                                    <div class="form-group">
                                        <label>Separate Receipt </label>
                                        <input type="checkbox" class="form-control" name="is_sepr" value="1" <?php echo $category->is_separate == "1" ? "checked" : ""; ?> /> <span style="color: #999; font-size: 10px;">(Quantity wise separate receipt will be generated)</span>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label>Upload Image</label>
                                        <input type="file" class="form-control img_file" value="<?php echo $category->image;?>" data-value="<?php echo $category->image;?>" name="image" data-allowed_exetnsions="<?php echo implode('|', image_extensions());?>" />
                                        <!-- Eg: data-allowed_size 2 MB -->
                                        <div class="img_preview">
                                            <?php
                                            if ((!empty($category->image)) && (file_exists(FCPATH . DIR_CATEGORY_IMAGE . $category->image))) {
                                                $image_url = base_url() . DIR_CATEGORY_IMAGE . $category->image;
                                                $alt = 'No image not found!';   
                                            }
                                            else {
                                                $image_url = base_url() . NO_IMG;
                                                $alt = 'No image not found!';
                                            }
                                            ?>
                                            <img class="toggle" src="<?php echo $image_url;?>" alt="<?php echo $alt;?>" style="padding-left: 15%;" /><br />
                                            
                                            <?php if ((!empty($category->image)) && (file_exists(FCPATH . DIR_CATEGORY_IMAGE . $category->image))) { ?>
                                            <span><input type="checkbox" id="img_hide" name="img_delete" value="1"/>Delete</span>
                                             <?php } ?>
                                        </div>
                                        <span class="allowed_type">File should be <b><i><?php echo strtoupper(implode(', ', image_extensions()));?></i></b> file format</span>  
                                    </div>
                                </div>
                            </div>
                        
                            <div class="box-footer form-actions float-clear">
                                <input class="btn reset" type="reset" value="Reset" />
                                <input type="submit" name="submit" value="Update" class="btn btn-success btn-primary" />
                            </div>
                        </div><!-- /.box -->    
                    </div><!-- /.box -->
                </form>
            </div><!-- /.col-xs-12 -->
        </div><!-- /.row -->
    </section><!-- /.content -->
</aside>
<style>
    .colorpicker:before {
        display: none;
    }
</style>
    