diff --git a/.gitattributes b/.gitattributes index dfe0770..f2c841e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,34 @@ # Auto detect text files and perform LF normalization * text=auto + +*.zip +### vscode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +.github + +### CodeIgniter ### +*/config/development +*/logs/log-*.php +!*/logs/index.html +*/cache/* +!*/cache/index.html +!*/cache/.htaccess + +user_guide_src/build/* +user_guide_src/cilexer/build/* +user_guide_src/cilexer/dist/* +user_guide_src/cilexer/pycilexer.egg-info/* + +#codeigniter 3 +application/logs/* +!application/logs/index.html +!application/logs/.htaccess +/vendor/ + +### CodeIgniter Patch ### \ No newline at end of file diff --git a/application/config/database.php b/application/config/database.php index 579aa6d..a7ff003 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -1,75 +1,7 @@ db->last_query() and profiling of DB queries. -| When you run a query, with this setting set to TRUE (default), -| CodeIgniter will store the SQL statement for debugging purposes. -| However, this may cause high memory usage, especially if you run -| a lot of SQL queries ... disable this to avoid that problem. -| -| The $active_group variable lets you choose which connection group to -| make active. By default there is only one group (the 'default' group). -| -| The $query_builder variables lets you determine whether or not to load -| the query builder class. -*/ + $active_group = 'default'; $query_builder = TRUE; @@ -78,7 +10,7 @@ 'hostname' => 'localhost', 'username' => 'root', 'password' => '', - 'database' => 'eVoting', + 'database' => 'evoting', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/controllers/Home.php b/application/controllers/Home.php index e804ebc..8fea497 100644 --- a/application/controllers/Home.php +++ b/application/controllers/Home.php @@ -27,7 +27,7 @@ public function __construct() parent::__construct(); $this->load->database(); $this->load->library('ion_auth', 'form_validation', 'session'); - $this->load->helper('url', 'language'); + $this->load->helper('url', 'language', 'my_helper'); $this->load->model('Home_model'); } @@ -39,7 +39,7 @@ public function index() } $data['title'] = 'E-Voting'; - $data['action'] = site_url('user/Userauth/login'); + $data['action'] = site_url('user/userauth/login'); $this->load->view('front/main', $data); } @@ -48,7 +48,7 @@ public function vote() { // Security check if the user is authorize if (!cek_login_bol()) { - redirect('user/Userauth', 'refresh'); + redirect('user/userauth', 'refresh'); } // Get All Kandidat @@ -79,7 +79,7 @@ public function doVote($idkandidat) { // Security check if the user is authorize if (!cek_login_bol()) { - redirect('user/Userauth', 'refresh'); + redirect('user/userauth', 'refresh'); } // menetapkan idpemilih diff --git a/application/controllers/user/userAuth.php b/application/controllers/user/userAuth.php index 5a5f09f..28cbb1d 100644 --- a/application/controllers/user/userAuth.php +++ b/application/controllers/user/userAuth.php @@ -37,7 +37,7 @@ public function index() 'class' => 'form-control', 'placeholder' => 'Password', ]; - $data['action'] = site_url('user/Userauth/login'); + $data['action'] = site_url('user/userauth/login'); $this->load->view('front/login', $data); } } @@ -55,7 +55,7 @@ public function login() 'message', '
' . validation_errors() . '
' ); - redirect('user/Userauth', 'refresh'); + redirect('user/userauth', 'refresh'); } else { // Define var dari login.php @@ -108,7 +108,7 @@ public function login() ); // Directed to login page - redirect('user/Userauth', 'refresh'); + redirect('user/userauth', 'refresh'); } } else { @@ -121,7 +121,7 @@ public function login() ); // Directed to login page - redirect('user/Userauth', 'refresh'); + redirect('user/userauth', 'refresh'); } } } @@ -144,4 +144,4 @@ public function logout() } } -/* End of file Userauth.php */ +/* End of file UserAuth.php */ diff --git a/application/helpers/my_helper.php b/application/helpers/my_helper.php index 69cb8db..cb86370 100644 --- a/application/helpers/my_helper.php +++ b/application/helpers/my_helper.php @@ -170,63 +170,58 @@ function terbilang($nilai) * */ -function convertNumber($number) -{ - list($integer, $fraction) = explode(".", (string) $number); - - $output = ""; - - if ($integer{ - 0} == "-") { - $output = "negative "; - $integer = ltrim($integer, "-"); - } else if ($integer{ - 0} == "+") { - $output = "positive "; - $integer = ltrim($integer, "+"); - } - - if ($integer{ - 0} == "0") { - $output .= "zero"; - } else { - $integer = str_pad($integer, 36, "0", STR_PAD_LEFT); - $group = rtrim(chunk_split($integer, 3, " "), " "); - $groups = explode(" ", $group); - - $groups2 = array(); - foreach ($groups as $g) { - $groups2[] = convertThreeDigit($g{ - 0}, $g{ - 1}, $g{ - 2}); - } - - for ($z = 0; $z < count($groups2); $z++) { - if ($groups2[$z] != "") { - $output .= $groups2[$z] . convertGroup(11 - $z) . ($z < 11 - && !array_search('', array_slice($groups2, $z + 1, -1)) - && $groups2[11] != '' - && $groups[11]{ - 0} == '0' - ? " and " - : ", "); - } - } - - $output = rtrim($output, ", "); - } - - if ($fraction > 0) { - $output .= " point"; - for ($i = 0; $i < strlen($fraction); $i++) { - $output .= " " . convertDigit($fraction{ - $i}); - } - } - - return $output; -} +// DEPECTED IN PHP 7.4 + +// function convertNumber($number) +// { +// list($integer, $fraction) = explode(".", (string) $number); + +// $output = ""; + +// if ($integer{0} == "-") { +// $output = "negative "; +// $integer = ltrim($integer, "-"); +// } else if ($integer{0} == "+") { +// $output = "positive "; +// $integer = ltrim($integer, "+"); +// } + +// if ($integer{ +// 0} == "0") { +// $output .= "zero"; +// } else { +// $integer = str_pad($integer, 36, "0", STR_PAD_LEFT); +// $group = rtrim(chunk_split($integer, 3, " "), " "); +// $groups = explode(" ", $group); + +// $groups2 = array(); +// foreach ($groups as $g) { +// $groups2[] = convertThreeDigit($g{0}, $g{1}, $g{2}); +// } + +// for ($z = 0; $z < count($groups2); $z++) { +// if ($groups2[$z] != "") { +// $output .= $groups2[$z] . convertGroup(11 - $z) . ($z < 11 +// && !array_search('', array_slice($groups2, $z + 1, -1)) +// && $groups2[11] != '' +// && $groups[11]{0} == '0' +// ? " and " +// : ", "); +// } +// } + +// $output = rtrim($output, ", "); +// } + +// if ($fraction > 0) { +// $output .= " point"; +// for ($i = 0; $i < strlen($fraction); $i++) { +// $output .= " " . convertDigit($fraction{$i}); +// } +// } + +// return $output; +// } function convertGroup($index) { diff --git a/application/models/userAuth_model.php b/application/models/userAuth_model.php index 27f1513..b44bc1c 100644 --- a/application/models/userAuth_model.php +++ b/application/models/userAuth_model.php @@ -16,4 +16,4 @@ public function akses($username, $password) } } -/* End of file userAuth_model.php */ +/* End of file Userauth_model.php */ diff --git a/application/views/back/sidebar.php b/application/views/back/sidebar.php index 0e3a98e..42dabf7 100644 --- a/application/views/back/sidebar.php +++ b/application/views/back/sidebar.php @@ -13,6 +13,11 @@