<script type="application/javascript">
   function showVideo(link,title){
    $('#popupModal').modal('show');
            $("#_popupTitle").html(title);
            $("#popuHeader").attr("style","background: #99bf3c;");
            $("#_popupContent").html('<iframe width="540" height="315" src="<?php echo base_url() ?>' + link + '" frameborder="0" allowfullscreen></iframe>');
            $('#_popupFooter').empty();
            $('#_popupFooter').append(''); 
            $("#canb").click(function() {
    $('#popupModal').modal('hide'); 
    });
    }
      $('#popupModal').on('hidden', function () {
        $("#_popupContent").empty();
    })
</script>
<?php
if ($content) {
    foreach ($content as $row) {
        ?>
       
        <div class="block">
            <div class="head">
                            <h2><strong> <?php echo $row->title; ?></strong></h2>
                            <div class="side fr">
                                <a target="blank" href="<?php echo base_url() ?>userguide/ug_pdf/<?php echo $row->ugID; ?>" class="btn btn-primary" onClick="clear_form('#validate');" type="button"><i class="icon-white icon-download-alt"></i> PDF</a>
                            </div>
                        </div>
            <div  class="content">
                <div  class="row-fluid scRow"> 
                    <?php
                    echo $row->content;
                    ?>
                </div>
              
            </div>
            
        </div>
  <div class="row-fluid scRow">
                    <div class="span6 scCol">
                        <div class="block" id="grid_block_4">
                            <div class="content">
                                <div class="controls-row span12">
                                    <h3 style="margin-top:-10px;">Video Links</h3>
                                    <ul>
                                          <?php
                                                if ($videoLinks) {
                                                    foreach ($videoLinks as $rowV) {
                                                        ?>
                                        <li> <a onclick="showVideo('<?php echo $rowV->videoLink; ?>','<?php echo $rowV->title; ?>')" href="#"><?php echo $rowV->title; ?></a></li>
                                                    <?php
                                                    }
                                                }
                                                ?>
                                        </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="span6 scCol">
                        <div class="block" id="grid_block_4">
                            <div class="content">
                                <div class="controls-row span12">
                                        <h3 style="margin-top:-10px;">Related Topic</h3>
                                        <ul>
                                          <?php
                                                if ($relatedTopic) {
                                                    $this->lang->load("ug_topic",$this->session->userdata('language'));
                                                    foreach ($relatedTopic as $rowT) {
                                                        ?>
                                        <li> <a href="#" onclick="getContent(<?php echo $rowT->fldid; ?>)"><?php echo $this->lang->line($rowT->name); ?></a></li>
                                                    <?php
                                                    }
                                                }
                                                ?>
                                        </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        <?php
    }
} else {
    ?>

    <div class="block">
        <div  class="content">
            <div  class="row-fluid scRow"> 
                <img src="img/sorry.png" />
            </div>
        </div>
    </div>


    <?php
}
?>
