diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/includes/config.php b/includes/config.php index 74744cc..6cac7d1 100755 --- a/includes/config.php +++ b/includes/config.php @@ -12,8 +12,9 @@ |-------------------------------------------------------------------------- */ define( 'DB_HOST', 'localhost' ); // Set database host -define( 'DB_USER', 'webuser' ); // Set database user -define( 'DB_PASS', 'p1r4sp' ); // Set database password +define( 'DB_USER', 'root' ); // Set database user +define( 'DB_PASS', '' ); // Set database password define( 'DB_NAME', 'inventory' ); // Set database name +define( 'APP_LANG', 'es'); //Set language of app ?> diff --git a/includes/language.php b/includes/language.php new file mode 100644 index 0000000..b86ceaf --- /dev/null +++ b/includes/language.php @@ -0,0 +1,27 @@ +lang_folder = $lang_folder; + $this->lang_content = $lang_content; + + } + + public function set($lang_content) { + $this->lang_content = $lang_content; + } + + public function get($var) { + $lang = $this->load_lang_content(); + echo $lang[$var]; + } + + private function load_lang_content() { + include($this->lang_folder.DIRECTORY_SEPARATOR.$this->lang_content); + return $lang; + } +} +?> \ No newline at end of file diff --git a/includes/load.php b/includes/load.php index beeb7bf..3e8151b 100755 --- a/includes/load.php +++ b/includes/load.php @@ -26,7 +26,9 @@ require_once LIB_PATH_INC.'database.php'; require_once LIB_PATH_INC.'sql.php'; require_once LIB_PATH_INC.'formatcurrency.php'; +require_once LIB_PATH_INC.'language.php'; +$lang = new Language('..'.DS.'language'.DS.APP_LANG); /*--------------------------------------------------------------*/ /* Change format of currency used throughout the system /*--------------------------------------------------------------*/ diff --git a/language/es/common.php b/language/es/common.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/customers.php b/language/es/customers.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/products.php b/language/es/products.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/reports.php b/language/es/reports.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/sales.php b/language/es/sales.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/uploads.php b/language/es/uploads.php new file mode 100644 index 0000000..e69de29 diff --git a/language/es/users.php b/language/es/users.php new file mode 100644 index 0000000..7723d89 --- /dev/null +++ b/language/es/users.php @@ -0,0 +1,88 @@ + 'Añadir nuevo usuario:', + + 'NAME_GROUP_NO_DATABASE' => '¡Lo siento! El nombre del grupo no está en la base de datos!', + 'LEVEL_GROUP_NO_DATABASE' => '¡Lo siento! El nivel del grupo no está en la base de datos!', + 'GROUP_BEEN_CREATE' => '¡El grupo ha sido creado!', + 'GRUP_NO_CREATE' => '¡Lo siento! El grupo no fué creado.', + + 'GROUP_NAME' => 'Nombre del grupo', + 'GROUP_LEVEL' => 'Nivel del grupo', + + 'STATUS_NAME' => 'Estado', + 'STATUS_ACTIVE' => 'Activo', + 'STATUS_DESACTIVE' => 'Inactivo', + + 'UPDATE_NAME' => 'Actualizar', + + // File add_user.php + 'USER_USED' => '¡Lo siento! El usuario ya esta en uso.', + 'ACCOUNT_CREATE' => 'Su cuenta ha sido creada.', + 'ACCOUNT_NO_CREATE' => '¡Lo siento! Su cuenta no ha sido creada.', + + 'ADD_NEW_USER' => 'Añadir usuario.', + 'ACCOUNT_NAME' => 'Nombre', + 'ACCOUNT_USERNAME' => 'Nombre de usuario', + 'ACCOUNT_PASSWORD' => 'Contraseña', + 'ACCOUNT_USERROLE' => 'Rol de usuario', + + // File admin.php + 'ADMIN_TITLE' => 'Administración del sitio', + + 'CUSTOMER_NAME' => 'Clientes', + 'CAT_NAME' => 'Categorías', + 'PRODUCTS_NAME' => 'Productos', + 'SALES_NAME' => 'Ventas', + + 'WELCOME_SUPPORT_ADDITIONAL' => '¡Bienvenido! Para información adicional por favor contacte a soporte técnico.', + + 'HIGHEST_SELLING_PRODUCTS' => 'Productos más vendidos', + 'TOTAL_SOLD' => 'Total vendido (productos)', + 'TOTAL_QUANTY' => 'Total vendido (dinero)', + + 'LATEST_SALES' => 'Ultimas ventas', + 'DATE_NAME' => 'Fecha', + 'TOTAL_SALE' => 'Venta total', + + 'RECENTLY_ADDLE_PRODUCTS' => 'Productos añadidos recientemente.', + + //File auth.php + + 'WELCOME_TO_APP' => 'Bienvenido a Inventory', + 'USERNAME_OR_PASS_INCORRECT' => '¡Lo siento! Usuario o contraseña incorrecta', + + //File change_password.php + 'TITLE_CHANGE_PASS' => 'Cambiar contraseña', + + 'OLD_PASS_NO_MATCH' => 'Contraseña incorrecta', + 'LOGIN_NEW_PASS' => 'Inicia sesión con tu nueva contraseña', + 'FAILED_UPDATE' => '¡Lo siento! La actualización de tus datos ha fallado', + + 'CHANGE_PASS'| => 'Cambiar contraseña', + 'NEW_PASS' => 'Contraseña nueva', + 'OLD_PASS' => 'Contraseña antigüa', + 'CHANGE_NAME' => 'Cambiar', + + //File delete_group.php + 'GROUP_DELETED' => 'El grupo ha sido eliminado', + 'GROUP_NO_DELETED' => 'Error al eliminar el grupo o no existe', + + //File delete_log_by_ip.php + 'LOG_DELETED' => 'Log eliminado', + 'LOG_NO_DELETED' => 'Error al eliminar el Log', + 'LOG_NO_FOUND' => 'No se encontró el log con el identificador establecido' + + /* + * TERMINAR DE TRADUCIR LOS ARCHIVOS FALTANTES Y RESPETAR EL ORDEN QUE LLEVO + * TO COMPLETE OF TRANSLATE MISSING FILES AND RESPECT THE ORDER + */ + + + +); + +?> \ No newline at end of file diff --git a/users/add_group.php b/users/add_group.php index e4ab4dc..eb6ed03 100644 --- a/users/add_group.php +++ b/users/add_group.php @@ -8,8 +8,12 @@ $page_title = 'Add Group'; require_once '../includes/load.php'; + +// Setting language var +$lang->set('users.php'); + // Checkin What level user has permission to view this page -page_require_level(1); +page_require_level(1); ?> query($query)) { //sucess - $session->msg('s', "Group has been creted! "); + $session->msg('s', $lang->get('NAME_GROUP_NO_DATABASE')); redirect('../users/add_group.php', false); } else { //failed - $session->msg('d', ' Sorry failed to create Group!'); + $session->msg('d', $lang->get('LEVEL_GROUP_NO_DATABASE')); redirect('../users/add_group.php', false); } } else { @@ -52,27 +56,27 @@