<input type="hidden" id="baseUrl" value="<?php echo base_url(); ?>">
<div class="col-sm-10">    
<!--    Search Section Starts Here -->
    <div class="row">    
        <div class="col-sm-12">
            <div class="col-sm-6 col-sm-offset-2 form-group">                
                    <div class="input-group">
                        <input class="form-control" 
                               id="SearchRatingName" 
                               placeholder="Search here..." 
                               aria-describedby="basic-addon1" type="text">
                        <span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>
                    </div>                
            </div>
            <div class="col-sm-4 form-group padding-zero">                
                    <div class="col-sm-6 form-group ">
                        <select class="form-control"
                                id="SearchRatingPubStatus">
                            <option value="">Rating Status</option>
                            <option value="0">Unpublished</option>
                            <option value="1">Published</option>
                            <option value="2">Pending</option>
                            <option value="3">Approved</option>                            
                        </select>
                    </div>
            </div>
        </div>
    </div>
<!--    Search Section Ends Here -->


    <div class="row gray_ttc">
        <div class="col-sm-12 form-group" style="padding: 0">
            <div class="col-sm-12 form-group" >
                <div class="col-sm-12 gray_ttc" style="margin-left: 5px; display: none;" id="edit_rating_form">
                    <div class="col-sm-12 form-group" style="border-bottom: 1px solid #80c12c; display: block">
                        <span class=" col-sm-6  form-group">
                            <h3 id="header_name" style="margin: 0">Edit Rating</h3>
                        </span>                         
                    </div> 
            <!--    Edit Rating Form Start    -->
                    <div class="row gray_ttc">

                        <div class="col-sm-12 ">
                            <div class="col-sm-12 row"><br></div>
                            <?php
                            $url = 'super-admin/manage-rating';
                            echo form_open($url, 'name="edit_rating_form" id="editRating"');
                            ?>
                            <div class="col-sm-12">
                                <div class="col-sm-12 row ">
                                    <div class="form-group col-sm-6 ">
                                        <div id="O_Rating">
                                            <div class="input-group">
                                                <input autofocus type="text" 
                                                       name="rating_value"
                                                       id="rating_value"
                                                       class="form-control" 
                                                       placeholder="Please Enter Rating" 
                                                       aria-describedby="basic-addon1" >
                                                <span class="input-group-addon" id="basic-addon1"> <i class="fa fa-star-o"></i></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group col-sm-12">
                                    <label for="rating_status" class="col-sm-2 padding-zero">Rating Status  : </label>
                                    <div class="radio radio-success col-sm-8 padding-zero margin-zero">
                                        <input type="radio" 
                                               name="rating_status"                                                  
                                               id="unpublish"
                                               data-errormessage-value-missing="Please Select Publication Status"
                                               class=""
                                               value="0">
                                        <label for="unpublish">Unpublish</label>
                                        <span style="margin-right: 30px"></span>
                                        <input type="radio" 
                                               name="rating_status"
                                               id="publish"
                                               data-errormessage-value-missing="Please Select Publication Status"
                                               class=""
                                               value="1" >
                                        <label for="publish">Publish</label>
                                        <span style="margin-right: 30px"></span>
                                        <input type="radio" 
                                               name="rating_status"                                                   
                                               id="pending"
                                               data-errormessage-value-missing="Please Select Publication Status"
                                               class=""                                                   
                                               value="2">
                                        <label for="pending">Pending</label>
                                        <span style="margin-right: 30px"></span>
                                        <input type="radio" 
                                               name="rating_status"                                                  
                                               id="approved"
                                               data-errormessage-value-missing="Please Select Publication Status"
                                               class=""                                                   
                                               value="3">
                                        <label for="approved">Approved</label>
                                    </div>
                                </div>
                                <span id="current_status" style="color: red"></span>
                            </div>

                            <div class="col-sm-12 "><br></div>
                            <div class="col-sm-12 ">
                                <div class="form-group col-sm-1 col-sm-offset-2">
                                    <button type="submit" id="updateRating" class=" btn btn-default">
                                        <i class="fa fa-save" title="Update Rating"></i></button>
                                </div>
                                <div class="form-group col-sm-1">
                                    <span id="edit_rating_cancel">
                                        <a class=" btn btn-default" href="javascript:void(0)">
                                            <i class="fa fa-times" title="Cancel"></i>
                                        </a>
                                    </span>
                                </div>
                            </div>
                            <?php echo form_close(); ?>
                        </div>
                    </div>
            <!--    Edit Rating Form End    -->
                </div>             
            </div>

            <div class="col-sm-12 white form-group" id="manageRatingView">
                <div class="col-sm-12 gray_ttc" style="margin-left: 5px" >
                    <div class="col-sm-12 form-group" style="border-bottom: 1px solid #80c12c;">
                        <span class=" col-sm-12  form-group">
                            <h3 style="margin: 0">Manage Rating</h3>
                        </span> 
                    </div>

                    <div class="col-sm-12 form-group white">
                        <div class="col-sm-12 gray_ttc form-group" style="margin-left: 5px;border-bottom: 1px solid #80c12c">
                            <div class="form-group col-sm-4">
                                <strong>Rating Type Title</strong>
                            </div>
                            <div class="form-group col-sm-4">
                                <strong>Person Name</strong>
                            </div>
                            <div class="form-group col-sm-2">
                                <strong>Rating Value</strong>
                            </div>                            
                            <div class="form-group col-sm-2">
                                <strong> Action</strong>
                            </div>                             
                        </div>
                        <div class="col-sm-12" style="height: 10px;"></div>
                        <div class="col-sm-12" id="ratingList"> 
                            <div class="col-sm-12  form-group" style="margin-left: 5px;background: #ededed" id="rating_row">
                                <div class=" col-sm-4 " style="padding-top: 5px;padding-bottom: 5px">
                                    <a href=""><?php echo 'Video_Course' ?></a>
                                </div>
                                <div class=" col-sm-4 " style="padding-top: 5px;padding-bottom: 5px">
                                    <a href=""><?php echo 'Sumon' ?></a>
                                </div>
                                <div class=" col-sm-2 " style="padding-top: 5px;padding-bottom: 5px">
                                    <?php echo 7.8 ?>
                                </div>
                                <?php if ($this->session->person_role == 6) { ?>
                                    <div class="col-sm-2 " style="padding-top: 5px;padding-bottom: 5px">
                                        <a href="javascript:void(0)" onclick="editRating()" class="EditBtn"><i class="fa fa-edit" title="Edit"></i></a>                                    
                                        <span>&nbsp;&nbsp;</span>
                                        <a href="javascript:void(0)" id="approveRating"><i class="glyphicon glyphicon-ok" title="Approve"></i></a>
                                        <span>&nbsp;&nbsp;</span>
                                        <a href="javascript:void(0)" data-toggle="modal" data-target="#deleteRating"><i class="fa fa-trash-o" title="Delete"></i></a>
                                    </div>
                                <?php } ?>
                            </div>
                            
                    <!-- -----Delete Modal Start----- -->
                            <div class="modal" style="" id="deleteRating" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content" style="top: 180px;border: 5px solid #80c12c;border-top: 20px solid #80c12c !important;margin: 0 auto;max-width: 400px">           
                                        <div class="modal-body text-center" style="padding-bottom: 0px;">
                                            <span class="text-center">Are you sure you want to delete this Rating?</span>
                                        </div>
                                        <div class="modal-footer">
                                            <div  class="col-sm-12 text-center">  
                                                <span class="col-sm-3 col-sm-offset-3">
                                                    <button  type="button" class="btn btn-danger  col-sm-12" data-dismiss="modal" style="font-size: 14px;">No</button>
                                                </span>		
                                                <span class="col-sm-3">
                                                    <button onclick="" class="btn btn-success  col-sm-12" data-dismiss="modal">Yes</button>
                                                </span>										
                                            </div>
                                        </div>            
                                    </div>
                                </div>
                            </div>
                <!-- -----Delete Modal End----- -->   
                
                        </div>
                    </div>
                </div>                
            </div>
        </div>
    </div>
</div>
<script src="<?php echo base_url(); ?>rating_asset/rating_back_end/rating.js" type="text/javascript"></script>
