What is the most simplist way to generate reports in Codeigniter framework? Is there any library available to do this task? Except charting what are the other resources to do this.
Answers
You are using Firefox, aren't you?
You could try looking at system/libraries/Upload.php
line 199:
$this->_file_mime_type($_FILES[$field]);
Change that line to:
$this->_file_mime_type($_FILES[$field]); var_dump($this->file_type); die();
Then do upload your .wmv
file. It would show something like application/octet-stream
or whatever. Add that to your mimes.php
. Hope this help =)
Similar answer here
Some links:
- CodeIgniter forum's thread
- Mimetype corruption in Firefox
- Getting around IE’s MIME type mangling
SOLUTION: I've try to upload it to server. But it still gives me the same error. Then i found this: Codeigniter : The filetype you are attempting to upload is not allowed. Yesterday it was fine "The most recent time I have had this is when I upgraded my core Codeiginter version from 2.x to 3.x. I updated the contents of the system directory, but not application/config. I didn't spot the fact that the application/config/mimes.php file is slightly different - the newer version returns an array whereas the old one included it as a var. The fix was to copy in the newer version of mimes.php"
Noticed several issues in code.
required
& array
spelling is wrong moreover wrong syntax used in last params in form_dropdown()
function
Try this
<div class="col-md-5 ">
<div class="control-group form-group">
<label class="control-label">
Escalation Email Ids
</label>
<div class="controls">
<?php $options=array(); if(count($useridsoptions)){ foreach($useridsoptions as $key=>$val){ $options[$key]=$val; } } echo form_dropdown('esc_users[]', $options, explode(",",$row->esc_users),'id="esc_users" class="form-control function col-md-12 select2" required="required" multiple'); ?>
</div>
</div>
</div>
You need to remove index.php from your url.Create .htacces file and place in your root.Copy this code and run
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
for more how to remove index.php form url try this http://w3code.in/2015/09/how-to-remove-index-php-file-from-codeigniter-url/
Please try below solution.
You have missed dynamic classes adding in div like apps and joomla
<div class="portfolio-item apps joomla col-xs-12 col-sm-4 col-md-3">
added class in above line with your existing code
<?php
foreach($results as $row) {
//code for getting dynamic class names from db
$class = explode(",.", $row->type);
$gettypes = implode(" ", $class);
?>
<div class="portfolio-item <?php echo $gettypes;?> col-xs-12 col-sm-4 col-md-3">
Hope this work!
Found a nice solution myself. If you want to generate reports in csv format it is very easy with codeigniter. Your model function
Now in controller
No externals are required everything is available in codeigntier. Cheers! If you want to write xml file it is easy too.
Just use
xml_from_result()
method of dbutil and usewrite_file('xml_file.xml,$new_report)
Visit these links they will help.Database Utility Class
And
File Helper