ERP / application /views /v_setting /v_docpattern /docpattern_form.php
cappucaine's picture
Upload 6127 files
971eb1e verified
Raw History Blame Contribute Delete
19.6 kB
<?php
/*
* Author = Dian Hermanto
* Create Date = 2 Februari 2017
* File Name = docpattern_form.php
* Location = -
*/
?>
<?php
$this->load->view('template/head');
$appName = $this->session->userdata('appName');
//$this->load->view('template/topbar');
//$this->load->view('template/sidebar');
// _global function
$this->db->select('Display_Rows,decFormat');
$resGlobal = $this->db->get('tglobalsetting')->result();
foreach($resGlobal as $row) :
$Display_Rows = $row->Display_Rows;
$decFormat = $row->decFormat;
endforeach;
$decFormat = 2;
if($task == 'add')
{
$thisyear = date('Y');
$default['Pattern_YearAktive'] = $thisyear;
$default['useYear'] = 1;
$default['useMonth'] = 1;
$default['useDate'] = 1;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style type="text/css">@import url("<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/css/style.css'; ?>");</style>
<title><?php echo $appName; ?> | Data Tables</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/bootstrap/css/bootstrapa.min.css'; ?>">
<!-- Font Awesome -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/css/font-awesome.min.css'; ?>">
<!-- Ionicons -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/css/ionicons.min.css'; ?>">
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE.min.css'; ?>">
<!-- DataTables -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/datatables/dataTables.bootstrap.css'; ?>">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/dist/css/AdminLTE.minaa.css'; ?>">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/dist/css/skins/_all-skins.min.css'; ?>">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE.css'; ?>">
<!-- daterange picker -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/daterangepicker/daterangepicker.css'; ?>">
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/datepicker/datepicker3.css'; ?>">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/iCheck/all.css'; ?>">
<!-- Bootstrap Color Picker -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/colorpicker/bootstrap-colorpicker.min.css'; ?>">
<!-- Bootstrap time Picker -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/timepicker/bootstrap-timepicker.min.css'; ?>">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/datatables/dataTables.bootstrap.css'; ?>">
<!-- Select2 -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/select2/select2.min.css'; ?>">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/dist/css/AdminLTE.min.css'; ?>">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<?php echo base_url() . 'assets/AdminLTE-2.0.5/dist/css/skins/_all-skins.min.css'; ?>">
<link rel="stylesheet" href="<?php echo base_url() . 'assetscss/AdminLTE.css'; ?>">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<script src="<?php echo base_url('assets/js/jquery-1.10.1.min.js') ?>" type="text/javascript"></script>
<?php
$this->load->view('template/topbar');
$this->load->view('template/sidebar');
$ISREAD = $this->session->userdata['ISREAD'];
$ISCREATE = $this->session->userdata['ISCREATE'];
$ISAPPROVE = $this->session->userdata['ISAPPROVE'];
$ISDWONL = $this->session->userdata['ISDWONL'];$LangID = $this->session->userdata['LangID'];
$sqlTransl = "SELECT MLANG_CODE, MLANG_$LangID AS LangTransl FROM tbl_translate";
$resTransl = $this->db->query($sqlTransl)->result();
foreach($resTransl as $rowTransl) :
$TranslCode = $rowTransl->MLANG_CODE;
$LangTransl = $rowTransl->LangTransl;
if($TranslCode == 'Add')$Add = $LangTransl;
if($TranslCode == 'Edit')$Edit = $LangTransl;
if($TranslCode == 'Save')$Save = $LangTransl;
if($TranslCode == 'Update')$Update = $LangTransl;
if($TranslCode == 'Back')$Back = $LangTransl;
if($TranslCode == 'PatternCode')$PatternCode = $LangTransl;
if($TranslCode == 'PatternPosition')$PatternPosition = $LangTransl;
if($TranslCode == 'PatternforDocument')$PatternforDocument = $LangTransl;
if($TranslCode == 'PatternName')$PatternName = $LangTransl;
if($TranslCode == 'PatternYear')$PatternYear = $LangTransl;
if($TranslCode == 'PatternMonth')$PatternMonth = $LangTransl;
if($TranslCode == 'PatternDate')$PatternDate = $LangTransl;
if($TranslCode == 'PatternDocumentLength')$PatternDocumentLength = $LangTransl;
endforeach;
?>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $h2_title; ?>
<small>setting</small>
</h1>
<?php /*?><ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="#">Tables</a></li>
<li class="active">Data tables</li>
</ol><?php */?>
</section>
<!-- Main content -->
<section class="content">
<div class="box box-primary"><br>
<form name="absen_form" method="post" action="<?php echo $form_action; ?>" onSubmit="validateInVendCat();">
<table width="100%" border="0" style="size:auto" bgcolor="#FFFFFF">
<tr>
<td width="18%" align="left" class="style1"><?php echo $PatternCode ?> </td>
<td width="1%" align="left" class="style1">:</td>
<td align="left" class="style1" style="font-style:italic">
<input type="hidden" name="Pattern_ID" id="Pattern_ID" class="form-control" style="max-width:350px" value="<?php echo set_value('Pattern_ID', isset($default['Pattern_ID']) ? $default['Pattern_ID'] : ''); ?>" />
<input type="text" maxlength="5" name="Pattern_Code" id="Pattern_Code" class="form-control" style="max-width:100px" value="<?php echo set_value('Pattern_Code', isset($default['Pattern_Code']) ? $default['Pattern_Code'] : ''); ?>" placeholder="Max. 5 char" /></td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternPosition ?> </td>
<td align="left" class="style1">:</td>
<td align="left" style="font-style:italic">
<select name="Pattern_Position" id="Pattern_Position" class="form-control" style="max-width:120px">
<?php
$nowPosition = $default['Pattern_Position'];
$Pattern_NameEdited = $default['Pattern_NameEdited'];
?>
<option value="Normal" <?php if($nowPosition == 'Normal') { ?>selected<?php } ?>>Normal</option>
<option value="Especially" <?php if($nowPosition == 'Especially') { ?>selected<?php } ?>>Especially</option>
</select></td>
<tr>
<td align="left" class="style1"><?php echo $PatternforDocument ?> </td>
<td align="left" class="style1">:</td>
<td align="left" style="font-style:italic">
<input type="hidden" name="Pattern_NameEdited" id="Pattern_NameEdited" size="5" value="<?php echo $Pattern_NameEdited; ?>" />
<select name="menu_code" id="menu_code" class="form-control" style="max-width:200px">
<?php
$menu_codex = $default['menu_code'];
$i = 0;
foreach($viewMenuPattern as $row) :
$menu_codeA = $row->menu_code;
$menu_nameA = $row->menu_name_ENG;
?>
<option value="<?php echo $row->menu_code;?>" <?php if($row->menu_code == $menu_codex) { ?>selected<?php } ?>><?php echo "$menu_codeA - $menu_nameA";?></option>
<?php endforeach;?>
</select></td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternName ?> </td>
<td align="left" class="style1">:</td>
<td align="left" class="style1">
<input type="text" name="Pattern_Name" id="Pattern_Name" class="form-control" style="max-width:350px" <?php if($Pattern_NameEdited==1) { ?> disabled <?php } ?> value="<?php echo set_value('Pattern_Name', isset($default['Pattern_Name']) ? $default['Pattern_Name'] : ''); ?>" />
<?php if($Pattern_NameEdited==1) { ?>
<input type="hidden" name="Pattern_Name" id="Pattern_Name" size="30" value="<?php echo set_value('Pattern_Name', isset($default['Pattern_Name']) ? $default['Pattern_Name'] : ''); ?>" />
<?php } ?> </td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternYear ?> </td>
<td align="left" class="style1">:</td>
<td align="left">
<?php
$Pattern_YearAktive = $default['Pattern_YearAktive'];
$useYear = $default['useYear'];
$useMonth = $default['useMonth'];
$useDate = $default['useDate'];
$nowYear = date('Y');
$startYear = $nowYear - 5;
?>
<select name="Pattern_YearAktive" id="Pattern_YearAktive" class="form-control" style="max-width:80px">
<?php
for($idx=$startYear;$idx<=$nowYear;$idx++)
{
?>
<option value="<?php echo $idx; ?>" <?php if($idx == $Pattern_YearAktive) { ?>selected<?php } ?>><?php echo $idx;?></option>
<?php
}
?>
</select>
<input type="checkbox" value="1" name="useYear" id="useYear" onClick="showLengYear();" <?php if($useYear==1){ ?> checked <?php } ?> style="display:none" >
<input type="text" name="Pattern_LengthYear" id="Pattern_LengthYear" class="form-control" style="max-width:80px; display:none" value="<?php echo set_value('Pattern_LengthYear', isset($default['Pattern_LengthYear']) ? $default['Pattern_LengthYear'] : ''); ?>" /> </label></td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternMonth ?> </td>
<td align="left" class="style1">:</td>
<td align="left" nowrap class="style1" style="font-style:italic">
<select name="Pattern_MonthAktive" id="Pattern_MonthAktive" class="form-control" style="max-width:120px">
<?php
$nowMonth = $default['Pattern_MonthAktive'];
if($nowMonth==0) $nowMonth = date('m');
for($idx=1;$idx<=12;$idx++)
{
if($idx == 1) $month = "January";
elseif($idx == 2) $month = "February";
elseif($idx == 3) $month = "March";
elseif($idx == 4) $month = "April";
elseif($idx == 5) $month = "May";
elseif($idx == 6) $month = "June";
elseif($idx == 7) $month = "July";
elseif($idx == 8) $month = "August";
elseif($idx == 9) $month = "September";
elseif($idx == 10) $month = "October";
elseif($idx == 11) $month = "November";
elseif($idx == 12) $month = "Desember";
?>
<option value="<?php echo $idx;?>" <?php if($idx == $nowMonth) { ?>selected<?php } ?>><?php echo $month;?></option>
<?php
}
?>
</select>
<input type="checkbox" value="1" name="useMonth" id="useMonth" <?php if($useMonth==1){ ?> checked <?php } ?> style="display:none">
<input type="text" name="Pattern_LengthMonth" id="Pattern_LengthMonth" size="4" value="<?php echo set_value('Pattern_LengthMonth', isset($default['Pattern_LengthMonth']) ? $default['Pattern_LengthMonth'] : ''); ?>" style="display:none" /></td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternDate ?> </td>
<td align="left" class="style1">:</td>
<td align="left" class="style1">
<select name="Pattern_DateAktive" id="Pattern_DateAktive" class="form-control" style="max-width:80px">
<?php
$nowDate = $default['Pattern_DateAktive'];
if($nowDate==0) $nowDate = date('d');
for($idx=1;$idx<=31;$idx++)
{
?>
<option value="<?php echo $idx;?>" <?php if($idx==$nowDate) { ?>selected<?php } ?>><?php echo $idx;?></option>
<?php
}
?>
</select>
<input type="checkbox" value="1" name="useDate" id="useDate" <?php if($useDate==1){ ?> checked <?php } ?> style="display:none">
<input type="text" name="Pattern_LengthDate" id="Pattern_LengthDate" size="4" value="<?php echo set_value('Pattern_LengthDate', isset($default['Pattern_LengthDate']) ? $default['Pattern_LengthYear'] : ''); ?>" style="display:none" /></td>
</tr>
<tr>
<td align="left" class="style1"><?php echo $PatternDocumentLength ?> </td>
<td align="left" class="style1">:</td>
<td align="left" class="style1">
<input type="text" name="Pattern_Length" id="Pattern_Length" class="form-control" style="max-width:50px" value="<?php echo set_value('Pattern_Length', isset($default['Pattern_Length']) ? $default['Pattern_Length'] : ''); ?>" /> </td>
</tr>
<tr>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1">
<div class="alert alert-info alert-dismissable">
<i class="fa fa-warning"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<b><span style="font-style:italic">Notes : <br>1. If position is Normal, document pattern will use current date. But if the position is Especially, document pattern will use what just you saved. You can not edit the Pattern Name.<br>2. If Pattern Position is Especially, document pattern will use current date.</span> </div>
</td>
</tr>
<tr>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1">
<?php
if($ISCREATE == 1)
{
if($task=='add')
{
?>
<button class="btn btn-primary">
<i class="cus-save-16x16"></i>&nbsp;&nbsp;<?php echo $Save; ?>
</button>&nbsp;
<?php
}
else
{
?>
<button class="btn btn-primary" >
<i class="cus-save1-16x16"></i>&nbsp;&nbsp;<?php echo $Update; ?>
</button>&nbsp;
<?php
}
}
echo anchor("$backURL",'<button class="btn btn-danger" type="button"><i class="cus-back-16x16"></i>&nbsp;&nbsp;'.$Back.'</button>');
?>
</td>
</tr>
<tr>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1">&nbsp;</td>
<td align="left" class="style1"><hr></td>
</tr>
</table>
</form>
</div>
</section>
</body>
</html>
<!-- jQuery 2.2.3 -->
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/jQuery/jquery-2.2.3.min.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/bootstrap/js/bootstrap.min.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/datatables/jquery.dataTables.min.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/datatables/dataTables.bootstrap.min.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/slimScroll/jquery.slimscroll.min.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE-2.0.5/plugins/fastclick/fastclick.js'; ?>"></script>
<script language="javascript" src="<?php echo base_url() . 'assets/AdminLTE/dist/js/demo.js'; ?>"></script>
<script>
$(function ()
{
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
<?php
$this->load->view('template/js_data');
?>
<!--tambahkan custom js disini-->
<?php
$this->load->view('template/foot');
?>