⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

javascript error



Ram
  • profile picture
  • Member

Posted 25 April 2018 - 13:16 PM

My view file

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/bootstrap-clearmin.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/roboto.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/material-design.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/small-n-flat.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/css/flexigrid.css" />
    
     <script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/flexigrid.js"></script>
<script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/jquery.form.js"></script>
<script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/flexigrid-add.js"></script>
<script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/flexigrid-edit.js"></script>
<script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/jquery.printElement.js"></script>
<script src="<?php echo base_url();?>/assets/grocery_crud/themes/flexigrid/js/jquery.printElement.min.js"></script>
 
<script src="<?php echo base_url(); ?>assets/js/jquery.mousewheel.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/fastclick.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/clearmin.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/demo/home.js"></script>

<?php
foreach($css_files as $file): ?>
    <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
    
<?php endforeach; ?>
<?php foreach($js_files as $file): ?>
    <script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
<style type='text/css'>
.cm-menu-items li a{
font-size:18px;
color:black;
}
p{
font-size:20px;
}
</style>
</head>
<body class="cm-no-transition cm-1-navbar">
<div id="cm-menu">
<nav class="cm-navbar cm-navbar-primary">
<div class="cm-flex"><img src="<?php echo base_url(); ?>assets/img/logolux.png" alt="Less support" class="img-responsive"></div>
<div class="btn btn-primary md-menu-white" data-toggle="cm-menu"></div>
</nav>
<div id="cm-menu-content">
<div id="cm-menu-items-wrapper">
<div id="cm-menu-scroller">
<ul class="cm-menu-items">
<li><a href='<?php echo site_url('admin')?>' class="sf-house">Home</a></li>
<li class="cm-submenu">
<a class="sf-lock-open">Roles & Login <span class="caret"></span></a>
<ul>
<li><a href='<?php echo site_url('role/role')?>'>Different Roles</a></li>
<li><a href='<?php echo site_url('login/login')?>'>Members</a></li>
</ul>
</li>
<li><a href='<?php echo site_url('villa/villa')?>'class=" sf-shop">Available Villas</a></li>
 
<li class="cm-submenu">
<a class="sf-sign-add">Villa Services & Images<span class="caret"></span></a>
<ul>
<li><a href='<?php echo site_url('villafacility/villafacility')?>'>Villa Facilities</a></li>
<li><a href='<?php echo site_url('Villaaminitie/villaamenitie')?>'>Villa Aminities</a></li>
<li><a href='<?php echo site_url('villaimage/villaimage')?>'>Villa Images</a></li>
<li><a href='<?php echo site_url('villaroom/villaroom')?>'>Villa Rooms</a></li>
<li><a href='<?php echo site_url('villapolicy/villapolicy')?>'>Villa Policies</a></li>
 
 
 
</ul>
</li>
<li><a href='<?php echo site_url('villabooking/villabooking')?>'class="sf-file-bookmark">Book a Villa </a></li>
<li class="active"><a href='<?php echo site_url('bookingenquiry/bookingenquiry')?>'class="sf-bubbles-alt">Enquiry </a></li>
<li><a href='<?php echo site_url('review/review')?>'class=" sf-notepad">Review </a></li>
</ul>
</div>
</div>
</div>
</div>
<header id="cm-header">
<nav class="cm-navbar cm-navbar-primary">
<div class="btn btn-primary md-menu-white hidden-md hidden-lg" data-toggle="cm-menu"></div>
<div class="cm-flex">
<h1>Booking Enquiry</h1>
<form id="cm-search" action="index.html" method="get">
<input type="search" name="q" autocomplete="off" placeholder="Search...">
</form>
</div>
<div class="pull-right">
<div id="cm-search-btn" class="btn btn-primary md-search-white" data-toggle="cm-search"></div>
</div>
<div class="dropdown pull-right">
<button class="btn btn-primary md-notifications-white" data-toggle="dropdown"> <span class="label label-danger">23</span> </button>
<div class="popover cm-popover bottom">
<div class="arrow"></div>
<div class="popover-content">
<div class="list-group">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading text-overflow">
<i class="fa fa-fw fa-envelope"></i> Nunc volutpat aliquet magna.
</h4>
<p class="list-group-item-text text-overflow">Pellentesque tincidunt mollis scelerisque. Praesent vel blandit quam.</p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">
<i class="fa fa-fw fa-envelope"></i> Aliquam orci lectus
</h4>
<p class="list-group-item-text">Donec quis arcu non risus sagittis</p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">
<i class="fa fa-fw fa-warning"></i> Holy guacamole !
</h4>
<p class="list-group-item-text">Best check yo self, you're not looking too good.</p>
</a>
</div>
<div style="padding:10px"><a class="btn btn-success btn-block" href="#">Show me more...</a></div>
</div>
</div>
</div>
<div class="dropdown pull-right">
<button class="btn btn-primary md-account-circle-white" data-toggle="dropdown"></button>
<ul class="dropdown-menu">
<li class="disabled text-center">
<a style="cursor:default;"><strong>John Smith</strong></a>
</li>
<li class="divider"></li>
<li>
<a href="#"><i class="fa fa-fw fa-user"></i> Profile</a>
</li>
<li>
<a href="#"><i class="fa fa-fw fa-cog"></i> Settings</a>
</li>
<li>
<a href="login.html"><i class="fa fa-fw fa-sign-out"></i> Sign out</a>
</li>
</ul>
</div>
</nav>
</header>
<div id="global">
<div class="container-fluid cm-container-white">
<h2 style="margin-top:0;"> Villa Enquiry</h2>
 
<div style='height:20px;'></div>
<div>
        <?php echo $output; ?>
</div>
</div>
 
 
<footer class="cm-footer"><span class="pull-left">Connected as John Smith</span><span class="pull-right">&copy; PAOMEDIA SARL</span></footer>
</div>
<script type='text/javascript' src="<?php echo base_url(); ?>assets/js/script.js"></script>
</body>
</html>

 

My Controller

 

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Bookingenquiry extends CI_Controller {

    public function __construct()
    {
        parent::__construct();

        $this->load->database();
        $this->load->helper('url');
        $this->load->library('javascript');
        $this->load->library('javascript/jquery');
        $this->load->library('grocery_CRUD');
    }

    public function _example_output($output = null)
    {
        $this->load->view('bookingenquiry.php',(array)$output);
    }

    public function index()
    {
        $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
    }

    public function bookingenquiry()
    {
            $crud = new grocery_CRUD();

            $crud->set_theme('flexigrid');
            $crud->set_table('bookingenquiry');
            $crud->set_relation('VillaId','villa','VillaName');
            $output = $crud->render();
            $crud->unset_jquery();          
            $this->_example_output($output);
    }
}

 

when i write my view and controller like this click function is not working and getting an error like this....can anyone plz figure out my problem?