<script type="text/javascript" src="<?php echo base_url();?>assets/js/service_settings.js"></script>
<style type="text/css">
    .service_div [type="checkbox"] {
        width: 20px;
        max-width: 20px;
    }
    
    .service_div .menu-title {
        width: 240px;
        color: #999;
        border: 1px dotted #eee;
        background: rgba(170, 187, 170, 0.02);
        padding: 5px 15px;
        cursor: pointer;

        position: absolute;
        margin-bottom: 10px;
        margin-top: -5px;
        box-shadow: -2px -2px 4px #eee;
        font-size: 12px;
    }
    
    .menu-title:focus {
        outline: none;
    }
    
</style>

<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <h1 class="major_txt_color">Service Settings Edit</h1>
            <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
        </div>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box-header">
                    <div class="box-body table-responsive">
                        <?php if(!empty($success)) {?>
                            <div class="alert alert-success alert-dismissable">
                                <i class="fa fa-thumbs-o-up"></i>
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                <h4><?php echo $success;?></h4>
                            </div>
                        <?php }
                        else if(!empty($error)) {?>
                            <div class="alert alert-danger alert-dismissable">
                                <i class="fa fa-thumbs-o-down"></i>
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                <h4><?php echo $error;?></h4>
                            </div>
                        <?php }?>
                    </div>
                    <!-- .box-tools -->
                </div>
            </div>
            
            <div class="col-xs-12">
                <!--<h3 style="margin-top: 0; margin-right: 5px; width: 100%; display: inline-block;">
                    <a class="label btn btn-primary float-rht edit" href="<?php echo $view_link?>"><span>View</span></a>
                </h3>--> 
                <form name="master_settings" action="<?php echo $form_action;?>" method="post" enctype="multipart/form-data">
                    <div class="box box-danger">
                        <div class="box-body">
                            <ul class="error_container"></ul>
                            <!--<h3 class="major_txt_color" style="margin: 10px 0 25px 0;">Company</h3>-->
                            <div class="col-xs-12">
                                <div class="form-group float-clear">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="form-control check_all" name="check_all" value="all" />&nbsp;&nbsp;Select All
                                        </label>
                                    </div>
                                </div>
                                <?php foreach($setting as $key=>$value) {?>
                                    <div class="col-xs-12">
                                        <div class="col-md-12">
                                            <div class="form-group service_div">
                                                <label>&nbsp;</label>
                                                <label style="width: 100%;">
                                                    <input type="checkbox" class="form-control service_name" name="service_name[]" value="<?php echo $value->id;?>" <?php echo ($value->status == 1) ? 'checked' : '';?> />&nbsp;&nbsp;<input type="text" name="name[<?php echo $value->id; ?>]" value="<?php echo $value->service_name; ?>" onfocus="return false;" class="menu-title" style="" />
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xs-12">
                                        <div class="col-md-3" >
                                            <div class="form-group">
                                               <input type="text" class="form-control tamil-name input-tamil" name="tamil_name[<?php echo $value->id;?>]" placeholder="jkpH;bgah;" value="<?php echo $value->tamil_name;?>" style="font-size: 18px!important;" />
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-3" >
                                            <div class="form-group">
                                                <input type="text" class="form-control integer_value" name="seq_no[<?php echo $value->id;?>]" value="<?php echo $value->seq_number;?>" placeholder="Sequence Number" />
                                            </div>
                                        </div>
                                        
                                        <div class="col-md-6">
                                            <div class="form-group">
                                               <input type="file" class="form-control img_file" value="<?php echo $value->image;?>" data-value="<?php echo $value->image;?>" name="image[<?php echo $value->id;?>]" data-allowed_exetnsions="<?php echo implode('|', image_extensions());?>" />
                                                <!-- Eg: data-allowed_size 2 MB -->
                                                <div class="img_preview" style="padding-right: 130px; !important; bottom: 40px;">
                                                    <?php
                                                    if ((!empty($value->image)) && (file_exists(FCPATH . DIR_SERVICE_IMAGE . $value->image))) {
                                                        $image_url = base_url() . DIR_SERVICE_IMAGE . $value->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;?>" /><br />
                                                    
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                        </div>
                        
                        <div class="box-footer form-actions float-clear" style="text-align:center;">
                            <input class="btn reset" type="reset" value="Reset" />
                            <input type="submit" name="submit" value="Update" class="btn btn-success btn-primary" />
                        </div>
                    </div><!-- /.box -->
                </form>
            </div><!-- /.col-xs-12 -->
        </div><!-- /.row -->
    </section><!-- /.content -->
</aside>
<script type="text/javascript">
    $(document).on('ready', function(){
        $('.service_div .menu-title').on('click', function(){
            return false;
        });
    });
    </script>