forgotten to declare some variables, i guess this is the problem that there is nothing on your views..
In your model class
WHERE mds_orders.OrderDate BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59'
On the top of your $query, after
$this->load->database();
or before your query statement.. Declare these two variables:
$date_from = $this->input->post('dfrom');//the name of your input field :date from
$date_to = $this->input->post('dto');//the name of your input field :date to
change the variables into
WHERE mds_orders.OrderDate BETWEEN '".$date_from." 00:00:00' AND '".$date_to('dto'." 23:59:59'
Then in your views
you haven’t specified the action on the form.
here some roundups, you can do this if you haven’t auto load some of your model class,helpers,libraries. If you have already done the auto loading then skip reading this..
Go to application>config>autoload.php
1.Go to the line 55 where auto loading libraries, declare in the array the libraries y
your want to load as for me i autoload this libraries
$autoload['libraries'] = array('database','form_validation','session','pagination','email');
2. Go to line 112 and auto load your model there, in this way less typing and make even more faster and produce clean codings.
3. Go to line 67 on autoload.php in the auto load helper. load important helpers. As for
me I auto load these helpers.
$autoload['helper'] = array('url','file','form','text');
Let’s get back on your views. Inspect your form…. do it now. Have you seen the problem?
you haven’t specified the action. Like i was saying awhile ago..
<form name="fetching" method="POST" action="">
first we will do a very easy way on creating a form by the help of the auto loading the form helper we can have this functionality..
change your starting form tag to this one:
<?php echo form_open('sales/getAll');?>
then close your form tag..
change </form> to this:
<?php echo form_close();?>
I hope this works.. ^_^
one more thing your coding style is a bad practice, no offense im just here to help.When you declare a method:
like you name this method getAll you could change it to get_all, sometimes it could cause some problems.. anyway you use getAll() naming your method when you are creating your own libraries, but in a controller i don’t think its a good practice. You can read in the guide of coding style.