<?php
$page = 'Gallery';
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Admin</title>
   
    <!-- Bootstrap Core CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/sb-admin.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/plugins/morris.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/Backend/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>

<body>
    <div id="wrapper">
       <!-- Navigation -->
        <?php
		include "include/header.php";
		?>       
         <div id="page-wrapper">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                           Add Video
                            <small>Details</small>
                            <a href="<?php echo base_url(); ?>app/products" class="btn btn-primary pull-right">Back</a>
                        </h1>
                        <ol class="breadcrumb">
                            <li>
                                <i class="fa fa-dashboard"></i>  <a href="<?php echo base_url();?>app/home">Dashboard</a>
                            </li>
                            <li class="active">
                                <i class="fa fa-file"></i> Add Video
                            </li>
                        </ol>                        
                    </div>
                </div>                
                <!-- /.row -->
				<div class="row">
					     <?php foreach($product as $ss_row);?>     
                    <form role="form" action="<?php echo base_url(); ?>index.php/Insert/in_pvideo/<?php echo $ss_row->p_id;?>" method="post" enctype="multipart/form-data">
                    <div class="col-lg-6">                        
                                     
                            <div class="form-group">
                                <input type="text" name="v_link" class="form-control" required="" placeholder="Video Link">
								 <input type="hidden" name="p_id" value="<?php echo $ss_row->p_id;?>" class="form-control">
								
                            </div>                            
                           
                    </div>
					
					<div class="col-lg-6">
						<div class="form-group">
							 <input type="submit" class="btn btn-primary" value="Save Image">
                        	<input type="reset" class="btn btn-default" >
						</div>
					</div>
                    </form>
                </div>
				
				<div class="row">
                    <div class="col-lg-12">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover"style=" width:80%;">
                                <thead>
                                    <tr>
                                    	<th width="3%">Sr. No.</th>
                                        <th width="15%">Video link</th>
                                        <th width="8%">Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php
								$cnt=0;
								foreach($images as $row):
							    if($row->p_id == $ss_row->p_id) {
								$v_id = $row->v_id;
								$cnt+=1;
								?>
								
                                    <tr>
                                    	<td style="text-align: center;"><?php echo $cnt; ?></td>
										<td><?php echo $row->v_link;?></td>                                      
                                        <td style="text-align: center;">
                                        <a href="<?php echo base_url(); ?>index.php/Delete/del_productvideo/<?php echo $v_id; ?>"  onclick="return confirm ('Are you sure you want to delete');"class="btn btn-danger">Delete</a>
                                        </td>
                                    </tr>
											
                                <?php }
								endforeach;
								?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
   <!-- /#wrapper -->

    <!-- jQuery Version 1.11.0 -->
    <script src="<?php echo base_url(); ?>assets/Backend/js/jquery-1.11.0.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="<?php echo base_url(); ?>assets/Backend/js/bootstrap.min.js"></script>

    <!-- Morris Charts JavaScript -->
    <script src="<?php echo base_url(); ?>assets/Backend/js/plugins/morris/raphael.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/Backend/js/plugins/morris/morris.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/Backend/js/plugins/morris/morris-data.js"></script>
	<script src="<?php echo base_url(); ?>assets/Backend/editor/js/libs/jquery-1.11.1.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/froala_editor.min.js"></script>
  
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/tables.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/lists.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/colors.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/font_family.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/font_size.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/block_styles.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/media_manager.min.js"></script>
  <script src="<?php echo base_url(); ?>assets/Backend/editor/js/plugins/video.min.js"></script>

  <script>
      $(function(){
        $('#edit').editable({inlineMode: false})
      });
	  
	  
	   function show_image(input,image)
	{
		if(input.files && input.files[0])
		{
			var reader = new FileReader();
			reader.onload = function(e)
			{
				var oimg = document.createElement('img');
				$(image)
						.attr('src',e.target.result);
			};
			reader.readAsDataURL(input.files[0]);
		}
	}
	  
  </script>
</body>

</html>
