File size: 19,620 Bytes
971eb1e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<?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');
?>