This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
Query With Multiple Results | |
**************************************************************************/ | |
/*--------------------------------------------------------------*/ | |
Obejct Version | |
/*--------------------------------------------------------------*/ | |
$query = $this->db->query('SELECT name, title, email FROM my_table'); | |
foreach ($query->result() as $row) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->table->set_heading('Id','My Title','My Content'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $this->table->generate($records); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="<?php echo base_url();?>/css/style.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond $1 !^(index\.php|resources|robots\.txt) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L,QSA] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Base Site URL | |
|-------------------------------------------------------------------------- | |
| | |
| URL to your CodeIgniter root. Typically this will be your base URL, | |
| WITH a trailing slash: | |
| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
| ------------------------------------------------------------------- | |
| AUTO-LOADER | |
| ------------------------------------------------------------------- | |
| This file specifies which systems should be loaded by default. | |
| | |
| In order to keep the framework as light-weight as possible only the | |
| absolute minimal resources are loaded by default. For example, | |
| the database is not connected to automatically since no assumption |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Site extends CI_Controller { | |
//Shows data inserted and views | |
public function index() | |
{ | |
if($query=$this->site_model->get_records()){ | |
$data['records']=$query; | |
} | |
$this->load->view('option_view',$data); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Site_model extends CI_Model { | |
//Select all | |
function get_records(){ | |
$query=$this->db->get('data'); | |
return $query->result(); | |
} | |
//Add Record | |
function add_record(){ | |
$data=array( | |
'title'=>$this->input->post('title'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$path=$this->config->item('server_root'); | |
$file=$path.'/CI25_06_2012/attachments/informa.txt'; | |
$this->email->attach($file); |