CodeIgniter Forums
to use datatables with my code - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: to use datatables with my code (/thread-66545.html)



to use datatables with my code - sheenam - 11-03-2016

Hi all,

i want to implement datatables with my code but when m trying to use datatables but its not working can you please help me with this.
 my code is given below:

These both codes are in view. i want to know whether any jquery is conflicting
VIEW
PHP Code:
<!DOCTYPE html>
<
html>
<
head>
 
 <meta charset="utf-8">
 
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 
 
  
<titleDashboard</title>

 
 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
 
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /bootstrap/css/bootstrap.min.css">

 
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

 
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

 
 
  
<link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /dist/css/AdminLTE.min.css">

 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /dist/css/skins/_all-skins.min.css">
 
 <!-- iCheck -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/iCheck/flat/blue.css">
 
 <!-- Morris chart -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/morris/morris.css">
 
 <!-- jvectormap -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/jvectormap/jquery-jvectormap-1.2.2.css">
 
 <!-- Date Picker -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/datepicker/datepicker3.css">
 
 <!-- Daterange picker -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/daterangepicker/daterangepicker.css">
 
 <!-- bootstrap wysihtml5 text editor -->
 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

 
 <link rel="stylesheet" href="<?php echo base_url(). "assets" ?> /css/jquery-ui-1.10.3.custom.min.css">

 
 


    
<meta name="viewport" content="width=device-width, initial-scale=1">
 
   <meta name="description" content="jquery autocomplete">
    <
meta name="keywords" content="jquery autocomplete">
    <
meta name="author" content="muni">
 
  

    
<!-- 
 
   
    
<link rel="stylesheet" type="text/css" href="<?php echo base_url(). "assets" ?>/css/jquery-ui.min.css" />
    <!--<
link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
    <
link rel="stylesheet" type="text/css" href="<?php echo base_url(). "assets" ?>/css/main.css" />
        
//<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>-->
 
   
    
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
    <
script type="text/javascript" src="<?php echo base_url(). "assets" ?>/js/jquery-ui.min.js"></script>

 
  <script  type="text/javascript" src="<?php echo base_url(). "assets" ?>/js/auto.js"></script>
 <
script  type="text/javascript" src="<?php echo base_url(). "assets" ?>/js/datatable.example.js"></script>
 <
script  type="text/javascript" src="<?php echo base_url(). "assets" ?>/js/jQuery.dtplugin.js"></script>
 
 </head>
<
body class="hold-transition skin-blue fixed sidebar-mini">

<
div class="wrapper">

 
 <header class="main-header">
 
   <!-- Logo -->
 
   <a href="index2.html" class="logo">
 
  
      
<span class="logo-lg"><b>Call</b>365</span>
 
   </a>

 
   <nav class="navbar navbar-static-top">
 
     <!-- Sidebar toggle button-->
 
     <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
 
       <span class="sr-only">Toggle navigation</span>
 
     </a>

 
     <div class="navbar-custom-menu">
 
       <ul class="nav navbar-nav">
 
      
          
<li class="dropdown messages-menu">
 
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
 
             <class="fa fa-envelope-o"></i>
 
             <span class="label label-success">4</span>
 
           </a>
 
           <ul class="dropdown-menu">
 
             <li class="header">You have 4 messages</li>
 
             <li>
 
               <!-- inner menucontains the actual data -->
 
               <ul class="menu">
 
                 <li><!-- start message -->
 
                   <a href="#">
 
                     <div class="pull-left">
 
                       <img src="" class="img-circle" alt="User Image">
 
                     </div>
 
                     <h4>
 
                       Support Team
                        
<small><class="fa fa-clock-o"></i5 mins</small>
 
                     </h4>
 
                     <p>Why not buy a new awesome theme?</p>
 
                   </a>
 
                 </li>
 
                 <!-- end message -->
 
                 <li>
 
                   <a href="#">
 
                     <div class="pull-left">
 
                       <img src="" class="img-circle" alt="User Image">
 
                     </div>
 
                     <h4>
 
                       AdminLTE Design Team
                        
<small><class="fa fa-clock-o"></i2 hours</small>
 
                     </h4>
 
                 
                    
</a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <div class="pull-left">
 
                       <img src="<?php echo base_url(). "assets" ?> /dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
 
                     </div>
 
                     <h4>
 
                       Developers
                        
<small><class="fa fa-clock-o"></iToday</small>
 
                     </h4>
 
                     <p>Why not buy a new awesome theme?</p>
 
                   </a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <div class="pull-left">
 
                       <img src="<?php echo base_url(). "assets" ?> /dist/img/user3-128x128.jpg" class="img-circle" alt="User Image">
 
                     </div>
 
                     <h4>
 
                       Sales Department
                        
<small><class="fa fa-clock-o"></iYesterday</small>
 
                     </h4>
 
                     <p>Why not buy a new awesome theme?</p>
 
                   </a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <div class="pull-left">
 
                       <img src="<?php echo base_url(). "assets" ?> /dist/img/user4-128x128.jpg" class="img-circle" alt="User Image">
 
                     </div>
 
                     <h4>
 
                       Reviewers
                        
<small><class="fa fa-clock-o"></i2 days</small>
 
                     </h4>
 
                     <p>Why not buy a new awesome theme?</p>
 
                   </a>
 
                 </li>
 
               </ul>
 
             </li>
 
             <li class="footer"><a href="#">See All Messages</a></li>
 
           </ul>
 
         </li>
 
         <!-- Notificationsstyle can be found in dropdown.less -->
 
         <li class="dropdown notifications-menu">
 
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
 
             <class="fa fa-bell-o"></i>
 
             <span class="label label-warning">10</span>
 
           </a>
 
           <ul class="dropdown-menu">
 
             <li class="header">You have 10 notifications</li>
 
             <li>
 
               <!-- inner menucontains the actual data -->
 
               <ul class="menu">
 
                 <li>
 
                   <a href="#">
 
                     <class="fa fa-users text-aqua"></inew members joined today
                    
</a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <class="fa fa-warning text-yellow"></iVery long description here that may not fit into the
                      page 
and may cause design problems
                    
</a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <class="fa fa-users text-red"></inew members joined
                    
</a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <class="fa fa-shopping-cart text-green"></i25 sales made
                    
</a>
 
                 </li>
 
                 <li>
 
                   <a href="#">
 
                     <class="fa fa-user text-red"></iYou changed your username
                    
</a>
 
                 </li>
 
               </ul>
 
             </li>
 
             <li class="footer"><a href="#">View all</a></li>
 
           </ul>
 
         </li>
 
         <!-- Tasksstyle can be found in dropdown.less -->
 
         <li class="dropdown tasks-menu">
 
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
 
             <class="fa fa-flag-o"></i>
 
             <span class="label label-danger">9</span>
 
           </a>
 
           <ul class="dropdown-menu">
 
             <li class="header">You have 9 tasks</li>
 
             <li>
 
               <!-- inner menucontains the actual data -->
 
               <ul class="menu">
 
                 <li><!-- Task item -->
 
                   <a href="#">
 
                     <h3>
 
                       Design some buttons
                        
<small class="pull-right">20%</small>
 
                     </h3>
 
                     <div class="progress xs">
 
                       <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
 
                         <span class="sr-only">20Complete</span>
 
                       </div>
 
                     </div>
 
                   </a>
 
                 </li>
 
                 <!-- end task item -->
 
                 <li><!-- Task item -->
 
                   <a href="#">
 
                     <h3>
 
                       Create a nice theme
                        
<small class="pull-right">40%</small>
 
                     </h3>
 
                     <div class="progress xs">
 
                       <div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
 
                         <span class="sr-only">40Complete</span>
 
                       </div>
 
                     </div>
 
                   </a>
 
                 </li>
 
                 <!-- end task item -->
 
                 <li><!-- Task item -->
 
                   <a href="#">
 
                     <h3>
 
                       Some task I need to do
 
                       <small class="pull-right">60%</small>
 
                     </h3>
 
                     <div class="progress xs">
 
                       <div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
 
                         <span class="sr-only">60Complete</span>
 
                       </div>
 
                     </div>
 
                   </a>
 
                 </li>
 
                 <!-- end task item -->
 
                 <li><!-- Task item -->
 
                   <a href="#">
 
                     <h3>
 
                       Make beautiful transitions
                        
<small class="pull-right">80%</small>
 
                     </h3>
 
                     <div class="progress xs">
 
                       <div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
 
                         <span class="sr-only">80Complete</span>
 
                       </div>
 
                     </div>
 
                   </a>
 
                 </li>
 
                 <!-- end task item -->
 
               </ul>
 
             </li>
 
             <li class="footer">
 
               <a href="#">View all tasks</a>
 
             </li>
 
           </ul>
 
         </li>
 
         <!-- User Accountstyle can be found in dropdown.less -->
 
         <li class="dropdown user user-menu">
 
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
 
             <img src="" class="user-image" alt="">
 
             <span class="hidden-xs">Admin</span>
 
           </a>
 
           <ul class="dropdown-menu">
 
             <!-- User image -->
 
             
              
<!-- Menu Body -->
 
             <li class="user-body">
 
               <div class="row">
 
                 <div class="col-xs-4 text-center">
 
                   <a href="#">Followers</a>
 
                 </div>
 
                 <div class="col-xs-4 text-center">
 
                   <a href="#">Sales</a>
 
                 </div>
 
                 <div class="col-xs-4 text-center">
 
                   <a href="#">Friends</a>
 
                 </div>
 
               </div>
 
               <!-- /.row -->
 
             </li>
 
             <!-- Menu Footer-->
 
             <li class="user-footer">
 
               <div class="pull-left">
 
                 <a href="#" class="btn btn-default btn-flat">Profile</a>
 
               </div>
 
               <div class="pull-right">
 
                 <a href="<?php echo base_url(). "admin/home/logout" ?>" class="btn btn-default btn-flat">Sign out</a>
 
               </div>
 
             </li>
 
           </ul>
 
         </li>
 
         <!-- Control Sidebar Toggle Button -->
 
         <li>
 
           <a href="#" data-toggle="control-sidebar"><class="fa fa-gears"></i></a>
 
         </li>
 
       </ul>
 
     </div>
 
   </nav>
 
 </header>
 
 <!-- Left side columncontains the logo and sidebar -->
 
 <aside class="main-sidebar">
 
   <!-- sidebarstyle can be found in sidebar.less -->
 
   <section class="sidebar">
 
     <!-- Sidebar user panel -->
 
     <div class="user-panel">
 
       <div class="pull-left image">
 
         <h2></h2>
 
       </div>
 
      <div class="pull-left info">
 
        <p>Admin</p>
 
     <a href="#"><class="fa fa-circle text-success"></iOnline</a>
 
       </div>
 
     </div>
 
    
      
<form action="#" method="get" class="sidebar-form">
 
       <div class="input-group">
 
         <input type="text" name="q" class="form-control" placeholder="Search...">
 
             <span class="input-group-btn">
 
               <button type="submit" name="search" id="search-btn" class="btn btn-flat"><class="fa fa-search"></i>
 
               </button>
 
             </span>
 
       </div>
 
     </form>
 
   <?php 
// Define a default Page
 
 $pg = isset($page) && $page != ''  $page :'dash'     
?>

   <ul class="sidebar-menu">
      <li class="header">MAIN NAVIGATION</li>
 <li <?php echo  $pg =='dash' 'class="active"' '' ?>> <a href="<?php echo base_url(); ?>admin/dashboard"><i class="fa fa-dashboard"></i>  <span>Dashboard  </span>
        <span class="pull-right-container">
             
            </span>
          </a>
         </li>
         
<li <?php echo  $pg =='leads' 'class="active"' '' ?>> <a href="<?php echo base_url(); ?>admin/leads">
       <i class="fa fa-user"></i>
       <span>Leads
       
       </span></a>
       </li>
       
    
       <li <?php echo  $pg =='account' 'class="active"' '' ?>> <a href="<?php echo base_url(); ?>>
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>Accounts</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          
        </li>
        <li <?php echo  $pg =='mainproducts' 'class="active"' '' ?>> <a href="<?php echo base_url(); ?>admin/mainproducts">
   
            <i class="fa fa-pie-chart"></i>
            <span>Products</span>
            <span class="pull-right-container">
              
            </span>
          </a>
        </li>
      <li  <?php echo  $pg =='contacts' 'class="active"' '' ?>><a href="<?php echo base_url(); ?>admin/contacts">
       
            <i class="fa fa-user"></i>
            <span>Contacts</span>
            <span class="pull-right-container">
      
            </span>
      
         
     
      <!--  <li class="treeview">
          <a href="#">
            <i class="fa fa-edit"></i> <span>Opportunities</span>
            <span class="pull-right-container">
              
            </span>
          </a>
        </li>-->
       
       
        <li  <?php echo  $pg =='calendar' 'class="active"' '' ?>><a href="<?php echo base_url(); ?>admin/calendar">
          
            <i class="fa fa-calendar"></i> <span>Calendar</span>
            <span class="pull-right-container">
            
            </span>
          </a>
        </li>
        <!--<li>
          <a href="pages/mailbox/mailbox.html">
            <i class="fa fa-envelope"></i> <span>Server/issues</span>
            <span class="pull-right-container">
              <small class="label pull-right bg-yellow"></small>
              <small class="label pull-right bg-green"></small>
              <small class="label pull-right bg-red"></small>
            </span>
          </a>
        </li>-->
        <li class="treeview">
          <a href="#">
            <i class="fa fa-folder"></i> <span>Documents</span>
            <span class="pull-right-container">
        
            </span>
          </a>
         
        </li>
      
   
     </li>
     
       
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->

 

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
      <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
      <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <div class="tab-pane" id="control-sidebar-home-tab">
        <h3 class="control-sidebar-heading">Recent Activity</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-birthday-cake bg-red"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                <p>Will be 23 on April 24th</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-user bg-yellow"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                <p>New phone +1(800)555-1234</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                <p>nora@example.com</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-file-code-o bg-green"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                <p>Execution time 5 seconds</p>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

        <h3 class="control-sidebar-heading">Tasks Progress</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Custom Template Design
                <span class="label label-danger pull-right">70%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Update Resume
                <span class="label label-success pull-right">95%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Laravel Integration
                <span class="label label-warning pull-right">50%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Back End Framework
                <span class="label label-primary pull-right">68%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

      </div>
      <!-- /.tab-pane -->
      <!-- Stats tab content -->
      <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
      <!-- /.tab-pane -->
      <!-- Settings tab content -->
      <div class="tab-pane" id="control-sidebar-settings-tab">
        <form method="post">
          <h3 class="control-sidebar-heading">General Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Some information about this general settings option
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Other sets of options are available
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Allow the user to show his name in blog posts
            </p>
          </div>
          <!-- /.form-group -->

          <h3 class="control-sidebar-heading">Chat Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Show me as online
              <input type="checkbox" class="pull-right" checked>
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Turn off notifications
              <input type="checkbox" class="pull-right">
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Delete chat history
              <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
            </label>
          </div>
          <!-- /.form-group -->
        </form>
      </div>
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.3 -->
<script src="<?php echo base_url(). "assets" ?> /plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.6 -->
<script src="<?php echo base_url(). "assets" ?> /bootstrap/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="<?php echo base_url(). "assets" ?> /plugins/morris/morris.min.js"></script>
<!-- Sparkline -->
<script src="<?php echo base_url(). "assets" ?> /plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="<?php echo base_url(). "assets" ?> /plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="<?php echo base_url(). "assets" ?> /plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="<?php echo base_url(). "assets" ?> /plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
<script src="<?php echo base_url(). "assets" ?> /plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="<?php echo base_url(). "assets" ?> /plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="<?php echo base_url(). "assets" ?> /plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url(). "assets" ?> /plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="<?php echo base_url(). "assets" ?> /plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url(). "assets" ?> /dist/js/app.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="<?php echo base_url(). "assets" ?> /dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url(). "assets" ?> /dist/js/demo.js"></script>
</body>
</html> 
PHP Code:
VIEW sorry this is a view file
PHP Code:
<?php include_once "vwHeader.php" ?>


<html>

<head>
<style>
table {
    width:100%;
}
table , thead
{
background: #4682B4;
color:white;
}
table, th, td {
    border: 1px solid white;
    border-collapse: collapse;
}
th, td {
    padding: 5px;
    text-align: left;
}
td{
color:black;
}
table#t01 tr:nth-child(even) {
    background-color: #eee;
}
table#t01 tr:nth-child(odd) {
   background-color:#fff;
}
table#t01 th {
    background-color: black;
    color: white;
}
</style>
<script>
function duplicate()
{
   var f1 = document.getElementById('field1');
   var f2 = document.getElementById('field2');

   f2.value = f1.value;
}
</script>
</head>
<body>
<div class="content-wrapper">

 <section class="content-header">
    
      <ol class="breadcrumb">
        <li><a href="#">Unassign&nbsp;<i class="fa fa-times"></i></a></li>
        
      </ol>
    </section>
<br>
<?php  include_once "vwLeadshead.php" ?> 
 <section class="content">
 <div class="row">

<?php include_once "vwMenu.php" ?> 

 <div class="col-lg-9 col-xs-9">  
          
<div class="box box-primary">
<div class="box-header">
 Products
</div>
 </div>
 </div> 
 
 <?php
foreach ($records as $row 
         
 

?>
  
      


<div class="container-fluid">
<div class="row main-content">       
    <div class="col-xs-9 col-xs-9">
     <div class="input-group">
 <?php echo form_open('admin/products/search?id='.$row->l_id,['class'=>'form-horizontal panel','method'=>'post']); ?>

<div class="table-responsive">
     <table id="example1" class="table table-bordered table-striped">
<tr>
  <!--  <th><input class='check_all' type='checkbox' onclick="select_all()"/></th>-->
<thead>
<th>ID</th>
   <th>Brand Name</th>
<th>Short Name</th>
<th>Long Description</th>
<th>Cost Price</th>
<th>Selling Price</th>
<th>Supplier</th>
<th>Inventory</th>
<th colspan="2">Action</th>
</thead>
</tr>
<tr>
    <!--<td><input type='checkbox' class='case'/></td>-->
    <td><span id='snum'>1.</span></td>
  <td><input class="form-control autocomplete_txt" type='text' id='p_name_1' name='p_name[]'/></td>
    <td><input class="form-control autocomplete_txt" type='text' id='p_short_name_1' name='p_short_name[]'/></td>
    <td><input class="form-control autocomplete_txt" type='text' id='p_long_description_1' name='p_long_description[]'/></td>
    <td><input class="form-control autocomplete_txt" type='text' id='p_costprice_1' name='p_costprice[]'/> </td>
<td><input class="form-control autocomplete_txt" type='text' id='p_sellingprice_1' name='p_sellingprice[]'/> </td>
<td><input class="form-control autocomplete_txt" type='text' id='p_supplier_1' name='p_supplier[]'/> </td>
<td><input class="form-control autocomplete_txt" type='text' id='p_inventory_1' name='p_inventory[]'/> </td>
<td><a href="">Edit</a> </td>
<td><a href="">Delete</a> </td>
  </tr>
  </table>
  
<button type="button" class='btn btn-success addmore'>+ Add More</button>
</div>
</form>
</div> 

</div> 
</div><!-- /container -->
<div class="clearfix"></div>
           




         
          


   <?php
}
?>
 
              

                </form>
        

        </div>
    </div>
</div>
<script>
$(document).ready(function() {
    $('#loginForm').formValidation({
        framework: 'bootstrap',
        excluded: ':disabled',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            username: {
                validators: {
                    notEmpty: {
                        message: 'The username is required'
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: 'The password is required'
                    }
                }
            }
        }
    });
});
</script>
</span>
</div>
</div>
 

</div>
</div>
</section>
</body>

</html>





<?php include_once "vwFooter.php" ?>



RE: to use datatables with my code - abhijeetgk - 11-03-2016

First of all Kindly provide what error message you get

secondly you should avoid using html code in your controller. Smile


RE: to use datatables with my code - sheenam - 11-03-2016

(11-03-2016, 02:31 AM)abhijeetgk Wrote: First of all Kindly provide what error message you get

secondly you should avoid using html code in your controller. Smile

abhijeetgk . sorry it was my mistake actly both files are in view. my datatables arent working with this code.  and thanks for replying Smile


RE: to use datatables with my code - Wouter60 - 11-03-2016

You mean Datatables.js, don't you?
It requires this structure for your table:
Code:
<table id="myId">
 <thead>
   <tr><th>Heading1</th><th>Heading2</th></tr>
 </thead>
 <tbody>
   <tr><td>Cell1.1></td><td>Cell1.2</td></tr>
   <tr><td>Cell2.1></td><td>Cell2.2</td></tr>
 </tbody>
</table>



RE: to use datatables with my code - sheenam - 11-03-2016

(11-03-2016, 01:31 PM)Wouter60 Wrote: You mean Datatables.js, don't you?
It requires this structure for your table:
Code:
<table id="myId">
 <thead>
   <tr><th>Heading1</th><th>Heading2</th></tr>
 </thead>
 <tbody>
   <tr><td>Cell1.1></td><td>Cell1.2</td></tr>
   <tr><td>Cell2.1></td><td>Cell2.2</td></tr>
 </tbody>
</td>
Wouter60 , Yes dear i have used this structure only but datatable isnt working.


RE: to use datatables with my code - Wouter60 - 11-04-2016

Quote:Wouter60 , Yes dear i have used this structure only but datatable isnt working.

No, you haven't. There are no <tbody> and </tbody> tags in your code. Besides that, the <thead> section is inside a <tr> element. It should be the other way around.