Skip to content

Commit

Permalink
Merge pull request #212 from basoro/mlite
Browse files Browse the repository at this point in the history
Mlite
  • Loading branch information
basoro authored Sep 27, 2024
2 parents 791d55d + b6d9bf7 commit 6658ff0
Show file tree
Hide file tree
Showing 63 changed files with 7,351 additions and 597 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ logs/
config.php
workerman.php
composer.lock
backups
15 changes: 15 additions & 0 deletions assets/css/jquery.keypad.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.keypad button {
margin: 1%;
width: 31%;
height: 23%;
background: #eee;
border: 2px solid black;
border-radius: 10px;
font-size: 3em;
}

.keypad button.delete,
.keypad button.submit {
background: black;
color: white;
}
43 changes: 43 additions & 0 deletions assets/jscripts/jquery.keypad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
;(function($) {
(function(pluginName) {
var defaults = {
inputField: 'input.keypad',
buttonTemplate: '<button></button>',
submitButtonText: 'ok',
deleteButtonText: 'del',
submitButtonClass: 'submit',
deleteButtonClass: 'delete'
};
$.fn[pluginName] = function(options) {
options = $.extend(true, {}, defaults, options);

return this.each(function() {
var elem = this,
$elem = $(elem),
$input = jQuery.type(options.inputField) == 'string' ? $(options.inputField) : options.inputField,
$form = $input.parents('form').length ? $($input.parents('form')[0]) : $elem;

var numbers = Array.apply(null, Array(9)).map(function (_, i) {
return $(options.buttonTemplate).html(i+1).addClass('number');
});
numbers.push($(options.buttonTemplate).html(options.deleteButtonText).addClass(options.deleteButtonClass));
numbers.push($(options.buttonTemplate).html("0").addClass('number'));
numbers.push($(options.buttonTemplate).html(options.submitButtonText).addClass(options.submitButtonClass));
$elem.html(numbers).addClass('keypad');

$elem.find('.number').click(function(e) {
$input.val($input.val() + $(e.target).text());
$input.trigger('change');
});
$elem.find('.' + options.deleteButtonClass).click(function(e) {
$input.val($input.val().slice(0, -1));
$input.trigger('change');
});
$elem.find('.' + options.submitButtonClass).click(function(e) {
$form.submit();
});
});
};
$.fn[pluginName].defaults = defaults;
})('keypad');
})(jQuery);
53 changes: 53 additions & 0 deletions docker/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
if (!version_compare(PHP_VERSION, '7.0.0', '>=')) {
exit("mLITE requires at least <b>PHP 7.0</b>");
}

define('DBHOST', '172.17.0.1');
define('DBPORT', '3308');
define('DBUSER', 'mlite_db');
define('DBPASS', 'mlite_db');
define('DBNAME', 'mlite_db');

// URL Webapps
define('WEBAPPS_URL', $_SERVER['SERVER_ADDR'].'/uploads');
define('WEBAPPS_PATH', BASE_DIR . '/uploads');

// Admin cat name
define('ADMIN', 'admin');

// Multi APP
define('MULTI_APP', false);
define('MULTI_APP_REDIRECT', '');

// Themes path
define('THEMES', BASE_DIR . '/themes');

// Modules path
define('MODULES', BASE_DIR . '/plugins');

// Uploads path
define('UPLOADS', BASE_DIR . '/uploads');

// Lock files
define('FILE_LOCK', false);

// Basic modules
define('BASIC_MODULES', serialize([
9 => 'settings',
0 => 'dashboard',
1 => 'master',
2 => 'pasien',
3 => 'rawat_jalan',
4 => 'kasir_rawat_jalan',
5 => 'kepegawaian',
6 => 'farmasi',
8 => 'users',
7 => 'modules',
10 => 'wagateway'
]));

// Developer mode
define('DEV_MODE', true);

?>
47 changes: 47 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "3"
services:
nginx:
build:
context: .
dockerfile: nginx.Dockerfile
image: nginx:alpine
ports:
- 8085:80
networks:
- internal
volumes:
- .:/var/www/html/
- ./logs/nginx:/var/log/nginx/
depends_on:
- php

php:
image: php:8.1-fpm-alpine
user: root
build:
context: .
dockerfile: php.Dockerfile
networks:
- internal
volumes:
- .:/var/www/html/
depends_on:
- mysql

mysql:
image: mysql:5.7.22
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword123
MYSQL_DATABASE: mlite_db
ports:
- 3308:3306
expose:
- 3308
volumes:
- ./mysql:/var/lib/mysql
- ./db:/docker-entrypoint-initdb.d

networks:
internal:
driver: bridge
6 changes: 6 additions & 0 deletions docker/nginx.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM nginx:alpine

COPY nginx/default.conf /etc/nginx/conf.d

# COPY . /var/www/html

31 changes: 31 additions & 0 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
server {
listen 0.0.0.0:80;

root /var/www/html/mlite;

location / {
index index.php;
if (!-e $request_filename) {
rewrite / /index.php last;
}
}

location ^~ /systems/data/ {
deny all;
return 403;
}

location /admin {
index index.php;
try_files $uri $uri/ /admin/index.php?$args;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}


}
38 changes: 38 additions & 0 deletions docker/php.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM php:8.1-fpm-alpine

RUN apk update
RUN apk upgrade
RUN apk add ca-certificates wget
RUN update-ca-certificates
RUN apk add libpng-dev

RUN apk add --no-cache mysql-client msmtp perl wget procps shadow libzip libpng libjpeg-turbo libwebp freetype icu

RUN apk add --no-cache --virtual build-essentials \
icu-dev icu-libs zlib-dev g++ make automake autoconf libzip-dev \
libpng-dev libwebp-dev libjpeg-turbo-dev freetype-dev && \
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp && \
docker-php-ext-install gd && \
docker-php-ext-install mysqli && \
docker-php-ext-install pdo_mysql && \
docker-php-ext-install intl && \
docker-php-ext-install opcache && \
docker-php-ext-install exif && \
docker-php-ext-install zip && \
apk del build-essentials && rm -rf /usr/src/php*

WORKDIR /var/www/html

RUN wget https://getcomposer.org/composer-stable.phar -O /usr/local/bin/composer && chmod +x /usr/local/bin/composer
RUN php /usr/local/bin/composer create-project basoro/mlite mlite

COPY config.php mlite/config.php

RUN mkdir -p mlite/uploads
RUN mkdir -p mlite/tmp
RUN mkdir -p mlite/admin
RUN mkdir -p mlitr/admin/tmp

RUN chmod -R 777 mlite/uploads
RUN chmod -R 777 mlite/tmp
RUN chmod -R 777 mlite/admin/tmp
13 changes: 12 additions & 1 deletion mlite_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,17 @@ CREATE TABLE `maping_poliklinik_pcare` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;


# Dump of table maping_dokter_pcare
# ------------------------------------------------------------

CREATE TABLE `maping_dokter_pcare` (
`kd_dokter` varchar(20) NOT NULL,
`kd_dokter_pcare` varchar(20) DEFAULT NULL,
`nm_dokter_pcare` varchar(50) DEFAULT NULL,
PRIMARY KEY (`kd_dokter`) USING BTREE,
CONSTRAINT `maping_dokter_pcare_ibfk_1` FOREIGN KEY (`kd_dokter`) REFERENCES `dokter` (`kd_dokter`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;


# Dump of table master_aturan_pakai
# ------------------------------------------------------------
Expand Down Expand Up @@ -2469,7 +2480,7 @@ VALUES
(31,'settings','admin_mode','complex'),
(32,'settings','input_kasir','tidak'),
(33,'settings','editor','wysiwyg'),
(34,'settings','version','4.1.4'),
(34,'settings','version','4.1.5'),
(35,'settings','update_check','0'),
(36,'settings','update_changelog',''),
(37,'settings','update_version','0'),
Expand Down
2 changes: 1 addition & 1 deletion mlite_only.sql
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ INSERT INTO `mlite_settings` (`id`, `module`, `field`, `value`) VALUES
(31, 'settings', 'admin_mode', 'complex'),
(32, 'settings', 'input_kasir', 'tidak'),
(33, 'settings', 'editor', 'wysiwyg'),
(34, 'settings', 'version', '4.1.4'),
(34, 'settings', 'version', '4.1.5'),
(35, 'settings', 'update_check', '0'),
(36, 'settings', 'update_changelog', ''),
(37, 'settings', 'update_version', '0'),
Expand Down
Loading

0 comments on commit 6658ff0

Please sign in to comment.