Commit ae5327c9 authored by hr cloud's avatar hr cloud
Browse files

up tera latihan one

parent 24f1e323
<?php
// ini_set('display_errors', '1');
// ini_set('display_startup_errors', '1');
//
$application['application_id'] = 1;
// do not edit this config
$application['gtfw_base'] = GTFW_BASE_DIR;
$application['docroot'] = GTFW_APP_DIR;
$application['basedir'] = str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']); // with trailling slash
$application['baseaddress'] = "http" . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "s" : "") . "://" . $_SERVER['HTTP_HOST']; // without trailling slash
$application['domain'] = NULL; // name of domain
//============database============================
// connection number 0
$application['db_conn'][0]['db_driv'] = 'pdo';
$application['db_conn'][0]['db_type'] = 'mysqlt';
$application['db_conn'][0]['db_host'] = 'localhost';
$application['db_conn'][0]['db_user'] = 'root';
$application['db_conn'][0]['db_pass'] = 'password';
$application['db_conn'][0]['db_name'] = 'pelatihan_gtfw_session1';
$application['db_conn'][0]['db_result_cache_lifetime'] = '';
$application['db_conn'][0]['db_result_cache_path'] = '';
$application['db_conn'][0]['db_debug_enabled'] = '';
$application['db_conn'][0]['db_port'] = '3306';
/* sample connection number 1
$application['db_conn'][1]['db_driv'] = 'adodb';
$application['db_conn'][1]['db_type'] = 'mysqlt';
$application['db_conn'][1]['db_host'] = 'localhost';
$application['db_conn'][1]['db_user'] = 'user';
$application['db_conn'][1]['db_pass'] = 'pass';
$application['db_conn'][1]['db_name'] = 'databasename';
$application['db_conn'][1]['db_result_cache_lifetime'] = '';
$application['db_conn'][1]['db_result_cache_path'] = '';
$application['db_conn'][1]['db_debug_enabled'] = '';
$application['db_conn'][1]['db_port'] = '3306';
*/
/*
=================================================
sample Connection for Oracle database
=================================================
$application['db_conn'][0]['db_driv'] = 'adodb';
$application['db_conn'][0]['db_type'] = 'oci8';
$application['db_conn'][0]['db_host'] = 'localhost';
$application['db_conn'][0]['db_user'] = 'GTFW';
$application['db_conn'][0]['db_pass'] = 'GTFWENTERPRISE';
$application['db_conn'][0]['db_name'] = 'ORCL';
*/
//============session============================
$application['use_session'] = TRUE;
$application['session_name'] = 'GTFW35SessID';
$application['session_save_path'] = NULL; //TODO: should not be here!!!, and pelase, support NULL value to fallback to PHP INI's session save path
$application['session_expire'] = 30; // in minutes
$application['session_cookie_params']['lifetime'] = 60 * $application['session_expire']; // in seconds
$application['session_cookie_params']['path'] = $application['basedir'];
$application['session_cookie_params']['domain'] = $application['domain'];
$application['session_cookie_params']['secure'] = FALSE; // needs secure connection?
//============default page============================
$application['default_page']['mod'] = 'core.home';
$application['default_page']['sub'] = 'landingPage';
$application['default_page']['act'] = 'view';
$application['default_page']['typ'] = 'html';
//============login page============================
$application['login_page']['mod'] = 'core.login';
$application['login_page']['sub'] = 'login';
$application['login_page']['act'] = 'view';
$application['login_page']['typ'] = 'html';
//============security===========================
$application['enable_security'] = true;
$application['default_user'] = 'nobody';
$application['enable_url_obfuscator'] = FALSE;
$application['url_obfuscator_exception'] = array('soap'); // list of exeption request/response type
$application['url_type'] = 'Long'; // type: Long or Short
$application['login_method'] = 'default';
//============development============================
$application['debug_mode'] = TRUE;
//=========== Single Sign On ========================
$application['system_id'] = 'com.gamatechno.gtfw';
$application['sso_group'] = 'com_gamatechno_academica'; //FIXME: what if this system is associated with more than one sso group
//=========== Single Sign On Server ========================
$application['sso_ldap_connection'] = 3; // connection number available for ldap access, see db_conn above
//============== syslog =============================
$application['syslog_enabled'] = FALSE;
$application['syslog_category'] = array(); // what category permitted to be printed out, array() equals all category
$application['syslog_io_engine'] = 'std'; //tcp, file, std
$application['syslog_log_path'] = '/tmp';
$application['syslog_tcp_host'] = 'localhost';
$application['syslog_tcp_port'] = 9777;
//================ soapgateway ========================
$application['wsdl_use_cache'] = false; // use cached wsdl if available
$application['wsdl_cache_path'] = '/path/to/soap/'; // use cached wsdl if available
$application['wsdl_cache_lifetime'] = 60 * 60 * 24 /* one day! */; // invalidate wsdl cache every x seconds
//================ additional config =====================
$application['company_name'] = "Gamatechno";
$application['application_name'] = "gtEnterprise App Base";
$application['company_address'] = "Jl. Kaliurang Km.5, no.53, Depok, Sleman";
//================Gaji=====================
//================Upload Dir ==============
$application['upload_dir_path'] = "upload_file/";
$application['icon_save_path'] = "files/icons/";
$application['icon_condition_save_path'] = "assets/images/icons/";
$application['employee_save_path'] = "files/employee/";
$application['transfer_save_path'] = "files/transfer/history/";
$application['identity_history_save_path'] = "files/history/identity/";
$application['education_history_save_path'] = "files/history/history/";
$application['medical_history_save_path'] = "files/history/medical/";
$application['transaction_history_save_path'] = "files/history/transaction/";
$application['master_save_path'] = "files/master/";
$application['account_logo_save_path'] = "files/crm/";
$application['contact_logo_save_path'] = "files/crm/contact/";
$application['vendor_save_path'] = "files/purchasing/master/";
$application['company_save_path'] = "files/reference/company/";
$application['fxa_master_save_path'] = "files/fxa/";
$application['ga_master_save_path'] = "files/ga/";
$application['crm_save_path'] = "files/crm/";
$application['icon_path'] = "assets/images/icons/";
$application['family_save_path'] = "files/family/";
$application['cms_save_path'] = "files/cms/";
//================Language=====================
$application['language'] = 'id';
$application['send_email'] = false;
$application['asset_usage_send_email'] = true;
$application['asset_usage_send_notification'] = false;
$application['smtp_host'] = 'mail.domain.com';
$application['smtp_port'] = '25';
$application['smtp_auth'] = true;
$application['smtp_username'] = 'email_tester@domain.com';
$application['smtp_password'] = 'password';
//=================date ref==================
$application['date_time_zone'] = 'Asia/Jakarta'; // see http://php.net/manual/en/timezones.php
date_default_timezone_set($application['date_time_zone']);
$application['autoload_notif'] = false;
?>
/home/base/
\ No newline at end of file
......@@ -12,18 +12,18 @@ MySQL - 5.7.34-0ubuntu0.18.04.1 : Database - pelatihan_gtfw
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`pelatihan_gtfw` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`pelatihan_gtfw_session1` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `pelatihan_gtfw`;
USE `pelatihan_gtfw_session1`;
/*Table structure for table `comp_email_history` */
DROP TABLE IF EXISTS `comp_email_history`;
CREATE TABLE `comp_email_history` (
`emailhis_id` bigint(20) NOT NULL AUTO_INCREMENT,
`emailhis_subject` varchar(255) DEFAULT NULL,
`emailhis_to` text,
`emailhis_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`emailhis_subject` VARCHAR(255) DEFAULT NULL,
`emailhis_to` TEXT,
`emailhis_from` varchar(255) DEFAULT NULL,
`emailhis_body` longtext,
`emailhis_status` tinyint(1) DEFAULT '0',
/*
SQLyog Ultimate v12.4.3 (64 bit)
MySQL - 5.7.34-0ubuntu0.18.04.1 : Database - pelatihan_gtfw_session1
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`pelatihan_gtfw_session1` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `pelatihan_gtfw_session1`;
/* Procedure structure for procedure `sp_update_employee_number` */
/*!50003 DROP PROCEDURE IF EXISTS `sp_update_employee_number` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`dev`@`%` PROCEDURE `sp_update_employee_number`()
BEGIN
DECLARE a,
b INT ;
DECLARE cur CURSOR FOR
SELECT
emp_id
FROM
emp_employee
ORDER BY emp_join_date;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET b = 1 ;
OPEN cur ;
SET b = 0 ;
WHILE
b = 0 DO FETCH cur INTO a ;
UPDATE emp_employee t, (
SELECT
CONCAT(YEAR(e.`emp_join_date`),'.',LPAD(IFNULL(MAX(SUBSTRING_INDEX(e.`emp_number`,'.',-1)),0)+1,5,'0')) AS nomor,
YEAR(e.`emp_join_date`) AS tahun
FROM
emp_employee e
GROUP BY YEAR(e.`emp_join_date`)
) r
SET
t.emp_number = r.nomor
WHERE
YEAR(t.emp_join_date) = r.tahun AND t.emp_id = a;
END WHILE ;
CLOSE cur ;
END */$$
DELIMITER ;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
<?php
/**
* @author GTFW CRUD Generator
*/
class TblBerita extends Database
{
public function __construct($connectionNumber = 0)
{
parent::__construct($connectionNumber);
$this->LoadSql('module/tbl.berita.terupdate/business/mysqlt/tblberita.sql.php');
$this->SetDebugOn();
}
public function countTblBerita($filter)
{
if (is_array($filter))
extract($filter);
$str = '';
if (!empty($title)) {
$str .= " AND LOWER(berita_title) LIKE('%$title%')";
}
$query = $this->mSqlQueries['count_tblberita'];
$query = str_replace('--search--', $str, $query);
$result = $this->Open($query, array());
return $result[0]['total'];
}
public function getTblBerita($filter)
{
if (is_array($filter))
extract($filter);
$str = '';
if (!empty($title)) {
$str .= " AND LOWER(berita_title) LIKE('%$title%')";
}
$limit = '';
if (!empty($display)) {
$limit = "LIMIT $start, $display";
}
$query = $this->mSqlQueries['get_tblberita'];
$query = str_replace('--search--', $str, $query);
$query = str_replace('--limit--', $limit, $query);
$result = $this->Open(stripslashes($query), array());
return $result;
}
public function getDetailTblBerita($id)
{
$result = $this->Open($this->mSqlQueries['get_detail_tblberita'], array($id));
if ($result) {
return $result[0];
}
}
public function insertTblBerita($params)
{
return $this->Execute($this->mSqlQueries['insert_tblberita'], $params);
}
public function updateTblBerita($params)
{
return $this->Execute($this->mSqlQueries['update_tblberita'], $params);
}
public function deleteTblBerita($id)
{
return $this->Execute($this->mSqlQueries['delete_tblberita'], array($id));
}
public function listTblBerita()
{
return $this->Open($this->mSqlQueries['list_tblberita'], array());
}
}
// End of file TblBerita.class.php
\ No newline at end of file
<?php
$sql["count_tblberita"] = "
SELECT
COUNT(berita_id) AS total
FROM tbl_berita
WHERE
1 = 1
--search--
";
$sql["get_tblberita"] = "
SELECT
a.berita_id AS `id`,
a.berita_title AS `title`,
a.berita_snippet AS `snippet`,
a.berita_content AS `content`,
a.insert_timestamp AS `insert_timestamp`,
a.insert_user_id AS `insert_user_id`,
a.update_timestamp AS `update_timestamp`,
a.update_user_id AS `update_user_id`,
IFNULL(CONCAT(b.`user_real_name`,', ',DATE_FORMAT(a.update_timestamp,'%d %b %Y %H:%i')),CONCAT(b.`user_real_name`,', ',DATE_FORMAT(a.insert_timestamp,'%d %b %Y %H:%i'))) AS last_modified
FROM tbl_berita a
LEFT JOIN gtfw_user b ON b.`user_id` = a.`insert_user_id`
WHERE
1 = 1
--search--
--limit--
";
$sql["get_detail_tblberita"] = "
SELECT
a.berita_id AS `id`,
a.berita_title AS `title`,
a.berita_snippet AS `snippet`,
a.berita_content AS `content`,
a.insert_timestamp AS `insert_timestamp`,
a.insert_user_id AS `insert_user_id`,
a.update_timestamp AS `update_timestamp`,
a.update_user_id AS `update_user_id`,
CONCAT(b.`user_real_name`,', ',DATE_FORMAT(a.update_timestamp,'%%d %%b %%Y %%H:%%i')) AS last_update,
CONCAT(b.`user_real_name`,', ',DATE_FORMAT(a.insert_timestamp,'%%d %%b %%Y %%H:%%i')) AS last_insert
FROM tbl_berita a
LEFT JOIN gtfw_user b ON b.`user_id` = a.`insert_user_id`
WHERE berita_id = %d
";
$sql["insert_tblberita"] = "
INSERT INTO tbl_berita
(
berita_title,
berita_snippet,
berita_content,
insert_timestamp,
insert_user_id
) VALUES (
%s,
%s,
%s,
NOW(),
%s
)
";
$sql["update_tblberita"] = "
UPDATE tbl_berita
SET
berita_title = %s,
berita_snippet = %s,
berita_content = %s,
update_timestamp = NOW(),
update_user_id = %s
WHERE berita_id = %d
";
$sql["delete_tblberita"] = "
DELETE FROM tbl_berita
WHERE berita_id = %d
";
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
class DoAddTblBerita extends JsonResponse
{
function ProcessRequest()
{
$proses = GtfwDispt()->load->process('ProcessTblBerita', 'tbl.berita');
$result = $proses->input();
if ($result) {
return array('exec' => 'replaceContentWithUrl("subcontent-element","' . GtfwDispt()->GetUrl('tbl.berita', 'TblBerita', 'view', 'html') . '&display' . '&ascomponent=1")');
} else {
return array('exec' => 'replaceContentWithUrl("subcontent-element","' . GtfwDispt()->GetUrl('tbl.berita', 'addTblBerita', 'view', 'html') . '&ascomponent=1")');
}
}
}
?>
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
class DoDeleteTblBerita extends JsonResponse
{
function ProcessRequest()
{
$proses = GtfwDispt()->load->process('ProcessTblBerita', 'tbl.berita');
$id = $_GET['id']->Integer()->Raw();
$proses->delete($id);
return array('exec' => 'replaceContentWithUrl("subcontent-element","' . GtfwDispt()->GetUrl('tbl.berita', 'TblBerita', 'view', 'html') .'&display' . '&ascomponent=1")');
}
}
?>
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
class DoUpdateTblBerita extends JsonResponse
{
function ProcessRequest()
{
$proses = GtfwDispt()->load->process('ProcessTblBerita', 'tbl.berita');
$id = $_POST['id']->Integer()->Raw();
$result = $proses->input();
if ($result) {
return array('exec' => 'replaceContentWithUrl("subcontent-element","' . GtfwDispt()->GetUrl('tbl.berita', 'TblBerita', 'view', 'html').'&display' . '&ascomponent=1")');
} else {
return array('exec' => 'replaceContentWithUrl("subcontent-element","' . GtfwDispt()->GetUrl('tbl.berita', 'updateTblBerita', 'view', 'html').'&id='. $id . '&ascomponent=1")');
}
}
}
?>
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
class ProcessTblBerita
{
var $Obj;
var $user;
var $cssDone = 'notebox-done';
var $cssFail = 'notebox-warning';
var $cssAlert = 'notebox-alert';
function __construct()
{
$this->ObjTblBerita = GtfwDispt()->load->business('TblBerita');
$this->user = Security::Authentication()->GetCurrentUser()->GetUserId();
}
function input()
{
$post = $_POST->AsArray();
$Val = GtfwDispt()->load->library('Validation');
$Val->set_rules('title', GtfwLangText('title'), 'required');
$Val->set_rules('snippet', GtfwLangText('snippet'), 'required');
$Val->set_rules('content', GtfwLangText('content'), 'required');
$result = $Val->run();
if ($result) {
if (!$post['id']) {
$this->ObjTblBerita->StartTrans();
$params = array(
$post['title'],
$post['snippet'],
$post['content'],
$this->user
);
$result = $result && $this->ObjTblBerita->insertTblBerita($params);
$this->ObjTblBerita->EndTrans($result);
if ($result) {
$msg = GtfwLangText('msg_add_success');
$css = $this->cssDone;
} else {
$msg = GtfwLangText('msg_add_fail');
$css = $this->cssFail;
}
} else {
$this->ObjTblBerita->StartTrans();
$params = array(
$post['title'],
$post['snippet'],
$post['content'],
$this->user,
$post['id']
);
$result = $result && $this->ObjTblBerita->updateTblBerita($params);
$this->ObjTblBerita->EndTrans($result);
if ($result) {
$msg = GtfwLangText('msg_update_success');
$css = $this->cssDone;
} else {
$msg = GtfwLangText('msg_update_fail');
$css = $this->cssFail;
}
}
} else {
$msg = $Val->error_string('', '<br />');
$css = $this->cssFail;
}
if ($result) {
Messenger::Instance()->Send('tbl.berita.terkini', 'TblBerita', 'view', 'html', array(NULL, $msg, $css), Messenger::NextRequest);
//return Dispatcher::Instance()->GetUrl('tbl.berita', 'tblberita', 'view', 'html');
} else {
Messenger::Instance()->Send('tbl.berita.terkini', 'inputTblBerita', 'view', 'html', array($post, $msg, $css), Messenger::NextRequest);
//return Dispatcher::Instance()->GetUrl('tbl.berita', (empty($post['id'])?'add':'update').'TblBerita', 'view', 'html');
}
return $result;
}
function delete($id)
{
$result = $this->ObjTblBerita->deleteTblBerita($id);
if ($result) {
$msg = GtfwLangText('msg_delete_success');
$css = $this->cssDone;
} else {
$msg = GtfwLangText('msg_delete_fail');
$css = $this->cssFail;
}
Messenger::Instance()->Send('tbl.berita.terkini', 'TblBerita', 'view', 'html', array(NULL, $msg, $css), Messenger::NextRequest);
return $result;
}
}
?>
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
GtfwDispt()->load->response('ViewInputTblBerita');
class ViewAddTblBerita extends ViewInputTblBerita
{
}
?>
\ No newline at end of file
<?php
/**
* @author Prima Noor
*/
class ViewDetailTblBerita extends HtmlResponse
{
function TemplateModule()
{
$this->SetTemplateBasedir(Configuration::Instance()->GetValue('application','docroot').'module/'.GtfwDispt()->mModule.'/template');
$this->SetTemplateFile('view_detail_tblberita.html');
}
function ProcessRequest()
{
$ObjTblBerita = GtfwDispt()->load->business('TblBerita', 'tbl.berita');
$id = $_GET['id']->Integer()->Raw();