├── README.md ├── application ├── .htaccess ├── cache │ ├── .htaccess │ └── index.html ├── config │ ├── autoload.php │ ├── config.php │ ├── constants.php │ ├── database.php │ ├── doctypes.php │ ├── foreign_chars.php │ ├── hooks.php │ ├── index.html │ ├── ldap.php │ ├── migration.php │ ├── mimes.php │ ├── profiler.php │ ├── rest.php │ ├── routes.php │ ├── smileys.php │ └── user_agents.php ├── controllers │ ├── NavigViewRight_ctrl.php │ ├── Navigations_ctrl.php │ ├── Roles_ctrl.php │ ├── Users_ctrl.php │ ├── home_ctrl.php │ ├── index.html │ ├── login.php │ └── projects.php ├── core │ └── index.html ├── errors │ ├── error_404.php │ ├── error_db.php │ ├── error_general.php │ ├── error_php.php │ └── index.html ├── helpers │ └── index.html ├── hooks │ └── index.html ├── index.html ├── language │ └── english │ │ └── index.html ├── libraries │ ├── base_ctrl.php │ └── index.html ├── logs │ └── index.html ├── models │ ├── NavigViewRight_model.php │ ├── Navigations_model.php │ ├── Roles_model.php │ ├── Users_model.php │ ├── index.html │ ├── login_model.php │ └── project_model.php ├── third_party │ └── index.html └── views │ ├── NavigViewRight_view.php │ ├── Navigations_view.php │ ├── Roles_view.php │ ├── Users_view.php │ ├── forbidden.php │ ├── home_view.php │ ├── index.html │ ├── layout.php │ ├── list.php │ └── login.php ├── index.php ├── sampledb.sql ├── static ├── appScript │ ├── NavigViewRightCtrl.js │ ├── NavigationsCtrl.js │ ├── RolesCtrl.js │ ├── UsersCtrl.js │ └── app.js ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── font-awesome-ie7.css │ ├── font-awesome-ie7.min.css │ ├── font-awesome.css │ ├── font-awesome.min.css │ ├── font │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── ng-grid.css │ ├── ng-grid.min.css │ ├── site.css │ ├── smoothness │ │ ├── images │ │ │ ├── animated-overlay.gif │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ ├── jquery-ui-1.10.2.custom.css │ │ └── jquery-ui-1.10.2.custom.min.css │ └── toastr.min.css ├── img │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png └── js │ ├── angular-resource.js │ ├── angular.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jQuery-ui-directive.js │ ├── jquery-1.9.1.js │ ├── jquery-ui-1.10.2.custom.min.js │ ├── ng-grid.js │ ├── ng-grid.min.js │ ├── scripts.js │ ├── toastr.min.js │ ├── ui-bootstrap-0.5.0.min.js │ └── ui-bootstrap-tpls-0.5.0.min.js ├── system ├── .htaccess ├── core │ ├── Benchmark.php │ ├── CodeIgniter.php │ ├── Common.php │ ├── Config.php │ ├── Controller.php │ ├── Exceptions.php │ ├── Hooks.php │ ├── Input.php │ ├── Lang.php │ ├── Loader.php │ ├── Model.php │ ├── Output.php │ ├── Router.php │ ├── Security.php │ ├── URI.php │ ├── Utf8.php │ └── index.html ├── database │ ├── DB.php │ ├── DB_active_rec.php │ ├── DB_cache.php │ ├── DB_driver.php │ ├── DB_forge.php │ ├── DB_result.php │ ├── DB_utility.php │ ├── drivers │ │ ├── cubrid │ │ │ ├── cubrid_driver.php │ │ │ ├── cubrid_forge.php │ │ │ ├── cubrid_result.php │ │ │ ├── cubrid_utility.php │ │ │ └── index.html │ │ ├── index.html │ │ ├── mssql │ │ │ ├── index.html │ │ │ ├── mssql_driver.php │ │ │ ├── mssql_forge.php │ │ │ ├── mssql_result.php │ │ │ └── mssql_utility.php │ │ ├── mysql │ │ │ ├── index.html │ │ │ ├── mysql_driver.php │ │ │ ├── mysql_forge.php │ │ │ ├── mysql_result.php │ │ │ └── mysql_utility.php │ │ ├── mysqli │ │ │ ├── index.html │ │ │ ├── mysqli_driver.php │ │ │ ├── mysqli_forge.php │ │ │ ├── mysqli_result.php │ │ │ └── mysqli_utility.php │ │ ├── oci8 │ │ │ ├── index.html │ │ │ ├── oci8_driver.php │ │ │ ├── oci8_forge.php │ │ │ ├── oci8_result.php │ │ │ └── oci8_utility.php │ │ ├── odbc │ │ │ ├── index.html │ │ │ ├── odbc_driver.php │ │ │ ├── odbc_forge.php │ │ │ ├── odbc_result.php │ │ │ └── odbc_utility.php │ │ ├── pdo │ │ │ ├── index.html │ │ │ ├── pdo_driver.php │ │ │ ├── pdo_forge.php │ │ │ ├── pdo_result.php │ │ │ └── pdo_utility.php │ │ ├── postgre │ │ │ ├── index.html │ │ │ ├── postgre_driver.php │ │ │ ├── postgre_forge.php │ │ │ ├── postgre_result.php │ │ │ └── postgre_utility.php │ │ ├── sqlite │ │ │ ├── index.html │ │ │ ├── sqlite_driver.php │ │ │ ├── sqlite_forge.php │ │ │ ├── sqlite_result.php │ │ │ └── sqlite_utility.php │ │ └── sqlsrv │ │ │ ├── index.html │ │ │ ├── sqlsrv_driver.php │ │ │ ├── sqlsrv_forge.php │ │ │ ├── sqlsrv_result.php │ │ │ └── sqlsrv_utility.php │ └── index.html ├── fonts │ ├── index.html │ └── texb.ttf ├── helpers │ ├── array_helper.php │ ├── captcha_helper.php │ ├── cookie_helper.php │ ├── date_helper.php │ ├── directory_helper.php │ ├── download_helper.php │ ├── email_helper.php │ ├── file_helper.php │ ├── form_helper.php │ ├── html_helper.php │ ├── index.html │ ├── inflector_helper.php │ ├── language_helper.php │ ├── number_helper.php │ ├── path_helper.php │ ├── security_helper.php │ ├── smiley_helper.php │ ├── string_helper.php │ ├── text_helper.php │ ├── typography_helper.php │ ├── url_helper.php │ └── xml_helper.php ├── index.html ├── language │ ├── english │ │ ├── calendar_lang.php │ │ ├── date_lang.php │ │ ├── db_lang.php │ │ ├── email_lang.php │ │ ├── form_validation_lang.php │ │ ├── ftp_lang.php │ │ ├── imglib_lang.php │ │ ├── index.html │ │ ├── migration_lang.php │ │ ├── number_lang.php │ │ ├── profiler_lang.php │ │ ├── unit_test_lang.php │ │ └── upload_lang.php │ └── index.html └── libraries │ ├── Cache │ ├── Cache.php │ └── drivers │ │ ├── Cache_apc.php │ │ ├── Cache_dummy.php │ │ ├── Cache_file.php │ │ └── Cache_memcached.php │ ├── Calendar.php │ ├── Cart.php │ ├── Driver.php │ ├── Email.php │ ├── Encrypt.php │ ├── Form_validation.php │ ├── Ftp.php │ ├── Image_lib.php │ ├── Javascript.php │ ├── Log.php │ ├── Migration.php │ ├── Pagination.php │ ├── Parser.php │ ├── Profiler.php │ ├── Session.php │ ├── Sha1.php │ ├── Table.php │ ├── Trackback.php │ ├── Typography.php │ ├── Unit_test.php │ ├── Upload.php │ ├── User_agent.php │ ├── Xmlrpc.php │ ├── Xmlrpcs.php │ ├── Zip.php │ ├── index.html │ └── javascript │ └── Jquery.php ├── tools ├── JCrud.php ├── Oxygen.php ├── code-gen.php ├── codemirror │ ├── addon │ │ ├── comment │ │ │ └── comment.js │ │ ├── edit │ │ │ ├── closebrackets.js │ │ │ ├── closetag.js │ │ │ ├── continuecomment.js │ │ │ ├── continuelist.js │ │ │ ├── matchbrackets.js │ │ │ ├── matchtags.js │ │ │ └── trailingspace.js │ │ ├── fold │ │ │ ├── brace-fold.js │ │ │ ├── foldcode.js │ │ │ ├── foldgutter.js │ │ │ ├── indent-fold.js │ │ │ └── xml-fold.js │ │ ├── hint │ │ │ ├── anyword-hint.js │ │ │ ├── html-hint.js │ │ │ ├── javascript-hint.js │ │ │ ├── pig-hint.js │ │ │ ├── python-hint.js │ │ │ ├── show-hint.css │ │ │ ├── show-hint.js │ │ │ └── xml-hint.js │ │ ├── search │ │ │ ├── match-highlighter.js │ │ │ ├── search.js │ │ │ └── searchcursor.js │ │ └── selection │ │ │ ├── active-line.js │ │ │ └── mark-selection.js │ ├── clike.js │ ├── css.js │ ├── htmlmixed.js │ ├── javascript.js │ ├── lib │ │ ├── codemirror.css │ │ └── codemirror.js │ ├── php.js │ └── xml.js ├── fileinfo.php ├── index.php ├── jquery.tablednd.js ├── modify.php ├── partials │ ├── controller.php │ ├── homeView.html │ ├── model.php │ ├── script_ctrl.php │ └── view.php ├── tool.js └── util.php └── user_guide ├── cg1.png ├── cg2.png ├── cg3.png ├── cg4.png ├── cg5.png ├── cg6.png ├── cg7.png └── user_guide.html /README.md: -------------------------------------------------------------------------------- 1 | Angularjs-and-codeIgniter 2 | ========================= 3 | 4 | Fast web application development. There is an interactive code generator embedded with this application. Please read the user guide. 5 | -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /application/cache/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/autoload.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 */ -------------------------------------------------------------------------------- /application/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 */ -------------------------------------------------------------------------------- /application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/ldap.php: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /application/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 */ -------------------------------------------------------------------------------- /application/config/profiler.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 */ -------------------------------------------------------------------------------- /application/controllers/NavigViewRight_ctrl.php: -------------------------------------------------------------------------------- 1 | load->model('NavigViewRight_model','model'); 8 | } 9 | public function index() 10 | { 11 | if($this->is_authentic($this->auth->RoleId, $this->user->UserId, 'NavigViewRight')){ 12 | $data['fx']='return '.json_encode(array("insert"=>$this->auth->IsInsert==="1","update"=>$this->auth->IsUpdate==="1","delete"=>$this->auth->IsDelete==="1")); 13 | $data['read']=$this->auth->IsRead; 14 | $this->load->view('NavigViewRight_view', $data); 15 | } 16 | else 17 | { 18 | $this->load->view('forbidden'); 19 | } 20 | } 21 | 22 | public function save() 23 | { 24 | $data=$this->post(); 25 | $success=FALSE; 26 | $msg= 'You are not permitted.'; 27 | $id=0; 28 | if(!isset($data->NavgViewId)) 29 | { 30 | if($this->auth->IsInsert){ 31 | $id=$this->model->add($data); 32 | $msg='Data inserted successfully'; 33 | $success=TRUE; 34 | } 35 | 36 | } 37 | else{ 38 | if($this->auth->IsUpdate){ 39 | $id=$this->model->update($data->NavgViewId, $data); 40 | $success=TRUE; 41 | $msg='Data updated successfully'; 42 | } 43 | } 44 | print json_encode(array('success'=>$success, 'msg'=>$msg, 'id'=>$id)); 45 | } 46 | 47 | public function delete() 48 | { 49 | if($this->auth->IsDelete){ 50 | $data=$this->post(); 51 | print json_encode( array("success"=>TRUE,"msg"=>$this->model->delete($data->NavgViewId))); 52 | } 53 | else{ 54 | print json_encode( array("success"=>FALSE,"msg"=>"You are not permitted")); 55 | } 56 | } 57 | public function get_Navigations_list(){ 58 | print json_encode($this->model->get_Navigations_list()); 59 | } 60 | public function get_Roles_list(){ 61 | print json_encode($this->model->get_Roles_list()); 62 | } 63 | public function get_Users_list(){ 64 | print json_encode($this->model->get_Users_list()); 65 | } 66 | 67 | public function get() 68 | { 69 | $data=$this->post(); 70 | print json_encode($this->model->get($data->NavgViewId)); 71 | } 72 | public function get_all() 73 | { 74 | print json_encode($this->model->get_all()); 75 | } 76 | public function get_page() 77 | { 78 | $data=$this->post(); 79 | print json_encode($this->model->get_page($data->size, $data->pageno)); 80 | } 81 | public function get_page_where() 82 | { 83 | $data=$this->post(); 84 | print json_encode($this->model->get_page_where($data->size, $data->pageno, $data)); 85 | } 86 | } 87 | 88 | ?> -------------------------------------------------------------------------------- /application/controllers/Navigations_ctrl.php: -------------------------------------------------------------------------------- 1 | load->model('Navigations_model','model'); 10 | } 11 | public function index() 12 | { 13 | if($this->is_authentic($this->auth->RoleId, $this->user->UserId, 'Navigations')){ 14 | $data['fx']='return '.json_encode(array("insert"=>$this->auth->IsInsert==="1","update"=>$this->auth->IsUpdate==="1","delete"=>$this->auth->IsDelete==="1")); 15 | $data['read']=$this->auth->IsRead; 16 | $this->load->view('Navigations_view', $data); 17 | } 18 | else 19 | { 20 | $this->load->view('forbidden'); 21 | } 22 | 23 | } 24 | private function generate_routes(){ 25 | 26 | $data=$this->model->get_all(); 27 | $routes=""; 28 | foreach($data as $col){ 29 | $routes .=Navigations_ctrl::$tab2.'when(\'/'.$col->ActionPath.'\', { templateUrl:BASE_URL+\''.$col->ActionPath.'_ctrl\'}).'.Navigations_ctrl::$newLine; 30 | 31 | } 32 | $content='angular.module(\'project\', [\'ui.bootstrap\', \'ngGrid\', \'jQuery-ui\']). 33 | config(function($routeProvider) { 34 | $routeProvider. 35 | when(\'/\', { templateUrl:BASE_URL+\'home_ctrl\'}). 36 | '.$routes.' 37 | otherwise({redirectTo:\'/\'}); 38 | });'; 39 | $this->putContent('static/appScript/app.js', $content); 40 | } 41 | private function putContent($path, $content){ 42 | //file_put_contents($path, $content, FILE_APPEND | LOCK_EX); 43 | $file=fopen($path, "w+"); 44 | if($file==false){ 45 | echo "Error in opening $file "; 46 | exit(); 47 | } 48 | fwrite($file, $content); 49 | fclose($file); 50 | } 51 | public function save() 52 | { 53 | $data=$this->post(); 54 | $success=FALSE; 55 | $msg= 'You are not permitted.'; 56 | $id=0; 57 | if(!isset($data->NavigationId)) 58 | { 59 | if($this->auth->IsInsert){ 60 | $id=$this->model->add($data); 61 | $msg='Data inserted successfully'; 62 | $success=TRUE; 63 | } 64 | 65 | } 66 | else{ 67 | if($this->auth->IsUpdate){ 68 | $id=$this->model->update($data->NavigationId, $data); 69 | $success=TRUE; 70 | $msg='Data updated successfully'; 71 | } 72 | } 73 | $this->generate_routes(); 74 | print json_encode(array('success'=>$success, 'msg'=>$msg, 'id'=>$id)); 75 | } 76 | 77 | public function delete() 78 | { 79 | if($this->auth->IsDelete){ 80 | $data=$this->post(); 81 | print json_encode( array("success"=>TRUE,"msg"=>$this->model->delete($data->NavigationId))); 82 | } 83 | else{ 84 | print json_encode( array("success"=>FALSE,"msg"=>"You are not permitted")); 85 | } 86 | $this->generate_routes(); 87 | } 88 | public function get_Navigations_list(){ 89 | print json_encode($this->model->get_Navigations_list()); 90 | } 91 | 92 | public function get() 93 | { 94 | $data=$this->post(); 95 | print json_encode($this->model->get($data->NavigationId)); 96 | } 97 | public function get_all() 98 | { 99 | print json_encode($this->model->get_all()); 100 | } 101 | public function get_page() 102 | { 103 | $data=$this->post(); 104 | print json_encode($this->model->get_page($data->size, $data->pageno)); 105 | } 106 | public function get_page_where() 107 | { 108 | $data=$this->post(); 109 | print json_encode($this->model->get_page_where($data->size, $data->pageno, $data)); 110 | } 111 | } 112 | 113 | ?> -------------------------------------------------------------------------------- /application/controllers/Roles_ctrl.php: -------------------------------------------------------------------------------- 1 | load->model('Roles_model','model'); 8 | } 9 | public function index() 10 | { 11 | if($this->is_authentic($this->auth->RoleId, $this->user->UserId, 'Roles')){ 12 | $data['fx']='return '.json_encode(array("insert"=>$this->auth->IsInsert==="1","update"=>$this->auth->IsUpdate==="1","delete"=>$this->auth->IsDelete==="1")); 13 | $data['read']=$this->auth->IsRead; 14 | $this->load->view('Roles_view', $data); 15 | } 16 | else 17 | { 18 | $this->load->view('forbidden'); 19 | } 20 | } 21 | 22 | public function save() 23 | { 24 | $data=$this->post(); 25 | $success=FALSE; 26 | $msg= 'You are not permitted.'; 27 | $id=0; 28 | if(!isset($data->RoleId)) 29 | { 30 | if($this->auth->IsInsert){ 31 | $id=$this->model->add($data); 32 | $msg='Data inserted successfully'; 33 | $success=TRUE; 34 | } 35 | 36 | } 37 | else{ 38 | if($this->auth->IsUpdate){ 39 | $id=$this->model->update($data->RoleId, $data); 40 | $success=TRUE; 41 | $msg='Data updated successfully'; 42 | } 43 | } 44 | print json_encode(array('success'=>$success, 'msg'=>$msg, 'id'=>$id)); 45 | } 46 | 47 | public function delete() 48 | { 49 | if($this->auth->IsDelete){ 50 | $data=$this->post(); 51 | print json_encode( array("success"=>TRUE,"msg"=>$this->model->delete($data->RoleId))); 52 | } 53 | else{ 54 | print json_encode( array("success"=>FALSE,"msg"=>"You are not permitted")); 55 | } 56 | } 57 | public function get_Navigations_list(){ 58 | print json_encode($this->model->get_Navigations_list()); 59 | } 60 | 61 | public function get() 62 | { 63 | $data=$this->post(); 64 | print json_encode($this->model->get($data->RoleId)); 65 | } 66 | public function get_all() 67 | { 68 | print json_encode($this->model->get_all()); 69 | } 70 | public function get_page() 71 | { 72 | $data=$this->post(); 73 | print json_encode($this->model->get_page($data->size, $data->pageno)); 74 | } 75 | public function get_page_where() 76 | { 77 | $data=$this->post(); 78 | print json_encode($this->model->get_page_where($data->size, $data->pageno, $data)); 79 | } 80 | } 81 | 82 | ?> -------------------------------------------------------------------------------- /application/controllers/Users_ctrl.php: -------------------------------------------------------------------------------- 1 | load->model('Users_model','model'); 8 | } 9 | public function index() 10 | { 11 | if($this->is_authentic($this->auth->RoleId, $this->user->UserId, 'Users')){ 12 | $data['fx']='return '.json_encode(array("insert"=>$this->auth->IsInsert==="1","update"=>$this->auth->IsUpdate==="1","delete"=>$this->auth->IsDelete==="1")); 13 | $data['read']=$this->auth->IsRead; 14 | $this->load->view('Users_view', $data); 15 | } 16 | else 17 | { 18 | $this->load->view('forbidden'); 19 | } 20 | } 21 | 22 | public function save() 23 | { 24 | $data=$this->post(); 25 | $success=FALSE; 26 | $msg= 'You are not permitted.'; 27 | $id=0; 28 | if(!isset($data->UserId)) 29 | { 30 | if($this->auth->IsInsert){ 31 | $id=$this->model->add($data); 32 | $msg='Data inserted successfully'; 33 | $success=TRUE; 34 | } 35 | 36 | } 37 | else{ 38 | if($this->auth->IsUpdate){ 39 | $id=$this->model->update($data->UserId, $data); 40 | $success=TRUE; 41 | $msg='Data updated successfully'; 42 | } 43 | } 44 | print json_encode(array('success'=>$success, 'msg'=>$msg, 'id'=>$id)); 45 | } 46 | 47 | public function delete() 48 | { 49 | if($this->auth->IsDelete){ 50 | $data=$this->post(); 51 | print json_encode( array("success"=>TRUE,"msg"=>$this->model->delete($data->UserId))); 52 | } 53 | else{ 54 | print json_encode( array("success"=>FALSE,"msg"=>"You are not permitted")); 55 | } 56 | } 57 | public function get_Roles_list(){ 58 | print json_encode($this->model->get_Roles_list()); 59 | } 60 | public function get_Navigations_list(){ 61 | print json_encode($this->model->get_Navigations_list()); 62 | } 63 | 64 | public function get() 65 | { 66 | $data=$this->post(); 67 | print json_encode($this->model->get($data->UserId)); 68 | } 69 | public function get_all() 70 | { 71 | print json_encode($this->model->get_all()); 72 | } 73 | public function get_page() 74 | { 75 | $data=$this->post(); 76 | print json_encode($this->model->get_page($data->size, $data->pageno)); 77 | } 78 | public function get_page_where() 79 | { 80 | $data=$this->post(); 81 | print json_encode($this->model->get_page_where($data->size, $data->pageno, $data)); 82 | } 83 | } 84 | 85 | ?> -------------------------------------------------------------------------------- /application/controllers/home_ctrl.php: -------------------------------------------------------------------------------- 1 | load->view('home_view'); 12 | } 13 | 14 | 15 | } 16 | 17 | ?> -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/controllers/login.php: -------------------------------------------------------------------------------- 1 | load->database(); 8 | $this->load->helper('url'); 9 | $this->load->model('login_model','model'); 10 | } 11 | public function index() 12 | { 13 | $this->load->view('login'); 14 | } 15 | public function submit(){ 16 | $uname = $this->input->post('username'); 17 | $pwd = $this->input->post('password'); 18 | 19 | $result=$this->model->login($uname, $pwd ); 20 | 21 | if ($result) { 22 | $this->session->set_userdata('login_state', TRUE); 23 | $this->session->set_userdata('auth', $this->model->get_role($result->Role)); 24 | $this->session->set_userdata('user', $result); 25 | redirect( 'projects', TRUE ); 26 | } else { 27 | redirect( 'login', TRUE ); 28 | } 29 | } 30 | 31 | public function logout(){ 32 | $this->session->sess_destroy(); 33 | redirect('login', TRUE); 34 | } 35 | } 36 | 37 | ?> -------------------------------------------------------------------------------- /application/controllers/projects.php: -------------------------------------------------------------------------------- 1 | load->helper('url'); 8 | $this->load->model('Project_model','model'); 9 | } 10 | public function index() 11 | { 12 | $result=$this->model->get_navigations($this->auth->RoleId, $this->user->UserId); 13 | $menu=$this->get_menu($result); 14 | 15 | $this->load->view('layout', array('menu'=>$menu)); 16 | } 17 | private function get_menu($res){ 18 | //NavigationId, NavName, NavOrder,ParentNavId,ActionPath 19 | $menu=""; 20 | foreach($res as $item){ 21 | if(is_null($item->ParentNavId)){ 22 | $subMenu=$this->getSubMenu($res, $item->NavigationId); 23 | if($subMenu==""){ 24 | $menu.='
  • '.$item->NavName.'
  • '; 25 | } 26 | else{ 27 | $menu .=''; 33 | } 34 | } 35 | } 36 | return $menu; 37 | } 38 | private function getSubMenu($list, $navId){ 39 | $html=""; 40 | foreach($list as $item){ 41 | if($item->ParentNavId==$navId){ 42 | $subMenu=$this->getSubMenu($list, $item->NavigationId); 43 | if($subMenu==""){ 44 | $html.='
  • '.$item->NavName.'
  • '; 45 | } 46 | else{ 47 | $html .=''; 53 | } 54 | } 55 | } 56 | return $html; 57 | } 58 | 59 | } 60 | 61 | /* End of file projects.php */ 62 | /* Location: ./application/controllers/projects.php */ -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/errors/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Page Not Found 5 | 55 | 56 | 57 |
    58 |

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

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

    59 | 60 |
    61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_php.php: -------------------------------------------------------------------------------- 1 |
    2 | 3 |

    A PHP Error was encountered

    4 | 5 |

    Severity:

    6 |

    Message:

    7 |

    Filename:

    8 |

    Line Number:

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

    Directory access is forbidden.

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

    Directory access is forbidden.

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

    Directory access is forbidden.

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

    Directory access is forbidden.

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

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/libraries/base_ctrl.php: -------------------------------------------------------------------------------- 1 | load->database(); 8 | $this->load->helper('url'); 9 | if ( $this->session->userdata('login_state') == FALSE ) { 10 | redirect( "login" ); 11 | } 12 | else{ 13 | $this->auth=$this->session->userdata('auth'); 14 | $this->user=$this->session->userdata('user'); 15 | } 16 | } 17 | 18 | protected function post(){ 19 | return json_decode(file_get_contents("php://input")); 20 | } 21 | 22 | protected function is_authentic($roleId, $userId, $action){ 23 | $query= $this->db->query("SELECT NavigationId, NavName, NavOrder,ParentNavId,ActionPath 24 | From navigations where NavigationId in(SELECT a.Navigations FROM NavigViewRight a 25 | WHERE a.Roles=".$this->db->escape($roleId)." or a.Users=".$this->db->escape($userId).") AND ActionPath =".$this->db->escape($action)." order by NavOrder"); 26 | return $query->num_rows()>0; 27 | } 28 | 29 | protected $auth; 30 | protected $user; 31 | 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

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

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/models/Navigations_model.php: -------------------------------------------------------------------------------- 1 | db->select('NavigationId, NavName')->get('Navigations')->result(); 9 | } 10 | public function get_all() 11 | { 12 | return $this->db->get($this->table)->result(); 13 | } 14 | public function get_page($size, $pageno){ 15 | $this->db 16 | ->limit($size, $pageno) 17 | ->select('Navigations.NavigationId,Navigations.NavName,Navigations.NavOrder,Navigations.ActionPath,x.NavName as Navigations_NavName,Navigations.ParentNavId') 18 | 19 | ->join('Navigations as x', 'Navigations.ParentNavId = x.NavigationId', 'left outer'); 20 | 21 | $data=$this->db->get($this->table)->result(); 22 | $total=$this->count_all(); 23 | return array("data"=>$data, "total"=>$total); 24 | } 25 | public function get_page_where($size, $pageno, $params){ 26 | $this->db->limit($size, $pageno) 27 | ->select('Navigations.NavigationId,Navigations.NavName,Navigations.NavOrder,Navigations.ActionPath,x.NavName as Navigations_NavName,Navigations.ParentNavId') 28 | 29 | ->join('Navigations as x', 'Navigations.ParentNavId = x.NavigationId', 'left outer'); 30 | 31 | if(isset($params->NavName) && !empty($params->NavName)){ 32 | $this->db->like("Navigations.NavName",$params->NavName); 33 | } 34 | if(isset($params->ParentNavId) && !empty($params->ParentNavId)){ 35 | $this->db->where("Navigations.ParentNavId",$params->ParentNavId); 36 | } 37 | 38 | $data=$this->db->get($this->table)->result(); 39 | $total=$this->count_where($params); 40 | return array("data"=>$data, "total"=>$total); 41 | } 42 | public function count_where($params) 43 | { 44 | $this->db 45 | ->join('Navigations as x', 'Navigations.ParentNavId = x.NavigationId', 'left outer'); 46 | 47 | if(isset($params->NavName) && !empty($params->NavName)){ 48 | $this->db->like("Navigations.NavName",$params->NavName); 49 | } 50 | if(isset($params->ParentNavId) && !empty($params->ParentNavId)){ 51 | $this->db->where("Navigations.ParentNavId",$params->ParentNavId); 52 | } 53 | 54 | return $this->db->count_all_results($this->table); 55 | } 56 | public function count_all() 57 | { 58 | return $this->db 59 | ->count_all_results($this->table); 60 | } 61 | public function get($id) 62 | { 63 | return $this->db->where('NavigationId', $id)->get($this->table)->row(); 64 | } 65 | 66 | public function add($data) 67 | { 68 | $this->db->insert($this->table, $data); 69 | return $this->db->insert_id(); 70 | } 71 | 72 | public function update($id, $data) 73 | { 74 | return $this->db->where('NavigationId', $id)->update($this->table, $data); 75 | } 76 | 77 | public function delete($id) 78 | { 79 | $this->db->where('NavigationId', $id)->delete($this->table); 80 | return $this->db->affected_rows(); 81 | } 82 | 83 | } 84 | 85 | ?> -------------------------------------------------------------------------------- /application/models/Roles_model.php: -------------------------------------------------------------------------------- 1 | db->select('NavigationId, NavName')->get('Navigations')->result(); 9 | } 10 | public function get_all() 11 | { 12 | return $this->db->get($this->table)->result(); 13 | } 14 | public function get_page($size, $pageno){ 15 | $this->db 16 | ->limit($size, $pageno) 17 | ->select('Roles.RoleId,Roles.RoleName,Navigations.NavName as Navigations_NavName,Roles.NavigationId,Roles.IsRead,Roles.IsInsert,Roles.IsUpdate,Roles.IsDelete') 18 | 19 | ->join('Navigations', 'Roles.NavigationId = Navigations.NavigationId', 'left outer'); 20 | 21 | $data=$this->db->get($this->table)->result(); 22 | $total=$this->count_all(); 23 | return array("data"=>$data, "total"=>$total); 24 | } 25 | public function get_page_where($size, $pageno, $params){ 26 | $this->db->limit($size, $pageno) 27 | ->select('Roles.RoleId,Roles.RoleName,Navigations.NavName as Navigations_NavName,Roles.NavigationId,Roles.IsRead,Roles.IsInsert,Roles.IsUpdate,Roles.IsDelete') 28 | 29 | ->join('Navigations', 'Roles.NavigationId = Navigations.NavigationId', 'left outer'); 30 | 31 | if(isset($params->RoleName) && !empty($params->RoleName)){ 32 | $this->db->like("Roles.RoleName",$params->RoleName); 33 | } 34 | if(isset($params->NavigationId) && !empty($params->NavigationId)){ 35 | $this->db->where("Roles.NavigationId",$params->NavigationId); 36 | } 37 | 38 | $data=$this->db->get($this->table)->result(); 39 | $total=$this->count_where($params); 40 | return array("data"=>$data, "total"=>$total); 41 | } 42 | public function count_where($params) 43 | { 44 | $this->db 45 | ->join('Navigations', 'Roles.NavigationId = Navigations.NavigationId', 'left outer'); 46 | 47 | if(isset($params->RoleName) && !empty($params->RoleName)){ 48 | $this->db->like("Roles.RoleName",$params->RoleName); 49 | } 50 | if(isset($params->NavigationId) && !empty($params->NavigationId)){ 51 | $this->db->where("Roles.NavigationId",$params->NavigationId); 52 | } 53 | 54 | return $this->db->count_all_results($this->table); 55 | } 56 | public function count_all() 57 | { 58 | return $this->db 59 | ->count_all_results($this->table); 60 | } 61 | public function get($id) 62 | { 63 | return $this->db->where('RoleId', $id)->get($this->table)->row(); 64 | } 65 | 66 | public function add($data) 67 | { 68 | $this->db->insert($this->table, $data); 69 | return $this->db->insert_id(); 70 | } 71 | 72 | public function update($id, $data) 73 | { 74 | return $this->db->where('RoleId', $id)->update($this->table, $data); 75 | } 76 | 77 | public function delete($id) 78 | { 79 | $this->db->where('RoleId', $id)->delete($this->table); 80 | return $this->db->affected_rows(); 81 | } 82 | 83 | } 84 | 85 | ?> -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/models/login_model.php: -------------------------------------------------------------------------------- 1 | db->get($this->table)->result(); 11 | } 12 | function login($username, $password) 13 | { 14 | $this->db->select('UserId, UserName, Email, FirstName, LastName, Role'); 15 | $this -> db -> from('users'); 16 | $this -> db -> where('UserName', $username); 17 | $this -> db -> where('Password', $password); 18 | $this -> db -> where('IsActive', TRUE); 19 | $this -> db -> limit(1); 20 | 21 | $query = $this -> db -> get(); 22 | 23 | if($query -> num_rows() == 1) 24 | { 25 | return $query->row(); 26 | } 27 | else 28 | { 29 | return false; 30 | } 31 | } 32 | public function get_role($roleId) 33 | { 34 | return $this->db->where('RoleId', $roleId)->get('Roles')->row(); 35 | } 36 | } 37 | 38 | ?> -------------------------------------------------------------------------------- /application/models/project_model.php: -------------------------------------------------------------------------------- 1 | db->query("SELECT NavigationId, NavName, NavOrder,ParentNavId,ActionPath 10 | From navigations where NavigationId in(SELECT a.Navigations FROM NavigViewRight a 11 | WHERE a.Roles=".$this->db->escape($roleId)." or a.Users=".$this->db->escape($userId).") 12 | order by NavOrder"); 13 | return $query->result(); 14 | 15 | } 16 | 17 | } 18 | 19 | /* End of file project_model.php */ 20 | /* Location: ./application/models/project_model.php */ -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/NavigViewRight_view.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
    5 | 6 |
    7 |
    8 | 9 | 10 |
    11 |
    12 |
    13 |
    14 |
    15 |
    16 | NavigViewRight 17 |
    18 | 19 |
    20 | 21 | Required 22 |
    23 |
    24 |
    25 |
    26 | 27 |
    28 |
    29 |
    30 | 31 |
    32 | 33 |
    34 | 35 | 36 |
    37 |
    38 |
    39 |
    40 |
    41 | 45 | 62 | 67 |
    68 | 69 |

    Not permitted

    70 | 71 | -------------------------------------------------------------------------------- /application/views/forbidden.php: -------------------------------------------------------------------------------- 1 | 2 |

    Forbidden

    -------------------------------------------------------------------------------- /application/views/home_view.php: -------------------------------------------------------------------------------- 1 |
    2 | jQuery ui directives( Please look at the file static/js/jQuery-ui-directive.js)
    3 | 4 |
    5 | 6 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/layout.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | AngularJS and CodeIgniter 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 46 | 47 |
    48 | 49 |
    50 | 51 | 54 | 55 |
    56 | 57 |
    58 | 59 |
    60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /application/views/list.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 |
    ProjectDescription Add project
    {{project.name}}{{project.description}} 15 |
    16 | Edit 17 | 18 |
    19 |
    -------------------------------------------------------------------------------- /application/views/login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sign in · 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 46 | 47 | 48 | 49 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
    59 | 68 | 69 |
    70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /static/appScript/app.js: -------------------------------------------------------------------------------- 1 | angular.module('project', ['ui.bootstrap', 'ngGrid', 'jQuery-ui']). 2 | config(function($routeProvider) { 3 | $routeProvider. 4 | when('/', { templateUrl:BASE_URL+'home_ctrl'}). 5 | 6 | when('/Navigations', { templateUrl:BASE_URL+'Navigations_ctrl'}). 7 | when('/NavigViewRight', { templateUrl:BASE_URL+'NavigViewRight_ctrl'}). 8 | when('/Roles', { templateUrl:BASE_URL+'Roles_ctrl'}). 9 | when('/Users', { templateUrl:BASE_URL+'Users_ctrl'}). 10 | 11 | otherwise({redirectTo:'/'}); 12 | }); -------------------------------------------------------------------------------- /static/css/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/font/FontAwesome.otf -------------------------------------------------------------------------------- /static/css/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/css/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/css/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/css/site.css: -------------------------------------------------------------------------------- 1 | .gridStyle { 2 | border: 1px solid rgb(212,212,212); 3 | width: 1000px; 4 | height: 420px; 5 | } -------------------------------------------------------------------------------- /static/css/smoothness/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/animated-overlay.gif -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /static/css/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/css/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /static/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /static/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/static/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /static/js/jQuery-ui-directive.js: -------------------------------------------------------------------------------- 1 |  2 | angular.module('jQuery-ui', []). 3 | directive('jqDate', function () { 4 | return { 5 | restrict: 'A', 6 | link: function (scope, element, attrs) { 7 | 8 | element.datepicker(scope[attrs.jqDate]); 9 | } 10 | }; 11 | }). 12 | directive('jqButton', function () { 13 | return { 14 | restrict: 'A', 15 | link: function (scope, element, attrs) { 16 | 17 | element.button(scope[attrs.jqDate]); 18 | } 19 | }; 20 | }). 21 | directive('jqAccordion', function () { 22 | return { 23 | restrict: 'A', 24 | link: function (scope, element, attrs) { 25 | 26 | element.accordion(scope[attrs.jqDate]); 27 | } 28 | }; 29 | }). 30 | directive('jqAutocomplete', function () { 31 | return { 32 | restrict: 'A', 33 | link: function (scope, element, attrs) { 34 | 35 | element.autocomplete(scope[attrs.jqDate]); 36 | } 37 | }; 38 | }). 39 | directive('jqDialog', function () { 40 | return { 41 | restrict: 'A', 42 | link: function (scope, element, attrs) { 43 | 44 | element.dialog(scope[attrs.jqDate]); 45 | } 46 | }; 47 | }). 48 | directive('jqMenu', function () { 49 | return { 50 | restrict: 'A', 51 | link: function (scope, element, attrs) { 52 | 53 | element.menu(scope[attrs.jqDate]); 54 | } 55 | }; 56 | }). 57 | directive('jqProgressbar', function () { 58 | return { 59 | restrict: 'A', 60 | link: function (scope, element, attrs) { 61 | 62 | element.progressbar(scope[attrs.jqDate]); 63 | } 64 | }; 65 | }). 66 | directive('jqSlider', function () { 67 | return { 68 | restrict: 'A', 69 | link: function (scope, element, attrs) { 70 | 71 | element.slider(scope[attrs.jqDate]); 72 | } 73 | }; 74 | }). 75 | directive('jqSpinner', function () { 76 | return { 77 | restrict: 'A', 78 | link: function (scope, element, attrs) { 79 | 80 | element.spinner(scope[attrs.jqDate]); 81 | } 82 | }; 83 | }). 84 | directive('jqTabs', function () { 85 | return { 86 | restrict: 'A', 87 | link: function (scope, element, attrs) { 88 | 89 | element.tabs(scope[attrs.jqDate]); 90 | } 91 | }; 92 | }). 93 | directive('jqTooltip', function () { 94 | return { 95 | restrict: 'A', 96 | link: function (scope, element, attrs) { 97 | 98 | element.tooltip(scope[attrs.jqDate]); 99 | } 100 | }; 101 | }); -------------------------------------------------------------------------------- /static/js/scripts.js: -------------------------------------------------------------------------------- 1 | angular.module('project', ['projectApi','ui.bootstrap', 'ngGrid']). 2 | config(function($routeProvider) { 3 | $routeProvider. 4 | when('/', {controller:ListCtrl, templateUrl:'index.php/projects/template_list'}). 5 | when('/edit/:id', {controller:EditCtrl, templateUrl:'index.php/projects/template_detail'}). 6 | when('/new', {controller:CreateCtrl, templateUrl:'index.php/projects/template_detail'}). 7 | when('/Department', { templateUrl:'index.php/Department_ctrl'}). 8 | when('/Student', { templateUrl:'index.php/Student_ctrl'}). 9 | otherwise({redirectTo:'/'}); 10 | }); 11 | 12 | function ListCtrl($scope, $location, Project) { 13 | 14 | 15 | $scope.projects = Project.query(); 16 | 17 | $scope.destroy = function(Project) { 18 | Project.destroy(function() { 19 | $scope.projects.splice($scope.projects.indexOf(Project), 1); 20 | }); 21 | }; 22 | } 23 | 24 | function CreateCtrl($scope, $location, Project) { 25 | $scope.save = function() { 26 | Project.save($scope.project, function(project) { 27 | $location.path('/edit/' + project.id); 28 | }); 29 | }; 30 | } 31 | 32 | function EditCtrl($scope, $location, $routeParams, Project) { 33 | var self = this; 34 | 35 | Project.get({id: $routeParams.id}, function(project) { 36 | self.original = project; 37 | $scope.project = new Project(self.original); 38 | }); 39 | 40 | $scope.isClean = function() { 41 | return angular.equals(self.original, $scope.project); 42 | }; 43 | 44 | $scope.destroy = function() { 45 | self.original.destroy(function() { 46 | $location.path('/'); 47 | }); 48 | }; 49 | 50 | $scope.save = function() { 51 | $scope.project.update(function() { 52 | $location.path('/'); 53 | }); 54 | }; 55 | } 56 | 57 | 58 | angular.module('projectApi', ['ngResource']). 59 | factory('Project', function($resource) { 60 | 61 | var Project = $resource('index.php/api/projects/:method/:id', {}, { 62 | query: {method:'GET', params: {method:'index'}, isArray:true }, 63 | save: {method:'POST', params: {method:'save'} }, 64 | get: {method:'GET', params: {method:'edit'} }, 65 | remove: {method:'DELETE', params: {method:'remove'} } 66 | }); 67 | 68 | Project.prototype.update = function(cb) { 69 | return Project.save({id: this.id}, 70 | angular.extend({}, this, {id:undefined}), cb); 71 | }; 72 | 73 | Project.prototype.destroy = function(cb) { 74 | return Project.remove({id: this.id}, cb); 75 | }; 76 | 77 | return Project; 78 | }); -------------------------------------------------------------------------------- /static/js/toastr.min.js: -------------------------------------------------------------------------------- 1 | (function(n){n(["jquery"],function(n){return function(){function u(r){return(r||(r=i()),t=n("#"+r.containerId),t.children().length)?t:(t=n("
    ").attr("id",r.containerId).addClass(r.positionClass),t.appendTo(n(r.target)),t)}function i(){return n.extend({},o,f.options)}function e(n){(t||(t=u()),n.is(":visible"))||(n.remove(),n=null,t.children().length===0&&t.remove())}var t,o={tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,fadeIn:300,onFadeIn:undefined,fadeOut:1e3,onFadeOut:undefined,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",newestOnTop:!0},s=function(n,t,u){return r({iconClass:i().iconClasses.error,message:n,optionsOverride:u,title:t})},h=function(n,t,u){return r({iconClass:i().iconClasses.info,message:n,optionsOverride:u,title:t})},r=function(r){function s(){if(!(n(":focus",o).length>0))return o.fadeOut(f.fadeOut,function(){e(o),f.onFadeOut&&f.onFadeOut()})}function y(){(f.timeOut>0||f.extendedTimeOut>0)&&(c=setTimeout(s,f.extendedTimeOut))}function p(){clearTimeout(c),o.stop(!0,!0).fadeIn(f.fadeIn)}var f=i(),h=r.iconClass||f.iconClass;typeof r.optionsOverride!="undefined"&&(f=n.extend(f,r.optionsOverride),h=r.optionsOverride.iconClass||h),t=u(f);var c=null,o=n("
    "),l=n("
    "),a=n("
    "),v={options:f,map:r};return r.iconClass&&o.addClass(f.toastClass).addClass(h),r.title&&(l.append(r.title).addClass(f.titleClass),o.append(l)),r.message&&(a.append(r.message).addClass(f.messageClass),o.append(a)),o.hide(),f.newestOnTop?t.prepend(o):t.append(o),o.fadeIn(f.fadeIn,f.onFadeIn),f.timeOut>0&&(c=setTimeout(s,f.timeOut)),o.hover(p,y),!f.onclick&&f.tapToDismiss&&o.click(s),f.onclick&&o.click(function(){f.onclick()&&s()}),f.debug&&console&&console.log(v),o},c=function(n,t,u){return r({iconClass:i().iconClasses.success,message:n,optionsOverride:u,title:t})},l=function(n,t,u){return r({iconClass:i().iconClasses.warning,message:n,optionsOverride:u,title:t})},a=function(r){var f=i();if(t||u(f),r&&n(":focus",r).length===0){r.fadeOut(f.fadeOut,function(){e(r)});return}t.children().length&&t.fadeOut(f.fadeOut,function(){t.remove()})},f={clear:a,error:s,getContainer:u,info:h,options:{},success:c,version:"1.3.0",warning:l};return f}()})})(typeof define=="function"&&define.amd?define:function(n,t){typeof module!="undefined"&&module.exports?module.exports=t(require(n[0])):window.toastr=t(window.jQuery)}); -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/core/Controller.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 */ -------------------------------------------------------------------------------- /system/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 52 | } 53 | } 54 | // END Model Class 55 | 56 | /* End of file Model.php */ 57 | /* Location: ./system/core/Model.php */ -------------------------------------------------------------------------------- /system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/cubrid_utility.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 */ -------------------------------------------------------------------------------- /system/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

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

    Directory access is forbidden.

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

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/mssql_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 */ -------------------------------------------------------------------------------- /system/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

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

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/postgre/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/sqlite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

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

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/system/fonts/texb.ttf -------------------------------------------------------------------------------- /system/helpers/array_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 */ -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/helpers/download_helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/helpers/path_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 */ -------------------------------------------------------------------------------- /system/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 */ -------------------------------------------------------------------------------- /system/helpers/xml_helper.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 */ -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/migration_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/Cache_apc.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 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/Cache_dummy.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 */ -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

    Directory access is forbidden.

    8 | 9 | 10 | -------------------------------------------------------------------------------- /tools/JCrud.php: -------------------------------------------------------------------------------- 1 | $e->getMessage() doesn't exist", E_USER_ERROR); 15 | } 16 | } 17 | 18 | public static $HOST; 19 | public static $USER; 20 | public static $PASS; 21 | public static $DBNAME; 22 | 23 | public function insert($sql, $params) 24 | { 25 | try 26 | { 27 | $stmt=$this->prepare($sql); 28 | 29 | $stmt->execute($params); 30 | 31 | return $this->lastInsertId(); 32 | }catch (Exception $ex) 33 | { 34 | throw $ex; 35 | } 36 | } 37 | public function update($sql, $params) 38 | { 39 | try 40 | { 41 | $stmt=$this->prepare($sql); 42 | 43 | $stmt->execute($params); 44 | 45 | }catch (Exception $ex) 46 | { 47 | throw $ex; 48 | } 49 | } 50 | 51 | public function query1($sql) 52 | { 53 | try 54 | { 55 | $stmt=$this->prepare($sql); 56 | $stmt->execute(); 57 | return $stmt->fetchAll(self::FETCH_OBJ); 58 | } catch (Exception $ex) 59 | { 60 | throw $ex; 61 | } 62 | } 63 | public function query2($sql, $params) 64 | { 65 | try 66 | { 67 | $stmt=$this->prepare($sql); 68 | $stmt->execute($params); 69 | return $stmt->fetchAll(self::FETCH_OBJ); 70 | } catch (Exception $ex) 71 | { 72 | throw $ex; 73 | } 74 | } 75 | public function query3($sql, $start, $limit) 76 | { 77 | try 78 | { 79 | $sql .=" LIMIT $start, $limit"; 80 | $stmt=$this->prepare($sql); 81 | $stmt->execute(); 82 | return $stmt->fetchAll(self::FETCH_OBJ); 83 | } catch (Exception $ex) 84 | { 85 | 86 | throw $ex; 87 | } 88 | } 89 | public function query4($sql, $start, $limit, $params) 90 | { 91 | try 92 | { 93 | $sql .=" LIMIT $start, $limit"; 94 | $stmt=$this->prepare($sql); 95 | $stmt->execute($params); 96 | return $stmt->fetchAll(self::FETCH_OBJ); 97 | } catch (Exception $ex) 98 | { 99 | 100 | throw $ex; 101 | } 102 | } 103 | 104 | public function count1($sql){ 105 | try 106 | { 107 | $stmt=$this->prepare($sql); 108 | $stmt->execute(); 109 | return $stmt->fetchColumn(); 110 | 111 | } catch (Exception $ex) 112 | { 113 | 114 | throw $ex; 115 | } 116 | } 117 | public function count2($sql, $params){ 118 | try 119 | { 120 | $stmt=$this->prepare($sql); 121 | $stmt->execute($params); 122 | return $stmt->fetchColumn(); 123 | 124 | } catch (Exception $ex) 125 | { 126 | 127 | throw $ex; 128 | } 129 | } 130 | 131 | } 132 | ?> 133 | -------------------------------------------------------------------------------- /tools/codemirror/addon/edit/closebrackets.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var DEFAULT_BRACKETS = "()[]{}''\"\""; 3 | var DEFAULT_EXPLODE_ON_ENTER = "[]{}"; 4 | var SPACE_CHAR_REGEX = /\s/; 5 | 6 | CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { 7 | if (old != CodeMirror.Init && old) 8 | cm.removeKeyMap("autoCloseBrackets"); 9 | if (!val) return; 10 | var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER; 11 | if (typeof val == "string") pairs = val; 12 | else if (typeof val == "object") { 13 | if (val.pairs != null) pairs = val.pairs; 14 | if (val.explode != null) explode = val.explode; 15 | } 16 | var map = buildKeymap(pairs); 17 | if (explode) map.Enter = buildExplodeHandler(explode); 18 | cm.addKeyMap(map); 19 | }); 20 | 21 | function charsAround(cm, pos) { 22 | var str = cm.getRange(CodeMirror.Pos(pos.line, pos.ch - 1), 23 | CodeMirror.Pos(pos.line, pos.ch + 1)); 24 | return str.length == 2 ? str : null; 25 | } 26 | 27 | function buildKeymap(pairs) { 28 | var map = { 29 | name : "autoCloseBrackets", 30 | Backspace: function(cm) { 31 | if (cm.somethingSelected()) return CodeMirror.Pass; 32 | var cur = cm.getCursor(), around = charsAround(cm, cur); 33 | if (around && pairs.indexOf(around) % 2 == 0) 34 | cm.replaceRange("", CodeMirror.Pos(cur.line, cur.ch - 1), CodeMirror.Pos(cur.line, cur.ch + 1)); 35 | else 36 | return CodeMirror.Pass; 37 | } 38 | }; 39 | var closingBrackets = ""; 40 | for (var i = 0; i < pairs.length; i += 2) (function(left, right) { 41 | if (left != right) closingBrackets += right; 42 | function surround(cm) { 43 | var selection = cm.getSelection(); 44 | cm.replaceSelection(left + selection + right); 45 | } 46 | function maybeOverwrite(cm) { 47 | var cur = cm.getCursor(), ahead = cm.getRange(cur, CodeMirror.Pos(cur.line, cur.ch + 1)); 48 | if (ahead != right || cm.somethingSelected()) return CodeMirror.Pass; 49 | else cm.execCommand("goCharRight"); 50 | } 51 | map["'" + left + "'"] = function(cm) { 52 | if (left == "'" && cm.getTokenAt(cm.getCursor()).type == "comment") 53 | return CodeMirror.Pass; 54 | if (cm.somethingSelected()) return surround(cm); 55 | if (left == right && maybeOverwrite(cm) != CodeMirror.Pass) return; 56 | var cur = cm.getCursor(), ahead = CodeMirror.Pos(cur.line, cur.ch + 1); 57 | var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch), curChar = cur.ch > 0 ? line.charAt(cur.ch - 1) : ""; 58 | if (left == right && CodeMirror.isWordChar(curChar)) 59 | return CodeMirror.Pass; 60 | if (line.length == cur.ch || closingBrackets.indexOf(nextChar) >= 0 || SPACE_CHAR_REGEX.test(nextChar)) 61 | cm.replaceSelection(left + right, {head: ahead, anchor: ahead}); 62 | else 63 | return CodeMirror.Pass; 64 | }; 65 | if (left != right) map["'" + right + "'"] = maybeOverwrite; 66 | })(pairs.charAt(i), pairs.charAt(i + 1)); 67 | return map; 68 | } 69 | 70 | function buildExplodeHandler(pairs) { 71 | return function(cm) { 72 | var cur = cm.getCursor(), around = charsAround(cm, cur); 73 | if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; 74 | cm.operation(function() { 75 | var newPos = CodeMirror.Pos(cur.line + 1, 0); 76 | cm.replaceSelection("\n\n", {anchor: newPos, head: newPos}, "+input"); 77 | cm.indentLine(cur.line + 1, null, true); 78 | cm.indentLine(cur.line + 2, null, true); 79 | }); 80 | }; 81 | } 82 | })(); 83 | -------------------------------------------------------------------------------- /tools/codemirror/addon/edit/continuecomment.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var modes = ["clike", "css", "javascript"]; 3 | for (var i = 0; i < modes.length; ++i) 4 | CodeMirror.extendMode(modes[i], {blockCommentStart: "/*", 5 | blockCommentEnd: "*/", 6 | blockCommentContinue: " * "}); 7 | 8 | function continueComment(cm) { 9 | var pos = cm.getCursor(), token = cm.getTokenAt(pos); 10 | var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode; 11 | var space; 12 | 13 | if (token.type == "comment" && mode.blockCommentStart) { 14 | var end = token.string.indexOf(mode.blockCommentEnd); 15 | var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; 16 | if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) { 17 | // Comment ended, don't continue it 18 | } else if (token.string.indexOf(mode.blockCommentStart) == 0) { 19 | space = full.slice(0, token.start); 20 | if (!/^\s*$/.test(space)) { 21 | space = ""; 22 | for (var i = 0; i < token.start; ++i) space += " "; 23 | } 24 | } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && 25 | found + mode.blockCommentContinue.length > token.start && 26 | /^\s*$/.test(full.slice(0, found))) { 27 | space = full.slice(0, found); 28 | } 29 | } 30 | 31 | if (space != null) 32 | cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end"); 33 | else 34 | return CodeMirror.Pass; 35 | } 36 | 37 | CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { 38 | if (prev && prev != CodeMirror.Init) 39 | cm.removeKeyMap("continueComment"); 40 | var map = {name: "continueComment"}; 41 | map[typeof val == "string" ? val : "Enter"] = continueComment; 42 | cm.addKeyMap(map); 43 | }); 44 | })(); 45 | -------------------------------------------------------------------------------- /tools/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/, 5 | unorderedBullets = '*+-'; 6 | 7 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 8 | var pos = cm.getCursor(), 9 | inList = cm.getStateAfter(pos.line).list, 10 | match; 11 | 12 | if (!inList || !(match = cm.getLine(pos.line).match(listRE))) { 13 | cm.execCommand('newlineAndIndent'); 14 | return; 15 | } 16 | 17 | var indent = match[1], after = match[4]; 18 | var bullet = unorderedBullets.indexOf(match[2]) >= 0 19 | ? match[2] 20 | : (parseInt(match[3], 10) + 1) + '.'; 21 | 22 | cm.replaceSelection('\n' + indent + bullet + after, 'end'); 23 | }; 24 | 25 | }()); 26 | -------------------------------------------------------------------------------- /tools/codemirror/addon/edit/matchtags.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | CodeMirror.defineOption("matchTags", false, function(cm, val, old) { 5 | if (old && old != CodeMirror.Init) { 6 | cm.off("cursorActivity", doMatchTags); 7 | cm.off("viewportChange", maybeUpdateMatch); 8 | clear(cm); 9 | } 10 | if (val) { 11 | cm.on("cursorActivity", doMatchTags); 12 | cm.on("viewportChange", maybeUpdateMatch); 13 | doMatchTags(cm); 14 | } 15 | }); 16 | 17 | function clear(cm) { 18 | if (cm.state.matchedTag) { 19 | cm.state.matchedTag.clear(); 20 | cm.state.matchedTag = null; 21 | } 22 | } 23 | 24 | function doMatchTags(cm) { 25 | cm.state.failedTagMatch = false; 26 | cm.operation(function() { 27 | clear(cm); 28 | var cur = cm.getCursor(), range = cm.getViewport(); 29 | range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); 30 | var match = CodeMirror.findMatchingTag(cm, cur, range); 31 | if (!match) return; 32 | var other = match.at == "close" ? match.open : match.close; 33 | if (other) 34 | cm.state.matchedTag = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); 35 | else 36 | cm.state.failedTagMatch = true; 37 | }); 38 | } 39 | 40 | function maybeUpdateMatch(cm) { 41 | if (cm.state.failedTagMatch) doMatchTags(cm); 42 | } 43 | 44 | CodeMirror.commands.toMatchingTag = function(cm) { 45 | var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); 46 | if (found) { 47 | var other = found.at == "close" ? found.open : found.close; 48 | if (other) cm.setSelection(other.to, other.from); 49 | } 50 | }; 51 | })(); 52 | -------------------------------------------------------------------------------- /tools/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 2 | if (prev == CodeMirror.Init) prev = false; 3 | if (prev && !val) 4 | cm.removeOverlay("trailingspace"); 5 | else if (!prev && val) 6 | cm.addOverlay({ 7 | token: function(stream) { 8 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 9 | if (i > stream.pos) { stream.pos = i; return null; } 10 | stream.pos = l; 11 | return "trailingspace"; 12 | }, 13 | name: "trailingspace" 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /tools/codemirror/addon/fold/brace-fold.js: -------------------------------------------------------------------------------- 1 | CodeMirror.registerHelper("fold", "brace", function(cm, start) { 2 | var line = start.line, lineText = cm.getLine(line); 3 | var startCh, tokenType; 4 | 5 | function findOpening(openCh) { 6 | for (var at = start.ch, pass = 0;;) { 7 | var found = lineText.lastIndexOf(openCh, at - 1); 8 | if (found == -1) { 9 | if (pass == 1) break; 10 | pass = 1; 11 | at = lineText.length; 12 | continue; 13 | } 14 | if (pass == 1 && found < start.ch) break; 15 | tokenType = cm.getTokenAt(CodeMirror.Pos(line, found + 1)).type; 16 | if (!/^(comment|string)/.test(tokenType)) return found + 1; 17 | at = found - 1; 18 | } 19 | } 20 | 21 | var startToken = "{", endToken = "}", startCh = findOpening("{"); 22 | if (startCh == null) { 23 | startToken = "[", endToken = "]"; 24 | startCh = findOpening("["); 25 | } 26 | 27 | if (startCh == null) return; 28 | var count = 1, lastLine = cm.lastLine(), end, endCh; 29 | outer: for (var i = line; i <= lastLine; ++i) { 30 | var text = cm.getLine(i), pos = i == line ? startCh : 0; 31 | for (;;) { 32 | var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); 33 | if (nextOpen < 0) nextOpen = text.length; 34 | if (nextClose < 0) nextClose = text.length; 35 | pos = Math.min(nextOpen, nextClose); 36 | if (pos == text.length) break; 37 | if (cm.getTokenAt(CodeMirror.Pos(i, pos + 1)).type == tokenType) { 38 | if (pos == nextOpen) ++count; 39 | else if (!--count) { end = i; endCh = pos; break outer; } 40 | } 41 | ++pos; 42 | } 43 | } 44 | if (end == null || line == end && endCh == startCh) return; 45 | return {from: CodeMirror.Pos(line, startCh), 46 | to: CodeMirror.Pos(end, endCh)}; 47 | }); 48 | CodeMirror.braceRangeFinder = CodeMirror.fold.brace; // deprecated 49 | 50 | CodeMirror.registerHelper("fold", "import", function(cm, start) { 51 | function hasImport(line) { 52 | if (line < cm.firstLine() || line > cm.lastLine()) return null; 53 | var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); 54 | if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); 55 | if (start.type != "keyword" || start.string != "import") return null; 56 | // Now find closing semicolon, return its position 57 | for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { 58 | var text = cm.getLine(i), semi = text.indexOf(";"); 59 | if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; 60 | } 61 | } 62 | 63 | var start = start.line, has = hasImport(start), prev; 64 | if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) 65 | return null; 66 | for (var end = has.end;;) { 67 | var next = hasImport(end.line + 1); 68 | if (next == null) break; 69 | end = next.end; 70 | } 71 | return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; 72 | }); 73 | CodeMirror.importRangeFinder = CodeMirror.fold["import"]; // deprecated 74 | 75 | CodeMirror.registerHelper("fold", "include", function(cm, start) { 76 | function hasInclude(line) { 77 | if (line < cm.firstLine() || line > cm.lastLine()) return null; 78 | var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); 79 | if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); 80 | if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; 81 | } 82 | 83 | var start = start.line, has = hasInclude(start); 84 | if (has == null || hasInclude(start - 1) != null) return null; 85 | for (var end = start;;) { 86 | var next = hasInclude(end + 1); 87 | if (next == null) break; 88 | ++end; 89 | } 90 | return {from: CodeMirror.Pos(start, has + 1), 91 | to: cm.clipPos(CodeMirror.Pos(end))}; 92 | }); 93 | CodeMirror.includeRangeFinder = CodeMirror.fold.include; // deprecated 94 | -------------------------------------------------------------------------------- /tools/codemirror/addon/fold/foldcode.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | function doFold(cm, pos, options) { 5 | var finder = options && (options.call ? options : options.rangeFinder); 6 | if (!finder) finder = cm.getHelper(pos, "fold"); 7 | if (!finder) return; 8 | if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); 9 | var minSize = options && options.minFoldSize || 0; 10 | 11 | function getRange(allowFolded) { 12 | var range = finder(cm, pos); 13 | if (!range || range.to.line - range.from.line < minSize) return null; 14 | var marks = cm.findMarksAt(range.from); 15 | for (var i = 0; i < marks.length; ++i) { 16 | if (marks[i].__isFold) { 17 | if (!allowFolded) return null; 18 | range.cleared = true; 19 | marks[i].clear(); 20 | } 21 | } 22 | return range; 23 | } 24 | 25 | var range = getRange(true); 26 | if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) { 27 | pos = CodeMirror.Pos(pos.line - 1, 0); 28 | range = getRange(false); 29 | } 30 | if (!range || range.cleared) return; 31 | 32 | var myWidget = makeWidget(options); 33 | CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); }); 34 | var myRange = cm.markText(range.from, range.to, { 35 | replacedWith: myWidget, 36 | clearOnEnter: true, 37 | __isFold: true 38 | }); 39 | myRange.on("clear", function(from, to) { 40 | CodeMirror.signal(cm, "unfold", cm, from, to); 41 | }); 42 | CodeMirror.signal(cm, "fold", cm, range.from, range.to); 43 | } 44 | 45 | function makeWidget(options) { 46 | var widget = (options && options.widget) || "\u2194"; 47 | if (typeof widget == "string") { 48 | var text = document.createTextNode(widget); 49 | widget = document.createElement("span"); 50 | widget.appendChild(text); 51 | widget.className = "CodeMirror-foldmarker"; 52 | } 53 | return widget; 54 | } 55 | 56 | // Clumsy backwards-compatible interface 57 | CodeMirror.newFoldFunction = function(rangeFinder, widget) { 58 | return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; 59 | }; 60 | 61 | // New-style interface 62 | CodeMirror.defineExtension("foldCode", function(pos, options) { doFold(this, pos, options); }); 63 | 64 | CodeMirror.registerHelper("fold", "combine", function() { 65 | var funcs = Array.prototype.slice.call(arguments, 0); 66 | return function(cm, start) { 67 | for (var i = 0; i < funcs.length; ++i) { 68 | var found = funcs[i](cm, start); 69 | if (found) return found; 70 | } 71 | }; 72 | }); 73 | })(); 74 | -------------------------------------------------------------------------------- /tools/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 2 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 3 | var myIndent = CodeMirror.countColumn(firstLine, null, tabSize); 4 | for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) { 5 | var curLine = cm.getLine(i); 6 | if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent && 7 | CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent) 8 | return {from: CodeMirror.Pos(start.line, firstLine.length), 9 | to: CodeMirror.Pos(i, curLine.length)}; 10 | } 11 | }); 12 | CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated 13 | -------------------------------------------------------------------------------- /tools/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | var WORD = /[\w$]+/, RANGE = 500; 5 | 6 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 7 | var word = options && options.word || WORD; 8 | var range = options && options.range || RANGE; 9 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 10 | var start = cur.ch, end = start; 11 | while (end < curLine.length && word.test(curLine.charAt(end))) ++end; 12 | while (start && word.test(curLine.charAt(start - 1))) --start; 13 | var curWord = start != end && curLine.slice(start, end); 14 | 15 | var list = [], seen = {}; 16 | function scan(dir) { 17 | var line = cur.line, end = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 18 | for (; line != end; line += dir) { 19 | var text = editor.getLine(line), m; 20 | var re = new RegExp(word.source, "g"); 21 | while (m = re.exec(text)) { 22 | if (line == cur.line && m[0] === curWord) continue; 23 | if ((!curWord || m[0].indexOf(curWord) == 0) && !seen.hasOwnProperty(m[0])) { 24 | seen[m[0]] = true; 25 | list.push(m[0]); 26 | } 27 | } 28 | } 29 | } 30 | scan(-1); 31 | scan(1); 32 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 33 | }); 34 | })(); 35 | -------------------------------------------------------------------------------- /tools/codemirror/addon/hint/python-hint.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function forEach(arr, f) { 3 | for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); 4 | } 5 | 6 | function arrayContains(arr, item) { 7 | if (!Array.prototype.indexOf) { 8 | var i = arr.length; 9 | while (i--) { 10 | if (arr[i] === item) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | return arr.indexOf(item) != -1; 17 | } 18 | 19 | function scriptHint(editor, _keywords, getToken) { 20 | // Find the token at the cursor 21 | var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; 22 | // If it's not a 'word-style' token, ignore the token. 23 | 24 | if (!/^[\w$_]*$/.test(token.string)) { 25 | token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, 26 | className: token.string == ":" ? "python-type" : null}; 27 | } 28 | 29 | if (!context) var context = []; 30 | context.push(tprop); 31 | 32 | var completionList = getCompletions(token, context); 33 | completionList = completionList.sort(); 34 | //prevent autocomplete for last word, instead show dropdown with one word 35 | if(completionList.length == 1) { 36 | completionList.push(" "); 37 | } 38 | 39 | return {list: completionList, 40 | from: CodeMirror.Pos(cur.line, token.start), 41 | to: CodeMirror.Pos(cur.line, token.end)}; 42 | } 43 | 44 | function pythonHint(editor) { 45 | return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); 46 | } 47 | CodeMirror.pythonHint = pythonHint; // deprecated 48 | CodeMirror.registerHelper("hint", "python", pythonHint); 49 | 50 | var pythonKeywords = "and del from not while as elif global or with assert else if pass yield" 51 | + "break except import print class exec in raise continue finally is return def for lambda try"; 52 | var pythonKeywordsL = pythonKeywords.split(" "); 53 | var pythonKeywordsU = pythonKeywords.toUpperCase().split(" "); 54 | 55 | var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str " 56 | + "any eval isinstance pow sum basestring execfile issubclass print super" 57 | + "bin file iter property tuple bool filter len range type" 58 | + "bytearray float list raw_input unichr callable format locals reduce unicode" 59 | + "chr frozenset long reload vars classmethod getattr map repr xrange" 60 | + "cmp globals max reversed zip compile hasattr memoryview round __import__" 61 | + "complex hash min set apply delattr help next setattr buffer" 62 | + "dict hex object slice coerce dir id oct sorted intern "; 63 | var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" "); 64 | var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" "); 65 | 66 | function getCompletions(token, context) { 67 | var found = [], start = token.string; 68 | function maybeAdd(str) { 69 | if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); 70 | } 71 | 72 | function gatherCompletions(_obj) { 73 | forEach(pythonBuiltinsL, maybeAdd); 74 | forEach(pythonBuiltinsU, maybeAdd); 75 | forEach(pythonKeywordsL, maybeAdd); 76 | forEach(pythonKeywordsU, maybeAdd); 77 | } 78 | 79 | if (context) { 80 | // If this is a property, see if it belongs to some object we can 81 | // find in the current environment. 82 | var obj = context.pop(), base; 83 | 84 | if (obj.type == "variable") 85 | base = obj.string; 86 | else if(obj.type == "variable-3") 87 | base = ":" + obj.string; 88 | 89 | while (base != null && context.length) 90 | base = base[context.pop().string]; 91 | if (base != null) gatherCompletions(base); 92 | } 93 | return found; 94 | } 95 | })(); 96 | -------------------------------------------------------------------------------- /tools/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | .CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /tools/codemirror/addon/hint/xml-hint.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | var Pos = CodeMirror.Pos; 5 | 6 | function getHints(cm, options) { 7 | var tags = options && options.schemaInfo; 8 | var quote = (options && options.quoteChar) || '"'; 9 | if (!tags) return; 10 | var cur = cm.getCursor(), token = cm.getTokenAt(cur); 11 | var inner = CodeMirror.innerMode(cm.getMode(), token.state); 12 | if (inner.mode.name != "xml") return; 13 | var result = [], replaceToken = false, prefix; 14 | var isTag = token.string.charAt(0) == "<"; 15 | if (!inner.state.tagName || isTag) { // Tag completion 16 | if (isTag) { 17 | prefix = token.string.slice(1); 18 | replaceToken = true; 19 | } 20 | var cx = inner.state.context, curTag = cx && tags[cx.tagName]; 21 | var childList = cx ? curTag && curTag.children : tags["!top"]; 22 | if (childList) { 23 | for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].indexOf(prefix) == 0) 24 | result.push("<" + childList[i]); 25 | } else { 26 | for (var name in tags) if (tags.hasOwnProperty(name) && name != "!top" && (!prefix || name.indexOf(prefix) == 0)) 27 | result.push("<" + name); 28 | } 29 | if (cx && (!prefix || ("/" + cx.tagName).indexOf(prefix) == 0)) 30 | result.push(""); 31 | } else { 32 | // Attribute completion 33 | var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs; 34 | if (!attrs) return; 35 | if (token.type == "string" || token.string == "=") { // A value 36 | var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)), 37 | Pos(cur.line, token.type == "string" ? token.start : token.end)); 38 | var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues; 39 | if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return; 40 | if (token.type == "string") { 41 | prefix = token.string; 42 | if (/['"]/.test(token.string.charAt(0))) { 43 | quote = token.string.charAt(0); 44 | prefix = token.string.slice(1); 45 | } 46 | replaceToken = true; 47 | } 48 | for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].indexOf(prefix) == 0) 49 | result.push(quote + atValues[i] + quote); 50 | } else { // An attribute name 51 | if (token.type == "attribute") { 52 | prefix = token.string; 53 | replaceToken = true; 54 | } 55 | for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.indexOf(prefix) == 0)) 56 | result.push(attr); 57 | } 58 | } 59 | return { 60 | list: result, 61 | from: replaceToken ? Pos(cur.line, token.start) : cur, 62 | to: replaceToken ? Pos(cur.line, token.end) : cur 63 | }; 64 | } 65 | 66 | CodeMirror.xmlHint = getHints; // deprecated 67 | CodeMirror.registerHelper("hint", "xml", getHints); 68 | })(); 69 | -------------------------------------------------------------------------------- /tools/codemirror/addon/search/match-highlighter.js: -------------------------------------------------------------------------------- 1 | // Highlighting text that matches the selection 2 | // 3 | // Defines an option highlightSelectionMatches, which, when enabled, 4 | // will style strings that match the selection throughout the 5 | // document. 6 | // 7 | // The option can be set to true to simply enable it, or to a 8 | // {minChars, style, showToken} object to explicitly configure it. 9 | // minChars is the minimum amount of characters that should be 10 | // selected for the behavior to occur, and style is the token style to 11 | // apply to the matches. This will be prefixed by "cm-" to create an 12 | // actual CSS class name. showToken, when enabled, will cause the 13 | // current token to be highlighted when nothing is selected. 14 | 15 | (function() { 16 | var DEFAULT_MIN_CHARS = 2; 17 | var DEFAULT_TOKEN_STYLE = "matchhighlight"; 18 | 19 | function State(options) { 20 | if (typeof options == "object") { 21 | this.minChars = options.minChars; 22 | this.style = options.style; 23 | this.showToken = options.showToken; 24 | } 25 | if (this.style == null) this.style = DEFAULT_TOKEN_STYLE; 26 | if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS; 27 | this.overlay = this.timeout = null; 28 | } 29 | 30 | CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { 31 | if (old && old != CodeMirror.Init) { 32 | var over = cm.state.matchHighlighter.overlay; 33 | if (over) cm.removeOverlay(over); 34 | clearTimeout(cm.state.matchHighlighter.timeout); 35 | cm.state.matchHighlighter = null; 36 | cm.off("cursorActivity", cursorActivity); 37 | } 38 | if (val) { 39 | cm.state.matchHighlighter = new State(val); 40 | highlightMatches(cm); 41 | cm.on("cursorActivity", cursorActivity); 42 | } 43 | }); 44 | 45 | function cursorActivity(cm) { 46 | var state = cm.state.matchHighlighter; 47 | clearTimeout(state.timeout); 48 | state.timeout = setTimeout(function() {highlightMatches(cm);}, 100); 49 | } 50 | 51 | function highlightMatches(cm) { 52 | cm.operation(function() { 53 | var state = cm.state.matchHighlighter; 54 | if (state.overlay) { 55 | cm.removeOverlay(state.overlay); 56 | state.overlay = null; 57 | } 58 | if (!cm.somethingSelected() && state.showToken) { 59 | var re = state.showToken === true ? /[\w$]/ : state.showToken; 60 | var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; 61 | while (start && re.test(line.charAt(start - 1))) --start; 62 | while (end < line.length && re.test(line.charAt(end))) ++end; 63 | if (start < end) 64 | cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style)); 65 | return; 66 | } 67 | if (cm.getCursor("head").line != cm.getCursor("anchor").line) return; 68 | var selection = cm.getSelection().replace(/^\s+|\s+$/g, ""); 69 | if (selection.length >= state.minChars) 70 | cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style)); 71 | }); 72 | } 73 | 74 | function boundariesAround(stream, re) { 75 | return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) && 76 | (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos))); 77 | } 78 | 79 | function makeOverlay(query, hasBoundary, style) { 80 | return {token: function(stream) { 81 | if (stream.match(query) && 82 | (!hasBoundary || boundariesAround(stream, hasBoundary))) 83 | return style; 84 | stream.next(); 85 | stream.skipTo(query.charAt(0)) || stream.skipToEnd(); 86 | }}; 87 | } 88 | })(); 89 | -------------------------------------------------------------------------------- /tools/codemirror/addon/selection/active-line.js: -------------------------------------------------------------------------------- 1 | // Because sometimes you need to style the cursor's line. 2 | // 3 | // Adds an option 'styleActiveLine' which, when enabled, gives the 4 | // active line's wrapping
    the CSS class "CodeMirror-activeline", 5 | // and gives its background
    the class "CodeMirror-activeline-background". 6 | 7 | (function() { 8 | "use strict"; 9 | var WRAP_CLASS = "CodeMirror-activeline"; 10 | var BACK_CLASS = "CodeMirror-activeline-background"; 11 | 12 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { 13 | var prev = old && old != CodeMirror.Init; 14 | if (val && !prev) { 15 | updateActiveLine(cm); 16 | cm.on("cursorActivity", updateActiveLine); 17 | } else if (!val && prev) { 18 | cm.off("cursorActivity", updateActiveLine); 19 | clearActiveLine(cm); 20 | delete cm.state.activeLine; 21 | } 22 | }); 23 | 24 | function clearActiveLine(cm) { 25 | if ("activeLine" in cm.state) { 26 | cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS); 27 | cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS); 28 | } 29 | } 30 | 31 | function updateActiveLine(cm) { 32 | var line = cm.getLineHandleVisualStart(cm.getCursor().line); 33 | if (cm.state.activeLine == line) return; 34 | clearActiveLine(cm); 35 | cm.addLineClass(line, "wrap", WRAP_CLASS); 36 | cm.addLineClass(line, "background", BACK_CLASS); 37 | cm.state.activeLine = line; 38 | } 39 | })(); 40 | -------------------------------------------------------------------------------- /tools/codemirror/addon/selection/mark-selection.js: -------------------------------------------------------------------------------- 1 | // Because sometimes you need to mark the selected *text*. 2 | // 3 | // Adds an option 'styleSelectedText' which, when enabled, gives 4 | // selected text the CSS class given as option value, or 5 | // "CodeMirror-selectedtext" when the value is not a string. 6 | 7 | (function() { 8 | "use strict"; 9 | 10 | CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) { 11 | var prev = old && old != CodeMirror.Init; 12 | if (val && !prev) { 13 | cm.state.markedSelection = []; 14 | cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext"; 15 | reset(cm); 16 | cm.on("cursorActivity", onCursorActivity); 17 | cm.on("change", onChange); 18 | } else if (!val && prev) { 19 | cm.off("cursorActivity", onCursorActivity); 20 | cm.off("change", onChange); 21 | clear(cm); 22 | cm.state.markedSelection = cm.state.markedSelectionStyle = null; 23 | } 24 | }); 25 | 26 | function onCursorActivity(cm) { 27 | cm.operation(function() { update(cm); }); 28 | } 29 | 30 | function onChange(cm) { 31 | if (cm.state.markedSelection.length) 32 | cm.operation(function() { clear(cm); }); 33 | } 34 | 35 | var CHUNK_SIZE = 8; 36 | var Pos = CodeMirror.Pos; 37 | 38 | function cmp(pos1, pos2) { 39 | return pos1.line - pos2.line || pos1.ch - pos2.ch; 40 | } 41 | 42 | function coverRange(cm, from, to, addAt) { 43 | if (cmp(from, to) == 0) return; 44 | var array = cm.state.markedSelection; 45 | var cls = cm.state.markedSelectionStyle; 46 | for (var line = from.line;;) { 47 | var start = line == from.line ? from : Pos(line, 0); 48 | var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line; 49 | var end = atEnd ? to : Pos(endLine, 0); 50 | var mark = cm.markText(start, end, {className: cls}); 51 | if (addAt == null) array.push(mark); 52 | else array.splice(addAt++, 0, mark); 53 | if (atEnd) break; 54 | line = endLine; 55 | } 56 | } 57 | 58 | function clear(cm) { 59 | var array = cm.state.markedSelection; 60 | for (var i = 0; i < array.length; ++i) array[i].clear(); 61 | array.length = 0; 62 | } 63 | 64 | function reset(cm) { 65 | clear(cm); 66 | var from = cm.getCursor("start"), to = cm.getCursor("end"); 67 | coverRange(cm, from, to); 68 | } 69 | 70 | function update(cm) { 71 | var from = cm.getCursor("start"), to = cm.getCursor("end"); 72 | if (cmp(from, to) == 0) return clear(cm); 73 | 74 | var array = cm.state.markedSelection; 75 | if (!array.length) return coverRange(cm, from, to); 76 | 77 | var coverStart = array[0].find(), coverEnd = array[array.length - 1].find(); 78 | if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE || 79 | cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0) 80 | return reset(cm); 81 | 82 | while (cmp(from, coverStart.from) > 0) { 83 | array.shift().clear(); 84 | coverStart = array[0].find(); 85 | } 86 | if (cmp(from, coverStart.from) < 0) { 87 | if (coverStart.to.line - from.line < CHUNK_SIZE) { 88 | array.shift().clear(); 89 | coverRange(cm, from, coverStart.to, 0); 90 | } else { 91 | coverRange(cm, from, coverStart.from, 0); 92 | } 93 | } 94 | 95 | while (cmp(to, coverEnd.to) < 0) { 96 | array.pop().clear(); 97 | coverEnd = array[array.length - 1].find(); 98 | } 99 | if (cmp(to, coverEnd.to) > 0) { 100 | if (to.line - coverEnd.from.line < CHUNK_SIZE) { 101 | array.pop().clear(); 102 | coverRange(cm, coverEnd.from, to); 103 | } else { 104 | coverRange(cm, coverEnd.to, to); 105 | } 106 | } 107 | } 108 | })(); 109 | -------------------------------------------------------------------------------- /tools/fileinfo.php: -------------------------------------------------------------------------------- 1 | setMaxDepth(1); 12 | $res=""; 13 | 14 | foreach ($it as $fileinfo) { 15 | $res .=''; 16 | } 17 | return $res; 18 | } 19 | 20 | ?> -------------------------------------------------------------------------------- /tools/jquery.tablednd.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/tools/jquery.tablednd.js -------------------------------------------------------------------------------- /tools/modify.php: -------------------------------------------------------------------------------- 1 | file_get_contents('../application/models/'.$_POST["name"]))); 17 | } 18 | function model_update(){ 19 | $content=$_POST["content"]; 20 | put_content('../application/models/'.$_POST["name"], $content); 21 | print json_encode( array('msg'=>'successfully updated')); 22 | } 23 | function get_view_content(){ 24 | 25 | print json_encode( array('content'=>file_get_contents('../application/views/'.$_POST["name"]))); 26 | } 27 | function view_update(){ 28 | $content=$_POST["content"]; 29 | put_content('../application/views/'.$_POST["name"], $content); 30 | print json_encode( array('msg'=>'successfully updated')); 31 | } 32 | function get_controller_content(){ 33 | 34 | print json_encode( array('content'=>file_get_contents('../application/controllers/'.$_POST["name"]))); 35 | } 36 | function controller_update(){ 37 | $content=$_POST["content"]; 38 | put_content('../application/controllers/'.$_POST["name"], $content); 39 | print json_encode( array('msg'=>'successfully updated')); 40 | } 41 | function get_script_content(){ 42 | 43 | print json_encode( array('content'=>file_get_contents('../static/appScript/'.$_POST["name"]))); 44 | } 45 | function script_update(){ 46 | $content=$_POST["content"]; 47 | put_content('../static/appScript/'.$_POST["name"], $content); 48 | print json_encode( array('msg'=>'successfully updated')); 49 | } 50 | function put_content($path, $content){ 51 | //file_put_contents($path, $content, FILE_APPEND | LOCK_EX); 52 | $file=fopen($path, "w+"); 53 | if($file==false){ 54 | echo "Error in opening $file "; 55 | exit(); 56 | } 57 | fwrite($file, $content); 58 | fclose($file); 59 | } 60 | ?> -------------------------------------------------------------------------------- /tools/partials/controller.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 8 | 9 |
    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 | -------------------------------------------------------------------------------- /tools/partials/model.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 8 | 9 |
    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 | -------------------------------------------------------------------------------- /tools/partials/script_ctrl.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 8 | 9 |
    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 | -------------------------------------------------------------------------------- /tools/partials/view.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
    4 | 8 | 9 |
    10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 | -------------------------------------------------------------------------------- /tools/util.php: -------------------------------------------------------------------------------- 1 | total=$total; 18 | $json->data=$data; 19 | $json->msg=$msg; 20 | $json->success=$isSuccess; 21 | echo json_encode($json); 22 | } 23 | 24 | function responseObj($json) 25 | { 26 | echo json_encode($json); 27 | } 28 | 29 | ?> 30 | -------------------------------------------------------------------------------- /user_guide/cg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg1.png -------------------------------------------------------------------------------- /user_guide/cg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg2.png -------------------------------------------------------------------------------- /user_guide/cg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg3.png -------------------------------------------------------------------------------- /user_guide/cg4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg4.png -------------------------------------------------------------------------------- /user_guide/cg5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg5.png -------------------------------------------------------------------------------- /user_guide/cg6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg6.png -------------------------------------------------------------------------------- /user_guide/cg7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JUkhan/Angularjs-and-codeIgniter/6e825b989e49383c27c04eed40d7e731463ad085/user_guide/cg7.png --------------------------------------------------------------------------------