├── LICENSE ├── app ├── .htaccess ├── cache │ ├── .htaccess │ └── index.html ├── index.html ├── config │ ├── index.html │ ├── hooks.php │ ├── profiler.php │ ├── doctypes.php │ ├── migration.php │ ├── constants.php │ ├── routes.php │ ├── foreign_chars.php │ ├── database.php │ ├── smileys.php │ ├── autoload.php │ └── mimes.php ├── core │ └── index.html ├── errors │ ├── index.html │ ├── error_php.php │ ├── error_general.php │ ├── error_db.php │ └── error_404.php ├── helpers │ └── index.html ├── hooks │ └── index.html ├── logs │ └── index.html ├── models │ ├── index.html │ ├── user_model.php │ ├── list_model.php │ └── task_model.php ├── views │ ├── index.html │ ├── lists │ │ ├── edit_list.php │ │ ├── index.php │ │ ├── add_list.php │ │ └── show.php │ ├── tasks │ │ ├── add_task.php │ │ ├── edit_task.php │ │ └── show.php │ ├── users │ │ ├── login.php │ │ └── register.php │ ├── layouts │ │ └── main.php │ └── home.php ├── controllers │ ├── index.html │ ├── home.php │ ├── users.php │ ├── tasks.php │ └── lists.php ├── libraries │ └── index.html ├── third_party │ └── index.html └── language │ └── english │ └── index.html ├── sys ├── .htaccess ├── fonts │ ├── texb.ttf │ └── index.html ├── index.html ├── core │ ├── index.html │ ├── Model.php │ ├── Controller.php │ ├── Benchmark.php │ ├── Utf8.php │ └── Lang.php ├── database │ ├── index.html │ ├── drivers │ │ ├── index.html │ │ ├── cubrid │ │ │ ├── index.html │ │ │ └── cubrid_utility.php │ │ ├── mssql │ │ │ ├── index.html │ │ │ ├── mssql_utility.php │ │ │ └── mssql_result.php │ │ ├── mysql │ │ │ ├── index.html │ │ │ └── mysql_result.php │ │ ├── mysqli │ │ │ ├── index.html │ │ │ ├── mysqli_utility.php │ │ │ └── mysqli_result.php │ │ ├── oci8 │ │ │ ├── index.html │ │ │ └── oci8_utility.php │ │ ├── odbc │ │ │ ├── index.html │ │ │ └── odbc_utility.php │ │ ├── pdo │ │ │ ├── index.html │ │ │ ├── pdo_utility.php │ │ │ └── pdo_result.php │ │ ├── sqlite │ │ │ ├── index.html │ │ │ ├── sqlite_utility.php │ │ │ └── sqlite_result.php │ │ ├── sqlsrv │ │ │ ├── index.html │ │ │ ├── sqlsrv_utility.php │ │ │ └── sqlsrv_result.php │ │ └── postgre │ │ │ ├── index.html │ │ │ ├── postgre_utility.php │ │ │ └── postgre_result.php │ └── DB.php ├── helpers │ ├── index.html │ ├── language_helper.php │ ├── email_helper.php │ ├── path_helper.php │ ├── xml_helper.php │ ├── number_helper.php │ ├── directory_helper.php │ ├── typography_helper.php │ ├── cookie_helper.php │ ├── array_helper.php │ ├── download_helper.php │ └── security_helper.php ├── language │ ├── index.html │ └── english │ │ ├── index.html │ │ ├── number_lang.php │ │ ├── migration_lang.php │ │ ├── unit_test_lang.php │ │ ├── profiler_lang.php │ │ ├── ftp_lang.php │ │ ├── calendar_lang.php │ │ ├── upload_lang.php │ │ ├── email_lang.php │ │ ├── form_validation_lang.php │ │ ├── imglib_lang.php │ │ ├── db_lang.php │ │ └── date_lang.php └── libraries │ ├── index.html │ ├── Log.php │ └── Cache │ └── drivers │ ├── Cache_dummy.php │ ├── Cache_apc.php │ └── Cache_file.php ├── .htaccess ├── README.md ├── assets └── css │ └── custom.css └── mytodo_ci.sql /LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /sys/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /app/cache/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /sys/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/mytodo_ci/HEAD/sys/fonts/texb.ttf -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/config/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/fonts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /app/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/mssql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/mysqli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/sqlite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /sys/database/drivers/postgre/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymLinks 2 | Options -Indexes 3 | DirectoryIndex index.php 4 | RewriteEngine on 5 | RewriteCond $1 !^(index\.php|assets|images|css|js|install|robots\.txt|favicon\.ico) 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteCond %{REQUEST_FILENAME} !-d 8 | RewriteRule ^(.*)$ index.php?/$1 [L,QSA] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MyTodo v1.0 2 | ========= 3 | 4 | This is a demo application that uses the CodeIgniter framework. Use it as you see fit. 5 | 6 | Note: This versions code may slightly differ from the version I created in the Youtube tutorial. 7 | 8 | I have included a database dump file as well. Just import it via phpmyadmin 9 | -------------------------------------------------------------------------------- /sys/language/english/number_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

A PHP Error was encountered

4 | 5 |

Severity:

6 |

Message:

7 |

Filename:

8 |

Line Number:

9 | 10 | -------------------------------------------------------------------------------- /app/config/hooks.php: -------------------------------------------------------------------------------- 1 | session->userdata('logged_in')){ 5 | //Get the logged in users id 6 | $user_id = $this->session->userdata('user_id'); 7 | //Get all lists from the model 8 | $data['lists'] = $this->List_model->get_all_lists($user_id); 9 | $data['tasks'] = $this->Task_model->get_users_tasks($user_id); 10 | } 11 | 12 | $data['main_content'] = 'home'; 13 | $this->load->view('layouts/main',$data); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/config/profiler.php: -------------------------------------------------------------------------------- 1 | Edit List 2 | 3 | '); ?> 4 | id.''); ?> 5 | 6 |

7 | 8 | 'list_name', 11 | 'value' => $this_list->list_name 12 | ); 13 | ?> 14 | 15 |

16 | 17 |

18 | 19 | 'list_body', 22 | 'value' => $this_list->list_body 23 | ); 24 | ?> 25 | 26 |

27 | 28 | 29 | "Update List", 30 | "name" => "submit", 31 | "class" => "btn btn-primary"); ?> 32 |

33 | 34 |

35 | -------------------------------------------------------------------------------- /app/views/lists/index.php: -------------------------------------------------------------------------------- 1 |

Task Lists

2 | session->flashdata('list_created')) : ?> 3 | ' .$this->session->flashdata('list_created') . '

'; ?> 4 | 5 | session->flashdata('list_deleted')) : ?> 6 | ' .$this->session->flashdata('list_deleted') . '

'; ?> 7 | 8 | session->flashdata('list_updated')) : ?> 9 | ' .$this->session->flashdata('list_updated') . '

'; ?> 10 | 11 |

These are your current task lists

12 | 20 |
21 |

To create a new list - Click here -------------------------------------------------------------------------------- /app/views/lists/add_list.php: -------------------------------------------------------------------------------- 1 |

Add a List

2 |

Please fill out the form below to create a new task list

3 | 4 | '); ?> 5 | 6 | 7 |

8 | 9 | 'list_name', 12 | 'value' => set_value('list_name') 13 | ); 14 | ?> 15 | 16 |

17 | 18 |

19 | 20 | 'list_body', 23 | 'value' => set_value('list_body') 24 | ); 25 | ?> 26 | 27 |

28 | 29 | 30 | "Add List", 31 | "name" => "submit", 32 | "class" => "btn btn-primary"); ?> 33 |

34 | 35 |

36 | -------------------------------------------------------------------------------- /app/config/doctypes.php: -------------------------------------------------------------------------------- 1 | '', 5 | 'xhtml1-strict' => '', 6 | 'xhtml1-trans' => '', 7 | 'xhtml1-frame' => '', 8 | 'html5' => '', 9 | 'html4-strict' => '', 10 | 'html4-trans' => '', 11 | 'html4-frame' => '' 12 | ); 13 | 14 | /* End of file doctypes.php */ 15 | /* Location: ./application/config/doctypes.php */ -------------------------------------------------------------------------------- /app/models/user_model.php: -------------------------------------------------------------------------------- 1 | $this->input->post('first_name'), 7 | 'last_name' => $this->input->post('last_name'), 8 | 'email' => $this->input->post('email'), 9 | 'username' => $this->input->post('username'), 10 | 'password' => md5($this->input->post('password')) 11 | ); 12 | 13 | $insert = $this->db->insert('users', $new_member_insert); 14 | return $insert; 15 | } 16 | 17 | 18 | public function login_user($username,$passowrd){ 19 | //Secure password 20 | $enc_password = md5($passowrd); 21 | 22 | //Validate 23 | $this->db->where('username',$username); 24 | $this->db->where('password',$enc_password); 25 | 26 | $result = $this->db->get('users'); 27 | if($result->num_rows() == 1){ 28 | return $result->row(0)->id; 29 | } else { 30 | return false; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sys/language/english/profiler_lang.php: -------------------------------------------------------------------------------- 1 | Add a Task 2 |

List:

3 | 4 | 5 | '); ?> 6 | uri->segment(3).''); ?> 7 | 8 | 9 |

10 | 11 | 'task_name', 14 | 'value' => set_value('task_name') 15 | ); 16 | ?> 17 | 18 |

19 | 20 | 21 |

22 | 23 | 'task_body', 26 | 'value' => set_value('task_body') 27 | ); 28 | ?> 29 | 30 |

31 | 32 | 33 |

34 | 35 | 36 |

37 | 38 | 39 | "Add Task", 40 | "name" => "submit", 41 | "class" => "btn btn-primary"); ?> 42 |

43 | 44 |

45 | 46 | -------------------------------------------------------------------------------- /app/views/tasks/edit_task.php: -------------------------------------------------------------------------------- 1 |

Edit Task

2 |

List:

3 | 4 | 5 | '); ?> 6 | uri->segment(3).''); ?> 7 | 8 | 9 |

10 | 11 | 'task_name', 14 | 'value' => $this_task->task_name 15 | ); 16 | ?> 17 | 18 |

19 | 20 | 21 |

22 | 23 | 'task_body', 26 | 'value' => $this_task->task_body 27 | ); 28 | ?> 29 | 30 |

31 | 32 | 33 |

34 | 35 | 36 |

37 | 38 | 39 | "Update Task", 40 | "name" => "submit", 41 | "class" => "btn btn-primary"); ?> 42 |

43 | 44 |

45 | 46 | -------------------------------------------------------------------------------- /sys/language/english/ftp_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /app/errors/error_db.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Database Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /app/errors/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Page Not Found 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /sys/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 52 | } 53 | } 54 | // END Model Class 55 | 56 | /* End of file Model.php */ 57 | /* Location: ./system/core/Model.php */ -------------------------------------------------------------------------------- /app/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->latest() this is the version that schema will 21 | | be upgraded / downgraded to. 22 | | 23 | */ 24 | $config['migration_version'] = 0; 25 | 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Migrations Path 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Path to your migrations folder. 33 | | Typically, it will be within your application path. 34 | | Also, writing permission is required within the migrations path. 35 | | 36 | */ 37 | $config['migration_path'] = APPPATH . 'migrations/'; 38 | 39 | 40 | /* End of file migration.php */ 41 | /* Location: ./application/config/migration.php */ -------------------------------------------------------------------------------- /app/views/tasks/show.php: -------------------------------------------------------------------------------- 1 | 12 |

task_name; ?>

13 |
24 |
task_body; ?>
25 |

26 | <- Go Back to list_name; ?> 27 | 28 | -------------------------------------------------------------------------------- /sys/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 46 | 47 | if ($id != '') 48 | { 49 | $line = '"; 50 | } 51 | 52 | return $line; 53 | } 54 | } 55 | 56 | // ------------------------------------------------------------------------ 57 | /* End of file language_helper.php */ 58 | /* Location: ./system/helpers/language_helper.php */ -------------------------------------------------------------------------------- /sys/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | $class) 45 | { 46 | $this->$var =& load_class($class); 47 | } 48 | 49 | $this->load =& load_class('Loader', 'core'); 50 | 51 | $this->load->initialize(); 52 | 53 | log_message('debug', "Controller Class Initialized"); 54 | } 55 | 56 | public static function &get_instance() 57 | { 58 | return self::$instance; 59 | } 60 | } 61 | // END Controller class 62 | 63 | /* End of file Controller.php */ 64 | /* Location: ./system/core/Controller.php */ -------------------------------------------------------------------------------- /app/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 12 | '/ö|œ/' => 'oe', 13 | '/ü/' => 'ue', 14 | '/Ä/' => 'Ae', 15 | '/Ü/' => 'Ue', 16 | '/Ö/' => 'Oe', 17 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', 18 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', 19 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 20 | '/ç|ć|ĉ|ċ|č/' => 'c', 21 | '/Ð|Ď|Đ/' => 'D', 22 | '/ð|ď|đ/' => 'd', 23 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', 24 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', 25 | '/Ĝ|Ğ|Ġ|Ģ/' => 'G', 26 | '/ĝ|ğ|ġ|ģ/' => 'g', 27 | '/Ĥ|Ħ/' => 'H', 28 | '/ĥ|ħ/' => 'h', 29 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', 30 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', 31 | '/Ĵ/' => 'J', 32 | '/ĵ/' => 'j', 33 | '/Ķ/' => 'K', 34 | '/ķ/' => 'k', 35 | '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', 36 | '/ĺ|ļ|ľ|ŀ|ł/' => 'l', 37 | '/Ñ|Ń|Ņ|Ň/' => 'N', 38 | '/ñ|ń|ņ|ň|ʼn/' => 'n', 39 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', 40 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', 41 | '/Ŕ|Ŗ|Ř/' => 'R', 42 | '/ŕ|ŗ|ř/' => 'r', 43 | '/Ś|Ŝ|Ş|Š/' => 'S', 44 | '/ś|ŝ|ş|š|ſ/' => 's', 45 | '/Ţ|Ť|Ŧ/' => 'T', 46 | '/ţ|ť|ŧ/' => 't', 47 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', 48 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', 49 | '/Ý|Ÿ|Ŷ/' => 'Y', 50 | '/ý|ÿ|ŷ/' => 'y', 51 | '/Ŵ/' => 'W', 52 | '/ŵ/' => 'w', 53 | '/Ź|Ż|Ž/' => 'Z', 54 | '/ź|ż|ž/' => 'z', 55 | '/Æ|Ǽ/' => 'AE', 56 | '/ß/'=> 'ss', 57 | '/IJ/' => 'IJ', 58 | '/ij/' => 'ij', 59 | '/Œ/' => 'OE', 60 | '/ƒ/' => 'f' 61 | ); 62 | 63 | /* End of file foreign_chars.php */ 64 | /* Location: ./application/config/foreign_chars.php */ -------------------------------------------------------------------------------- /sys/language/english/form_validation_lang.php: -------------------------------------------------------------------------------- 1 | ","\"", "'", "-"), 53 | array("&", "<", ">", """, "'", "-"), 54 | $str); 55 | 56 | // Decode the temp markers back to entities 57 | $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); 58 | 59 | if ($protect_all === TRUE) 60 | { 61 | $str = preg_replace("/$temp(\w+);/","&\\1;", $str); 62 | } 63 | 64 | return $str; 65 | } 66 | } 67 | 68 | // ------------------------------------------------------------------------ 69 | 70 | /* End of file xml_helper.php */ 71 | /* Location: ./system/helpers/xml_helper.php */ -------------------------------------------------------------------------------- /app/views/users/login.php: -------------------------------------------------------------------------------- 1 | session->userdata('logged_in')) : ?> 2 |

You are logged in as session->userdata('username'); ?>

3 | 4 | 'logout_form', 5 | 'class' => 'form-horizontal'); ?> 6 | 7 | 8 | "Logout", 9 | "name" => "submit", 10 | "class" => "btn btn-primary"); ?> 11 | 12 | 13 | 14 |

Login Form

15 | 16 | session->flashdata('login_failed')) : ?> 17 | ' .$this->session->flashdata('login_failed') . '

'; ?> 18 | 19 | 20 | 21 | 'login_form', 22 | 'class' => 'form-horizontal'); ?> 23 | 24 | 25 | 26 |

27 | 28 | 'username', 31 | 'placeholder' => 'Enter Username', 32 | 'style' => 'width:90%', 33 | 'value' => set_value('username') 34 | ); 35 | ?> 36 | 37 |

38 | 39 | 40 |

41 | 42 | 'password', 45 | 'placeholder' => 'Enter Password', 46 | 'style' => 'width:90%', 47 | 'value' => set_value('password') 48 | ); 49 | ?> 50 | 51 |

52 |
53 |

54 | 55 | "Login", 56 | "name" => "submit", 57 | "class" => "btn btn-primary"); ?> 58 | 59 |

60 | 61 | 62 | -------------------------------------------------------------------------------- /sys/helpers/number_helper.php: -------------------------------------------------------------------------------- 1 | lang->load('number'); 43 | 44 | if ($num >= 1000000000000) 45 | { 46 | $num = round($num / 1099511627776, $precision); 47 | $unit = $CI->lang->line('terabyte_abbr'); 48 | } 49 | elseif ($num >= 1000000000) 50 | { 51 | $num = round($num / 1073741824, $precision); 52 | $unit = $CI->lang->line('gigabyte_abbr'); 53 | } 54 | elseif ($num >= 1000000) 55 | { 56 | $num = round($num / 1048576, $precision); 57 | $unit = $CI->lang->line('megabyte_abbr'); 58 | } 59 | elseif ($num >= 1000) 60 | { 61 | $num = round($num / 1024, $precision); 62 | $unit = $CI->lang->line('kilobyte_abbr'); 63 | } 64 | else 65 | { 66 | $unit = $CI->lang->line('bytes'); 67 | return number_format($num).' '.$unit; 68 | } 69 | 70 | return number_format($num, $precision).' '.$unit; 71 | } 72 | } 73 | 74 | 75 | /* End of file number_helper.php */ 76 | /* Location: ./system/helpers/number_helper.php */ -------------------------------------------------------------------------------- /app/views/layouts/main.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | myTodo Task Manager 5 | 6 | 7 | 8 | 9 | 10 | 33 | 34 |
35 |
36 |
37 | 43 |
44 | 45 |
46 | 47 | load->view($main_content); ?> 48 |
49 |
50 |
51 | 52 | 55 |
56 | 57 | -------------------------------------------------------------------------------- /sys/database/drivers/postgre/postgre_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | 87 | /* End of file postgre_utility.php */ 88 | /* Location: ./system/database/drivers/postgre/postgre_utility.php */ -------------------------------------------------------------------------------- /app/views/users/register.php: -------------------------------------------------------------------------------- 1 |

Register

2 |

Please fill out the form below to create an account

3 | 4 | '); ?> 5 | 6 | 7 |

8 | 9 | 'first_name', 12 | 'value' => set_value('first_name') 13 | ); 14 | ?> 15 | 16 |

17 | 18 |

19 | 20 | 'last_name', 23 | 'value' => set_value('last_name') 24 | ); 25 | ?> 26 | 27 |

28 | 29 | 30 |

31 | 32 | 'email', 35 | 'value' => set_value('email') 36 | ); 37 | ?> 38 | 39 |

40 | 41 | 42 |

43 | 44 | 'username', 47 | 'value' => set_value('username') 48 | ); 49 | ?> 50 | 51 |

52 | 53 | 54 |

55 | 56 | 'password', 59 | 'value' => set_value('password') 60 | ); 61 | ?> 62 | 63 |

64 | 65 | 66 |

67 | 68 | 'password2', 71 | 'value' => set_value('password2') 72 | ); 73 | ?> 74 | 75 |

76 | 77 | 78 | "Register", 79 | "name" => "submit", 80 | "class" => "btn btn-primary"); ?> 81 |

82 | 83 |

84 | -------------------------------------------------------------------------------- /sys/database/drivers/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file oci8_utility.php */ 87 | /* Location: ./system/database/drivers/oci8/oci8_utility.php */ -------------------------------------------------------------------------------- /sys/language/english/db_lang.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /sys/database/drivers/mysqli/mysqli_utility.php: -------------------------------------------------------------------------------- 1 | db->_escape_identifiers($table); 52 | } 53 | 54 | // -------------------------------------------------------------------- 55 | 56 | /** 57 | * Repair table query 58 | * 59 | * Generates a platform-specific query so that a table can be repaired 60 | * 61 | * @access private 62 | * @param string the table name 63 | * @return object 64 | */ 65 | function _repair_table($table) 66 | { 67 | return "REPAIR TABLE ".$this->db->_escape_identifiers($table); 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * MySQLi Export 74 | * 75 | * @access private 76 | * @param array Preferences 77 | * @return mixed 78 | */ 79 | function _backup($params = array()) 80 | { 81 | // Currently unsupported 82 | return $this->db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file mysqli_utility.php */ 87 | /* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ -------------------------------------------------------------------------------- /sys/database/drivers/sqlsrv/sqlsrv_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /sys/helpers/directory_helper.php: -------------------------------------------------------------------------------- 1 | 0) && @is_dir($source_dir.$file)) 61 | { 62 | $filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden); 63 | } 64 | else 65 | { 66 | $filedata[] = $file; 67 | } 68 | } 69 | 70 | closedir($fp); 71 | return $filedata; 72 | } 73 | 74 | return FALSE; 75 | } 76 | } 77 | 78 | 79 | /* End of file directory_helper.php */ 80 | /* Location: ./system/helpers/directory_helper.php */ -------------------------------------------------------------------------------- /app/models/list_model.php: -------------------------------------------------------------------------------- 1 | db->where('list_user_id',$user_id); 6 | $this->db->order_by('create_date', 'asc'); 7 | $query = $this->db->get('lists'); 8 | return $query->result(); 9 | } 10 | 11 | public function get_list($id){ 12 | $this->db->select('*'); 13 | $this->db->from('lists'); 14 | $this->db->where('id',$id); 15 | $query = $this->db->get(); 16 | if($query->num_rows() != 1){ 17 | return FALSE; 18 | } 19 | return $query->row(); 20 | } 21 | 22 | public function get_list_tasks($list_id,$active = true){ 23 | $this->db->select(' 24 | tasks.task_name, 25 | tasks.task_body, 26 | tasks.id as task_id, 27 | lists.list_name, 28 | lists.list_body 29 | '); 30 | $this->db->from('tasks'); 31 | $this->db->join('lists', 'lists.id = tasks.list_id'); 32 | $this->db->where('tasks.list_id',$list_id); 33 | if($active == true){ 34 | $this->db->where('tasks.is_complete',0); 35 | } else { 36 | $this->db->where('tasks.is_complete',1); 37 | } 38 | $query = $this->db->get(); 39 | if($query->num_rows() < 1){ 40 | return FALSE; 41 | } 42 | return $query->result(); 43 | 44 | } 45 | 46 | 47 | public function create_list($data){ 48 | $insert = $this->db->insert('lists', $data); 49 | return $insert; 50 | } 51 | 52 | public function edit_list($list_id,$data){ 53 | $this->db->where('id', $list_id); 54 | $this->db->update('lists', $data); 55 | return TRUE; 56 | } 57 | 58 | public function get_list_data($list_id){ 59 | $this->db->where('id',$list_id); 60 | $query = $this->db->get('lists'); 61 | return $query->row(); 62 | } 63 | 64 | public function delete_list($list_id){ 65 | $this->db->where('id',$list_id); 66 | $this->db->delete('lists'); 67 | $this->delete_tasks_of_list($list_id); 68 | return; 69 | } 70 | 71 | private function delete_tasks_of_list($list_id){ 72 | $this->db->where('list_id',$list_id); 73 | $this->db->delete('tasks'); 74 | return; 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/views/lists/show.php: -------------------------------------------------------------------------------- 1 | 7 |

list_name; ?>

8 | session->flashdata('task_deleted')) : ?> 9 | ' .$this->session->flashdata('task_deleted') . '

'; ?> 10 | 11 | session->flashdata('task_created')) : ?> 12 | ' .$this->session->flashdata('task_created') . '

'; ?> 13 | 14 | session->flashdata('task_updated')) : ?> 15 | ' .$this->session->flashdata('task_updated') . '

'; ?> 16 | 17 | session->flashdata('marked_complete')) : ?> 18 | ' .$this->session->flashdata('marked_complete') . '

'; ?> 19 | 20 | session->flashdata('marked_new')) : ?> 21 | ' .$this->session->flashdata('marked_new') . '

'; ?> 22 | 23 | Created on: create_date)); ?> 24 |

25 |
list_body; ?>
26 |

27 |

Current Open Tasks

28 | 29 | 34 | 35 |

There are no current tasks

36 | 37 |
38 |

Recently Completed

39 | 40 | 45 | 46 |

There are no completed tasks

47 | 48 |
49 | <- Go Back to Lists 50 | -------------------------------------------------------------------------------- /sys/database/drivers/sqlite/sqlite_utility.php: -------------------------------------------------------------------------------- 1 | db_debug) 41 | { 42 | return $this->db->display_error('db_unsuported_feature'); 43 | } 44 | return array(); 45 | } 46 | 47 | // -------------------------------------------------------------------- 48 | 49 | /** 50 | * Optimize table query 51 | * 52 | * Is optimization even supported in SQLite? 53 | * 54 | * @access private 55 | * @param string the table name 56 | * @return object 57 | */ 58 | function _optimize_table($table) 59 | { 60 | return FALSE; 61 | } 62 | 63 | // -------------------------------------------------------------------- 64 | 65 | /** 66 | * Repair table query 67 | * 68 | * Are table repairs even supported in SQLite? 69 | * 70 | * @access private 71 | * @param string the table name 72 | * @return object 73 | */ 74 | function _repair_table($table) 75 | { 76 | return FALSE; 77 | } 78 | 79 | // -------------------------------------------------------------------- 80 | 81 | /** 82 | * SQLite Export 83 | * 84 | * @access private 85 | * @param array Preferences 86 | * @return mixed 87 | */ 88 | function _backup($params = array()) 89 | { 90 | // Currently unsupported 91 | return $this->db->display_error('db_unsuported_feature'); 92 | } 93 | } 94 | 95 | /* End of file sqlite_utility.php */ 96 | /* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ -------------------------------------------------------------------------------- /sys/helpers/typography_helper.php: -------------------------------------------------------------------------------- 1 | load->library('typography'); 44 | 45 | return $CI->typography->nl2br_except_pre($str); 46 | } 47 | } 48 | 49 | // ------------------------------------------------------------------------ 50 | 51 | /** 52 | * Auto Typography Wrapper Function 53 | * 54 | * 55 | * @access public 56 | * @param string 57 | * @param bool whether to allow javascript event handlers 58 | * @param bool whether to reduce multiple instances of double newlines to two 59 | * @return string 60 | */ 61 | if ( ! function_exists('auto_typography')) 62 | { 63 | function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE) 64 | { 65 | $CI =& get_instance(); 66 | $CI->load->library('typography'); 67 | return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks); 68 | } 69 | } 70 | 71 | 72 | // -------------------------------------------------------------------- 73 | 74 | /** 75 | * HTML Entities Decode 76 | * 77 | * This function is a replacement for html_entity_decode() 78 | * 79 | * @access public 80 | * @param string 81 | * @return string 82 | */ 83 | if ( ! function_exists('entity_decode')) 84 | { 85 | function entity_decode($str, $charset='UTF-8') 86 | { 87 | global $SEC; 88 | return $SEC->entity_decode($str, $charset); 89 | } 90 | } 91 | 92 | /* End of file typography_helper.php */ 93 | /* Location: ./system/helpers/typography_helper.php */ -------------------------------------------------------------------------------- /sys/database/drivers/pdo/pdo_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported PDO feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported PDO feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * PDO Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file pdo_utility.php */ 103 | /* Location: ./system/database/drivers/pdo/pdo_utility.php */ -------------------------------------------------------------------------------- /sys/database/drivers/odbc/odbc_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported ODBC feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported ODBC feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * ODBC Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file odbc_utility.php */ 103 | /* Location: ./system/database/drivers/odbc/odbc_utility.php */ -------------------------------------------------------------------------------- /app/views/home.php: -------------------------------------------------------------------------------- 1 | 2 | session->flashdata('registered')) : ?> 3 | ' .$this->session->flashdata('registered') . '

'; ?> 4 | 5 | session->flashdata('logged_out')) : ?> 6 | ' .$this->session->flashdata('logged_out') . '

'; ?> 7 | 8 | session->flashdata('need_login')) : ?> 9 | ' .$this->session->flashdata('need_login') . '

'; ?> 10 | 11 | 12 |

Welcome to myTodo!

13 |

myTodo us a simple and helpful application to help you manage your day to day tasks. You can add as many task lists as you want and as many tasks as you want. myTodo is absolutely free! Have fun.

14 | session->userdata('logged_in')) : ?> 15 |
16 | 17 | '); ?> 18 |

19 | 20 | "Add a New List", 21 | "name" => "list_name"); ?> 22 | 23 | 24 | "Login", 25 | "name" => "submit", 26 | "style"=> "vertical-align:top;", 27 | "class" => "btn btn-primary"); ?> 28 | 29 | 30 |

31 |
32 |

My Latest Lists

33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
List NameCreated OnView
list_name; ?>create_date; ?>View List
49 | 50 |

Latest Tasks

51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
Task NameList NameCreated OnView
task_name; ?>list_name; ?>create_date; ?>View Task
70 | -------------------------------------------------------------------------------- /app/models/task_model.php: -------------------------------------------------------------------------------- 1 | db->select(' 6 | tasks.task_name, 7 | tasks.id, 8 | tasks.create_date, 9 | tasks.due_date, 10 | tasks.task_body, 11 | tasks.is_complete, 12 | lists.id as list_id, 13 | lists.list_name, 14 | lists.list_body 15 | '); 16 | $this->db->from('tasks'); 17 | $this->db->join('lists', 'lists.id = tasks.list_id','LEFT'); 18 | $this->db->where('tasks.id',$id); 19 | $query = $this->db->get(); 20 | if($query->num_rows() != 1){ 21 | return FALSE; 22 | } 23 | return $query->row(); 24 | } 25 | 26 | public function get_task_list_id($task_id){ 27 | $this->db->where('id',$task_id); 28 | $query = $this->db->get('tasks'); 29 | return $query->row()->list_id; 30 | } 31 | 32 | public function get_list_name($list_id){ 33 | $this->db->where('id',$list_id); 34 | $query = $this->db->get('lists'); 35 | return $query->row()->list_name; 36 | } 37 | 38 | 39 | public function create_task($data){ 40 | $insert = $this->db->insert('tasks', $data); 41 | return $insert; 42 | } 43 | 44 | public function edit_task($task_id,$data){ 45 | $this->db->where('id', $task_id); 46 | $this->db->update('tasks', $data); 47 | return TRUE; 48 | } 49 | 50 | 51 | public function delete_task($task_id){ 52 | $this->db->where('id',$task_id); 53 | $this->db->delete('tasks'); 54 | return; 55 | } 56 | 57 | 58 | public function get_task_data($task_id){ 59 | $this->db->where('id',$task_id); 60 | $query = $this->db->get('tasks'); 61 | return $query->row(); 62 | } 63 | 64 | 65 | public function check_if_complete($id){ 66 | $this->db->where('id',$id); 67 | $query = $this->db->get('tasks'); 68 | return $query->row()->is_complete; 69 | } 70 | 71 | public function mark_complete($task_id){ 72 | $this->db->set('is_complete', 1); 73 | $this->db->where('id', $task_id); 74 | $this->db->update('tasks'); 75 | return TRUE; 76 | } 77 | 78 | public function mark_new($task_id){ 79 | $this->db->set('is_complete', 0); 80 | $this->db->where('id', $task_id); 81 | $this->db->update('tasks'); 82 | return TRUE; 83 | } 84 | 85 | 86 | public function get_users_tasks($user_id){ 87 | $this->db->where('list_user_id',$user_id); 88 | $this->db->join('tasks', 'lists.id = tasks.list_id'); 89 | $this->db->order_by('tasks.create_date', 'asc'); 90 | $query = $this->db->get('lists'); 91 | return $query->result(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /sys/helpers/cookie_helper.php: -------------------------------------------------------------------------------- 1 | input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); 52 | } 53 | } 54 | 55 | // -------------------------------------------------------------------- 56 | 57 | /** 58 | * Fetch an item from the COOKIE array 59 | * 60 | * @access public 61 | * @param string 62 | * @param bool 63 | * @return mixed 64 | */ 65 | if ( ! function_exists('get_cookie')) 66 | { 67 | function get_cookie($index = '', $xss_clean = FALSE) 68 | { 69 | $CI =& get_instance(); 70 | 71 | $prefix = ''; 72 | 73 | if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '') 74 | { 75 | $prefix = config_item('cookie_prefix'); 76 | } 77 | 78 | return $CI->input->cookie($prefix.$index, $xss_clean); 79 | } 80 | } 81 | 82 | // -------------------------------------------------------------------- 83 | 84 | /** 85 | * Delete a COOKIE 86 | * 87 | * @param mixed 88 | * @param string the cookie domain. Usually: .yourdomain.com 89 | * @param string the cookie path 90 | * @param string the cookie prefix 91 | * @return void 92 | */ 93 | if ( ! function_exists('delete_cookie')) 94 | { 95 | function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') 96 | { 97 | set_cookie($name, '', '', $domain, $path, $prefix); 98 | } 99 | } 100 | 101 | 102 | /* End of file cookie_helper.php */ 103 | /* Location: ./system/helpers/cookie_helper.php */ -------------------------------------------------------------------------------- /sys/helpers/array_helper.php: -------------------------------------------------------------------------------- 1 | '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); 34 | 35 | /** 36 | * Constructor 37 | */ 38 | public function __construct() 39 | { 40 | $config =& get_config(); 41 | 42 | $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/'; 43 | 44 | if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) 45 | { 46 | $this->_enabled = FALSE; 47 | } 48 | 49 | if (is_numeric($config['log_threshold'])) 50 | { 51 | $this->_threshold = $config['log_threshold']; 52 | } 53 | 54 | if ($config['log_date_format'] != '') 55 | { 56 | $this->_date_fmt = $config['log_date_format']; 57 | } 58 | } 59 | 60 | // -------------------------------------------------------------------- 61 | 62 | /** 63 | * Write Log File 64 | * 65 | * Generally this function will be called using the global log_message() function 66 | * 67 | * @param string the error level 68 | * @param string the error message 69 | * @param bool whether the error is a native PHP error 70 | * @return bool 71 | */ 72 | public function write_log($level = 'error', $msg, $php_error = FALSE) 73 | { 74 | if ($this->_enabled === FALSE) 75 | { 76 | return FALSE; 77 | } 78 | 79 | $level = strtoupper($level); 80 | 81 | if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) 82 | { 83 | return FALSE; 84 | } 85 | 86 | $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; 87 | $message = ''; 88 | 89 | if ( ! file_exists($filepath)) 90 | { 91 | $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; 92 | } 93 | 94 | if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) 95 | { 96 | return FALSE; 97 | } 98 | 99 | $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; 100 | 101 | flock($fp, LOCK_EX); 102 | fwrite($fp, $message); 103 | flock($fp, LOCK_UN); 104 | fclose($fp); 105 | 106 | @chmod($filepath, FILE_WRITE_MODE); 107 | return TRUE; 108 | } 109 | 110 | } 111 | // END Log Class 112 | 113 | /* End of file Log.php */ 114 | /* Location: ./system/libraries/Log.php */ -------------------------------------------------------------------------------- /sys/helpers/download_helper.php: -------------------------------------------------------------------------------- 1 | security->xss_clean($str, $is_image); 44 | } 45 | } 46 | 47 | // ------------------------------------------------------------------------ 48 | 49 | /** 50 | * Sanitize Filename 51 | * 52 | * @access public 53 | * @param string 54 | * @return string 55 | */ 56 | if ( ! function_exists('sanitize_filename')) 57 | { 58 | function sanitize_filename($filename) 59 | { 60 | $CI =& get_instance(); 61 | return $CI->security->sanitize_filename($filename); 62 | } 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * Hash encode a string 69 | * 70 | * @access public 71 | * @param string 72 | * @return string 73 | */ 74 | if ( ! function_exists('do_hash')) 75 | { 76 | function do_hash($str, $type = 'sha1') 77 | { 78 | if ($type == 'sha1') 79 | { 80 | return sha1($str); 81 | } 82 | else 83 | { 84 | return md5($str); 85 | } 86 | } 87 | } 88 | 89 | // ------------------------------------------------------------------------ 90 | 91 | /** 92 | * Strip Image Tags 93 | * 94 | * @access public 95 | * @param string 96 | * @return string 97 | */ 98 | if ( ! function_exists('strip_image_tags')) 99 | { 100 | function strip_image_tags($str) 101 | { 102 | $str = preg_replace("##", "\\1", $str); 103 | $str = preg_replace("##", "\\1", $str); 104 | 105 | return $str; 106 | } 107 | } 108 | 109 | // ------------------------------------------------------------------------ 110 | 111 | /** 112 | * Convert PHP tags to entities 113 | * 114 | * @access public 115 | * @param string 116 | * @return string 117 | */ 118 | if ( ! function_exists('encode_php_tags')) 119 | { 120 | function encode_php_tags($str) 121 | { 122 | return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); 123 | } 124 | } 125 | 126 | 127 | /* End of file security_helper.php */ 128 | /* Location: ./system/helpers/security_helper.php */ -------------------------------------------------------------------------------- /sys/libraries/Cache/drivers/Cache_dummy.php: -------------------------------------------------------------------------------- 1 | conn_id) 41 | { 42 | return "SELECT '" . $this->database . "'"; 43 | } 44 | else 45 | { 46 | return FALSE; 47 | } 48 | } 49 | 50 | // -------------------------------------------------------------------- 51 | 52 | /** 53 | * Optimize table query 54 | * 55 | * Generates a platform-specific query so that a table can be optimized 56 | * 57 | * @access private 58 | * @param string the table name 59 | * @return object 60 | * @link http://www.cubrid.org/manual/840/en/Optimize%20Database 61 | */ 62 | function _optimize_table($table) 63 | { 64 | // No SQL based support in CUBRID as of version 8.4.0. Database or 65 | // table optimization can be performed using CUBRID Manager 66 | // database administration tool. See the link above for more info. 67 | return FALSE; 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * Repair table query 74 | * 75 | * Generates a platform-specific query so that a table can be repaired 76 | * 77 | * @access private 78 | * @param string the table name 79 | * @return object 80 | * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency 81 | */ 82 | function _repair_table($table) 83 | { 84 | // Not supported in CUBRID as of version 8.4.0. Database or 85 | // table consistency can be checked using CUBRID Manager 86 | // database administration tool. See the link above for more info. 87 | return FALSE; 88 | } 89 | 90 | // -------------------------------------------------------------------- 91 | /** 92 | * CUBRID Export 93 | * 94 | * @access private 95 | * @param array Preferences 96 | * @return mixed 97 | */ 98 | function _backup($params = array()) 99 | { 100 | // No SQL based support in CUBRID as of version 8.4.0. Database or 101 | // table backup can be performed using CUBRID Manager 102 | // database administration tool. 103 | return $this->db->display_error('db_unsuported_feature'); 104 | } 105 | } 106 | 107 | /* End of file cubrid_utility.php */ 108 | /* Location: ./system/database/drivers/cubrid/cubrid_utility.php */ -------------------------------------------------------------------------------- /app/config/database.php: -------------------------------------------------------------------------------- 1 | array('grin.gif', '19', '19', 'grin'), 20 | ':lol:' => array('lol.gif', '19', '19', 'LOL'), 21 | ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), 22 | ':)' => array('smile.gif', '19', '19', 'smile'), 23 | ';-)' => array('wink.gif', '19', '19', 'wink'), 24 | ';)' => array('wink.gif', '19', '19', 'wink'), 25 | ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), 26 | ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), 27 | ':-S' => array('confused.gif', '19', '19', 'confused'), 28 | ':wow:' => array('surprise.gif', '19', '19', 'surprised'), 29 | ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), 30 | ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), 31 | '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), 32 | ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), 33 | ':P' => array('raspberry.gif', '19', '19', 'raspberry'), 34 | ':blank:' => array('blank.gif', '19', '19', 'blank stare'), 35 | ':long:' => array('longface.gif', '19', '19', 'long face'), 36 | ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), 37 | ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), 38 | ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), 39 | '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), 40 | ':down:' => array('downer.gif', '19', '19', 'downer'), 41 | ':red:' => array('embarrassed.gif', '19', '19', 'red face'), 42 | ':sick:' => array('sick.gif', '19', '19', 'sick'), 43 | ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), 44 | ':-/' => array('hmm.gif', '19', '19', 'hmmm'), 45 | '>:(' => array('mad.gif', '19', '19', 'mad'), 46 | ':mad:' => array('mad.gif', '19', '19', 'mad'), 47 | '>:-(' => array('angry.gif', '19', '19', 'angry'), 48 | ':angry:' => array('angry.gif', '19', '19', 'angry'), 49 | ':zip:' => array('zip.gif', '19', '19', 'zipper'), 50 | ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), 51 | ':ahhh:' => array('shock.gif', '19', '19', 'shock'), 52 | ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), 53 | ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), 54 | ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), 55 | ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), 56 | ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), 57 | ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), 58 | ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), 59 | ':snake:' => array('snake.gif', '19', '19', 'snake'), 60 | ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), 61 | ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item 62 | 63 | ); 64 | 65 | /* End of file smileys.php */ 66 | /* Location: ./application/config/smileys.php */ -------------------------------------------------------------------------------- /sys/core/Benchmark.php: -------------------------------------------------------------------------------- 1 | marker[$name] = microtime(); 54 | } 55 | 56 | // -------------------------------------------------------------------- 57 | 58 | /** 59 | * Calculates the time difference between two marked points. 60 | * 61 | * If the first parameter is empty this function instead returns the 62 | * {elapsed_time} pseudo-variable. This permits the full system 63 | * execution time to be shown in a template. The output class will 64 | * swap the real value for this variable. 65 | * 66 | * @access public 67 | * @param string a particular marked point 68 | * @param string a particular marked point 69 | * @param integer the number of decimal places 70 | * @return mixed 71 | */ 72 | function elapsed_time($point1 = '', $point2 = '', $decimals = 4) 73 | { 74 | if ($point1 == '') 75 | { 76 | return '{elapsed_time}'; 77 | } 78 | 79 | if ( ! isset($this->marker[$point1])) 80 | { 81 | return ''; 82 | } 83 | 84 | if ( ! isset($this->marker[$point2])) 85 | { 86 | $this->marker[$point2] = microtime(); 87 | } 88 | 89 | list($sm, $ss) = explode(' ', $this->marker[$point1]); 90 | list($em, $es) = explode(' ', $this->marker[$point2]); 91 | 92 | return number_format(($em + $es) - ($sm + $ss), $decimals); 93 | } 94 | 95 | // -------------------------------------------------------------------- 96 | 97 | /** 98 | * Memory Usage 99 | * 100 | * This function returns the {memory_usage} pseudo-variable. 101 | * This permits it to be put it anywhere in a template 102 | * without the memory being calculated until the end. 103 | * The output class will swap the real value for this variable. 104 | * 105 | * @access public 106 | * @return string 107 | */ 108 | function memory_usage() 109 | { 110 | return '{memory_usage}'; 111 | } 112 | 113 | } 114 | 115 | // END CI_Benchmark class 116 | 117 | /* End of file Benchmark.php */ 118 | /* Location: ./system/core/Benchmark.php */ -------------------------------------------------------------------------------- /app/controllers/users.php: -------------------------------------------------------------------------------- 1 | session->userdata('logged_in')){ 6 | redirect('home/index'); 7 | } 8 | $this->form_validation->set_rules('first_name','First Name','trim|required|xss_clean'); 9 | $this->form_validation->set_rules('last_name','Last Name','trim|required|xss_clean'); 10 | $this->form_validation->set_rules('email','Email','trim|required|valid_email|xss_clean'); 11 | 12 | $this->form_validation->set_rules('username','Username','trim|required|min_length[4]|xss_clean'); 13 | $this->form_validation->set_rules('password','Password','trim|required|min_length[4]|max_length[50]|xss_clean'); 14 | $this->form_validation->set_rules('password2','Confirm Password','trim|required|matches[password]|xss_clean'); 15 | 16 | if($this->form_validation->run() == FALSE){ 17 | //Load view and layout 18 | $data['main_content'] = 'users/register'; 19 | $this->load->view('layouts/main',$data); 20 | //Validation has ran and passed 21 | } else { 22 | if($this->User_model->create_member()){ 23 | $this->session->set_flashdata('registered', 'You are now registered, please log in'); 24 | //Redirect to index page with error above 25 | redirect('home/index'); 26 | } 27 | } 28 | } 29 | 30 | 31 | public function login(){ 32 | $this->form_validation->set_rules('username','Username','trim|required|min_length[4]|xss_clean'); 33 | $this->form_validation->set_rules('password','Password','trim|required|min_length[4]|max_length[50]|xss_clean'); 34 | 35 | if($this->form_validation->run() == FALSE){ 36 | //Set error 37 | $this->session->set_flashdata('login_failed', 'Sorry, the login info that you entered is invalid'); 38 | redirect('home/index'); 39 | } else { 40 | //Get from post 41 | $username = $this->input->post('username'); 42 | $password = $this->input->post('password'); 43 | 44 | //Get user id from model 45 | $user_id = $this->User_model->login_user($username,$password); 46 | 47 | //Validate user 48 | if($user_id){ 49 | //Create array of user data 50 | $user_data = array( 51 | 'user_id' => $user_id, 52 | 'username' => $username, 53 | 'logged_in' => true 54 | ); 55 | //Set session userdata 56 | $this->session->set_userdata($user_data); 57 | 58 | redirect('home/index'); 59 | } else { 60 | //Set error 61 | $this->session->set_flashdata('login_failed', 'Sorry, the login info that you entered is invalid'); 62 | redirect('home/index'); 63 | } 64 | } 65 | } 66 | 67 | 68 | public function logout(){ 69 | //Unset user data 70 | $this->session->unset_userdata('logged_in'); 71 | $this->session->unset_userdata('user_id'); 72 | $this->session->unset_userdata('username'); 73 | $this->session->sess_destroy(); 74 | 75 | //Set message 76 | $this->session->set_flashdata('logged_out', 'You have been logged out'); 77 | redirect('home/index'); 78 | } 79 | 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/config/autoload.php: -------------------------------------------------------------------------------- 1 | $time + $ttl, 121 | 'mtime' => $time, 122 | 'data' => $data 123 | ); 124 | } 125 | 126 | // ------------------------------------------------------------------------ 127 | 128 | /** 129 | * is_supported() 130 | * 131 | * Check to see if APC is available on this system, bail if it isn't. 132 | */ 133 | public function is_supported() 134 | { 135 | if ( ! extension_loaded('apc') OR ini_get('apc.enabled') != "1") 136 | { 137 | log_message('error', 'The APC PHP extension must be loaded to use APC Cache.'); 138 | return FALSE; 139 | } 140 | 141 | return TRUE; 142 | } 143 | 144 | // ------------------------------------------------------------------------ 145 | 146 | 147 | } 148 | // End Class 149 | 150 | /* End of file Cache_apc.php */ 151 | /* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ 152 | -------------------------------------------------------------------------------- /mytodo_ci.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.0.4.1 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Jan 25, 2014 at 07:41 PM 7 | -- Server version: 5.5.32 8 | -- PHP Version: 5.4.19 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8 */; 18 | 19 | -- 20 | -- Database: `mytodo_ci` 21 | -- 22 | CREATE DATABASE IF NOT EXISTS `mytodo_ci` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; 23 | USE `mytodo_ci`; 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Table structure for table `lists` 29 | -- 30 | 31 | CREATE TABLE IF NOT EXISTS `lists` ( 32 | `id` int(11) NOT NULL AUTO_INCREMENT, 33 | `list_name` varchar(255) NOT NULL, 34 | `list_body` text NOT NULL, 35 | `list_user_id` varchar(255) NOT NULL, 36 | `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 37 | PRIMARY KEY (`id`) 38 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; 39 | 40 | -- 41 | -- Dumping data for table `lists` 42 | -- 43 | 44 | INSERT INTO `lists` (`id`, `list_name`, `list_body`, `list_user_id`, `create_date`) VALUES 45 | (4, 'Kids & Family', 'Family events, drop off and pick up times for the kids sports and events', '2', '2013-09-25 22:27:33'), 46 | (5, 'Work Related', 'Tasks that need to be done for work. Meetings, projects, etc', '2', '2013-09-25 22:28:15'); 47 | 48 | -- -------------------------------------------------------- 49 | 50 | -- 51 | -- Table structure for table `tasks` 52 | -- 53 | 54 | CREATE TABLE IF NOT EXISTS `tasks` ( 55 | `id` int(11) NOT NULL AUTO_INCREMENT, 56 | `task_name` varchar(255) NOT NULL, 57 | `task_body` text NOT NULL, 58 | `list_id` int(11) NOT NULL, 59 | `due_date` date NOT NULL, 60 | `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 61 | `is_complete` tinyint(1) NOT NULL DEFAULT '0', 62 | PRIMARY KEY (`id`) 63 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ; 64 | 65 | -- 66 | -- Dumping data for table `tasks` 67 | -- 68 | 69 | INSERT INTO `tasks` (`id`, `task_name`, `task_body`, `list_id`, `due_date`, `create_date`, `is_complete`) VALUES 70 | (19, 'Pickup Nick at Baseball', 'Pick Nicky up at baseball at 5pm at the field', 4, '2013-09-28', '2013-09-25 22:29:47', 0), 71 | (20, 'Drop Bri off At School', 'Bring Brianna to school. Leave at 8:20', 4, '2013-09-27', '2013-09-25 22:30:19', 0), 72 | (21, 'Ethan''s Birthday Party', 'Bring Brianna to Ethans party at 77 Oak st', 4, '2013-09-29', '2013-09-25 22:31:00', 0), 73 | (22, 'Friday Meeting', 'Meet with boss on Friday at noon', 5, '2013-09-27', '2013-09-25 22:31:32', 0), 74 | (23, 'Project One Due', 'Project One is due by the 5th of October', 5, '2013-10-05', '2013-09-25 22:32:08', 0), 75 | (24, 'Project Two Due', 'Project One is due by the 15th of December', 5, '2013-12-15', '2013-09-25 22:32:32', 0); 76 | 77 | -- -------------------------------------------------------- 78 | 79 | -- 80 | -- Table structure for table `users` 81 | -- 82 | 83 | CREATE TABLE IF NOT EXISTS `users` ( 84 | `id` int(11) NOT NULL AUTO_INCREMENT, 85 | `first_name` varchar(255) NOT NULL, 86 | `last_name` varchar(255) NOT NULL, 87 | `email` varchar(255) NOT NULL, 88 | `username` varchar(255) NOT NULL, 89 | `password` varchar(255) NOT NULL, 90 | `register_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 91 | PRIMARY KEY (`id`) 92 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; 93 | 94 | -- 95 | -- Dumping data for table `users` 96 | -- 97 | 98 | INSERT INTO `users` (`id`, `first_name`, `last_name`, `email`, `username`, `password`, `register_date`) VALUES 99 | (2, 'Brad', 'Traversy', 'techguyinfo@gmail.com', 'BradT', '162b826c13cebd8806b1e114edecfcc9', '2013-09-25 22:04:41'); 100 | 101 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 102 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 103 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 104 | -------------------------------------------------------------------------------- /sys/database/drivers/mssql/mssql_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @mssql_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | while ($field = mssql_fetch_field($this->result_id)) 67 | { 68 | $field_names[] = $field->name; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | while ($field = mssql_fetch_field($this->result_id)) 88 | { 89 | $F = new stdClass(); 90 | $F->name = $field->name; 91 | $F->type = $field->type; 92 | $F->max_length = $field->max_length; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | mssql_free_result($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | return mssql_data_seek($this->result_id, $n); 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return mssql_fetch_assoc($this->result_id); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return mssql_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file mssql_result.php */ 169 | /* Location: ./system/database/drivers/mssql/mssql_result.php */ -------------------------------------------------------------------------------- /sys/database/drivers/sqlsrv/sqlsrv_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @sqlsrv_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) 67 | { 68 | $field_names[] = $field['Name']; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) 88 | { 89 | $F = new stdClass(); 90 | $F->name = $field['Name']; 91 | $F->type = $field['Type']; 92 | $F->max_length = $field['Size']; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | sqlsrv_free_stmt($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | // Not implemented 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return sqlsrv_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file mssql_result.php */ 169 | /* Location: ./system/database/drivers/mssql/mssql_result.php */ -------------------------------------------------------------------------------- /sys/database/drivers/postgre/postgre_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @pg_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | for ($i = 0; $i < $this->num_fields(); $i++) 67 | { 68 | $field_names[] = pg_field_name($this->result_id, $i); 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | for ($i = 0; $i < $this->num_fields(); $i++) 88 | { 89 | $F = new stdClass(); 90 | $F->name = pg_field_name($this->result_id, $i); 91 | $F->type = pg_field_type($this->result_id, $i); 92 | $F->max_length = pg_field_size($this->result_id, $i); 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | pg_free_result($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | return pg_result_seek($this->result_id, $n); 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return pg_fetch_assoc($this->result_id); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return pg_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file postgre_result.php */ 169 | /* Location: ./system/database/drivers/postgre/postgre_result.php */ -------------------------------------------------------------------------------- /sys/core/Utf8.php: -------------------------------------------------------------------------------- 1 | item('charset') == 'UTF-8' // Application charset must be UTF-8 48 | ) 49 | { 50 | log_message('debug', "UTF-8 Support Enabled"); 51 | 52 | define('UTF8_ENABLED', TRUE); 53 | 54 | // set internal encoding for multibyte string functions if necessary 55 | // and set a flag so we don't have to repeatedly use extension_loaded() 56 | // or function_exists() 57 | if (extension_loaded('mbstring')) 58 | { 59 | define('MB_ENABLED', TRUE); 60 | mb_internal_encoding('UTF-8'); 61 | } 62 | else 63 | { 64 | define('MB_ENABLED', FALSE); 65 | } 66 | } 67 | else 68 | { 69 | log_message('debug', "UTF-8 Support Disabled"); 70 | define('UTF8_ENABLED', FALSE); 71 | } 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Clean UTF-8 strings 78 | * 79 | * Ensures strings are UTF-8 80 | * 81 | * @access public 82 | * @param string 83 | * @return string 84 | */ 85 | function clean_string($str) 86 | { 87 | if ($this->_is_ascii($str) === FALSE) 88 | { 89 | $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); 90 | } 91 | 92 | return $str; 93 | } 94 | 95 | // -------------------------------------------------------------------- 96 | 97 | /** 98 | * Remove ASCII control characters 99 | * 100 | * Removes all ASCII control characters except horizontal tabs, 101 | * line feeds, and carriage returns, as all others can cause 102 | * problems in XML 103 | * 104 | * @access public 105 | * @param string 106 | * @return string 107 | */ 108 | function safe_ascii_for_xml($str) 109 | { 110 | return remove_invisible_characters($str, FALSE); 111 | } 112 | 113 | // -------------------------------------------------------------------- 114 | 115 | /** 116 | * Convert to UTF-8 117 | * 118 | * Attempts to convert a string to UTF-8 119 | * 120 | * @access public 121 | * @param string 122 | * @param string - input encoding 123 | * @return string 124 | */ 125 | function convert_to_utf8($str, $encoding) 126 | { 127 | if (function_exists('iconv')) 128 | { 129 | $str = @iconv($encoding, 'UTF-8', $str); 130 | } 131 | elseif (function_exists('mb_convert_encoding')) 132 | { 133 | $str = @mb_convert_encoding($str, 'UTF-8', $encoding); 134 | } 135 | else 136 | { 137 | return FALSE; 138 | } 139 | 140 | return $str; 141 | } 142 | 143 | // -------------------------------------------------------------------- 144 | 145 | /** 146 | * Is ASCII? 147 | * 148 | * Tests if a string is standard 7-bit ASCII or not 149 | * 150 | * @access public 151 | * @param string 152 | * @return bool 153 | */ 154 | function _is_ascii($str) 155 | { 156 | return (preg_match('/[^\x00-\x7F]/S', $str) == 0); 157 | } 158 | 159 | // -------------------------------------------------------------------- 160 | 161 | } 162 | // End Utf8 Class 163 | 164 | /* End of file Utf8.php */ 165 | /* Location: ./system/core/Utf8.php */ -------------------------------------------------------------------------------- /sys/core/Lang.php: -------------------------------------------------------------------------------- 1 | is_loaded, TRUE)) 77 | { 78 | return; 79 | } 80 | 81 | $config =& get_config(); 82 | 83 | if ($idiom == '') 84 | { 85 | $deft_lang = ( ! isset($config['language'])) ? 'english' : $config['language']; 86 | $idiom = ($deft_lang == '') ? 'english' : $deft_lang; 87 | } 88 | 89 | // Determine where the language file is and load it 90 | if ($alt_path != '' && file_exists($alt_path.'language/'.$idiom.'/'.$langfile)) 91 | { 92 | include($alt_path.'language/'.$idiom.'/'.$langfile); 93 | } 94 | else 95 | { 96 | $found = FALSE; 97 | 98 | foreach (get_instance()->load->get_package_paths(TRUE) as $package_path) 99 | { 100 | if (file_exists($package_path.'language/'.$idiom.'/'.$langfile)) 101 | { 102 | include($package_path.'language/'.$idiom.'/'.$langfile); 103 | $found = TRUE; 104 | break; 105 | } 106 | } 107 | 108 | if ($found !== TRUE) 109 | { 110 | show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile); 111 | } 112 | } 113 | 114 | 115 | if ( ! isset($lang)) 116 | { 117 | log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); 118 | return; 119 | } 120 | 121 | if ($return == TRUE) 122 | { 123 | return $lang; 124 | } 125 | 126 | $this->is_loaded[] = $langfile; 127 | $this->language = array_merge($this->language, $lang); 128 | unset($lang); 129 | 130 | log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); 131 | return TRUE; 132 | } 133 | 134 | // -------------------------------------------------------------------- 135 | 136 | /** 137 | * Fetch a single line of text from the language array 138 | * 139 | * @access public 140 | * @param string $line the language line 141 | * @return string 142 | */ 143 | function line($line = '') 144 | { 145 | $value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; 146 | 147 | // Because killer robots like unicorns! 148 | if ($value === FALSE) 149 | { 150 | log_message('error', 'Could not find the language line "'.$line.'"'); 151 | } 152 | 153 | return $value; 154 | } 155 | 156 | } 157 | // END Language Class 158 | 159 | /* End of file Lang.php */ 160 | /* Location: ./system/core/Lang.php */ 161 | -------------------------------------------------------------------------------- /sys/database/drivers/pdo/pdo_result.php: -------------------------------------------------------------------------------- 1 | num_rows)) 39 | { 40 | return $this->num_rows; 41 | } 42 | elseif (($this->num_rows = $this->result_id->rowCount()) > 0) 43 | { 44 | return $this->num_rows; 45 | } 46 | 47 | $this->num_rows = count($this->result_id->fetchAll()); 48 | $this->result_id->execute(); 49 | return $this->num_rows; 50 | } 51 | 52 | // -------------------------------------------------------------------- 53 | 54 | /** 55 | * Number of fields in the result set 56 | * 57 | * @access public 58 | * @return integer 59 | */ 60 | function num_fields() 61 | { 62 | return $this->result_id->columnCount(); 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * Fetch Field Names 69 | * 70 | * Generates an array of column names 71 | * 72 | * @access public 73 | * @return array 74 | */ 75 | function list_fields() 76 | { 77 | if ($this->db->db_debug) 78 | { 79 | return $this->db->display_error('db_unsuported_feature'); 80 | } 81 | return FALSE; 82 | } 83 | 84 | // -------------------------------------------------------------------- 85 | 86 | /** 87 | * Field data 88 | * 89 | * Generates an array of objects containing field meta-data 90 | * 91 | * @access public 92 | * @return array 93 | */ 94 | function field_data() 95 | { 96 | $data = array(); 97 | 98 | try 99 | { 100 | for($i = 0; $i < $this->num_fields(); $i++) 101 | { 102 | $data[] = $this->result_id->getColumnMeta($i); 103 | } 104 | 105 | return $data; 106 | } 107 | catch (Exception $e) 108 | { 109 | if ($this->db->db_debug) 110 | { 111 | return $this->db->display_error('db_unsuported_feature'); 112 | } 113 | return FALSE; 114 | } 115 | } 116 | 117 | // -------------------------------------------------------------------- 118 | 119 | /** 120 | * Free the result 121 | * 122 | * @return null 123 | */ 124 | function free_result() 125 | { 126 | if (is_object($this->result_id)) 127 | { 128 | $this->result_id = FALSE; 129 | } 130 | } 131 | 132 | // -------------------------------------------------------------------- 133 | 134 | /** 135 | * Data Seek 136 | * 137 | * Moves the internal pointer to the desired offset. We call 138 | * this internally before fetching results to make sure the 139 | * result set starts at zero 140 | * 141 | * @access private 142 | * @return array 143 | */ 144 | function _data_seek($n = 0) 145 | { 146 | return FALSE; 147 | } 148 | 149 | // -------------------------------------------------------------------- 150 | 151 | /** 152 | * Result - associative array 153 | * 154 | * Returns the result set as an array 155 | * 156 | * @access private 157 | * @return array 158 | */ 159 | function _fetch_assoc() 160 | { 161 | return $this->result_id->fetch(PDO::FETCH_ASSOC); 162 | } 163 | 164 | // -------------------------------------------------------------------- 165 | 166 | /** 167 | * Result - object 168 | * 169 | * Returns the result set as an object 170 | * 171 | * @access private 172 | * @return object 173 | */ 174 | function _fetch_object() 175 | { 176 | return $this->result_id->fetchObject(); 177 | } 178 | 179 | } 180 | 181 | 182 | /* End of file pdo_result.php */ 183 | /* Location: ./system/database/drivers/pdo/pdo_result.php */ -------------------------------------------------------------------------------- /sys/database/drivers/sqlite/sqlite_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @sqlite_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | for ($i = 0; $i < $this->num_fields(); $i++) 67 | { 68 | $field_names[] = sqlite_field_name($this->result_id, $i); 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | for ($i = 0; $i < $this->num_fields(); $i++) 88 | { 89 | $F = new stdClass(); 90 | $F->name = sqlite_field_name($this->result_id, $i); 91 | $F->type = 'varchar'; 92 | $F->max_length = 0; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | // Not implemented in SQLite 112 | } 113 | 114 | // -------------------------------------------------------------------- 115 | 116 | /** 117 | * Data Seek 118 | * 119 | * Moves the internal pointer to the desired offset. We call 120 | * this internally before fetching results to make sure the 121 | * result set starts at zero 122 | * 123 | * @access private 124 | * @return array 125 | */ 126 | function _data_seek($n = 0) 127 | { 128 | return sqlite_seek($this->result_id, $n); 129 | } 130 | 131 | // -------------------------------------------------------------------- 132 | 133 | /** 134 | * Result - associative array 135 | * 136 | * Returns the result set as an array 137 | * 138 | * @access private 139 | * @return array 140 | */ 141 | function _fetch_assoc() 142 | { 143 | return sqlite_fetch_array($this->result_id); 144 | } 145 | 146 | // -------------------------------------------------------------------- 147 | 148 | /** 149 | * Result - object 150 | * 151 | * Returns the result set as an object 152 | * 153 | * @access private 154 | * @return object 155 | */ 156 | function _fetch_object() 157 | { 158 | if (function_exists('sqlite_fetch_object')) 159 | { 160 | return sqlite_fetch_object($this->result_id); 161 | } 162 | else 163 | { 164 | $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC); 165 | if (is_array($arr)) 166 | { 167 | $obj = (object) $arr; 168 | return $obj; 169 | } else { 170 | return NULL; 171 | } 172 | } 173 | } 174 | 175 | } 176 | 177 | 178 | /* End of file sqlite_result.php */ 179 | /* Location: ./system/database/drivers/sqlite/sqlite_result.php */ -------------------------------------------------------------------------------- /sys/database/drivers/mysql/mysql_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @mysql_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | while ($field = mysql_fetch_field($this->result_id)) 67 | { 68 | $field_names[] = $field->name; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | while ($field = mysql_fetch_object($this->result_id)) 88 | { 89 | preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches); 90 | 91 | $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL; 92 | $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; 93 | 94 | $F = new stdClass(); 95 | $F->name = $field->Field; 96 | $F->type = $type; 97 | $F->default = $field->Default; 98 | $F->max_length = $length; 99 | $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 ); 100 | 101 | $retval[] = $F; 102 | } 103 | 104 | return $retval; 105 | } 106 | 107 | // -------------------------------------------------------------------- 108 | 109 | /** 110 | * Free the result 111 | * 112 | * @return null 113 | */ 114 | function free_result() 115 | { 116 | if (is_resource($this->result_id)) 117 | { 118 | mysql_free_result($this->result_id); 119 | $this->result_id = FALSE; 120 | } 121 | } 122 | 123 | // -------------------------------------------------------------------- 124 | 125 | /** 126 | * Data Seek 127 | * 128 | * Moves the internal pointer to the desired offset. We call 129 | * this internally before fetching results to make sure the 130 | * result set starts at zero 131 | * 132 | * @access private 133 | * @return array 134 | */ 135 | function _data_seek($n = 0) 136 | { 137 | return mysql_data_seek($this->result_id, $n); 138 | } 139 | 140 | // -------------------------------------------------------------------- 141 | 142 | /** 143 | * Result - associative array 144 | * 145 | * Returns the result set as an array 146 | * 147 | * @access private 148 | * @return array 149 | */ 150 | function _fetch_assoc() 151 | { 152 | return mysql_fetch_assoc($this->result_id); 153 | } 154 | 155 | // -------------------------------------------------------------------- 156 | 157 | /** 158 | * Result - object 159 | * 160 | * Returns the result set as an object 161 | * 162 | * @access private 163 | * @return object 164 | */ 165 | function _fetch_object() 166 | { 167 | return mysql_fetch_object($this->result_id); 168 | } 169 | 170 | } 171 | 172 | 173 | /* End of file mysql_result.php */ 174 | /* Location: ./system/database/drivers/mysql/mysql_result.php */ -------------------------------------------------------------------------------- /sys/database/drivers/mysqli/mysqli_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @mysqli_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | while ($field = mysqli_fetch_field($this->result_id)) 67 | { 68 | $field_names[] = $field->name; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | while ($field = mysqli_fetch_object($this->result_id)) 88 | { 89 | preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches); 90 | 91 | $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL; 92 | $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; 93 | 94 | $F = new stdClass(); 95 | $F->name = $field->Field; 96 | $F->type = $type; 97 | $F->default = $field->Default; 98 | $F->max_length = $length; 99 | $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 ); 100 | 101 | $retval[] = $F; 102 | } 103 | 104 | return $retval; 105 | } 106 | 107 | // -------------------------------------------------------------------- 108 | 109 | /** 110 | * Free the result 111 | * 112 | * @return null 113 | */ 114 | function free_result() 115 | { 116 | if (is_object($this->result_id)) 117 | { 118 | mysqli_free_result($this->result_id); 119 | $this->result_id = FALSE; 120 | } 121 | } 122 | 123 | // -------------------------------------------------------------------- 124 | 125 | /** 126 | * Data Seek 127 | * 128 | * Moves the internal pointer to the desired offset. We call 129 | * this internally before fetching results to make sure the 130 | * result set starts at zero 131 | * 132 | * @access private 133 | * @return array 134 | */ 135 | function _data_seek($n = 0) 136 | { 137 | return mysqli_data_seek($this->result_id, $n); 138 | } 139 | 140 | // -------------------------------------------------------------------- 141 | 142 | /** 143 | * Result - associative array 144 | * 145 | * Returns the result set as an array 146 | * 147 | * @access private 148 | * @return array 149 | */ 150 | function _fetch_assoc() 151 | { 152 | return mysqli_fetch_assoc($this->result_id); 153 | } 154 | 155 | // -------------------------------------------------------------------- 156 | 157 | /** 158 | * Result - object 159 | * 160 | * Returns the result set as an object 161 | * 162 | * @access private 163 | * @return object 164 | */ 165 | function _fetch_object() 166 | { 167 | return mysqli_fetch_object($this->result_id); 168 | } 169 | 170 | } 171 | 172 | 173 | /* End of file mysqli_result.php */ 174 | /* Location: ./system/database/drivers/mysqli/mysqli_result.php */ -------------------------------------------------------------------------------- /app/controllers/tasks.php: -------------------------------------------------------------------------------- 1 | Task_model->get_task($id); 6 | //Check if marked complete 7 | $data['is_complete'] = $this->Task_model->check_if_complete($id); 8 | 9 | //Load view and layout 10 | $data['main_content'] = 'tasks/show'; 11 | $this->load->view('layouts/main',$data); 12 | } 13 | 14 | public function add($list_id = null){ 15 | $this->form_validation->set_rules('task_name','Task Name','trim|required|xss_clean'); 16 | $this->form_validation->set_rules('task_body','Task Body','trim|xss_clean'); 17 | if($this->form_validation->run() == FALSE){ 18 | //Get list name for view 19 | $data['list_name'] = $this->Task_model->get_list_name($list_id); 20 | //Load view and layout 21 | $data['main_content'] = 'tasks/add_task'; 22 | $this->load->view('layouts/main',$data); 23 | } else { 24 | //Post values to array 25 | $data = array( 26 | 'task_name' => $this->input->post('task_name'), 27 | 'task_body' => $this->input->post('task_body'), 28 | 'due_date' => $this->input->post('due_date'), 29 | 'list_id' => $list_id 30 | ); 31 | 32 | if($this->Task_model->create_task($data)){ 33 | $this->session->set_flashdata('task_created', 'Your task has been created'); 34 | //Redirect to index page with error above 35 | redirect('lists/show/'.$list_id.''); 36 | } 37 | } 38 | } 39 | 40 | 41 | public function edit($task_id){ 42 | $this->form_validation->set_rules('task_name','Task Name','trim|required|xss_clean'); 43 | $this->form_validation->set_rules('task_body','Task Body','trim|xss_clean'); 44 | if($this->form_validation->run() == FALSE){ 45 | //Get list id 46 | $data['list_id'] = $this->Task_model->get_task_list_id($task_id); 47 | //Get list name for view 48 | $data['list_name'] = $this->Task_model->get_list_name($data['list_id']); 49 | //Get the current task info 50 | $data['this_task'] = $this->Task_model->get_task_data($task_id); 51 | //Load view and layout 52 | $data['main_content'] = 'tasks/edit_task'; 53 | $this->load->view('layouts/main',$data); 54 | } else { 55 | //Get list id 56 | $list_id = $this->Task_model->get_task_list_id($task_id); 57 | //Post values to array 58 | $data = array( 59 | 'task_name' => $this->input->post('task_name'), 60 | 'task_body' => $this->input->post('task_body'), 61 | 'due_date' => $this->input->post('due_date'), 62 | 'list_id' => $list_id 63 | ); 64 | if($this->Task_model->edit_task($task_id,$data)){ 65 | $this->session->set_flashdata('task_updated', 'Your task has been updated'); 66 | //Redirect to index page with error aboves 67 | redirect('lists/show/'.$list_id.''); 68 | } 69 | } 70 | } 71 | 72 | 73 | public function mark_complete($task_id){ 74 | if($this->Task_model->mark_complete($task_id)){ 75 | $list_id = $this->Task_model->get_task_list_id($task_id); 76 | //Create Message 77 | $this->session->set_flashdata('marked_complete', 'Task has been marked complete'); 78 | redirect('/lists/show/'.$list_id.''); 79 | } 80 | } 81 | 82 | 83 | public function mark_new($task_id){ 84 | if($this->Task_model->mark_new($task_id)){ 85 | $list_id = $this->Task_model->get_task_list_id($task_id); 86 | //Create Message 87 | $this->session->set_flashdata('marked_new', 'Task has been marked new'); 88 | redirect('/lists/show/'.$list_id.''); 89 | } 90 | } 91 | 92 | 93 | public function delete($list_id,$task_id){ 94 | //Delete list 95 | $this->Task_model->delete_task($task_id); 96 | //Create Message 97 | $this->session->set_flashdata('task_deleted', 'Your task has been deleted'); 98 | //Redirect to list index 99 | redirect('lists/show/'.$list_id.''); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/config/mimes.php: -------------------------------------------------------------------------------- 1 | 'application/mac-binhex40', 12 | 'cpt' => 'application/mac-compactpro', 13 | 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), 14 | 'bin' => 'application/macbinary', 15 | 'dms' => 'application/octet-stream', 16 | 'lha' => 'application/octet-stream', 17 | 'lzh' => 'application/octet-stream', 18 | 'exe' => array('application/octet-stream', 'application/x-msdownload'), 19 | 'class' => 'application/octet-stream', 20 | 'psd' => 'application/x-photoshop', 21 | 'so' => 'application/octet-stream', 22 | 'sea' => 'application/octet-stream', 23 | 'dll' => 'application/octet-stream', 24 | 'oda' => 'application/oda', 25 | 'pdf' => array('application/pdf', 'application/x-download'), 26 | 'ai' => 'application/postscript', 27 | 'eps' => 'application/postscript', 28 | 'ps' => 'application/postscript', 29 | 'smi' => 'application/smil', 30 | 'smil' => 'application/smil', 31 | 'mif' => 'application/vnd.mif', 32 | 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), 33 | 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), 34 | 'wbxml' => 'application/wbxml', 35 | 'wmlc' => 'application/wmlc', 36 | 'dcr' => 'application/x-director', 37 | 'dir' => 'application/x-director', 38 | 'dxr' => 'application/x-director', 39 | 'dvi' => 'application/x-dvi', 40 | 'gtar' => 'application/x-gtar', 41 | 'gz' => 'application/x-gzip', 42 | 'php' => 'application/x-httpd-php', 43 | 'php4' => 'application/x-httpd-php', 44 | 'php3' => 'application/x-httpd-php', 45 | 'phtml' => 'application/x-httpd-php', 46 | 'phps' => 'application/x-httpd-php-source', 47 | 'js' => 'application/x-javascript', 48 | 'swf' => 'application/x-shockwave-flash', 49 | 'sit' => 'application/x-stuffit', 50 | 'tar' => 'application/x-tar', 51 | 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), 52 | 'xhtml' => 'application/xhtml+xml', 53 | 'xht' => 'application/xhtml+xml', 54 | 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), 55 | 'mid' => 'audio/midi', 56 | 'midi' => 'audio/midi', 57 | 'mpga' => 'audio/mpeg', 58 | 'mp2' => 'audio/mpeg', 59 | 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), 60 | 'aif' => 'audio/x-aiff', 61 | 'aiff' => 'audio/x-aiff', 62 | 'aifc' => 'audio/x-aiff', 63 | 'ram' => 'audio/x-pn-realaudio', 64 | 'rm' => 'audio/x-pn-realaudio', 65 | 'rpm' => 'audio/x-pn-realaudio-plugin', 66 | 'ra' => 'audio/x-realaudio', 67 | 'rv' => 'video/vnd.rn-realvideo', 68 | 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'), 69 | 'bmp' => array('image/bmp', 'image/x-windows-bmp'), 70 | 'gif' => 'image/gif', 71 | 'jpeg' => array('image/jpeg', 'image/pjpeg'), 72 | 'jpg' => array('image/jpeg', 'image/pjpeg'), 73 | 'jpe' => array('image/jpeg', 'image/pjpeg'), 74 | 'png' => array('image/png', 'image/x-png'), 75 | 'tiff' => 'image/tiff', 76 | 'tif' => 'image/tiff', 77 | 'css' => 'text/css', 78 | 'html' => 'text/html', 79 | 'htm' => 'text/html', 80 | 'shtml' => 'text/html', 81 | 'txt' => 'text/plain', 82 | 'text' => 'text/plain', 83 | 'log' => array('text/plain', 'text/x-log'), 84 | 'rtx' => 'text/richtext', 85 | 'rtf' => 'text/rtf', 86 | 'xml' => 'text/xml', 87 | 'xsl' => 'text/xml', 88 | 'mpeg' => 'video/mpeg', 89 | 'mpg' => 'video/mpeg', 90 | 'mpe' => 'video/mpeg', 91 | 'qt' => 'video/quicktime', 92 | 'mov' => 'video/quicktime', 93 | 'avi' => 'video/x-msvideo', 94 | 'movie' => 'video/x-sgi-movie', 95 | 'doc' => 'application/msword', 96 | 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'), 97 | 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'), 98 | 'word' => array('application/msword', 'application/octet-stream'), 99 | 'xl' => 'application/excel', 100 | 'eml' => 'message/rfc822', 101 | 'json' => array('application/json', 'text/json') 102 | ); 103 | 104 | 105 | /* End of file mimes.php */ 106 | /* Location: ./application/config/mimes.php */ 107 | -------------------------------------------------------------------------------- /app/controllers/lists.php: -------------------------------------------------------------------------------- 1 | session->userdata('logged_in')){ 6 | //Set error 7 | $this->session->set_flashdata('need_login', 'Sorry, you need to be logged in to view that area'); 8 | redirect('home/index'); 9 | } 10 | } 11 | 12 | public function index(){ 13 | //Get the logged in users id 14 | $user_id = $this->session->userdata('user_id'); 15 | //Get all lists from the model 16 | $data['lists'] = $this->List_model->get_all_lists($user_id); 17 | 18 | //Load view and layout 19 | $data['main_content'] = 'lists/index'; 20 | $this->load->view('layouts/main',$data); 21 | } 22 | 23 | public function show($id){ 24 | //Get all lists from the model 25 | $data['list'] = $this->List_model->get_list($id); 26 | //Get all completed tasks for this list 27 | $data['completed_tasks'] = $this->List_model->get_list_tasks($id,true); 28 | //Get all uncompleted tasks for this list 29 | $data['uncompleted_tasks'] = $this->List_model->get_list_tasks($id,false); 30 | 31 | //Load view and layout 32 | $data['main_content'] = 'lists/show'; 33 | $this->load->view('layouts/main',$data); 34 | } 35 | 36 | 37 | public function add(){ 38 | $this->form_validation->set_rules('list_name','List Name','trim|required|xss_clean'); 39 | $this->form_validation->set_rules('list_body','List Body','trim|xss_clean'); 40 | 41 | if($this->form_validation->run() == FALSE){ 42 | //Load view and layout 43 | $data['main_content'] = 'lists/add_list'; 44 | $this->load->view('layouts/main',$data); 45 | } else { 46 | //Validation has ran and passed 47 | //Post values to array 48 | $data = array( 49 | 'list_name' => $this->input->post('list_name'), 50 | 'list_body' => $this->input->post('list_body'), 51 | 'list_user_id' => $this->session->userdata('user_id') 52 | ); 53 | if($this->List_model->create_list($data)){ 54 | $this->session->set_flashdata('list_created', 'Your task list has been created'); 55 | //Redirect to index page with error above 56 | redirect('lists/index'); 57 | } 58 | } 59 | } 60 | 61 | 62 | public function quickadd(){ 63 | $this->form_validation->set_rules('list_name','List Name','trim|required|xss_clean'); 64 | if($this->form_validation->run() == FALSE){ 65 | //Load view and layout 66 | $data['main_content'] = 'home'; 67 | $this->load->view('layouts/main',$data); 68 | } else { 69 | $data['list_name'] = $this->input->post('list_name'); 70 | //Load view and layout 71 | $data['main_content'] = 'lists/add_list'; 72 | $this->load->view('layouts/main',$data); 73 | } 74 | } 75 | 76 | 77 | public function edit($list_id){ 78 | $this->form_validation->set_rules('list_name','List Name','trim|required|xss_clean'); 79 | $this->form_validation->set_rules('list_body','List Body','trim|xss_clean'); 80 | 81 | if($this->form_validation->run() == FALSE){ 82 | //Get the current list info 83 | $data['this_list'] = $this->List_model->get_list_data($list_id); 84 | //Load view and layout 85 | $data['main_content'] = 'lists/edit_list'; 86 | $this->load->view('layouts/main',$data); 87 | } else { 88 | //Validation has ran and passed 89 | //Post values to array 90 | $data = array( 91 | 'list_name' => $this->input->post('list_name'), 92 | 'list_body' => $this->input->post('list_body'), 93 | 'list_user_id' => $this->session->userdata('user_id') 94 | ); 95 | if($this->List_model->edit_list($list_id,$data)){ 96 | $this->session->set_flashdata('list_updated', 'Your task list has been updated'); 97 | //Redirect to index page with error above 98 | redirect('lists/index'); 99 | } 100 | } 101 | } 102 | 103 | 104 | public function delete($list_id){ 105 | //Delete list 106 | $this->List_model->delete_list($list_id); 107 | //Create Message 108 | $this->session->set_flashdata('list_deleted', 'Your list has been deleted'); 109 | //Redirect to list index 110 | redirect('lists/index'); 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /sys/database/DB.php: -------------------------------------------------------------------------------- 1 | $dns['scheme'], 77 | 'hostname' => (isset($dns['host'])) ? rawurldecode($dns['host']) : '', 78 | 'username' => (isset($dns['user'])) ? rawurldecode($dns['user']) : '', 79 | 'password' => (isset($dns['pass'])) ? rawurldecode($dns['pass']) : '', 80 | 'database' => (isset($dns['path'])) ? rawurldecode(substr($dns['path'], 1)) : '' 81 | ); 82 | 83 | // were additional config items set? 84 | if (isset($dns['query'])) 85 | { 86 | parse_str($dns['query'], $extra); 87 | 88 | foreach ($extra as $key => $val) 89 | { 90 | // booleans please 91 | if (strtoupper($val) == "TRUE") 92 | { 93 | $val = TRUE; 94 | } 95 | elseif (strtoupper($val) == "FALSE") 96 | { 97 | $val = FALSE; 98 | } 99 | 100 | $params[$key] = $val; 101 | } 102 | } 103 | } 104 | 105 | // No DB specified yet? Beat them senseless... 106 | if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '') 107 | { 108 | show_error('You have not selected a database type to connect to.'); 109 | } 110 | 111 | // Load the DB classes. Note: Since the active record class is optional 112 | // we need to dynamically create a class that extends proper parent class 113 | // based on whether we're using the active record class or not. 114 | // Kudos to Paul for discovering this clever use of eval() 115 | 116 | if ($active_record_override !== NULL) 117 | { 118 | $active_record = $active_record_override; 119 | } 120 | 121 | require_once(BASEPATH.'database/DB_driver.php'); 122 | 123 | if ( ! isset($active_record) OR $active_record == TRUE) 124 | { 125 | require_once(BASEPATH.'database/DB_active_rec.php'); 126 | 127 | if ( ! class_exists('CI_DB')) 128 | { 129 | eval('class CI_DB extends CI_DB_active_record { }'); 130 | } 131 | } 132 | else 133 | { 134 | if ( ! class_exists('CI_DB')) 135 | { 136 | eval('class CI_DB extends CI_DB_driver { }'); 137 | } 138 | } 139 | 140 | require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php'); 141 | 142 | // Instantiate the DB adapter 143 | $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; 144 | $DB = new $driver($params); 145 | 146 | if ($DB->autoinit == TRUE) 147 | { 148 | $DB->initialize(); 149 | } 150 | 151 | if (isset($params['stricton']) && $params['stricton'] == TRUE) 152 | { 153 | $DB->query('SET SESSION sql_mode="STRICT_ALL_TABLES"'); 154 | } 155 | 156 | return $DB; 157 | } 158 | 159 | 160 | 161 | /* End of file DB.php */ 162 | /* Location: ./system/database/DB.php */ -------------------------------------------------------------------------------- /sys/libraries/Cache/drivers/Cache_file.php: -------------------------------------------------------------------------------- 1 | load->helper('file'); 39 | 40 | $path = $CI->config->item('cache_path'); 41 | 42 | $this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path; 43 | } 44 | 45 | // ------------------------------------------------------------------------ 46 | 47 | /** 48 | * Fetch from cache 49 | * 50 | * @param mixed unique key id 51 | * @return mixed data on success/false on failure 52 | */ 53 | public function get($id) 54 | { 55 | if ( ! file_exists($this->_cache_path.$id)) 56 | { 57 | return FALSE; 58 | } 59 | 60 | $data = read_file($this->_cache_path.$id); 61 | $data = unserialize($data); 62 | 63 | if (time() > $data['time'] + $data['ttl']) 64 | { 65 | unlink($this->_cache_path.$id); 66 | return FALSE; 67 | } 68 | 69 | return $data['data']; 70 | } 71 | 72 | // ------------------------------------------------------------------------ 73 | 74 | /** 75 | * Save into cache 76 | * 77 | * @param string unique key 78 | * @param mixed data to store 79 | * @param int length of time (in seconds) the cache is valid 80 | * - Default is 60 seconds 81 | * @return boolean true on success/false on failure 82 | */ 83 | public function save($id, $data, $ttl = 60) 84 | { 85 | $contents = array( 86 | 'time' => time(), 87 | 'ttl' => $ttl, 88 | 'data' => $data 89 | ); 90 | 91 | if (write_file($this->_cache_path.$id, serialize($contents))) 92 | { 93 | @chmod($this->_cache_path.$id, 0777); 94 | return TRUE; 95 | } 96 | 97 | return FALSE; 98 | } 99 | 100 | // ------------------------------------------------------------------------ 101 | 102 | /** 103 | * Delete from Cache 104 | * 105 | * @param mixed unique identifier of item in cache 106 | * @return boolean true on success/false on failure 107 | */ 108 | public function delete($id) 109 | { 110 | return unlink($this->_cache_path.$id); 111 | } 112 | 113 | // ------------------------------------------------------------------------ 114 | 115 | /** 116 | * Clean the Cache 117 | * 118 | * @return boolean false on failure/true on success 119 | */ 120 | public function clean() 121 | { 122 | return delete_files($this->_cache_path); 123 | } 124 | 125 | // ------------------------------------------------------------------------ 126 | 127 | /** 128 | * Cache Info 129 | * 130 | * Not supported by file-based caching 131 | * 132 | * @param string user/filehits 133 | * @return mixed FALSE 134 | */ 135 | public function cache_info($type = NULL) 136 | { 137 | return get_dir_file_info($this->_cache_path); 138 | } 139 | 140 | // ------------------------------------------------------------------------ 141 | 142 | /** 143 | * Get Cache Metadata 144 | * 145 | * @param mixed key to get cache metadata on 146 | * @return mixed FALSE on failure, array on success. 147 | */ 148 | public function get_metadata($id) 149 | { 150 | if ( ! file_exists($this->_cache_path.$id)) 151 | { 152 | return FALSE; 153 | } 154 | 155 | $data = read_file($this->_cache_path.$id); 156 | $data = unserialize($data); 157 | 158 | if (is_array($data)) 159 | { 160 | $mtime = filemtime($this->_cache_path.$id); 161 | 162 | if ( ! isset($data['ttl'])) 163 | { 164 | return FALSE; 165 | } 166 | 167 | return array( 168 | 'expire' => $mtime + $data['ttl'], 169 | 'mtime' => $mtime 170 | ); 171 | } 172 | 173 | return FALSE; 174 | } 175 | 176 | // ------------------------------------------------------------------------ 177 | 178 | /** 179 | * Is supported 180 | * 181 | * In the file driver, check to see that the cache directory is indeed writable 182 | * 183 | * @return boolean 184 | */ 185 | public function is_supported() 186 | { 187 | return is_really_writable($this->_cache_path); 188 | } 189 | 190 | // ------------------------------------------------------------------------ 191 | } 192 | // End Class 193 | 194 | /* End of file Cache_file.php */ 195 | /* Location: ./system/libraries/Cache/drivers/Cache_file.php */ --------------------------------------------------------------------------------