 <script src="https://www.google.com/recaptcha/api.js?"></script>
 <?php 
   $person_id = $this->session->userdata('person_id');
    ?>
        <!--<div class="white-bg row padding-top-zero">-->
        <div class="col-sm-10">
            <div class="col-sm-12 text-center gray form-group">
                <div class="col-sm-6 col-sm-offset-1 text-center form-group">
                    <h2 class="padding-zero"> Idea</h2>
                </div>
                <div class="col-sm-4 form-group">
                    <a href="<?php echo base_url() ?>ideas" class="btn btn-success">Ideas</a>
                    <a href="<?php echo base_url() ?>bug-report" class="btn btn-success">Bug Report</a>
                </div>
            </div>
        <div class="col-sm-10 form-group"><br></div>
            <div class="col-sm-12 gray form-group">
                <div class="col-sm-8 form-group">
                    <div class="col-sm-12 form-group">
                        <h2 style="text-align: left !important;color:#80C12C;">
                            <?php echo $idea_answer->support_title; ?>
                        </h2>
                        <h2 style="text-align: left !important">
                            <?php echo $idea_answer->person_first_name . ' ' . $idea_answer->person_last_name; ?>
                        </h2>
                        <p style="text-align: left"> 
                        <?php 
                            echo $this->utility_model->time_format_for_read_write($idea_answer->support_date_time);
                        ?>
                        </p>
                        <hr>
                        <p class="text-justify">
                            <?php echo $idea_answer->support_description; ?>
                        </p>
                    </div> 
                    <?php
                    if($get_download){ ?>
                    <div class="col-sm-12 form-group text-left">
                    <?php
                        $file_name=explode('.', $get_download->support_attachment_location);
                        switch($file_name[1])
                        {
                           case 'gif':                              
                        ?>
                            <a 
                             href="javascript:void(0)" 
                             onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                             <img src="<?php echo base_url() .'content-library/'.$get_download->url.'/'.$get_download->support_attachment_location ?>"
                                 height="60" 
                                 width="60" > 
                            </a>
                        <?php
                          break;                       
                           case $file_name[1]== 'docx' || $file_name[1]== 'doc':
                        ?> 
                            <a 
                            href="javascript:void(0)" 
                            onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                             <img src="<?php echo base_url() . 'image/assignment/word.png' ?>">
                            </a>
                        <?php    
                        break; 
                           case $file_name[1]== 'png':
                        ?>
                        <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                             <img src="<?php echo base_url() .'content-library/'.$get_download->url.'/'.$get_download->support_attachment_location ?>"
                                  height="60" 
                                  width="60" >
                        </a>
                       <?php
                        break; 
                        case $file_name[1] == 'jpg':
                         ?>  
                         <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                              <img src="<?php echo base_url() .'content-library/'.$get_download->url.'/'.$get_download->support_attachment_location ?>" 
                                   height="60" 
                                   width="60" >
                        </a>
                        <?php
                        break; 
                        case $file_name[1] == 'zip':
                         ?>  
                         <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                               <img src="<?php echo base_url() . 'image/assignment/srar.png' ?>">
                        </a>                            
                       <?php 
                        break;
                        default :
                        ?>
                          <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaAssignment('<?php echo base_url() . 'download-idea-file' ?>', '<?php echo $get_download->support_attachment_id; ?>')"> 
                               <img src="<?php echo base_url() . 'image/assignment/unknown.png'; ?>">
                        </a>
                        
                        <?php
                        }
                    ?>
                                           
                    </div>                                      
<!--                     <?php
                     if(!$all_idea_reply){?>
                        <div class="col-sm-12 form-group text-left"> <p>Click here to reply...</p>  </div>  
                    <?php }
                     ?> -->
                
                    <?php } ?>
                    
                <?php foreach ($all_idea_reply as $all_idea_reply_info){ ?>    
                <div class="col-sm-12 form-group">   
                    <div class="media">
                    <div class="media-left">
                        <?php if($all_idea_reply_info->person_role==6 || $all_idea_reply_info->person_role==1){ ?>
                        <a href="#">                            
                           <img class="media-object" src="<?php echo base_url() . 'image/logo.png'; ?>" height="60" width="60"> 
                        </a>
                        <?php } else if($all_idea_reply_info->person_image_thumb== ''){ ?>
                         <a href="#">
                            <img class="media-object" src="<?php echo base_url() . 'image/no_profile_picture.png'; ?>" height="60" width="60"> 
                        </a>
                        <?php } else {?>
                          <a href="#">
                            <img 
                                class="media-object" 
                                src="<?php echo base_url().'content-library/'.$all_idea_reply_info->url.'/'.$all_idea_reply_info->person_image_thumb ?>" 
                                height="60" 
                                width="60" 
                                alt=" ">
                        </a>
                        <?php } ?>
                    </div>
                    <div class="media-body text-left">
                    <h4 class="media-heading">
                        <?php if($all_idea_reply_info->person_role==6 || $all_idea_reply_info->person_role==1){ 
                       echo 'TalhaTraining '  ; 
                        } 
                        else {
                       echo $all_idea_reply_info->person_first_name.' '.$all_idea_reply_info->person_last_name  ; 
                    }?>
                    </h4>
                    <p class="text-justify"> <?php echo $all_idea_reply_info->support_reply_description; ?></p>
                    <?php
                    if($idea_reply_attachment[$all_idea_reply_info->support_reply_id]){
                   ?>
                    <p> 
                        
                        <?php                  
                        $file_name=explode('.', $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_location);
                        switch($file_name[1])
                        {
                           case 'jpg':                              
                        ?>
                            <a 
                             href="javascript:void(0)" 
                             onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')">                             
                                <img src="<?php echo base_url() .'content-library/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->url.'/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_location ?>" 
                                   height="60" 
                                   width="60" >
                            </a>
                        <?php
                          break;                       
                          case $file_name[1]=='docx' || $file_name[1]=='doc':
                        ?> 
                            <a 
                            href="javascript:void(0)" 
                            onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')"> 
                             <img src="<?php echo base_url() . 'image/assignment/word.png' ?>">
                            </a>
                        <?php    
                        break; 
                        case $file_name[1]=='png':
                        ?>
                        <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')"> 
                              <img src="<?php echo base_url() .'content-library/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->url.'/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_location ?>" 
                                   height="60" 
                                   width="60" >
                        </a>
                       <?php
                        break; 
                        case $file_name[1] == 'gif':
                         ?>  
                         <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')"> 
                               <img src="<?php echo base_url() .'content-library/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->url.'/'.$idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_location ?>" 
                                   height="60" 
                                   width="60" >
                        </a>
                        <?php
                        break; 
                        case $file_name[1] == 'zip':
                         ?>  
                         <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')"> 
                               <img src="<?php echo base_url() . 'image/assignment/rar.png' ?>">
                        </a>                            
                       <?php 
                        break;
                        default :
                        ?>
                          <a 
                         href="javascript:void(0)" 
                         onclick="downloadIdeaReplyAssignment('<?php echo base_url() . 'download-idea-reply-file' ?>', '<?php echo $idea_reply_attachment[$all_idea_reply_info->support_reply_id]->support_attachment_id; ?>')"> 
                               <img src="<?php echo base_url() . 'image/assignment/unknown.png'; ?>">
                        </a>
                        
                        <?php
                        }
                    ?>  
                        
                    </p>   
                        
                    <?php    
                    }
                    ?>                                      
                    </div>
                  <p style="text-align: left"> 
                        <?php 
                        if($all_idea_reply_info->support_reply_date_time){
                             echo $this->utility_model->time_format_for_read_write($all_idea_reply_info->support_reply_date_time);
                        }

                       ?>
                        </p>
                    </div>
                     
                </div>
                        
               <?php  } ?>    
             <?php  if(!$sign_in_person_info)  {?>
                <div class="col-sm-12 form-group text-left"> 
                    <p id="clickhere">
                        <a  href="javascript:void(0)" onclick="displayReplyMessage()">Click here to reply...
                        </a> 
                    </p> 
                    <p id="show_message" style="color:#80C12C;"></p>
                </div>
               <?php }   ?>  
                    
                 
                   <?php  if($sign_in_person_info && $reply=='1')  { 
                       //echo $reply.'----person--'.$sign_in_person_info->person_id;?>
                    <div class="col-sm-12 form-group">
                        <div class="media">
                            <div class="media-left">
                                <?php if($sign_in_person_info->person_role ==6 || $sign_in_person_info->person_role ==1 ) { ?>
                                <a href="#">
                                     <img class="media-object" src="<?php echo base_url() . 'image/logo.png'; ?>" height="60" width="60">
                                </a>
                                <?php } else if($sign_in_person_info->person_image_thumb== ''){ ?>
                                  <a href="#">
                                   <img class="media-object" src="<?php echo base_url() . 'image/no_profile_picture.png'; ?>" height="60" width="60"> 
                                </a>
                                <?php }else{ ?>
                                <a>
                                <img class="media-object" src="<?php echo base_url().'content-library/'.$sign_in_person_info->url.'/'.$sign_in_person_info->person_image_thumb ?>" height="60" width="60">
                                </a>
                                    <?php } ?>
                            </div>
                            <div class="media-body">
                                <h4 class="media-heading">     
                                <?php 
                                if($sign_in_person_info->person_role ==6 || $sign_in_person_info->person_role ==1 ){
                                    echo 'TalhaTraining';
                                }
                                else {
                                echo $sign_in_person_info->person_first_name . ' ' . $sign_in_person_info->person_last_name; 
                                }
                                ?>
                                </h4>
                                <?php
                                $url = 'add-reply-idea/'.$idea_answer->support_id;
                                echo form_open_multipart($url, 'class="cmxform" id="formID6" onsubmit="return check_form_idea()" name="supportidea1"');
                                ?>
                                <div class="col-sm-12 form-group">
                                    <div class="input-group">
                                        <textarea  class="form-control" 
                                                   cols="100" 
                                                   name="support_reply_description" 
                                                   placeholder="Reply .." 
                                                   aria-describedby="basic-addon1" 
                                                   style="width:100%;float:right;max-width: 470px;max-height: 100px"><?php echo set_value('support_reply_description'); ?></textarea>
                                    </div>
                                    <span style="color: red"><?php echo form_error('support_reply_description'); ?></span>
                                </div>
                                
                                 <div class="form-group col-sm-12 padding-zero">
                                <div class="form-group col-sm-9 ">
                                    <script>
                                        $(":file").filestyle({icon: false});</script>
                                    <input type="file"
                                           id="idea_reply_file"
                                           name="idea_reply_file"
                                           onchange="getIdeareplyfile(this)"
                                           class="filestyle" 
                                           data-icon="false">
                                </div>
                                     <input type="hidden" name="reply_person_id" value="<?php echo $sign_in_person_info->person_id ?>">
                                <div class="form-group col-sm-3">
                                    <span class="text-left" 
                                          id="upload_reply_file">
                                        [Upload File]
                                    </span>
                                    <span id="view_file" style="display: none">
                                        <img id="src_file" src="" height="40" width="50">
                                    </span>
                                </div>
                            </div>                              
                                <?php
                                $super_admin=$sign_in_person_info->person_role == 6;
                                $admin=$sign_in_person_info->person_role == 1;

                                if(!$super_admin && !$admin){
                                ?>
                                <div class="col-sm-12 form-group">
                                    <div>                                  
                                        <input type="hidden" id="mcap" name="google_captcha" value="">
                                        <?php $this->general_library->google_captcha(); ?>                                   
                                    </div>
                                    <span id="captcha_error" style="color: red"><?php echo form_error('google_captcha'); ?></span>
                                
                                </div>
                                <?php
                                }
                                ?>
                                
                                <div class="col-sm-12">
                                    <div class=" col-sm-3 col-sm-offset-4 form-group">
                                        <input type="submit" 
                                               class="green-btn btn btn-default" 
                                               value="Submit !">
                                    </div>
                                </div>
                                <?php echo form_close(); ?>
                        </div>
                        </div>
                    </div>
                   <?php } ?>
                   
                    
                </div>
                <div class="col-sm-4 form-group">
                    <span class="col-sm-12 form-group"><h2>Related Ideas</h2><hr></span> 
                    <div class="col-sm-12" id="more_idea">
                        <?php
                        $counter = 0;
                        foreach ($related_idea as $related_idea_info) {
                            ?>
                            <span class="col-sm-12 form-group text-left" >      
                                
                                <a href="<?php echo base_url() ?>support-idea/<?php echo $related_idea_info->support_id ;?>" >
                                    <i class="fa fa-arrow-circle-o-right"> </i> 
                                    <?php echo $related_idea_info->support_title ?>
                                </a>    

                            </span> 

                            <?php
                            $counter ++;
                        }
                        ?>

                        <?php if ($total_idea->total_idea > $counter) { ?>
                            <a href="javascript:void(0)" onclick="more_view_idea('<?php echo base_url(); ?>support-more-idea/', '<?php echo $counter; ?>')" > More...</a>
                            <?php }
                        ?>
                    </div>
               </div>
            </div>

        </div>
        <!--</div> /.row -->
<script>
    function check_form_idea(){
        if(grecaptcha.getResponse() == ''){
            $('#mcap').val('');
            $('#captcha_error').html('Fill up the above fields then Complete The Captcha');
            return false;
        }
        else{
            $('#mcap').val('1');
            return true;
        }
    }
</script>

<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/support/support.js"></script>