· 7 years ago · Nov 23, 2018, 07:48 AM
1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MasterControl-ExitProcess.aspx.cs" Inherits="MasterControl_ExitProcess" EnableEventValidation="false" %>
2
3<!doctype html>
4
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6<!-- Meta, title, CSS, favicons, etc. -->
7<meta charset="utf-8">
8<meta http-equiv="X-UA-Compatible" content="IE=edge">
9<meta name="viewport" content="width=device-width, initial-scale=1">
10
11<html runat="server">
12
13<head>
14
15 <title>Master Control - Exit Process</title>
16
17 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/bootstrap.min.css" />
18
19 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/combinedMinifiedCSS.min.css" />
20
21 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/font-awesome.min.css" />
22
23 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/minified/loader-nucleus.min.css" />
24
25 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/jquery-ui.min.css" />
26 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/jquery-ui.structure.min.css" />
27 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/jquery-ui.theme.min.css" />
28 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/sumoselect.min.css" />
29 <!-- BOOTSTRAP DATETIME PICKER -->
30 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/minified/bootstrap-datepicker.min.css" />
31 <!-- END BOOTSTRAP DATETIME PICKER -->
32
33 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/minified/bootstrap-datetimepicker-standalone.min.css" />
34 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/minified/bootstrap-datetimepicker.min.css" rel="stylesheet" />
35 <!--alertify-->
36 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/alertify.min.css" rel="stylesheet" />
37 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/alertify/alertify-main.css" rel="stylesheet" />
38 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/alertify/alertify.bootstrap.min.css" rel="stylesheet" />
39 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/alertify/alertify.core.min.css" rel="stylesheet" />
40 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/alertify/alertify.default.min.css" rel="stylesheet" />
41 <link href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/animate2.min.css" rel="stylesheet" />
42 <!--alertify end-->
43 <%-- <link rel="stylesheet" href="/resources/demos/style.css" />--%>
44 <link rel="stylesheet" href="https://s3-ap-southeast-1.amazonaws.com/cdnilm/css/minified/jquery-ui-1.12.1.min.css" />
45 <style>
46 .modcircle_btn {
47 height: 36px;
48 width: 36px;
49 text-align: center;
50 border-radius: 100%;
51 display: inline-flex;
52 margin: 0 5px;
53 font-size: 20px;
54 cursor: pointer;
55 position: relative;
56 animation: ButtonPopOut .3s forwards cubic-bezier(.55, 0, .1, 1);
57 animation-delay: .3s;
58 transform: scale(0);
59 align-items: center;
60 justify-content: center;
61 border-style: none;
62 top: auto;
63 right: auto;
64 bottom: auto;
65 left: auto;
66 }
67
68 .MC_ExitProcess {
69 padding: 30px 10px;
70 }
71
72 ul.ExitProcess_List {
73 list-style: none;
74 padding: 10px;
75 margin: 0;
76 width: 100%;
77 }
78
79 ul.ExitProcess_List li:hover {
80 background-color: #ecf0f1;
81 }
82
83 ul.ExitProcess_List li a:nth-child(1) {
84 text-decoration: none;
85 display: inline-block;
86 padding: 6px 2px;
87 padding-left: 6px;
88 font-size: 16px;
89 }
90
91
92 ul.ExitProcess_List li a:nth-child(2) {
93 text-decoration: none;
94 display: inline-block;
95 padding: 6px 10px;
96 color: initial;
97 }
98
99 div.ExitProcess_Add {
100 padding: 10px;
101 position: absolute;
102 bottom: 10px;
103 }
104
105 table.PreviewDetails {
106 width: 100%;
107 }
108
109 table.PreviewDetails th {
110 padding: 4px 2px;
111 }
112
113 table.PreviewDetails td {
114 vertical-align: top;
115 padding: 4px 2px;
116 border-bottom: 1px solid #ecf0f1;
117 }
118
119 table.PreviewDetails td > ul {
120 list-style: none;
121 padding: 0;
122 margin: 0;
123 }
124
125 table.PreviewDetails td textarea {
126 width: 100%;
127 max-height: 300px;
128 min-height: 100px;
129 resize: vertical;
130 font-size: 12px;
131 }
132
133 .SetUp_btn_container {
134 position: absolute;
135 left: 0;
136 bottom: 50px;
137 width: 100%;
138 padding: 0 10px;
139 height: 0;
140 }
141
142 .SetUp_panel {
143 display: none;
144 }
145
146 .SetUp_panel.active {
147 display: block;
148 }
149
150 .SetUp_btn_container .Prev_btn {
151 float: left;
152 }
153
154 .SetUp_btn_container .Next_btn {
155 float: right;
156 }
157
158 ul.SetUp_list {
159 list-style: none;
160 padding: 0;
161 margin: 0;
162 text-align: center;
163 }
164
165 ul.SetUp_list li {
166 border: 1px solid #ecf0f1;
167 padding: 5px;
168 margin: 3px 0;
169 }
170
171 ul.SetUp_list li > input[type="text"] {
172 background-color: transparent;
173 border: none;
174 box-shadow: none;
175 text-align: center;
176 }
177
178 ul.SetUp_list li > input[type="text"]:focus {
179 outline: none;
180 background-color: #ecf0f1;
181 }
182
183 .SetUp_tip {
184 text-align: center;
185 display: inline-block;
186 padding: 20px 10px;
187 width: 100%;
188 border: 1px solid #ecf0f1;
189 color: gray;
190 }
191
192 .AcknowledgmentLevel_panel {
193 box-shadow: none;
194 margin-bottom: 25px;
195 /*border-bottom: 1px solid #ecf0f1;*/
196 }
197
198 input[type="text"].inline_input {
199 display: inline;
200 box-shadow: none;
201 width: auto;
202 max-width: 35px;
203 text-align: center;
204 /*text-overflow: ellipsis;*/
205 }
206
207 input[type="text"].LevelName {
208 display: inline;
209 box-shadow: none;
210 width: 195px;
211 text-align: left;
212 }
213
214 input[type="text"].PeriodLen {
215 display: inline;
216 box-shadow: none;
217 width: 90px;
218 text-align: left;
219 }
220
221 input[type="text"].text-center {
222 display: inline;
223 box-shadow: none;
224 width: 70px;
225 text-align: center;
226 }
227
228 #txtPayDeduct {
229 display: inline;
230 box-shadow: none;
231 width: 240px;
232 }
233
234 #txtPayAdd {
235 display: inline;
236 box-shadow: none;
237 width: 240px;
238 }
239
240 #txtNewResign {
241 display: inline;
242 box-shadow: none;
243 width: 240px;
244 }
245
246 textarea.Email_text {
247 resize: vertical;
248 min-height: 250px;
249 max-height: 500px;
250 width: 100%;
251 }
252
253 .hiddencol {
254 display: none;
255 }
256
257 .SumoSelect .select-all {
258 height: 40px;
259 }
260
261 .centerAlign {
262 text-align: center;
263 }
264
265 #ExitProcessData td:first-child,
266 #ExitProcessData th:first-child {
267 display: none;
268 }
269
270 .gray{
271 background-color:gray;
272 }
273 </style>
274
275</head>
276
277<body class="alt-grid">
278 <form runat="server">
279 <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
280
281 <div class="container">
282
283 <div class="col-sm-3">
284 <div class="content_panel FullHeight">
285 <div class="content_title2 MC">
286 <label>Create New Exit Process</label>
287 <asp:Label ID="GlobalID" Visible="false" runat="server" Text="Label"></asp:Label>
288
289 </div>
290
291 <div class="content_body2 no-padding">
292
293 <%--<ul class="ExitProcess_List">
294 <li><a href="#" class="Delete_btn inline_btn"><span class="fa fa-trash"></span></a><a href="#">New Exit Process 1</a></li>
295 </ul>--%>
296 <asp:Label ID="IDGLOBAL" Visible="false" runat="server" ></asp:Label>
297
298
299
300 <div>
301
302
303 <table id="LeavesList" class="content_table">
304 <thead>
305 <HeaderTemplate>
306 <th colspan="3">Process Name</th>
307 </HeaderTemplate>
308 </thead>
309
310 </table>
311
312
313
314
315 <asp:Panel ID="PanelExit" runat="server">
316
317
318 <asp:GridView class="content_table" ID="ExitProcessData" SelectedRowStyle-BackColor="#CECECE" runat="server" DataSourceID="SqlDataExitData" CssClass="content_table" GridLines="None" AutoGenerateColumns="False" DataKeyNames="ProcessID" OnPageIndexChanging="ExitProcessData_PageIndexChanging" OnSelectedIndexChanged="ExitProcessData_SelectedIndexChanged">
319 <Columns>
320 <asp:TemplateField>
321
322 <ItemTemplate>
323
324 <td>
325 <asp:LinkButton ID="lnbtnDelProc" OnClick="lnbtnDelProc_Click" runat="server" CausesValidation="false" CssClass="table_btn Delete">
326 <i class="fa fa-trash"></i>
327 </asp:LinkButton>
328 </td>
329
330
331 <td>
332 <asp:LinkButton runat="server" Text="Select" CommandName="Select" CausesValidation="False" ID="EditProcess_btn" CssClass="table_btn Edit">
333 <i class="fa fa-pencil"></i>
334 </asp:LinkButton>
335 </td>
336
337 <td>
338 <asp:Label ID="lblProcessName" runat="server" Text='<%# Eval("ProcessName")%>'></asp:Label>
339 </td>
340
341
342 </ItemTemplate>
343 </asp:TemplateField>
344 <%--<asp:TemplateField ShowHeader="False">
345 <ItemTemplate>
346 </ItemTemplate>
347 </asp:TemplateField> --%>
348 <%--<asp:BoundField DataField="ProcessName" HeaderText="" SortExpression="ProcessName">
349 <HeaderStyle CssClass="centerAlign"/>
350 <ItemStyle />
351 </asp:BoundField>--%>
352 <asp:BoundField DataField="ProcessID" HeaderText="ProcessID" SortExpression="ProcessID" InsertVisible="False" ReadOnly="True">
353 <HeaderStyle CssClass="NONE"></HeaderStyle>
354 <ItemStyle CssClass="NONE"></ItemStyle>
355 </asp:BoundField>
356 <asp:TemplateField HeaderText="ID" SortExpression="ID">
357 <HeaderStyle CssClass="NONE"></HeaderStyle>
358 <ItemStyle CssClass="NONE"></ItemStyle>
359 <ItemTemplate>
360 <asp:TextBox runat="server" Text='<%# Bind("ProcessID") %>' ID="Label1"></asp:TextBox>
361 </ItemTemplate>
362 </asp:TemplateField>
363 </Columns>
364 </asp:GridView>
365
366 <asp:SqlDataSource runat="server" ID="SqlDataExitData" ConnectionString='<%$ ConnectionStrings:MISConnectionString %>' SelectCommand="SELECT [ProcessID], [ProcessName] FROM [tbl_HRMS_ExitProcess_Master] ORDER BY [ProcessID]"></asp:SqlDataSource>
367
368 </asp:Panel>
369
370 </div>
371
372
373
374
375 <div class="circle_btn_container col-sm-12">
376
377 <div class="col-sm-10">
378 <asp:TextBox ID="txtNewProc" runat="server"></asp:TextBox>
379 </div>
380
381 <%--<asp:LinkButton ID="lnbtnAddProc" runat="server" OnClick="LinkButton1_Click" CssClass="circle_btn Blue_btn"><i class="fa fa-plus"></i></asp:LinkButton>--%>
382 <asp:HyperLink ID="lnbtnAddProc" runat="server" CssClass="circle_btn Blue_btn" ToolTip="Add">
383 <i class="fa fa-plus fa-fw"></i>
384 </asp:HyperLink>
385
386 </div>
387
388 </div>
389
390
391
392
393 </div>
394
395 </div>
396 <div class="col-sm-5">
397 <div class="content_panel FullHeight">
398 <div class="content_title2 MC">
399 <label>Setup Wizard</label>
400 </div>
401
402 <div class="content_body2 MC_ExitProcess">
403
404 <div class="SetUpWizard">
405
406 <!--Step 1 START-->
407 <div class="SetUp_panel active hidden" id="setup">
408 <div class="col-sm-12 no-padding">
409 <div class="col-sm-6">
410 <span>Exit process name</span>
411 </div>
412
413 <div class="col-sm-6">
414 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
415 <ContentTemplate>
416 <asp:TextBox ID="exitnametxt" runat="server"></asp:TextBox>
417 </ContentTemplate>
418 </asp:UpdatePanel>
419
420 </div>
421 </div>
422 <div class="col-sm-12 content_divider" style="height: 20px"></div>
423 <!--divider-->
424 <!--What would be the rendeing period?-->
425 <div class="col-sm-12 no-padding">
426
427
428 <div class="col-sm-6">
429 <span>What would be the rendering period?</span>
430 </div>
431
432 <div class="col-sm-6 no-padding">
433 <div class="col-sm-6">
434 <asp:DropDownList ID="ddlRenderLength" AppendDataBoundItems="true" runat="server">
435 <asp:ListItem Value="0">-</asp:ListItem>
436 <asp:ListItem>15</asp:ListItem>
437 <asp:ListItem>30</asp:ListItem>
438 </asp:DropDownList>
439 </div>
440
441 <div class="col-sm-6">
442 <asp:DropDownList ID="ddlRenderType" AppendDataBoundItems="true" runat="server">
443 <asp:ListItem>-</asp:ListItem>
444 <asp:ListItem>Day(s)</asp:ListItem>
445 <asp:ListItem>Month(s)</asp:ListItem>
446 </asp:DropDownList>
447 </div>
448 </div>
449
450 </div>
451
452 <div class="col-sm-12 content_divider" style="height: 60px"></div>
453 <!--divider-->
454
455 <!--What mesage would you like to send?-->
456 <div class="col-sm-12 form_body_input no-padding">
457 <div class="col-sm-12">
458 <span>What message would you like to send?</span>
459 </div>
460
461 <div class="col-sm-12">
462 <asp:TextBox ID="txtRenderMsg" runat="server" Columns="50" Rows="5" TextMode="MultiLine"></asp:TextBox>
463 </div>
464 </div>
465
466 </div>
467 <!--Step 1 END-->
468
469 <!--Step 2 START-->
470 <div class="SetUp_panel" id ="divtocheck1">
471
472 <label>What are the accepted reasons for resignation?</label>
473
474 <div class="col-sm-12 content_divider" style="height: 30px"></div>
475 <!--divider-->
476
477 <div class="col-sm-12 no-padding">
478 <div class="col-sm-6"><span>Reasons for Resignation</span></div>
479 <div class="row" id="ReasonsDiv">
480
481
482
483 </div>
484 <div class="col-md-12">
485 <a href="#" id="ReasonAdd" onclick="duplicate1()">
486 <i class="fa fa-plus-square-o fa-fw"></i> Add
487 </a>
488
489 </div>
490
491 <asp:UpdatePanel ID="UpdatePanel2" runat="server">
492 <ContentTemplate>
493 <div class="col-sm-12" style="visibility:hidden">
494 <div class="col-sm-6"></div>
495 <div class="col-sm-6">
496 <%--<ul class="SetUp_list" id="ResignReason">
497 <li>Personal Reason</li>
498 <li>Medical Reason</li>
499 <li>Going back to School</li>
500 <li>Going Abroad</li>
501 </ul>--%>
502 <asp:DropDownList ID="lstResignReason" style="visibility:hidden" runat="server">
503 </asp:DropDownList>
504 </div>
505
506 </div>
507 <div class="col-md-12">
508 <div class="col-md-6"></div>
509 <div class="col-md-6" style="visibility:hidden">
510 <asp:TextBox ID="txtNewResign" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
511 <asp:TextBox ID="AllResign" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
512 <asp:TextBox ID="AllTermType" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
513 <asp:TextBox ID="AllTermReason" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
514 <asp:TextBox ID="AllResignID" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
515 <asp:TextBox ID="AllTermTypeID" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
516 <asp:TextBox ID="AllTermReasonID" style="width:100%;visibility:hidden" runat="server"></asp:TextBox>
517 </div>
518 </div>
519 <div class="col-md-12" style="visibility:hidden">
520 <div class="col-md-6"></div>
521 <div class="col-md-6">
522 <asp:LinkButton ID="lnbtnEditReason" OnClick="lnbtnEditReason_Click" style="visibility:hidden" CssClass="circle_btn Yellow_btn" runat="server"><i class="fa fa-pencil"></i></asp:LinkButton>
523 <asp:LinkButton ID="lnbtnAddReason" CssClass="circle_btn Blue_btn" style="visibility:hidden" runat="server" OnClientClick="return false;"><i class="fa fa-plus"></i></asp:LinkButton>
524 <asp:LinkButton ID="lnbtnDelReason" OnClientClick="return false" style="visibility:hidden" CssClass="circle_btn Red_btn" runat="server" ><i class="fa fa-trash"></i></asp:LinkButton>
525 </div>
526 </div>
527
528
529 </ContentTemplate>
530 </asp:UpdatePanel>
531 </div>
532
533
534
535 </div>
536 <!--Step 2 END-->
537
538
539 <!--Step 3 START-->
540 <div class="SetUp_panel">
541
542 <!--Can employee retract submitted resignation?-->
543 <div class="col-sm-12 no-padding">
544 <div class="col-sm-8">
545 <span>Can employee retract submitted resignation?</span>
546 </div>
547
548 <div class="col-sm-4">
549 <label class="switch">
550 <asp:CheckBox ID="chkRetract" runat="server" />
551 <span class="slider round"></span>
552 </label>
553 </div>
554 </div>
555
556
557 <div class="col-sm-12 content_divider" style="height: 30px"></div>
558 <!--divider-->
559 <div class="RetractPanel" style="display: none">
560 <div class="col-sm-12 no-padding">
561
562 <!--Rules for Retraction-->
563 <div class="col-sm-12">
564 <label>Rules for retraction</label>
565 </div>
566 <div id="retractarea">
567 <div class="col-sm-12 no-padding">
568 <div class="col-sm-4"><span>Employee can retract</span></div>
569 <div class="col-sm-2">
570 <asp:TextBox ID="txtRetractLen" MaxLength="3" onkeypress="return isNumber(event)" class="text-center" runat="server"></asp:TextBox>
571 </div>
572 <div class="col-sm-3">
573 <select runat="server" id="ddlRetractType">
574 <option></option>
575 <option>Day(s)</option>
576 <option>Month(s)</option>
577 </select>
578 </div>
579
580 <div class="col-sm-3"><span>before effective date</span></div>
581
582
583 </div>
584 </div>
585 <div class="col-sm-12">
586 </div>
587 <div class="col-sm-12 content_divider" style="height: 30px"></div>
588 <!--divider-->
589
590 <!--Show message ON/OFF-->
591 <div class="col-sm-12 no-padding">
592 <div class="col-sm-9">
593 <span>If employee retracts resignation beyond allowed date show message</span>
594 </div>
595
596 <div class="col-sm-3">
597 <label class="switch">
598 <asp:CheckBox ID="chkShowMsg" runat="server" />
599 <span class="slider round"></span>
600 </label>
601 </div>
602
603 <div class="col-sm-12">
604 <asp:TextBox ID="txtRetractMsg" runat="server" TextMode="MultiLine" CssClass="Email_text"></asp:TextBox>
605 <span style="display: none" class="SetUp_tip">You can only retract resignation within 7 days before effective date</span>
606 </div>
607 </div>
608
609
610 </div>
611
612 </div>
613
614
615 </div>
616 <!--Step 3 END-->
617
618 <!--Step 4 START-->
619 <div class="SetUp_panel">
620
621 <!--Can employee upload resignation letter?-->
622 <div class="col-sm-12 no-padding">
623 <div class="col-sm-8">
624 <span>Can employee upload resignation letter?</span>
625 </div>
626
627 <div class="col-sm-4">
628 <label class="switch">
629 <asp:CheckBox ID="chkUpload" runat="server" />
630 <span class="slider round"></span>
631 </label>
632 </div>
633 </div>
634
635 <!--Can employee create resignation letter?-->
636 <div class="col-sm-12 no-padding">
637 <div class="col-sm-8">
638 <span>Can employee create resignation letter?</span>
639 </div>
640
641 <div class="col-sm-4">
642 <label class="switch">
643 <asp:CheckBox ID="chkCreate" runat="server" />
644 <span class="slider round"></span>
645 </label>
646 </div>
647 </div>
648
649 </div>
650 <!--Step 4 END-->
651
652 <!--Step 5 START-->
653 <div class="SetUp_panel">
654
655 <!--Create level of acknownledgement?-->
656 <div class="col-sm-12 no-padding" style="display: none">
657 <div class="col-sm-8">
658 <span>Create level of acknowledgement?</span>
659 </div>
660
661 <div class="col-sm-4">
662 <label class="switch">
663 <asp:CheckBox ID="chkAcknowledge" runat="server" Checked="true" />
664 <span class="slider round"></span>
665 </label>
666 </div>
667 </div>
668 <div class="AckPanel" style="display: none">
669
670
671
672
673 <!--1st Level of acknowledgement-->
674 <div class="col-sm-12 no-padding AcknowledgmentLevel_panel">
675 Acknowledgement
676 <div id="AddAckBig">
677 <div id="AddAck" class="ackclass">
678 <!--1st Level-->
679 <%--<div class="col-sm-12 no-padding">
680 <div class="col-sm-7">
681 <span>1<sup>st</sup> Level of Acknowledgement</span>
682 </div>
683
684 <div class="col-sm-5">
685 <input type="text" runat="server" id="txtLevelName" class="LevelName" placeholder="Type name here..."/>
686 </div>
687
688 </div>
689
690 <div class="col-sm-12 content_divider"></div> <!--divider-->
691
692 <!--Who will acknowledge-->
693 <div class="col-sm-12 no-padding">
694 <div class="col-sm-7">
695 <span>Who will acknowledge the resignation?</span>
696 </div>
697
698 <div class="col-sm-5">
699 <select runat="server" id="ddlLevel1EmpLvl" class="Level1EmpLvl">
700 <option>Sample 1</option>
701 <option>Sample 2</option>
702 <option>Sample 3</option>
703 </select>
704 </div>
705
706 </div>
707
708 <div class="col-sm-12 content_divider"></div> <!--divider-->
709
710 <!--If exit request-->
711 <div class="col-sm-12 no-padding">
712 <div class="col-sm-12">
713 <span>If exit request is not acknowledged within:</span>
714 </div>
715
716
717 <div class="col-sm-7 no-padding">
718
719 <div class="col-sm-4">
720 <input type="text" runat="server" id="txtPeriodLen" class="PeriodLen">
721 </div>
722
723 <div class="col-sm-4">
724 <select runat="server" id="ddlPeriodType" class="PeriodType">
725 <option>Sample 1</option>
726 <option>Sample 2</option>
727 <option>Sample 3</option>
728 </select>
729 </div>
730
731 <div class="col-sm-4">
732 <span>escalate</span>
733 </div>
734
735 </div>
736
737 <div class="col-sm-5">
738 <select runat="server" id="ddlLevel2EmpLvl" class="Level2EmpLvl">
739 <option>Sample 1</option>
740 <option>Sample 2</option>
741 <option>Sample 3</option>
742 </select>
743 </div>
744
745 <div class="col-sm-12 content_divider"></div> <!--divider-->
746
747
748
749
750 </div>--%>
751 </div>
752 </div>
753 <div class="col-sm-12">
754 <a id="AddAcknowledge" class="circle_btn Blue_btn" onclick="addacknowledge();return false;"><i class="fa fa-plus"></i></a>
755 <a id="DelAcknowledge" class="circle_btn Red_btn hidden" onclick="return false;"><i class="fa fa-trash"></i></a>
756 </div>
757
758 </div>
759 </div>
760 </div>
761 <!--Step 5 END-->
762
763 <!--Step 6 START-->
764 <div class="SetUp_panel" id="divtocheck2">
765
766 <!--Termination Type-->
767 <div class="col-sm-12 no-padding">
768 <div class="col-md-12">
769 <div class="col-sm-6"><span>What are the termination types?</span></div>
770 <div class="row" id="TerminationDiv1">
771
772
773
774 </div>
775 <div class="col-md-12">
776 <a href="#" id="TerminationAdd1" onclick="duplicate2()">
777 <i class="fa fa-plus-square-o fa-fw"></i> Add
778 </a>
779
780 </div>
781 <div class="col-sm-6" hidden style="visibility:hidden">
782 <asp:DropDownList ID="lstTermType" style="visibility:hidden" runat="server"></asp:DropDownList>
783 </div>
784 </div>
785 <div class="col-md-12"></div>
786 <div class="col-md-12" hidden style="visibility:hidden">
787 <div class="col-md-6"></div>
788 <div class="col-md-6">
789 <asp:TextBox ID="txtTermType" style="visibility:hidden" runat="server"></asp:TextBox>
790
791 </div>
792 </div>
793 <%-- <div class="col-md-12"></div>--%>
794 <div class="col-md-12" hidden style="visibility:hidden">
795 <div class="col-md-6"></div>
796 <div class="col-md-6">
797 <asp:LinkButton ID="lnbtnEditType" style="visibility:hidden" OnClick="lnbtnEditType_Click" CssClass="circle_btn Yellow_btn" runat="server"><i class="fa fa-pencil"></i></asp:LinkButton>
798 <asp:LinkButton ID="lnbtnAddType" style="visibility:hidden" CssClass="circle_btn Blue_btn" runat="server" OnClientClick="return false;"><i class="fa fa-plus"></i></asp:LinkButton>
799 <asp:LinkButton ID="lnbtnDelType" style="visibility:hidden" CssClass="circle_btn Red_btn" runat="server" OnClientClick="return false;"><i class="fa fa-trash"></i></asp:LinkButton>
800 </div>
801 </div>
802
803 </div>
804
805
806 <div class="col-sm-12 content_divider" style="height: 30px"></div>
807 <!--divider-->
808 <asp:UpdatePanel ID="uPanel3" runat="server">
809 <ContentTemplate>
810 <!--Reasons for termination-->
811
812 <div class="col-sm-12" >
813 <div class="col-md-6"><span>What are the reasons for termination?</span></div>
814 <div class="row" id="TerminationDiv2">
815
816
817
818 </div>
819 <div class="col-md-12">
820 <a href="#" id="TerminationAdd2" onclick="duplicate3()">
821 <i class="fa fa-plus-square-o fa-fw"></i> Add
822 </a>
823
824 </div>
825 <div class="col-md-6">
826 <asp:DropDownList Width="100%" ID="lstTermReason" style="display:none" runat="server"></asp:DropDownList>
827 </div>
828
829 <div class="col-md-6">
830 <asp:TextBox Width="100%" ID="txtTermReason" style="display:none" runat="server"></asp:TextBox>
831 </div>
832 </div>
833 <%--<div class="col-md-12"></div>--%>
834 <%-- <div class="col-md-12" style="visibility:hidden">--%>
835 <div class="col-md-6"></div>
836 <div class="col-md-6">
837 <asp:LinkButton ID="lnbtnEditTermReason" style="visibility:hidden" OnClick="lnbtnEditTermReason_Click" CssClass="circle_btn Yellow_btn" runat="server"><i class="fa fa-pencil"></i></asp:LinkButton>
838 <asp:LinkButton ID="lnbtnAddTermReason" style="visibility:hidden" CssClass="circle_btn Blue_btn" runat="server" OnClientClick="return false;"><i class="fa fa-plus"></i></asp:LinkButton>
839 <asp:LinkButton ID="lnbtnDelTermReason" style="visibility:hidden" CssClass="circle_btn Red_btn" runat="server" OnClientClick="return false;"><i class="fa fa-trash"></i></asp:LinkButton>
840 </div>
841 <%-- </div>--%>
842
843
844
845 </ContentTemplate>
846 </asp:UpdatePanel>
847
848 </div>
849 <!--Step 6 END-->
850 <!--
851 <!--Step 7 START-->
852 <div class="SetUp_panel">
853
854 <span>Who will determine if employee is eligible for rehire?</span>
855
856 <div class="col-sm-6 no-padding">
857
858 <select runat="server" multiple="true" class="Multiselect" id="ddlTermProc">
859 </select>
860
861 </div>
862
863
864
865 </div>
866 <!--Step 7 END-->
867
868 <!--Step 8 START-->
869 <div class="SetUp_panel">
870
871 <!--Who can initiate exit process?-->
872 <div class="col-sm-12 no-padding">
873 <div class="col-sm-6"><span>Who can initiate exit process?</span></div>
874 <div class="col-sm-6">
875 <asp:DropDownList ID="ddlExitInit" multiple="true" class="test Multiselect" runat="server">
876 </asp:DropDownList>
877 </div>
878 </div>
879
880 </div>
881 <!--Step 8 END-->
882
883
884 <!--Step 9 START-->
885 <div class="SetUp_panel">
886
887 <div class="col-sm-12 no-padding">
888 <div class="col-sm-8">
889 <span>Do you want all leave types that have leave conversion paid on exit?</span>
890 </div>
891
892 <div class="col-sm-4">
893 <label class="switch">
894 <asp:CheckBox ID="chkLeave" runat="server" />
895 <span class="slider round"></span>
896 </label>
897 </div>
898 </div>
899 <div class="col-sm-12 content_divider" style="height: 30px"></div>
900 <!--divider-->
901
902 <div class="LeavePanel" style="display:none">
903 <!--All remaining leaves-->
904 <div class="col-sm-12 no-padding">
905 <div class="col-sm-8">
906 <span>All remaining leaves</span>
907 </div>
908
909 <div class="col-sm-4">
910 <label class="switch">
911 <asp:CheckBox ID="chkLeaveOpt1" runat="server" />
912 <span class="slider round"></span>
913 </label>
914 </div>
915 </div>
916
917 <!--Only the maximum set per leave type-->
918 <div class="col-sm-12 no-padding">
919 <div class="col-sm-8">
920 <span>Only the maximum set per leave type</span>
921 </div>
922
923 <div class="col-sm-4">
924 <label class="switch">
925 <asp:CheckBox ID="chkLeaveOpt2" runat="server" />
926 <span class="slider round"></span>
927 </label>
928 </div>
929 </div>
930</div>
931 <div class="col-sm-12 content_divider" style="height: 30px"></div>
932 <!--divider-->
933
934
935
936 <label class="hidden">What will be the final computation</label>
937
938 <!--Amount of FF-->
939 <div class="col-sm-12 no-padding hidden">
940 <div class="col-sm-6"><span>Add the amount of the following</span></div>
941 <div class="col-sm-6">
942 <asp:ListBox ID="lstPayAdd" runat="server"></asp:ListBox>
943 <asp:TextBox ID="txtPayAdd" runat="server" Class="PayAdd"></asp:TextBox>
944 <asp:LinkButton ID="lnbtnPayAddAdd" CssClass="circle_btn Blue_btn" runat="server" OnClientClick="return false;"><i class="fa fa-plus"></i></asp:LinkButton>
945 <asp:LinkButton ID="lnbtnPayAddDel" CssClass="circle_btn Red_btn" runat="server" OnClientClick="return false;"><i class="fa fa-trash"></i></asp:LinkButton>
946
947
948 </div>
949 </div>
950
951 <div class="col-sm-12 content_divider" style="height: 30px"></div>
952 <!--divider-->
953
954 <!--Deduct amount of FF-->
955 <div class="col-sm-12 no-padding hidden">
956 <div class="col-sm-6"><span>Deduct the amount of the following</span></div>
957 <div class="col-sm-6">
958 <asp:ListBox ID="lstPayDeduct" runat="server"></asp:ListBox>
959 <asp:TextBox ID="txtPayDeduct" runat="server" Class="PadDeduc"></asp:TextBox>
960 <asp:LinkButton ID="lnbtnPayDeductAdd" CssClass="circle_btn Blue_btn" runat="server" OnClientClick="return false;"><i class="fa fa-plus"></i></asp:LinkButton>
961 <asp:LinkButton ID="lnbtnPayDeductDel" CssClass="circle_btn Red_btn" runat="server" OnClientClick="return false;"><i class="fa fa-trash"></i></asp:LinkButton>
962 </div>
963 </div>
964
965 <div class="col-sm-12 content_divider" style="height: 30px"></div>
966 <!--divider-->
967
968 </div>
969 <!--Step 9 END-->
970
971 <!--Step 10 START-->
972 <div class="SetUp_panel">
973
974 <label>How is the final pay paid out?</label>
975
976 <!--Thorugh Bank Account-->
977 <div class="col-sm-12 no-padding">
978 <div class="col-sm-12">
979 <label class="switch">
980 <asp:CheckBox ID="chkBank" runat="server" />
981 <span class="slider round"></span>
982 </label>
983 <span>Through bank account</span>
984 </div>
985
986 <div id="divBank" runat="server">
987 <div class="col-sm-12">
988 <span>Calculate
989 <asp:TextBox ID="txtCalcBank" MaxLength="3" onkeypress="return isNumber(event)" runat="server" class="inline_input"></asp:TextBox>
990 day/s after final acknowledgement</span>
991 </div>
992
993 <div class="col-sm-12">
994 <span>Pay
995 <asp:TextBox ID="txtPayBank" MaxLength="3" onkeypress="return isNumber(event)" runat="server" class="inline_input"></asp:TextBox>
996 day/s after final acknowledgement</span>
997 </div>
998 </div>
999 </div>
1000
1001 <div class="col-sm-12 content_divider" style="height: 30px"></div>
1002 <!--divider-->
1003
1004 <!--By Check or Cash-->
1005 <div class="col-sm-12 no-padding">
1006 <div class="col-sm-12">
1007 <label class="switch">
1008 <asp:CheckBox ID="chkCheck" runat="server" />
1009 <span class="slider round"></span>
1010 </label>
1011 <span>By Check or Cash</span>
1012 </div>
1013
1014 <div id="divCheck" runat="server">
1015 <div class="col-sm-12">
1016 <span>Calculate
1017 <asp:TextBox ID="txtCalcCheck" MaxLength="3" onkeypress="return isNumber(event)" runat="server" class="inline_input"></asp:TextBox>
1018 day/s after final acknowledgement</span>
1019 </div>
1020
1021 <div class="col-sm-12">
1022 <span>Pay
1023 <asp:TextBox ID="txtPayCheck" MaxLength="3" onkeypress="return isNumber(event)" runat="server" class="inline_input"></asp:TextBox>
1024 day/s after final acknowledgement</span>
1025 </div>
1026 </div>
1027 </div>
1028
1029 </div>
1030 <!--Step 10 END-->
1031
1032 <!--Step 11 START-->
1033 <div class="SetUp_panel">
1034
1035 <!--Who can waive the days notice?-->
1036 <div class="col-sm-12 no-padding">
1037 <div class="col-sm-6"><span>Who can waive the days notice?</span></div>
1038 <div class="col-sm-6">
1039 <asp:DropDownList ID="ddlEmpLevel" AppendDataBoundItems="true" multiple="true" class="Multiselect" runat="server">
1040 <asp:ListItem></asp:ListItem>
1041 </asp:DropDownList>
1042
1043
1044
1045 </div>
1046 </div>
1047
1048 <div class="col-sm-12 content_divider" style="height: 30px"></div>
1049 <!--divider-->
1050
1051 <!--Unoworded Days ON/OFF-->
1052 <div class="col-sm-12 no-padding">
1053 <div class="col-sm-9">
1054 <span>Will the unworked days during the rendering period be paid?</span>
1055 </div>
1056
1057 <div class="col-sm-3">
1058 <label class="switch">
1059 <asp:CheckBox ID="chkPaid" runat="server" />
1060 <span class="slider round"></span>
1061 </label>
1062 </div>
1063 </div>
1064
1065
1066
1067 </div>
1068 <!--Step 11 END-->
1069
1070 <!--Step 12 START-->
1071 <div class="SetUp_panel">
1072
1073 <div class="col-sm-12 no-padding">
1074 <div class="col-sm-12">
1075 <span>Send email to employee notification
1076 <asp:TextBox ID="txtDaysNotif" MaxLength="3" onkeypress="return isNumber(event)" runat="server" CssClass="inline_input"></asp:TextBox>
1077 day/s after effective date.</span>
1078 </div>
1079 </div>
1080
1081 <div class="col-sm-12 content_divider" style="height: 30px"></div>
1082 <!--divider-->
1083
1084 <div class="col-sm-12 no-padding">
1085 <div class="col-sm-12"><span>What message would you like to send? (send as email)</span></div>
1086 <div class="col-sm-12">
1087 <asp:TextBox ID="txtEmailNotif" runat="server" CssClass="Email_text" TextMode="MultiLine"></asp:TextBox>
1088
1089 </div>
1090
1091 <div class="col-sm-12 content_divider" style="height: 10px"></div>
1092 <!--divider-->
1093
1094 <div class="col-sm-12">
1095 <span>
1096 <asp:CheckBox ID="chk2316" runat="server" />
1097 Attach 2316</span>
1098 </div>
1099 </div>
1100
1101 <div class="circle_btn_container">
1102
1103 <asp:LinkButton ID="btnSave" ToolTip-asp="Save" OnClick="btnSave_Click" class="circle_btn Blue_btn Save_btn" runat="server"><i class="fa fa-save fa-fw"></i></asp:LinkButton>
1104
1105 </div>
1106
1107 </div>
1108 <!--Step 12 END-->
1109
1110
1111
1112 <div class="SetUp_btn_container">
1113 <a href="#" id="btnPrev" class="circle_btn Blue_btn Prev_btn">
1114 <span class="fa fa-arrow-left"></span>
1115 </a>
1116
1117 <a href="#" runat="server" id="btnNext" class="circle_btn Blue_btn Next_btn">
1118 <span class="fa fa-arrow-right"></span>
1119 </a>
1120 </div>
1121
1122 </div>
1123
1124
1125
1126 </div>
1127 </div>
1128 </div>
1129
1130 <div class="col-sm-4">
1131 <div class="content_panel FullHeight">
1132 <div class="content_title2 MC">
1133 <label>Detail Preview</label>
1134 </div>
1135
1136 <div class="content_body2">
1137
1138 <table class="PreviewDetails">
1139 <tr>
1140 <td>Name</td>
1141 <td>
1142 <asp:Label ID="lblProcName" runat="server" Text=""></asp:Label></td>
1143 </tr>
1144
1145 <tr>
1146 <td>Employee Level</td>
1147 <td>All</td>
1148 </tr>
1149
1150 <tr>
1151 <td>Employee Category</td>
1152 <td>All</td>
1153 </tr>
1154
1155 <tr>
1156 <td>Rendering Period</td>
1157 <td>
1158 <asp:Label ID="lblRenderLength" runat="server"></asp:Label>
1159 <asp:Label ID="lblRenderType" runat="server"></asp:Label>
1160
1161 </td>
1162 </tr>
1163
1164 <tr>
1165 <td>Notification</td>
1166 <td>
1167 <asp:TextBox ID="txtDetailRenderMsg" Enabled="false" TextMode="MultiLine" runat="server"></asp:TextBox></td>
1168 </tr>
1169
1170 <tr>
1171 <td>Reason for resignation</td>
1172 <td>
1173 <ul runat="server" id="ulResign">
1174 <%--<li>Personal Reasons</li>
1175 <li>Medical Reasons</li>
1176 <li>Going back to school</li>
1177 <li>Going Abroad</li>--%>
1178 </ul>
1179 </td>
1180 </tr>
1181
1182 <tr>
1183 <td>Retraction Period</td>
1184 <td>
1185 <asp:Label ID="lblRetractLen" runat="server" Text=""></asp:Label>
1186 <asp:Label ID="lblRetractType" runat="server" Text=""></asp:Label></td>
1187 </tr>
1188
1189 <tr>
1190 <td>Notification</td>
1191 <td>
1192 <asp:TextBox ID="txtDetailRetractMsg" Enabled="false" TextMode="MultiLine" runat="server"></asp:TextBox>
1193
1194 </td>
1195 </tr>
1196
1197 <tr>
1198 <td>Upload Letter</td>
1199 <td>
1200 <asp:Label ID="lblUpload" runat="server" Text=""></asp:Label></td>
1201 </tr>
1202
1203 <tr id="Letter">
1204 <td>Create Letter</td>
1205 <td>
1206 <asp:Label ID="lblCreate" runat="server" Text=""></asp:Label></td>
1207 </tr>
1208
1209
1210 <tr>
1211 <th colspan="2" >Acknowledgement</th>
1212 </tr>
1213
1214 <%--<tr id="detailAck">
1215
1216 </tr>--%>
1217
1218
1219
1220 <tr id="track">
1221 <td>Termination Type</td>
1222 <td>
1223 <ul runat="server" id="ulTermType"></ul>
1224 </td>
1225 </tr>
1226
1227 <tr>
1228 <td>Termination Reasons</td>
1229 <td>
1230 <ul runat="server" id="ulTermReason"></ul>
1231 </td>
1232 </tr>
1233
1234 <tr>
1235 <td>Termination Access</td>
1236 <td>
1237 <ul runat="server" id="ulTermAccess"></ul>
1238 </td>
1239 </tr>
1240
1241 <tr>
1242 <td>Initiation Termination</td>
1243 <td>
1244 <ul runat="server" id="ulTermInit"></ul>
1245 </td>
1246 </tr>
1247
1248 <tr class="hide">
1249 <td>Final Computation</td>
1250 <td></td>
1251 </tr>
1252
1253 <tr class="hidden">
1254 <td>Add</td>
1255 <td>
1256 <ul runat="server" id="ulPayAdd">
1257 </ul>
1258
1259 </td>
1260 </tr>
1261
1262 <tr class="hidden">
1263 <td>Deduct</td>
1264 <td>
1265 <ul runat="server" id="ulPayDeduct">
1266 </ul>
1267
1268 </td>
1269 </tr>
1270
1271 <tr>
1272 <td>Leave Convertion</td>
1273 <td></td>
1274 </tr>
1275
1276 <tr>
1277 <td>All remaining leaves</td>
1278 <td>
1279 <asp:Label ID="lblAllLeave" runat="server" Text=""></asp:Label>
1280 </td>
1281 </tr>
1282
1283 <tr>
1284 <td>Only the maximum set per leave type</td>
1285 <td>
1286 <asp:Label ID="lblMaxLeave" runat="server" Text=""></asp:Label>
1287 </td>
1288 </tr>
1289
1290 <tr>
1291 <td>Final Payout</td>
1292 <td>
1293 <asp:Label runat="server" ID="lblPayoutMethod"></asp:Label></td>
1294 </tr>
1295
1296 <tr>
1297 <td>Calculate</td>
1298 <td>
1299 <asp:Label runat="server" ID="lblDayCalc"></asp:Label>
1300 day/s</td>
1301 </tr>
1302
1303 <tr>
1304 <td>Pay</td>
1305 <td>
1306 <asp:Label runat="server" ID="lblDayPay"></asp:Label>
1307 day/s</td>
1308 </tr>
1309
1310 <tr>
1311 <td>Waived by</td>
1312 <td>
1313 <ul runat="server" id="ulEmpLevel"></ul>
1314 </td>
1315 </tr>
1316
1317 <tr>
1318 <td>Pay Unworked days</td>
1319 <td>
1320 <asp:Label ID="lblDetailUnpaid" runat="server" Text=""></asp:Label>
1321
1322 </td>
1323 </tr>
1324
1325 <tr>
1326 <td>Send Notification</td>
1327 <td>
1328 <asp:TextBox ID="txtDetailEmailMsg" TextMode="MultiLine" Enabled="false" runat="server"></asp:TextBox>
1329
1330 </td>
1331 </tr>
1332
1333 <tr>
1334 <td>Attach 2316</td>
1335 <td>
1336 <asp:Label ID="lbl2316" runat="server"></asp:Label>
1337 </td>
1338 </tr>
1339
1340 </table>
1341
1342 </div>
1343 </div>
1344 </div>
1345
1346 </div>
1347
1348 <asp:HiddenField runat="server" ID="hdnProcID" />
1349 <!--SCRIPTS///////////////////////////////////////////////////////////////////////////////////////////////-->
1350
1351 <script src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/jquery.min.js"></script>
1352 <script src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/jquery-ui.min.js"></script>
1353 <script defer src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/bootstrap.min.js"></script>
1354 <script defer type="text/javascript" src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/minified/bootstrap-datepicker.min.js"></script>
1355 <script defer src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/moment.min.js"></script>
1356 <script defer type="text/javascript" src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/bootstrap-datetimepicker.min.js"></script>
1357 <script defer src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/minified/alertify.min.js"></script>
1358 <script src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/jquery.sumoselect.min.js"></script>
1359 <!--HRMS START-->
1360 <script defer src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/minified/RippleClick.min.js"></script>
1361 <script defer src="https://s3-ap-southeast-1.amazonaws.com/cdnilm/js/HRMS.min.js"></script>
1362 <script defer src="less/font-awesome.less"></script>
1363 <!--HRMS END-->
1364 <script defer type="text/javascript">
1365
1366 //var numAdd = 1;
1367 //var addresignreason = function () {
1368 // if (numAdd >= 10) return;
1369 // var x = $("#txtNewResign").val();
1370 // $('#lstResignReason').append('<option value="'+x+'">' + x + '</option>');
1371
1372 // numAdd++;
1373 //};
1374
1375 $('#ddlRenderLength').change(function () {
1376 $('#lblRenderLength').text($('#ddlRenderLength').val());
1377 });
1378
1379 $('#ddlRenderType').change(function () {
1380 $('#lblRenderType').text($('#ddlRenderType').val());
1381 });
1382
1383 $('#txtRetractLen').keyup(function () {
1384 $('#lblRetractLen').text($('#txtRetractLen').val());
1385 });
1386
1387 $('#ddlRetractType').change(function () {
1388 $('#lblRetractType').text($('#ddlRetractType').val());
1389 });
1390
1391 $('#chkShowMsg').change(function () {
1392 // this will contain a reference to the checkbox
1393 if ($(this).is(':checked')) {
1394 $('#txtRetractMsg').attr('disabled', false);
1395 } else {
1396 $('#txtRetractMsg').attr('disabled', true);
1397 }
1398 });
1399
1400 $('#chk2316').change(function () {
1401 // this will contain a reference to the checkbox
1402 if ($(this).is(':checked')) {
1403 $('#lbl2316').text('Yes');
1404 } else {
1405 $('#lbl2316').text('No');
1406 }
1407 });
1408
1409 $('#chkBank').change(function () {
1410 // this will contain a reference to the checkbox
1411 if ($(this).is(':checked')) {
1412 $('#divBank *').prop('disabled', false);
1413 $('#divCheck *').prop('disabled', true);
1414 $('#txtCalcCheck').val('');
1415 $('#txtPayCheck').val('');
1416 } else {
1417 $('#divBank *').prop('disabled', true);
1418 $('#divCheck *').prop('disabled', true);
1419 $('#txtCalcCheck').val('');
1420 $('#txtPayCheck').val('');
1421 $('#txtCalcBank').val('');
1422 $('#txtPayBank').val('');
1423 }
1424 });
1425
1426 $('#chkCheck').change(function () {
1427 // this will contain a reference to the checkbox
1428 if ($(this).is(':checked')) {
1429 $('#divBank *').prop('disabled', true);
1430 $('#divCheck *').prop('disabled', false);
1431 $('#txtCalcBank').val('');
1432 $('#txtPayBank').val('');
1433 } else {
1434 $('#divBank *').prop('disabled', true);
1435 $('#divCheck *').prop('disabled', true);
1436 $('#txtCalcCheck').val('');
1437 $('#txtPayCheck').val('');
1438 $('#txtCalcBank').val('');
1439 $('#txtPayBank').val('');
1440 }
1441 });
1442
1443
1444 $('#lnbtnAddReason').click(function () {
1445 var cnt = 0;
1446 var x = $("#txtNewResign").val();
1447 var list = $('#lstResignReason');
1448 var lstReasons = [];
1449 list.find('option').each(function
1450 (index, value) {
1451 var i = 0;
1452 lstReasons[i] = $(this).val()
1453 if (lstReasons[i].toLowerCase() == x.toLowerCase()) {
1454 cnt++;
1455 }
1456 i++;
1457 });
1458 if ($("#txtNewResign").val() == "") {
1459 alertify.error("Please input Value");
1460 }
1461 else if (cnt > 0) {
1462 alertify.error("Item already exists");
1463 }
1464 else {
1465 $('.ddclass option').val();
1466 //var ddSize = $('#lstResignReason option').size();
1467 //ddSize = ddSize + 1;
1468 var fdup = $('.0dup1').length + 1;
1469 $('#lstResignReason').append('<option value="' + x + '">' + x + '</option>');
1470 $('#lstResignReason1').append('<tbody><tr><td><input id="lstResignReason1_chkSRow_0" type="checkbox" name="lstResignReason1$ctl02$chkSRow"></td><td align="center" style="border:0" id="' + x + '" " ><input type="text" value="' + x + '">' + '</td><td align="center"><a class="box_btn colorPencil double" href="#")"><i class="fa fa-pencil" title="Edit"></i></a> <a class="box_btn colorPencil double" href="#"><i class="fa fa-eye" title="Click to View"> </i> </a></td>' + '</a></td></tbody>');
1471 $('#ulResign').append('<li class="classReason"><input class="duplab1" ID="dup1label' + fdup + '" />' + x + '</li>')
1472
1473
1474 //$('#lstResignReason').attr("size", ddSize);
1475
1476 $.ajax({
1477 async: false,
1478 type: 'POST',
1479 url: 'MasterControl-ExitProcess.aspx/AddToListBox',
1480 data: "{ 'lstReason': " + JSON.stringify(x) + "}",
1481 processData: false,
1482 contentType: 'application/json',
1483 success: function (result) {
1484 },
1485 failure: function (response) {
1486 console.log(response.d);
1487 },
1488 error: function (response) {
1489 console.log(response.responseText);
1490 }
1491 });
1492 }
1493 $("#txtNewResign").val('');
1494 });
1495
1496 function delReason(a) {
1497 $.ajax({
1498 async: false,
1499 type: 'POST',
1500 url: 'MasterControl-ExitProcess.aspx/DelFromList',
1501 data: "{ 'lstReason': " + JSON.stringify(a) + "}",
1502 processData: false,
1503 contentType: 'application/json',
1504 success: function (result) {
1505 alertify.success('Successfully Deleted');
1506 },
1507 failure: function (response) {
1508 console.log(response.d);
1509 alertify.error(response.d);
1510 },
1511 error: function (response) {
1512 console.log(response.responseText);
1513 }
1514 });
1515 }
1516
1517
1518 $('#lstResignReason').change(function () {
1519 var selectedinx = $('#lstResignReason option:selected').text();
1520 $("#txtNewResign").val(selectedinx);
1521 });
1522
1523
1524 $('#lstTermType').change(function () {
1525 var selectedinx = $('#lstTermType option:selected').text();
1526 $("#txtTermType").val(selectedinx);
1527 });
1528
1529
1530
1531 $('#lstTermReason').change(function () {
1532 var selectedinx = $('#lstTermReason option:selected').text();
1533 $("#txtTermReason").val(selectedinx);
1534 });
1535
1536 //$('#lnbtnEditReason').click(function () {
1537 // var res = $('#lstResignReason option:selected').val();
1538 // var cnt = 0;
1539 // var x = $("#txtNewResign").val();
1540 // console.log(x + " " + res);
1541 // var list = $('#lstResignReason');
1542 // var lstReasons = [];
1543 // list.find('option').each(function
1544 // (index, value) {
1545 // var i = 0;
1546 // lstReasons[i] = $(this).val()
1547 // if (lstReasons[i].toLowerCase() == x.toLowerCase()) {
1548 // cnt++;
1549 // }
1550 // i++;
1551 // });
1552 // if ($("#txtNewResign").val() == "") {
1553 // alertify.error("Please input Value");
1554 // }
1555 // else if (cnt > 0) {
1556 // alertify.error("Item already exists");
1557 // }
1558 // else {
1559 // $('.ddclass option').val();
1560 // //var ddSize = $('#lstResignReason option').size();
1561 // //ddSize = ddSize + 1;
1562
1563
1564 // $('#lstResignReason').empty();
1565
1566 // //$('#lstResignReason').attr("size", ddSize);
1567
1568 // $.ajax({
1569 // async: false,
1570 // type: 'POST',
1571 // url: 'MasterControl-ExitProcess.aspx/UpdateListBox',
1572 // data: "{ 'id': " + JSON.stringify(res) + ", 'lstReason': " + JSON.stringify(x) + "}",
1573 // processData: false,
1574 // contentType: 'application/json',
1575 // success: function (result) {
1576 // },
1577 // failure: function (response) {
1578 // console.log(response.d);
1579 // },
1580 // error: function (response) {
1581 // console.log(response.responseText);
1582 // }
1583 // });
1584 // }
1585 // $("#txtNewResign").val('');
1586 // $('#lstResignReason').append('<option value="' + res + '">' + x + '</option>');
1587 //});
1588
1589 $('#lnbtnDelReason').click(function () {
1590 var res = $('#lstResignReason option:selected').text();
1591 $('.classReason').filter(function () {
1592 return $.text([this]) === res;
1593 }).remove();
1594 $('#lstResignReason option:selected').each(function () {
1595 $(this).remove();
1596 });
1597 $.ajax({
1598 async: false,
1599 type: 'POST',
1600 url: 'MasterControl-ExitProcess.aspx/DelFromList',
1601 data: "{ 'lstReason': " + JSON.stringify(res) + "}",
1602 processData: false,
1603 contentType: 'application/json',
1604 success: function (result) {
1605 $('#txtNewResign').val(" ");
1606 },
1607 failure: function (response) {
1608 console.log(response.d);
1609 alertify.error(response.d);
1610 },
1611 error: function (response) {
1612 console.log(response.responseText);
1613 }
1614 });
1615
1616 });
1617
1618 $('#lnbtnAddRetract').click(function () {
1619 $('#retractarea').append('<div class="col-sm-12 no-padding"><div class="col-sm-4"><span>Employee can retract</span></div><div class="col-sm-2"><input type="text" class="text-center"/></div><div class="col-sm-3"><select></select> </div><div class="col-sm-3"><span>before effective date</span></div></div>')
1620 })
1621
1622
1623 $(document).ready(function () {
1624
1625 var lengthExitInIt = 0;
1626 var GlobalID = '';
1627 if (GlobalID == '') {
1628 $('#btnNext').hide();
1629 }
1630
1631
1632
1633 ///////////////////////////////////////////////////////////////////////////////////
1634 //if ($('#btnNext').is(":visible")==true) {
1635 // $('#setup').removeClass("hidden");
1636 //}
1637
1638 if ($('#chk2316').is(':checked')) {
1639 $('#lbl2316').text('Yes');
1640 }
1641 else {
1642 $('#lbl2316').text('No');
1643 }
1644
1645 if ($('#chkBank').is(':checked')) {
1646 $('#divBank *').prop('disabled', false);
1647 }
1648 else {
1649 $('#divBank *').prop('disabled', true);
1650 }
1651
1652 if ($('#chkCheck').is(':checked')) {
1653 $('#divCheck *').prop('disabled', false);
1654 }
1655 else {
1656 $('#divCheck *').prop('disabled', true);
1657 }
1658
1659 if ($('#chkShowMsg').is(':checked')) {
1660 $('#txtRetractMsg').attr('disabled', false);
1661 }
1662 else {
1663 $('#txtRetractMsg').attr('disabled', true);
1664 }
1665
1666 if ($('#chkRetract').is(':checked')) {
1667 $('.RetractPanel').css({ 'display': 'block' })
1668 }
1669 else {
1670 $('.RetractPanel').css({ 'display': 'none' })
1671 }
1672
1673 if ($('#chkLeave').is(':checked')) {
1674 $('.LeavePanel').css({ 'display': 'block' })
1675 }
1676 else {
1677 $('.LeavePanel').css({ 'display': 'none' })
1678 }
1679
1680 if ($('#chkAcknowledge').is(':checked')) {
1681 $('.AckPanel').css({ 'display': 'block' })
1682 }
1683 else {
1684 $('.AckPanel').css({ 'display': 'none' })
1685 }
1686 $('#txtDetailRenderMsg').text($('#txtRenderMsg').text());
1687 $('#txtDetailRetractMsg').text($('#txtRetractMsg').text());
1688 $('#txtDetailEmailMsg').text($('#txtEmailNotif').text());
1689 //DisplayAcknowledge();
1690 ///////////////////////////////////////////////////////////////////////////////////
1691
1692
1693 rerun();
1694 getLeaveType();
1695
1696 });
1697
1698 function rerun() {
1699
1700 var x = $('#AddAck').children().length;
1701 if (x < 1) {
1702 addacknowledge();
1703 }
1704 $('.Multiselect').SumoSelect({ search: true, selectAll: true, searchText: 'Enter here.' });
1705
1706
1707 var allres = $('#AllResign').val()
1708 var allresID = $('#AllResignID').val()
1709 //alert(allres);
1710 if (allres.length > 0) {
1711
1712 var res11 = (allres).split("|");
1713 var res11ID = (allresID).split("|");
1714 for (i = 1; i < res11.length; i++) {
1715 //alert(res11.length + res11[i])
1716 //var fdup = $('.0dup1').length + 1;
1717
1718 //var i = $('div.divApprover').length + 1;
1719 //alert("1st");
1720 //alert(res11[i])
1721 $("#ReasonsDiv").append("<div id='Dupli1" + i + "' class='col-md-12 0dup1'>"
1722 + "<input ID='Dup1Text" + i + "' onkeyup='SendReason(this.id)' style='width:300px' class='1dup1' />"
1723 //+ "<a class='circle_btn Yellow_btn 2dup1' id='EditMe" + i + "' onclick='ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
1724 + "<a style='color: #e74c3c!important' class='modcircle_btn 3dup1' id='DeleteMe" + i + "' onclick='ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
1725 + "<input ID='Dup1TextID" + i + "' style='width:50px;visibility:hidden;' class='4dup1' />"
1726 + "</div>");
1727 $('#ulResign').append("<li class='classReason' > <input class='duplab1' ID='dup1label" + i + "' /> </li>");
1728 $('#Dup1TextID' + i).val(res11ID[i]);
1729 $('#Dup1Text' + i).val(res11[i]);
1730 $('#dup1label' + i).val(res11[i]);
1731 }
1732 }
1733
1734 var allTerType = $('#AllTermType').val()
1735 var allTerTypeID = $('#AllTermTypeID').val()
1736 if (allTerType.length > 0) {
1737 //alert('counter')
1738 var res11 = (allTerType).split("|");
1739 var res11ID = (allTerTypeID).split("|");
1740 for (i = 1; i < res11.length; i++) {
1741 //alert(res11.length + res11[i])
1742 //var fdup = $('.0dup1').length + 1;
1743
1744 //var i = $('div.divApprover').length + 1;
1745 //alert("1st");
1746 //alert(res11[i])
1747
1748
1749 $("#TerminationDiv1").append("<div id='Term1Dupli1" + i + "' class='col-md-12 0Term1dup1'>"
1750 + "<input ID='Term1Dup1Text" + i + "' onkeyup='Term1SendReason(this.id)' style='width:300px' class='1Term1dup1' />"
1751 //+ "<a class='circle_btn Yellow_btn 2Term1dup1' id='Term1EditMe" + i + "' onclick='Term1ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
1752 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term1dup1' id='Term1DeleteMe" + i + "' onclick='Term1ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
1753 + "<input ID='Term1Dup1TextID" + i + "' style='width:50px;visibility:hidden;' class='4Term1dup1' />"
1754 + "</div>");
1755 $('#ulTermType').append("<li class='classTermType' > <input class='Term1duplab1' ID='Term1dup1label" + i + "' /> </li>");
1756 $('#Term1Dup1TextID' + i).val(res11ID[i]);
1757 $('#Term1Dup1Text' + i).val(res11[i]);
1758 $('#Term1dup1label' + i).val(res11[i]);
1759 }
1760 }
1761
1762 var allTerReason = $('#AllTermReason').val()
1763 var allTerReasonID = $('#AllTermReasonID').val()
1764 if (allTerReason.length > 0) {
1765 //alert('counter')
1766 var res11 = (allTerReason).split("|");
1767 var res11ID = (allTerReasonID).split("|");
1768 for (i = 1; i < res11.length; i++) {
1769 //alert(res11.length + res11[i])
1770 //var fdup = $('.0dup1').length + 1;
1771
1772 //var i = $('div.divApprover').length + 1;
1773 //alert("1st");
1774 //alert(res11[i])
1775
1776
1777 $("#TerminationDiv2").append("<div id='Term2Dupli1" + i + "' class='col-md-12 0Term2dup1'>"
1778 + "<input ID='Term2Dup1Text" + i + "' onkeyup='Term2SendReason(this.id)' style='width:300px' class='1Term2dup1' />"
1779 //+ "<a class='circle_btn Yellow_btn 2Term2dup1' id='Term2EditMe" + i + "' onclick='Term2ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
1780 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term2dup1' id='Term2DeleteMe" + i + "' onclick='Term2ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
1781 + "<input ID='Term2Dup1TextID" + i + "' style='width:50px;visibility:hidden;' class='4Term2dup1' />"
1782 + "</div>");
1783 $('#ulTermReason').append("<li class='classTermReason' > <input class='Term2duplab1' ID='Term2dup1label" + i + "' /> </li>");
1784 $('#Term2Dup1TextID' + i).val(res11ID[i]);
1785 $('#Term2Dup1Text' + i).val(res11[i]);
1786 $('#Term2dup1label' + i).val(res11[i]);
1787 }
1788 }
1789 }
1790
1791
1792
1793
1794
1795
1796
1797
1798 $('.Multiselect').SumoSelect({ search: true, selectAll: true, searchText: 'Enter here.' });
1799
1800 $('#txtRenderMsg').keyup(function () {
1801 $('#txtDetailRenderMsg').val($(this).val());
1802 });
1803 $('#txtRetractMsg').keyup(function () {
1804 $('#txtDetailRetractMsg').val($(this).val());
1805 });
1806 $('#txtEmailNotif').keyup(function () {
1807 $('#txtDetailEmailMsg').val($(this).val());
1808 });
1809
1810 $('#chkRetract').click(function () {
1811 if ($(this).is(':checked')) {
1812 $('.RetractPanel').css({ 'display': 'block' })
1813 }
1814 else {
1815 $('.RetractPanel').css({ 'display': 'none' })
1816 }
1817 });
1818
1819 $('#chkLeave').click(function () {
1820 if ($(this).is(':checked')) {
1821 $('.LeavePanel').css({ 'display': 'block' })
1822 }
1823 else {
1824 $('.LeavePanel').css({ 'display': 'none' })
1825 $('#chkLeaveOpt1').prop('checked', false);
1826 $('#chkLeaveOpt2').prop('checked', false);
1827 $('#lblAllLeave').text('False');
1828 $('#lblMaxLeave').text('False');
1829 }
1830 });
1831
1832 $('#chkLeaveOpt1').click(function () {
1833 if ($(this).is(':checked')) {
1834 $('#lblAllLeave').text('True');
1835 $('#chkLeaveOpt2').prop('checked', false);
1836 }
1837 else {
1838 $('#lblAllLeave').text('False');
1839 }
1840 });
1841
1842 $('#chkLeaveOpt2').click(function () {
1843 if ($(this).is(':checked')) {
1844 $('#lblMaxLeave').text('True');
1845 $('#chkLeaveOpt1').prop('checked', false);
1846 }
1847 else {
1848 $('#lblMaxLeave').text('False');
1849 }
1850 });
1851
1852 $('#chkAcknowledge').click(function () {
1853 if ($(this).is(':checked')) {
1854 $('.AckPanel').css({ 'display': 'block' })
1855 }
1856 else {
1857 $('.AckPanel').css({ 'display': 'none' })
1858 }
1859 });
1860
1861
1862 $('#lnbtnAddType').click(function () {
1863 var cnt = 0;
1864 var x = $("#txtTermType").val();
1865 var list = $('#lstTermType');
1866 var lstTerm = [];
1867 list.find('option').each(function (index, value) {
1868 var i = 0;
1869 lstTerm[i] = $(this).val()
1870 if (lstTerm[i].toLowerCase() == x.toLowerCase()) {
1871 cnt++;
1872 }
1873 i++;
1874 });
1875
1876 if ($("#txtTermType").val() == "") {
1877 alertify.error("Please input Value");
1878 }
1879 else if (cnt > 0) {
1880 alertify.error("Item already exists");
1881 }
1882 else {
1883 $('.ddclass option').val();
1884 var ddSize = $('#lstTermType option').size();
1885 ddSize = ddSize + 1;
1886 $('#lstTermType').append('<option value="' + x + '">' + x + '</option>');
1887 $('#ulTermType').append('<li class="classTermType">' + x + '</li>')
1888
1889 //$('#lstTermType').attr("size", ddSize);
1890
1891 $.ajax({
1892 async: false,
1893 type: 'POST',
1894 url: 'MasterControl-ExitProcess.aspx/AddtoTermType',
1895 data: "{ 'lstReason': " + JSON.stringify(x) + "}",
1896 processData: false,
1897 contentType: 'application/json',
1898 success: function (result) {
1899
1900 },
1901 failure: function (response) {
1902 console.log(response.d);
1903 //alert(response.responseText);
1904 },
1905 error: function (response) {
1906 console.log(response.responseText);
1907 //alert(response.responseText);
1908 }
1909 });
1910 }
1911 $("#txtTermType").val('');
1912 });
1913
1914 $('#lnbtnDelType').click(function () {
1915 var res = $('#lstTermType option:selected').text();
1916 var action = 'delete';
1917 $('#lstTermType option:selected').each(function () {
1918 $(this).remove();
1919 });
1920 $('.classTermType').filter(function () {
1921 return $.text([this]) === res;
1922 }).remove();
1923 $.ajax({
1924 async: false,
1925 type: 'POST',
1926 url: 'MasterControl-ExitProcess.aspx/DelfromTermType',
1927 data: "{ 'lstReason': " + JSON.stringify(res) + "}",
1928 processData: false,
1929 contentType: 'application/json',
1930 success: function (result) {
1931 $('#txtTermType').val(" ");
1932 },
1933 failure: function (response) {
1934 console.log(response.d);
1935 alertify.error(response.d);
1936 },
1937 error: function (response) {
1938 console.log(response.responseText);
1939 }
1940 });
1941 });
1942
1943
1944
1945 $('#lnbtnAddTermReason').click(function () {
1946 var cnt = 0;
1947 var res = $("#txtTermReason").val();
1948 var list = $('#lstTermReason');
1949 var lstTerm = [];
1950 list.find('option').each(function (index, value) {
1951 var i = 0;
1952 lstTerm[i] = $(this).val()
1953 if (lstTerm[i].toLowerCase() == res.toLowerCase()) {
1954 cnt++;
1955 }
1956 i++;
1957 });
1958
1959 if ($("#txtTermReason").val() == "") {
1960 alertify.error("Please input Value");
1961 }
1962 else if (cnt > 0) {
1963 alertify.error("Item already exists");
1964 }
1965 else {
1966 var action = 'add';
1967 $('#lstTermReason').append('<option value="' + res + '">' + res + '</option>');
1968 $('#ulTermReason').append('<li class="classTermReason">' + res + '</li>')
1969 $.ajax({
1970 async: false,
1971 type: 'POST',
1972 url: 'MasterControl-ExitProcess.aspx/UpdateTermReason',
1973 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + "}",
1974 processData: false,
1975 contentType: 'application/json',
1976 success: function (result) {
1977
1978 },
1979 failure: function (response) {
1980 console.log(response.d);
1981 alertify.error(response.d);
1982 },
1983 error: function (response) {
1984 console.log(response.responseText);
1985 }
1986 });
1987 }
1988 $("#txtTermReason").val('');
1989 });
1990
1991 $('#lnbtnDelTermReason').click(function () {
1992 var res = $('#lstTermReason option:selected').text();
1993 var action = 'delete';
1994 $('#lstTermReason option:selected').each(function () {
1995 $(this).remove();
1996 });
1997 $('.classTermReason').filter(function () {
1998 return $.text([this]) === res;
1999 }).remove();
2000 $.ajax({
2001 async: false,
2002 type: 'POST',
2003 url: 'MasterControl-ExitProcess.aspx/UpdateTermReason',
2004 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + "}",
2005 processData: false,
2006 contentType: 'application/json',
2007 success: function (result) {
2008 $('#txtTermReason').val(" " );
2009 },
2010 failure: function (response) {
2011 console.log(response.d);
2012 alertify.error(response.d);
2013 },
2014 error: function (response) {
2015 console.log(response.responseText);
2016 }
2017 });
2018 });
2019
2020 $('#lnbtnPayAddAdd').click(function () {
2021 if ($('#txtPayAdd').val() == "") {
2022 alertify.error("Please input Value");
2023 } else {
2024 var res = $('#txtPayAdd').val();
2025 var action = 'add';
2026 var type = 'add'
2027 $('#ulPayAdd').append('<li class="classPayAdd">' + res + '</li>')
2028 $('#lstPayAdd').append('<option value="' + res + '">' + res + '</option>');
2029 $.ajax({
2030 async: false,
2031 type: 'POST',
2032 url: 'MasterControl-ExitProcess.aspx/UpdateFinalPayItem',
2033 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + ", 'type': " + JSON.stringify(type) + "}",
2034 processData: false,
2035 contentType: 'application/json',
2036 success: function (result) {
2037
2038 },
2039 failure: function (response) {
2040 console.log(response.d);
2041 alertify.error(response.d);
2042 },
2043 error: function (response) {
2044 console.log(response.responseText);
2045 }
2046 });
2047 }
2048
2049 });
2050
2051 $('#lnbtnPayAddDel').click(function () {
2052 var res = $('#lstPayAdd option:selected').val();
2053 var action = 'delete';
2054 var type = 'add';
2055 $('.classPayAdd ').filter(function () {
2056 return $.text([this]) === res;
2057 }).remove();
2058 $('#lstPayAdd option:selected').each(function () {
2059 $(this).remove();
2060 });
2061 $.ajax({
2062 async: false,
2063 type: 'POST',
2064 url: 'MasterControl-ExitProcess.aspx/UpdateFinalPayItem',
2065 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + ", 'type': " + JSON.stringify(type) + "}",
2066 processData: false,
2067 contentType: 'application/json',
2068 success: function (result) {
2069
2070 },
2071 failure: function (response) {
2072 console.log(response.d);
2073 alertify.error(response.d);
2074 },
2075 error: function (response) {
2076 console.log(response.responseText);
2077 }
2078 });
2079 });
2080
2081 $('#lnbtnPayDeductAdd').click(function () {
2082 if ($('#txtPayDeduct').val() == "") {
2083 alertify.error("Please input Value");
2084 } else {
2085 var res = $('#txtPayDeduct').val();
2086 var action = 'add';
2087 var type = 'deduct'
2088 $('#lstPayDeduct').append('<option value="' + res + '">' + res + '</option>');
2089 $('#ulPayDeduct').append('<li class="classPayDeduct">' + res + '</li>')
2090 $.ajax({
2091 async: false,
2092 type: 'POST',
2093 url: 'MasterControl-ExitProcess.aspx/UpdateFinalPayItem',
2094 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + ", 'type': " + JSON.stringify(type) + "}",
2095 processData: false,
2096 contentType: 'application/json',
2097 success: function (result) {
2098
2099 },
2100 failure: function (response) {
2101 console.log(response.d);
2102 alertify.error(response.d);
2103 },
2104 error: function (response) {
2105 console.log(response.responseText);
2106 }
2107 });
2108 }
2109
2110 });
2111
2112 $('#lnbtnPayDeductDel').click(function () {
2113 var res = $('#lstPayDeduct option:selected').val();
2114 var action = 'delete';
2115 var type = 'deduct';
2116 $('#lstPayDeduct option:selected').each(function () {
2117 $(this).remove();
2118 });
2119 $('.classPayDeduct').filter(function () {
2120 return $.text([this]) === res;
2121 }).remove();
2122 $.ajax({
2123 async: false,
2124 type: 'POST',
2125 url: 'MasterControl-ExitProcess.aspx/UpdateFinalPayItem',
2126 data: "{ 'lstReason': " + JSON.stringify(res) + ", 'act': " + JSON.stringify(action) + ", 'type': " + JSON.stringify(type) + "}",
2127 processData: false,
2128 contentType: 'application/json',
2129 success: function (result) {
2130
2131 },
2132 failure: function (response) {
2133 console.log(response.d);
2134 alertify.error(response.d);
2135 },
2136 error: function (response) {
2137 console.log(response.responseText);
2138 }
2139 });
2140 });
2141
2142 $('#chkBank').click(function () {
2143 if ($(this).is(':checked')) {
2144 $('#chkCheck').removeAttr('checked')
2145 }
2146 $('#lblPayoutMethod').text('Through Bank');
2147 });
2148 $('#chkCheck').click(function () {
2149 if ($(this).is(':checked')) {
2150 $('#chkBank').removeAttr('checked')
2151 }
2152 $('#lblPayoutMethod').text('By Check or Cash');
2153
2154 });
2155
2156 $('#AddAcknowledge').click(function () {
2157
2158 });
2159
2160
2161
2162 function addacknowledge() {
2163 $('#DelAcknowledge').removeClass('hidden');
2164 var xt = GetEmpLevel();
2165 var d = $('div.ackclass').length;
2166 var result;
2167 var s = ["th", "st", "nd", "rd"],
2168 v = d % 100;
2169 var result = (s[(v - 20) % 10] || s[v] || s[0]);
2170 $('#AddAck').append('<div class="ackclass2" id="ackack' + d + '"><div class="col-sm-12 no-padding ackclass" >' +
2171 '<br /><br /><div class="col-sm-7">' +
2172 ' <span>' + d + '<sup>' + result + '</sup> Level of Acknowledgement</span>' +
2173 '</div>' +
2174
2175 '<div class="col-sm-5">' +
2176 '<input type="text" id="txtLevelName" value="" class="LevelName" placeholder="Type name here..."/>' +
2177 '</div>' +
2178
2179 '</div>' +
2180
2181 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2182
2183 '<!--Who will acknowledge-->' +
2184 '<div class="col-sm-12 no-padding">' +
2185 '<div class="col-sm-7">' +
2186 '<span>Who will acknowledge the resignation?</span>' +
2187 '</div>' +
2188
2189 '<div class="col-sm-5">' +
2190 '<select class="Level1EmpLvl" id="ddlLevel1Emp">' +
2191 '<option></option>' +
2192 '<option>Immediate Supervisor</option>' +
2193 '<option>Manager 1</option>' +
2194 '<option>Manager 2</option>' +
2195 xt +
2196 '</select>' +
2197 '</div>' +
2198
2199 '</div>' +
2200
2201 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2202
2203 '<!--If exit request-->' +
2204 '<div class="col-sm-12 no-padding">' +
2205 '<div class="col-sm-12">' +
2206 '<span>If exit request is not acknowledged within:</span>' +
2207 '</div>' +
2208
2209
2210 '<div class="col-sm-7 no-padding">' +
2211
2212 '<div class="col-sm-4">' +
2213 '<input type="text" id="txtPeriodLen" MaxLength="3" onkeypress="return isNumber(event)" class="PeriodLen">' +
2214 '</div>' +
2215
2216 '<div class="col-sm-4">' +
2217 '<select id="ddlPeriodType" class="PeriodType">' +
2218 '<option>Day(s)</option>' +
2219 '<option>Month(s)</option>' +
2220 '</select>' +
2221 '</div>' +
2222
2223 '<div class="col-sm-4">' +
2224 '<span>escalate</span>' +
2225 '</div>' +
2226
2227 '</div>' +
2228
2229 '<div class="col-sm-5">' +
2230 '<select id="ddlLevel2EmpLvl" class="Level2EmpLvl">' +
2231 '<option>Immediate Supervisor</option>' +
2232 '<option>Manager 1</option>' +
2233 '<option>Manager 2</option>' +
2234 xt +
2235 '</select>' +
2236 '</div>' +
2237
2238 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2239 '</div></div>');
2240
2241 popdrop();
2242 }
2243
2244 function isNumber(evt) {
2245 evt = (evt) ? evt : window.event;
2246 var charCode = (evt.which) ? evt.which : evt.keyCode;
2247 if (charCode > 31 && (charCode < 48 || charCode > 57)) {
2248 return false;
2249 }
2250 return true;
2251 }
2252
2253 $('#btnSave').click(function () {
2254 var div1 = $('#AddAckBig');
2255 var action = "hello";
2256 var type = "World";
2257 var LevelName = new Array();
2258 $('.LevelName').each(function (i) {
2259 var x = $(this).val();
2260 LevelName.push(x);
2261 });
2262 var Level1EmpLvl = new Array();
2263 $('.Level1EmpLvl').each(function (i) {
2264 var x = $(this).val();
2265 Level1EmpLvl.push(x);
2266 });
2267 var PeriodLength = new Array();
2268 $('.PeriodLen').each(function (i) {
2269 var x = $(this).val();
2270 PeriodLength.push(x);
2271 });
2272 var PeriodType = new Array();
2273 $('.PeriodType').each(function (i) {
2274 var x = $(this).val();
2275 PeriodType.push(x);
2276 });
2277 var Level2EmpLvl = new Array();
2278 $('.Level2EmpLvl').each(function (i) {
2279 var x = $(this).val();
2280 Level2EmpLvl.push(x);
2281 });
2282 passdata = JSON.stringify({
2283 'lstLevelName': LevelName,
2284 'lstLevel1': Level1EmpLvl,
2285 'lstPeriodLen': PeriodLength,
2286 'lstPeriodType': PeriodType,
2287 'lstLevel2': Level2EmpLvl
2288
2289 });
2290
2291
2292 $.ajax({
2293 async: false,
2294 type: 'POST',
2295 url: 'MasterControl-ExitProcess.aspx/InsertUpdateAcknowledgement',
2296 data: passdata,
2297 processData: false,
2298 contentType: 'application/json',
2299 success: function (result) {
2300
2301 },
2302 failure: function (response) {
2303 console.log(response.d);
2304 //alert(response.d);
2305 },
2306 error: function (response) {
2307 console.log(response.responseText);
2308 //alert(response.responseText);
2309 }
2310 });
2311 var termproclst = new Array();
2312 $('#ddlTermProc option:selected').each(function (i) {
2313 var x = $(this).val();
2314 termproclst.push(x);
2315 });
2316 $.ajax({
2317 async: false,
2318 type: 'POST',
2319 url: 'MasterControl-ExitProcess.aspx/UpdateTermProc',
2320 data: '{ TermProcLst:' + JSON.stringify(termproclst) + ', target: "TermProc"}',
2321 processData: false,
2322 contentType: 'application/json',
2323 success: function (result) {
2324
2325 },
2326 failure: function (response) {
2327 console.log(response.d);
2328 //alert(response.d);
2329 },
2330 error: function (response) {
2331 console.log(response.responseText);
2332 //alert(response.responseText);
2333 }
2334 });
2335 //
2336
2337 var exitinitlst = new Array();
2338 $('#ddlExitInit option:selected').each(function (i) {
2339 var x = $(this).val();
2340 exitinitlst.push(x);
2341 });
2342 $.ajax({
2343 async: false,
2344 type: 'POST',
2345 url: 'MasterControl-ExitProcess.aspx/UpdateTermProc',
2346 data: '{ TermProcLst:' + JSON.stringify(exitinitlst) + ', target: "ExitInit"}',
2347 processData: false,
2348 contentType: 'application/json',
2349 success: function (result) {
2350
2351 },
2352 failure: function (response) {
2353 console.log(response.d);
2354 //alert(response.d);
2355 },
2356 error: function (response) {
2357 console.log(response.responseText);
2358 //alert(response.responseText);
2359 }
2360 });
2361 //
2362
2363 var emplevel = new Array();
2364 $('#ddlEmpLevel option:selected').each(function (i) {
2365 var x = $(this).val();
2366 emplevel.push(x);
2367 });
2368 $.ajax({
2369 async: false,
2370 type: 'POST',
2371 url: 'MasterControl-ExitProcess.aspx/UpdateTermProc',
2372 data: '{ TermProcLst:' + JSON.stringify(emplevel) + ', target: "ExitWaive"}',
2373 processData: false,
2374 contentType: 'application/json',
2375 success: function (result) {
2376
2377 },
2378 failure: function (response) {
2379 console.log(response.d);
2380 //alert(response.d);
2381 },
2382 error: function (response) {
2383 console.log(response.responseText);
2384 //alert(response.responseText);
2385 }
2386 });
2387 });
2388
2389 function GetEmpLevel() {
2390 var g = '';
2391 $.ajax({
2392 async: false,
2393 type: 'POST',
2394 url: 'MasterControl-ExitProcess.aspx/GetEmpLevel',
2395 processData: false,
2396 contentType: 'application/json',
2397 success: function (result) {
2398
2399 InsertLevel(result.d);
2400 },
2401 failure: function (response) {
2402 console.log(response.d);
2403 },
2404 error: function (response) {
2405 console.log(response.responseText);
2406 }
2407 });
2408
2409 function InsertLevel(aData) {
2410 $.each(aData, function (record, recordnumber) {
2411 g = g + '<option>' + recordnumber.ProcID + '</option>';
2412 });
2413 }
2414 return g;
2415 }
2416
2417 function DisplayAcknowledge() {
2418 $.ajax({
2419 async: false,
2420 type: 'POST',
2421 url: 'MasterControl-ExitProcess.aspx/GetAcknowledgeData',
2422 processData: false,
2423 contentType: 'application/json',
2424 success: function (result) {
2425 GetAcknowledge(result.d);
2426
2427 },
2428 failure: function (response) {
2429 console.log(response.d);
2430 },
2431 error: function (response) {
2432 console.log(response.responseText);
2433 }
2434 });
2435
2436 $("#DelAcknowledge").click(function () {
2437 var count = $('div.ackclass2').length;
2438 //alert(count);
2439 if (count > 1) {
2440 $('#ackack' + count).remove();
2441
2442 }
2443 if (count == 2) {
2444 $('#DelAcknowledge').addClass('hidden');
2445 }
2446
2447 //alert($('#ackack3').length);
2448 });
2449
2450 function GetAcknowledge(aData) {
2451 var xt = GetEmpLevel();
2452 var y = 1;
2453 $('#AddAck').empty();
2454 $.each(aData, function (record, recordnumber) {
2455 var d = $('div.ackclass').length;
2456 var result;
2457 var s = ["th", "st", "nd", "rd"],
2458 v = d % 100;
2459 var result = (s[(v - 20) % 10] || s[v] || s[0]);
2460
2461
2462 $('#AddAck').append('<div class="ackclass2" id="ackack' + y + '"><div class="col-sm-12 no-padding ackclass" >' +
2463 '<br /><br /><div class="col-sm-7">' +
2464 ' <span>' + d + '<sup>' + result + '</sup> Level of Acknowledgement</span>' +
2465 '</div>' +
2466
2467 '<div class="col-sm-5">' +
2468 '<input type="text" id="txtLevelName' + y + '" value="' + recordnumber.LevelName + '" class="LevelName" placeholder="Type name here..."/>' +
2469 '</div>' +
2470
2471 '</div>' +
2472
2473 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2474
2475 '<!--Who will acknowledge-->' +
2476 '<div class="col-sm-12 no-padding">' +
2477 '<div class="col-sm-7">' +
2478 '<span>Who will acknowledge the resignation?</span>' +
2479 '</div>' +
2480
2481 '<div class="col-sm-5">' +
2482 '<select class="Level1EmpLvl" id="ddlLevel1Emp' + y + '" >' +
2483 '<option>Immediate Supervisor</option>' +
2484 '<option>Manager 1</option>' +
2485 '<option>Manager 2</option>' +
2486 xt +
2487 '</select>' +
2488 '</div>' +
2489
2490 '</div>' +
2491
2492 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2493
2494 '<!--If exit request-->' +
2495 '<div class="col-sm-12 no-padding">' +
2496 '<div class="col-sm-12">' +
2497 '<span>If exit request is not acknowledged within:</span>' +
2498 '</div>' +
2499
2500
2501 '<div class="col-sm-7 no-padding">' +
2502
2503 '<div class="col-sm-4">' +
2504 '<input type="text" MaxLength="3" id="txtPeriodLen' + y + '" value=' + recordnumber.PeriodLength + ' onkeypress="return isNumber(event)" class="PeriodLen">' +
2505 '</div>' +
2506
2507 '<div class="col-sm-4">' +
2508 '<select id="ddlPeriodType' + y + '" class="PeriodType">' +
2509 '<option>Day(s)</option>' +
2510 '<option>Month(s)</option>' +
2511 '</select>' +
2512 '</div>' +
2513
2514 '<div class="col-sm-4">' +
2515 '<span>escalate</span>' +
2516 '</div>' +
2517
2518 '</div>' +
2519
2520 '<div class="col-sm-5">' +
2521 '<select id="ddlLevel2EmpLvl' + y + '" class="Level2EmpLvl">' +
2522 '<option>Immediate Supervisor</option>' +
2523 '<option>Manager 1</option>' +
2524 '<option>Manager 2</option>' +
2525 xt +
2526 '</select>' +
2527 '</div>' +
2528 '<div class="col-sm-12 content_divider"></div> <!--divider-->' +
2529
2530
2531 '</div></div>');
2532
2533 $('#cleanser').remove();
2534 var prev = '<tr id="cleanser">' +
2535 '<td>' + recordnumber.LevelName + '</td>' +
2536 '<td><ul>' +
2537 '<li>' + recordnumber.EmpLevel1 + '</li>' +
2538 '<li>' + recordnumber.EmpLevel2 + '</li>' +
2539 '</ul></td></tr>';
2540 $('#track').before(prev);
2541
2542
2543
2544 $('#ddlLevel1Emp' + y + '').val(recordnumber.EmpLevel1);
2545 $('#ddlPeriodType' + y + '').val(recordnumber.PeriodType);
2546 $('#ddlLevel2EmpLvl' + y + '').val(recordnumber.EmpLevel2);
2547 y++;
2548 });
2549 }
2550 popdrop();
2551 }
2552
2553
2554
2555 $('#chkUpload').change(function () {
2556 if ($(this).is(':checked')) {
2557 $('#lblUpload').text("Yes");
2558 }
2559 else {
2560 $('#lblUpload').text("No");
2561 }
2562 });
2563 $('#chkCreate').change(function () {
2564 if ($(this).is(':checked')) {
2565 $('#lblCreate').text("Yes");
2566 }
2567 else {
2568 $('#lblCreate').text("No");
2569 }
2570 });
2571
2572 $('#btnNext').click(function (event) {
2573
2574
2575
2576
2577 if (document.getElementById('divtocheck1').className == 'SetUp_panel active') {
2578
2579 var fdups = $('.0dup1').length + 1;
2580
2581 for (i = 0; i < fdups; i++) {
2582 var restext = $('#Dup1Text' + i).val();//.trim();
2583 //console.log(i);
2584 //console.log(restext);
2585 //console.log('Dup1Text' + i);
2586 //console.log(fdups);
2587
2588 if (restext == '') {
2589 alertify.error('Please insert Reason.');
2590 //event.preventDefault();
2591 //return false;
2592 $('#btnPrev').click();
2593 break;
2594 }
2595
2596 }
2597
2598
2599 //MOVE THIS CODE TO SAVE BUTTON
2600 //var fdup = $('.0dup1').length + 1;
2601 // for (i = 0; i < fdup; i++) {
2602 // var resid = $('#Dup1TextID' + i).val();
2603 // var restext = $('#Dup1Text' + i).val();
2604 // $.ajax({
2605 // async: false,
2606 // type: 'POST',
2607 // url: 'MasterControl-ExitProcess.aspx/UpdateListBox',
2608 // data: "{ 'id': " + JSON.stringify(resid) + ", 'lstReason': " + JSON.stringify(restext) + "}",
2609 // processData: false,
2610 // contentType: 'application/json',
2611 // success: function (result) {
2612 // },
2613 // failure: function (response) {
2614 // console.log(response.d);
2615 // },
2616 // error: function (response) {
2617 // console.log(response.responseText);
2618 // }
2619 // });
2620 // }
2621
2622 //////
2623 }
2624 if (document.getElementById('divtocheck2').className == 'SetUp_panel active') {
2625 var fdupss = $('.0Term1dup1').length + 1;
2626 for (i = 1; i < fdupss; i++) {
2627 var restext = $('#Term1Dup1Text' + i).val();//.trim();
2628 if (restext == '') {
2629 alertify.error('Please insert Termination Type.');
2630 //return false;
2631 $('#btnPrev').click();
2632 break;
2633 }
2634 }
2635 var fdupsss = $('.0Term2dup1').length + 1;
2636 for (i = 1; i < fdupsss; i++) {
2637 var restext = $('#Term2Dup1Text' + i).val();//.trim();
2638 if (restext == '') {
2639 alertify.error('Please insert Termination Reason.');
2640 //alert("test");
2641 //return false;
2642 $('#btnPrev').click();
2643 break;
2644 }
2645 }
2646
2647 //MOVE THIS CODE TO SAVE BUTTON
2648 //var fdup1 = $('.0Term1dup1').length + 1;
2649 //for (i = 1; i < fdup1; i++) {
2650 // var resid = $('#Term1Dup1TextID' + i).val();
2651 // var restext = $('#Term1Dup1Text' + i).val();
2652
2653 // $.ajax({
2654 // async: false,
2655 // type: 'POST',
2656 // url: 'MasterControl-ExitProcess.aspx/AddtoTermType',
2657 // data: "{ 'id': " + JSON.stringify(resid) + ", 'lstReason': " + JSON.stringify(restext) + "}",
2658 // processData: false,
2659 // contentType: 'application/json',
2660 // success: function (result) {
2661 // },
2662 // failure: function (response) {
2663 // console.log(response.d);
2664 // },
2665 // error: function (response) {
2666 // console.log(response.responseText);
2667 // }
2668 // });
2669 //}
2670 //var fdup2 = $('.0Term2dup1').length + 1;
2671 //for (i = 1; i < fdup2; i++) {
2672 // var resid = $('#Term2Dup1TextID' + i).val();
2673 // var restext = $('#Term2Dup1Text' + i).val();
2674
2675 // $.ajax({
2676 // async: false,
2677 // type: 'POST',
2678 // url: 'MasterControl-ExitProcess.aspx/AddtoTermReason',
2679 // data: "{ 'id': " + JSON.stringify(resid) + ", 'lstReason': " + JSON.stringify(restext) + "}",
2680 // processData: false,
2681 // contentType: 'application/json',
2682 // success: function (result) {
2683 // },
2684 // failure: function (response) {
2685 // console.log(response.d);
2686 // },
2687 // error: function (response) {
2688 // console.log(response.responseText);
2689 // }
2690 // });
2691 //}
2692
2693
2694 }
2695
2696
2697
2698
2699 });
2700 $('#btnNext').click(function () {
2701 $('#ulTermAccess li').remove();
2702 $('#ddlTermProc option:selected').each(function (i) {
2703 var x = $(this).val();
2704 $('#ulTermAccess').append('<li>' + x + '</li>');
2705 });
2706 });
2707 $('#btnNext').click(function () {
2708 $('#ulTermInit li').remove();
2709 $('#ddlExitInit option:selected').each(function (i) {
2710 //alert(i);
2711 var x = $(this).val();
2712 $('#ulTermInit').append('<li>' + x + '</li>');
2713 });
2714 });
2715 $('#btnNext').click(function () {
2716 $('#ulEmpLevel li').remove();
2717 $('#ddlEmpLevel option:selected').each(function (i) {
2718 var x = $(this).val();
2719 $('#ulEmpLevel').append('<li>' + x + '</li>');
2720 });
2721 });
2722
2723 function popdrop() {
2724 $('#ddlTermProc').html('');
2725 $('#ddlEmpLevel').html('');
2726 $('#ddlTermProc')[0].sumo.reload();
2727 $('#ddlEmpLevel')[0].sumo.reload();
2728 $('#ddlTermProc')[0].sumo.unSelectAll();
2729 $('#ddlEmpLevel')[0].sumo.unSelectAll();
2730 $('#ddlEmpLevel')[0].sumo.add('Immediate Supervisor');
2731 $('#ddlEmpLevel')[0].sumo.add('Manager 1');
2732 $('#ddlEmpLevel')[0].sumo.add('Manager 2');
2733 var ct = $('div.ackclass2').length;
2734 for (var i = 1; i <= ct; i++) {
2735 var e = i;
2736 var res;
2737 var t = ["th", "st", "nd", "rd"],
2738 w = e % 100;
2739 var res = (t[(w - 20) % 10] || t[w] || t[0]);
2740 $('#ddlTermProc')[0].sumo.add(e + res + ' Level');
2741 $('#ddlEmpLevel')[0].sumo.add(e + res + ' Level');
2742
2743 }
2744 CheckRehire();
2745 CheckInitiate();
2746 CheckWaive();
2747 }
2748
2749
2750
2751 function CheckRehire() {
2752 $.ajax({
2753 async: false,
2754 type: 'POST',
2755 url: 'MasterControl-ExitProcess.aspx/SelectRehire',
2756 processData: false,
2757 contentType: 'application/json',
2758 success: function (result) {
2759 SelectRehire(result.d);
2760 },
2761 failure: function (response) {
2762 console.log(response.d);
2763 },
2764 error: function (response) {
2765 console.log(response.responseText);
2766 }
2767 });
2768
2769 function SelectRehire(myData) {
2770 $.each(myData, function (record, recordnumber) {
2771 $('#ddlTermProc')[0].sumo.selectItem(recordnumber.level);
2772 });
2773 }
2774
2775 }
2776
2777
2778 function CheckInitiate() {
2779 $.ajax({
2780 async: false,
2781 type: 'POST',
2782 url: 'MasterControl-ExitProcess.aspx/SelectInitiate',
2783 processData: false,
2784 contentType: 'application/json',
2785 success: function (result) {
2786 SelectInitiate(result.d);
2787 //DisplayInitiate(result.d);
2788 },
2789 failure: function (response) {
2790 console.log(response.d);
2791 },
2792 error: function (response) {
2793 console.log(response.responseText);
2794 }
2795 });
2796
2797 function SelectInitiate(myData) {
2798 $.each(myData, function (record, recordnumber) {
2799 $('#ddlExitInit')[0].sumo.selectItem(recordnumber.level);
2800 //$('#ddlExitInit')[0].sumo.add(recordnumber.level);
2801 });
2802 }
2803 //function DisplayInitiate(myData) {
2804 // $.each(myData, function (record, recordnumber) {
2805 // $('#ddlExitInit')[0].sumo.add(recordnumber.level);
2806 // });
2807 //}
2808 }
2809
2810
2811 function CheckWaive() {
2812 $.ajax({
2813 async: false,
2814 type: 'POST',
2815 url: 'MasterControl-ExitProcess.aspx/SelectWaive',
2816 processData: false,
2817 contentType: 'application/json',
2818 success: function (result) {
2819 SelectWaive(result.d);
2820 },
2821 failure: function (response) {
2822 console.log(response.d);
2823 },
2824 error: function (response) {
2825 console.log(response.responseText);
2826 }
2827 });
2828 function SelectWaive(myData) {
2829 $.each(myData, function (record, recordnumber) {
2830 $('#ddlEmpLevel')[0].sumo.selectItem(recordnumber.level);
2831 });
2832 }
2833
2834 }
2835 //first Append
2836 function duplicate1() {
2837 //alert(GlobalCategoryID)
2838 //alert($('.dup').length)
2839 var fdup = $('.0dup1').length + 1;
2840
2841 //var i = $('div.divApprover').length + 1;
2842 //alert("1st");
2843 $("#ReasonsDiv").append("<div id='Dupli1"+ fdup +"' class='col-md-12 0dup1'>"
2844 + "<input ID='Dup1Text" + fdup + "' onkeyup='SendReason(this.id)' style='width:300px' class='1dup1' />"
2845 //+ "<a class='circle_btn Yellow_btn 2dup1' id='EditMe" + fdup + "' onclick='ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
2846 + "<a style='color: #e74c3c!important' class='modcircle_btn 3dup1' id='DeleteMe" + fdup + "' onclick='ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
2847 + "<input ID='Dup1TextID" + fdup + "' style='width:50px;visibility:hidden;' class='4dup1' />"
2848 + "</div>");
2849 $('#ulResign').append("<li class='classReason' > <input class='duplab1' ID='dup1label" + fdup + "' /> </li>");
2850 $('#Dup1TextID' + fdup).val('0');
2851 }
2852 function ClickDeleteMe1(id) {
2853
2854 var i = id.substr(-1);
2855 var deleteID = $('#Dup1TextID' + i).val();
2856 if (deleteID != '0') {
2857 $.ajax({
2858 async: false,
2859 type: 'POST',
2860 url: 'MasterControl-ExitProcess.aspx/DelFromList',
2861 data: "{ 'lstReason': " + JSON.stringify(deleteID) + "}",
2862 processData: false,
2863 contentType: 'application/json',
2864 success: function (result) {
2865 },
2866 failure: function (response) {
2867 console.log(response.d);
2868 alertify.error(response.d);
2869 },
2870 error: function (response) {
2871 console.log(response.responseText);
2872 }
2873 });
2874 }
2875 var start1 = 1;
2876 var start2 = 1;
2877 var start3 = 1;
2878 var start4 = 1;
2879 var start5 = 1;
2880 var start6 = 1;
2881 //var s = start++ ddbonus2 BonusAppendDelete
2882 $('#Dupli1' + i).remove();
2883 $('#dup1label' + i).remove();
2884 $(".duplab1").each(function () {
2885 //alert($(this).val());
2886 $(this).attr('id', 'Dupli1' + start5++);
2887 });
2888 $(".0dup1").each(function () {
2889 //alert($(this).val());
2890 $(this).attr('id', 'dup1label' + start1++);
2891 });
2892 $(".1dup1").each(function () {
2893 //alert($(this).val());
2894 $(this).attr('id', 'Dup1Text' + start2++);
2895 });
2896 $(".2dup1").each(function () {
2897 //alert($(this).val());
2898 $(this).attr('id', 'EditMe' + start3++);
2899 });
2900 $(".3dup1").each(function () {
2901 //alert($(this).val());
2902 $(this).attr('id', 'DeleteMe' + start4++);
2903 });
2904 $(".4dup1").each(function () {
2905 //alert($(this).val());
2906 $(this).attr('id', 'Dup1TextID' + start6++);
2907 });
2908 //alert('sdsds')
2909 //$('#BonusLabelDiv').children().last().remove();
2910 //$('#BonusLabelDiv').children().last().remove();
2911 };
2912 function SendReason(id) {
2913 var i = id.substr(-1);
2914 //alert(i)
2915 //alert($('#Dup1Text' + i).val())
2916 $('#dup1label' + i).val($('#Dup1Text' + i).val());
2917 //$('#Dup1Text' + i).val() = $('#dup1label' + i).val();
2918 }
2919
2920 //Second Append
2921 function duplicate2() {
2922 //alert(GlobalCategoryID)
2923 //alert($('.dup').length)
2924 var fdup = $('.0Term1dup1').length + 1;
2925
2926 //var i = $('div.divApprover').length + 1;
2927 //alert("1st");
2928 $("#TerminationDiv1").append("<div id='Term1Dupli1" + fdup + "' class='col-md-12 0Term1dup1'>"
2929 + "<input ID='Term1Dup1Text" + fdup + "' onkeyup='Term1SendReason(this.id)' style='width:300px' class='1Term1dup1' />"
2930 //+ "<a class='circle_btn Yellow_btn 2Term1dup1' id='Term1EditMe" + fdup + "' onclick='Term1ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
2931 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term1dup1' id='Term1DeleteMe" + fdup + "' onclick='Term1ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
2932 + "<input ID='Term1Dup1TextID" + fdup + "' style='width:50px;visibility:hidden;' class='4Term1dup1' />"
2933 + "</div>");
2934 $('#ulTermType').append("<li class='classTermType' > <input class='Term1duplab1' ID='Term1dup1label" + fdup + "' /> </li>");
2935
2936 $('#Term1Dup1TextID' + fdup).val('0');
2937
2938 }
2939 function Term1ClickDeleteMe1(id) {
2940 //alert('ew')
2941 var i = id.substr(-1);
2942 var deleteID = $('#Term1Dup1TextID' + i).val();
2943 if (deleteID != '0') {
2944 $.ajax({
2945 async: false,
2946 type: 'POST',
2947 url: 'MasterControl-ExitProcess.aspx/DelfromTermType',
2948 data: "{ 'lstReason': " + JSON.stringify(deleteID) + "}",
2949 processData: false,
2950 contentType: 'application/json',
2951 success: function (result) {
2952 },
2953 failure: function (response) {
2954 console.log(response.d);
2955 alertify.error(response.d);
2956 },
2957 error: function (response) {
2958 console.log(response.responseText);
2959 }
2960 });
2961 }
2962 var start1 = 1;
2963 var start2 = 1;
2964 var start3 = 1;
2965 var start4 = 1;
2966 var start5 = 1;
2967 var start6 = 1;
2968 //var s = start++ ddbonus2 BonusAppendDelete
2969 $('#Term1Dupli1' + i).remove();
2970 $('#Term1dup1label' + i).remove();
2971 $(".Term1duplab1").each(function () {
2972 //alert($(this).val());
2973 $(this).attr('id', 'Term1Dupli1' + start5++);
2974 });
2975 $(".0Term1dup1").each(function () {
2976 //alert($(this).val());
2977 $(this).attr('id', 'Term1dup1label' + start1++);
2978 });
2979 $(".1Term1dup1").each(function () {
2980 //alert($(this).val());
2981 $(this).attr('id', 'Term1Dup1Text' + start2++);
2982 });
2983 $(".2Term1dup1").each(function () {
2984 //alert($(this).val());
2985 $(this).attr('id', 'Term1EditMe' + start3++);
2986 });
2987 $(".3Term1dup1").each(function () {
2988 //alert($(this).val());
2989 $(this).attr('id', 'Term1DeleteMe' + start4++);
2990 });
2991 $(".4Term1dup1").each(function () {
2992 //alert($(this).val());
2993 $(this).attr('id', 'Term1Dup1TextID' + start6++);
2994 });
2995 //alert('sdsds')
2996 //$('#BonusLabelDiv').children().last().remove();
2997 //$('#BonusLabelDiv').children().last().remove();
2998 };
2999 function Term1SendReason(id) {
3000 var i = id.substr(-1);
3001 //alert(i)
3002 //alert($('#Term1Dup1Text' + i).val())
3003 $('#Term1dup1label' + i).val($('#Term1Dup1Text' + i).val());
3004 //$('#Dup1Text' + i).val() = $('#dup1label' + i).val();
3005 }
3006 //tHIRD Append
3007 function duplicate3() {
3008 //alert(GlobalCategoryID)
3009 //alert($('.dup').length)
3010 var fdup = $('.0Term2dup1').length + 1;
3011
3012 //var i = $('div.divApprover').length + 1;
3013 //alert("1st");
3014 $("#TerminationDiv2").append("<div id='Term2Dupli1" + fdup + "' class='col-md-12 0Term2dup1'>"
3015 + "<input ID='Term2Dup1Text" + fdup + "' onkeyup='Term2SendReason(this.id)' style='width:300px' class='1Term2dup1' />"
3016 //+ "<a class='circle_btn Yellow_btn 2Term2dup1' id='Term2EditMe" + fdup + "' onclick='Term2ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
3017 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term2dup1' id='Term2DeleteMe" + fdup + "' onclick='Term2ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
3018 + "<input ID='Term2Dup1TextID" + fdup + "' style='width:50px;visibility:hidden;' class='4Term2dup1' />"
3019 + "</div>");
3020 $('#ulTermReason').append("<li class='classTermReason' > <input class='Term2duplab1' ID='Term2dup1label" + fdup + "' /> </li>");
3021 $('#Term2Dup1TextID' + fdup).val('0');
3022
3023 }
3024 function Term2ClickDeleteMe1(id) {
3025 //alert('ew')
3026 var i = id.substr(-1);
3027 var deleteID = $('#Term2Dup1TextID' + i).val();
3028 if (deleteID != '0') {
3029 $.ajax({
3030 async: false,
3031 type: 'POST',
3032 url: 'MasterControl-ExitProcess.aspx/DeleteTermReason',
3033 data: "{ 'lstReason': " + JSON.stringify(deleteID) + "}",
3034 processData: false,
3035 contentType: 'application/json',
3036 success: function (result) {
3037 },
3038 failure: function (response) {
3039 console.log(response.d);
3040 alertify.error(response.d);
3041 },
3042 error: function (response) {
3043 console.log(response.responseText);
3044 }
3045 });
3046 }
3047 var start1 = 1;
3048 var start2 = 1;
3049 var start3 = 1;
3050 var start4 = 1;
3051 var start5 = 1;
3052 var start6 = 1;
3053 //var s = start++ ddbonus2 BonusAppendDelete
3054 $('#Term2Dupli1' + i).remove();
3055 $('#Term2dup1label' + i).remove();
3056 $(".Term2duplab1").each(function () {
3057 //alert($(this).val());
3058 $(this).attr('id', 'Term2Dupli1' + start5++);
3059 });
3060 $(".0Term2dup1").each(function () {
3061 //alert($(this).val());
3062 $(this).attr('id', 'Term2dup1label' + start1++);
3063 });
3064 $(".1Term2dup1").each(function () {
3065 //alert($(this).val());
3066 $(this).attr('id', 'Term2Dup1Text' + start2++);
3067 });
3068 $(".2Term2dup1").each(function () {
3069 //alert($(this).val());
3070 $(this).attr('id', 'Term2EditMe' + start3++);
3071 });
3072 $(".3Term2dup1").each(function () {
3073 //alert($(this).val());
3074 $(this).attr('id', 'Term2DeleteMe' + start4++);
3075 });
3076 $(".4Term2dup1").each(function () {
3077 //alert($(this).val());
3078 $(this).attr('id', 'Term2Dup1TextID' + start6++);
3079 });
3080 //alert('sdsds')
3081 //$('#BonusLabelDiv').children().last().remove();
3082 //$('#BonusLabelDiv').children().last().remove();
3083 };
3084 function Term2SendReason(id) {
3085 var i = id.substr(-1);
3086 //alert(i)
3087 //alert($('#Term2Dup1Text' + i).val())
3088 $('#Term2dup1label' + i).val($('#Term2Dup1Text' + i).val());
3089 //$('#Dup1Text' + i).val() = $('#dup1label' + i).val();
3090 }
3091
3092 // ======================================================================================================== //
3093 // ======================================================================================================== //
3094 //edit button javascript taken fromp compandben-leaves and schedswap
3095
3096 function GetSelectedRow(SwapSchedTypeID) {
3097 SwapSchedTypeID = SwapSchedTypeID.replace(/^\D+/g, '');
3098
3099
3100 $.ajax({
3101 async: false,
3102 type: 'POST',
3103 url: 'MasterControl-ExitProcess.aspx/Display_Exit',
3104 data: "{PROCID: '" + SwapSchedTypeID + "'}",
3105 processData: false,
3106 contentType: 'application/json',
3107 success: function (result) {
3108 //$("#SwapForm").css('display', 'block');
3109 //$("#swapPreview").css('display', 'block');
3110 $.each(result.d, function (index, rslt) {
3111 //console.log(result.d)
3112
3113
3114 //check schedule swap for this code.
3115 //DisplaySwapWith(SwapSchedTypeID)
3116 //displayApprover(SwapSchedTypeID)
3117
3118 //codes below are from old method
3119 $('#GlobalID').val(rslt.ProcessName)
3120 GlobalID = SwapSchedTypeID
3121 $('#hdnProcID').val(rslt.ProcessName)
3122
3123 $('#btnNext').show();
3124 $('#setup').removeClass("hidden");
3125
3126
3127
3128
3129 $('#exitnametxt').val(rslt.ProcessName)
3130
3131 //Period Length Dropdown
3132 if (rslt.RenderPeriodLength != "0") {
3133 $('#ddlRenderLength').val(rslt.RenderPeriodLength)
3134 }
3135 else {
3136 $('#ddlRenderLength').val(0)
3137 }
3138 //Period Type Dropdown
3139 if (rslt.RenderPeriodType != "") {
3140 $('#ddlRenderType').val(rslt.RenderPeriodType)
3141 }
3142 else {
3143 $('#ddlRenderType').val(0);
3144 }
3145 //Retractable Switch
3146 if (rslt.IsRetractable == "True") {
3147 $('#chkRetract').prop("checked", true);
3148 $('.RetractPanel').css({ 'display': 'block' })
3149 }
3150 else {
3151 $('#chkRetract').prop("checked", false);
3152 $('.RetractPanel').css({ 'display': 'none' })
3153 }
3154 //Retract Message Switch
3155 if (rslt.ShowRetractMessage == "True") {
3156 $('#chkShowMsg').prop("checked", true);
3157 $('#txtRetractMsg').attr('disabled', false);
3158 }
3159 else {
3160 $('#chkShowMsg').prop("checked", false);
3161 $('#txtRetractMsg').attr('disabled', true);
3162 }
3163
3164 //Retract Message TextArea
3165 $('#txtRetractMsg').val(rslt.RetractMessage)
3166
3167 //UploadLetter
3168 if (rslt.CanUploadLetter == "True") {
3169 $('#chkUpload').prop("checked", true);
3170 $('#lblUpload').text("Yes");
3171 }
3172 else {
3173 $('#chkUpload').prop("checked", false);
3174 $('#chkUpload').text("No");
3175 }
3176
3177
3178 //CreateLetter
3179 if (rslt.CanCreateLetter == "True") {
3180 $('#chkCreate').prop("checked", true);
3181 $('#lblCreate').text("Yes");
3182 }
3183 else {
3184 $('#chkCreate').prop("checked", false);
3185 $('#lblCreate').text("No");
3186 }
3187
3188 //Acknowledged
3189 if (rslt.IsAcknowledged == "True") {
3190 $('#chkAcknowledge').prop("checked", true);
3191 }
3192 else {
3193 $('#chkAcknowledge').prop("checked", false);
3194 }
3195
3196 //CheckPaid Switch
3197 if (rslt.IsUnworkedDaysPaid == "True") {
3198 $('#chkPaid').prop("checked", true);
3199 }
3200 else {
3201 $('#chkPaid').prop("checked", false);
3202 }
3203
3204 $('#txtDaysNotif').val(rslt.SendEmailDays)
3205 $('#txtEmailNotif').val(rslt.EmailMessage)
3206
3207 //2316 Switch
3208 if (rslt.Is2316Attached == "True") {
3209 $('#chk2316').prop("checked", true);
3210 $('#lbl2316').text('Yes');
3211 }
3212 else {
3213 $('#chk2316').prop("checked", false);
3214 $('#lbl2316').text('No');
3215 }
3216
3217 //FinalPayoutMethod
3218 if (rslt.FinalPayoutMethod == "bank") {
3219 $('#chkBank').prop("checked", true);
3220 $('#chkCheck').prop("checked", false);
3221 $('#txtCalcBank').val(rslt.FinalPayoutCalc);
3222 $('#txtPayBank').val(rslt.FinalPayoutPay);
3223 $('#divBank *').prop('disabled', false);
3224 $('#divCheck *').prop('disabled', true);
3225 }
3226 else if (rslt.FinalPayoutMethod == "check") {
3227 $('#chkBank').prop("checked", false);
3228 $('#chkCheck').prop("checked", true);
3229 $('#txtCalcBank').val(rslt.FinalPayoutCalc);
3230 $('#txtPayBank').val(rslt.FinalPayoutPay);
3231 $('#divBank *').prop('disabled', true);
3232 $('#divCheck *').prop('disabled', false);
3233 }
3234
3235
3236 //Leave Convertion Switch
3237 if (rslt.LeaveConvertion == "True") {
3238 $('#chkLeave').prop("checked", true);
3239 $('.LeavePanel').css({ 'display': 'block' })
3240 }
3241 else {
3242 $('#chkLeave').prop("checked", false);
3243 $('.LeavePanel').css({ 'display': 'none' })
3244 }
3245
3246
3247 if ($('#chkAcknowledge').is(':checked')) {
3248 $('.AckPanel').css({ 'display': 'block' })
3249 }
3250 else {
3251 $('.AckPanel').css({ 'display': 'none' })
3252 }
3253
3254
3255
3256 $('#txtRenderMsg').text(rslt.RenderMessage);
3257 $('#txtRetractMsg').text(rslt.RetractMessage);
3258 $('#txtEmailNotif').text(rslt.EmailMessage);
3259
3260 $('#txtDetailRenderMsg').text($('#txtRenderMsg').text());
3261 $('#txtDetailRetractMsg').text($('#txtRetractMsg').text());
3262 $('#txtDetailEmailMsg').text($('#txtEmailNotif').text());
3263
3264 $('#ddlTermProc').html("");
3265 //$('#ddlExitInit').html("");
3266 $('#ddlEmpLevel').html("");
3267
3268 if (rslt.LeaveConvertion != "") {
3269 $('#chkLeave').val(rslt.LeaveConvertion)
3270 }
3271
3272 if (rslt.AllLeaveRemain != "") {
3273 $('#chkLeaveOpt1').val(rslt.AllLeaveRemain)
3274 }
3275
3276 if (rslt.MaximumSetLeave != "") {
3277 $('#chkLeaveOpt2').val(rslt.MaximumSetLeave)
3278 }
3279
3280 $('#txtRetractLen').val(rslt.RetractLength);
3281
3282 var x = $('#ddlEmpLevel').children('option').length;
3283
3284 //FROM DETAILBINDDATA
3285 $('#lblProcName').text(rslt.ProcessName)
3286 $('#lblRenderLength').text(rslt.RenderPeriodLength)
3287 $('#lblRenderType').text(rslt.LeaveConvertion)
3288
3289 if (rslt.Can == "True") {
3290 $('#chkLeave').prop("checked", true);
3291 $('.LeavePanel').css({ 'display': 'block' })
3292 }
3293 else {
3294 $('#chkLeave').prop("checked", false);
3295 $('.LeavePanel').css({ 'display': 'none' })
3296 }
3297
3298 $('#lblPayoutMethod').text(rslt.FinalPayoutMethod)
3299 $('#lblDayCalc').text(rslt.FinalPayoutCalc)
3300 $('#lblDayPay').text(rslt.FinalPayoutPay)
3301
3302 if (rslt.IsUnworkedDaysPaid == "True") {
3303 $('#lblDetailUnpaid').text("Yes");
3304 }
3305 else {
3306 $('#lblDetailUnpaid').text("No");
3307 }
3308 $('#lblAllLeave').text(rslt.AllLeaveRemain)
3309 $('#lblMaxLeave').text(rslt.MaximumSetLeave)
3310 $('#lblRetractLen').text(rslt.RetractLength)
3311 $('#lblRetractType').text(rslt.FinalPayoutCalc)
3312
3313
3314
3315
3316
3317 })
3318
3319 },
3320 failure: function (response) {
3321 console.log(response.d);
3322 },
3323 error: function (response) {
3324 console.log(response.responseText);
3325 }
3326 });
3327
3328 $.ajax({
3329 async: false,
3330 type: 'POST',
3331 url: 'MasterControl-ExitProcess.aspx/ResignReason',
3332 data: "{procID: '" + SwapSchedTypeID + "'}",
3333 processData: false,
3334 contentType: 'application/json',
3335 success: function (result) {
3336 showResignReason(result.d);
3337 },
3338 failure: function (response) {
3339 console.log(response.d);
3340 },
3341 error: function (response) {
3342 console.log(response.responseText);
3343 }
3344 });
3345
3346 $.ajax({
3347 async: false,
3348 type: 'POST',
3349 url: 'MasterControl-ExitProcess.aspx/SearchTermType',
3350 data: "{procID: '" + SwapSchedTypeID + "'}",
3351 processData: false,
3352 contentType: 'application/json',
3353 success: function (result) {
3354 showTermType(result.d);
3355 },
3356 failure: function (response) {
3357 console.log(response.d);
3358 },
3359 error: function (response) {
3360 console.log(response.responseText);
3361 }
3362 });
3363
3364 $.ajax({
3365 async: false,
3366 type: 'POST',
3367 url: 'MasterControl-ExitProcess.aspx/SearchTermReason',
3368 data: "{procID: '" + SwapSchedTypeID + "'}",
3369 processData: false,
3370 contentType: 'application/json',
3371 success: function (result) {
3372 showTermReason(result.d);
3373 },
3374 failure: function (response) {
3375 console.log(response.d);
3376 },
3377 error: function (response) {
3378 console.log(response.responseText);
3379 }
3380 });
3381
3382 $.ajax({
3383 async: false,
3384 type: 'POST',
3385 url: 'MasterControl-ExitProcess.aspx/DisplayExitInIt',
3386 processData: false,
3387 contentType: 'application/json',
3388 success: function (result) {
3389 emptyExitInIt(length);
3390 length = showExitInIt(result.d);
3391
3392 },
3393 failure: function (response) {
3394 console.log(response.d);
3395 },
3396 error: function (response) {
3397 console.log(response.responseText);
3398 }
3399 });
3400
3401 rerun();
3402 DisplayAcknowledge();
3403 //navigateTo(0);
3404 return false;
3405
3406 }
3407
3408 function showResignReason(myData) {
3409 $('#ulResign').empty();
3410 $("#ReasonsDiv").empty();
3411 $.each(myData, function (record, recordnumber) {
3412
3413 //alert(myData.length);
3414 //alert(record);
3415
3416 //var fdup = $('.0dup1').length + 1;
3417 //$('#lstResignReason').append('<option value="' + recordnumber.ID + '">' + recordnumber.ID + '</option>');
3418 //$('#lstResignReason1').append('<tbody><tr><td><input id="lstResignReason1_chkSRow_0" type="checkbox" name="lstResignReason1$ctl02$chkSRow"></td><td align="center" style="border:0" id="' + recordnumber.ID + '" " ><input type="text" value="' + recordnumber.ID + '">' + '</td><td align="center"><a class="box_btn colorPencil double" href="#")"><i class="fa fa-pencil" title="Edit"></i></a> <a class="box_btn colorPencil double" href="#"><i class="fa fa-eye" title="Click to View"> </i> </a></td>' + '</a></td></tbody>');
3419 //$('#ulResign').append('<li class="classReason"><input class="duplab1" ID="dup1label' + fdup + '" />' + recordnumber.ID + '</li>')
3420
3421
3422
3423 $("#ReasonsDiv").append("<div id='Dupli1" + record + "' class='col-md-12 0dup1'>"
3424 + "<input ID='Dup1Text" + record + "' onkeyup='SendReason(this.id)' style='width:300px' class='1dup1' />"
3425 //+ "<a class='circle_btn Yellow_btn 2dup1' id='EditMe" + i + "' onclick='ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
3426 + "<a style='color: #e74c3c!important' class='modcircle_btn 3dup1' id='DeleteMe" + record + "' onclick='ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
3427 + "<input ID='Dup1TextID" + record + "' style='width:50px;visibility:hidden;' class='4dup1' />"
3428 + "</div>");
3429 $('#ulResign').append("<li class='classReason' > <input class='duplab1' ID='dup1label" + record + "' /> </li>");
3430
3431 $('#Dup1TextID' + record).val(recordnumber.ID);
3432 $('#Dup1Text' + record).val(recordnumber.ID);
3433 $('#dup1label' + record).val(recordnumber.ID);
3434 });
3435
3436 }
3437
3438
3439
3440
3441 function showTermType(myData) {
3442 $('#ulTermType').empty();
3443 $("#TerminationDiv1").empty();
3444 $.each(myData, function (record, recordnumber) {
3445
3446 $("#TerminationDiv1").append("<div id='Term1Dupli1" + record + "' class='col-md-12 0Term1dup1'>"
3447 + "<input ID='Term1Dup1Text" + record + "' onkeyup='Term1SendReason(this.id)' style='width:300px' class='1Term1dup1' />"
3448 //+ "<a class='circle_btn Yellow_btn 2Term1dup1' id='Term1EditMe" + i + "' onclick='Term1ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
3449 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term1dup1' id='Term1DeleteMe" + record + "' onclick='Term1ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
3450 + "<input ID='Term1Dup1TextID" + record + "' style='width:50px;visibility:hidden;' class='4Term1dup1' />"
3451 + "</div>");
3452 $('#ulTermType').append("<li class='classTermType' > <input class='Term1duplab1' ID='Term1dup1label" + record + "' /> </li>");
3453
3454 $('#Term1Dup1TextID' + record).val(recordnumber.Type);
3455 $('#Term1Dup1Text' + record).val(recordnumber.Type);
3456 $('#Term1dup1label' + record).val(recordnumber.Type);
3457
3458 });
3459
3460
3461 }
3462
3463
3464 function showTermReason(myData) {
3465 $('#ulTermReason').empty();
3466 $("#TerminationDiv2").empty();
3467 $.each(myData, function (record, recordnumber) {
3468 $("#TerminationDiv2").append("<div id='Term2Dupli1" + record + "' class='col-md-12 0Term2dup1'>"
3469 + "<input ID='Term2Dup1Text" + record + "' onkeyup='Term2SendReason(this.id)' style='width:300px' class='1Term2dup1' />"
3470 //+ "<a class='circle_btn Yellow_btn 2Term2dup1' id='Term2EditMe" + i + "' onclick='Term2ClickEditMe1(this.id);'><i class='fa fa-pencil'></i></a>"
3471 + "<a style='color: #e74c3c!important' class='modcircle_btn 3Term2dup1' id='Term2DeleteMe" + record + "' onclick='Term2ClickDeleteMe1(this.id);'><i class='fa fa-trash'></i></a>"
3472 + "<input ID='Term2Dup1TextID" + record + "' style='width:50px;visibility:hidden;' class='4Term2dup1' />"
3473 + "</div>");
3474 $('#ulTermReason').append("<li class='classTermReason' > <input class='Term2duplab1' ID='Term2dup1label" + record + "' /> </li>");
3475
3476 $('#Term2Dup1TextID' + record).val(recordnumber.Type);
3477 $('#Term2Dup1Text' + record).val(recordnumber.Type);
3478 $('#Term2dup1label' + record).val(recordnumber.Type);
3479
3480 });
3481 }
3482
3483
3484 function emptyExitInIt(x) {
3485
3486 for (var i = 0; i <= x; i++) {
3487 $('select#ddlExitInit')[0].sumo.remove(0);
3488 alert("test")
3489 }
3490 alert(x);
3491
3492 }
3493
3494 function showExitInIt(myData) {
3495 var length;
3496 $.each(myData, function (record, recordnumber) {
3497
3498 $('#ddlExitInit')[0].sumo.add(recordnumber.Type);
3499 length = record;
3500 });
3501 return length;
3502 }
3503
3504
3505
3506 function getLeaveType() {
3507 $.ajax({
3508 async: false,
3509 type: 'POST',
3510 url: 'MasterControl-ExitProcess.aspx/GetSched',
3511 processData: false,
3512 contentType: 'application/json',
3513 success: function (result) {
3514 AllLeave(result.d);
3515 },
3516 failure: function (response) {
3517 console.log(response.d);
3518 },
3519 error: function (response) {
3520
3521 console.log(response.responseText);
3522 }
3523 });
3524 }
3525
3526 function AllLeave(myData) {
3527 $('LeavesList').empty();
3528 $.each(myData, function (record, recordnumber) {
3529 $('#LeavesList').append('<tr>\
3530 <td class="LtypeDel" style="width:15%">\
3531 <a href="#!" class="table_btn Delete" id="' + recordnumber.ID + '"onclick="delSwap(this.id);"><i class="fa fa-trash fa-fw"></i></a>\
3532 <a href="#!" class="table_btn btnSaveLeave" style="display:none; color:blue" onclick="saveNewLTypeName(this)"><i class="fa fa-save fa-fw"></i></a>\
3533 </td>\
3534 <td class="LTypeIDD" style="width:15%">\
3535 <a href="#!" class="table_btn Edit" id="' + recordnumber.ID + '" onclick="editBenName(this,this.id); editLName(this,this.id);"><i class="fa fa-pencil fa-fw"></i></a>\
3536 <a href="#!" class="table_btn btnCancelEditLeave" id="btnCancelLDel' + recordnumber.ID + '" style="display:none" onclick="cancelEditLName(this,this.id);"><i class="fa fa-ban fa-fw"></i></a>\
3537 </td>\
3538 <td >\
3539 <a href="#! class="inpuuteditbenName" value="' + recordnumber.Type + '" id="inputname' + recordnumber.ID + '" onclick="GetSelectedRow(this.id);" style="background-color:transparent;border:0;margin-right:2px;color: black;display:block;" >' + recordnumber.Type + '</a>\
3540 <input type="text" class="inpuuteditbenNeym" value="' + recordnumber.Type + '" id="inputneym' + recordnumber.ID + '" style="background-color:transparent;border:0;margin-right:2px;display:none;"/>\
3541 <input type="text" class="inpuuteditbenNamecheck" text="' + recordnumber.Type + '" value="' + recordnumber.Type + '" id="inputnamecheck' + recordnumber.ID + '" style="background-color:transparent;border:0;margin-right:2px;display:none;"/>\
3542 </td>\
3543 </tr>');
3544
3545
3546
3547 });
3548
3549
3550 }
3551
3552
3553 function editBenName(editRow, editRowID) {
3554 //alert(editRowID)
3555 editRowID = editRowID.replace(/^\D+/g, '');
3556 //alert(editRowID)
3557 $('.disabledtxt').removeAttr('onclick');
3558 $('.Delete, .Edit').show();
3559 $('.btnAddben, .btnCancel').hide();
3560 $('#inputname' + editRowID).css('display', 'none');
3561 $('#inputneym' + editRowID).css('display', 'block');
3562 $('#inputnamecheck' + editRowID).css('display', 'none');
3563
3564 $('.benefitlabel').prop('readonly', true).css('text-align', 'center');
3565
3566 $(editRow).hide();
3567 $(editRow).parent().parent().find('.OBtypeDel').find('.Delete').hide();
3568
3569 $(editRow).parent().parent().find('.OBtypeDel').find('.btnAddben').show();
3570 $(editRow).parent().find('.btnCancel').show();
3571
3572 $(editRow).parent().parent().find('.disabledtxt').find('#inputname' + editRowID).removeAttr('disabled');
3573 $(editRow).parent().parent().find('.disabledtxt').find('#inputname' + editRowID).css('border', '1px solid gray');
3574 $(editRow).parent().parent().find('.disabledtxt').find('#inputname' + editRowID).css('background', 'white');
3575 CurrentEditedBenefitSelected = editRowID;
3576
3577 CurrentBenefitName = $(editRow).parent().parent().find('.disabledtxt').find('.inpuuteditbenName').val();
3578 }
3579
3580 var CurrentLeaveName = '';
3581 function editLName(editRow, editRowID) {
3582
3583 CurrentEditedLeaveSelected = editRowID;
3584
3585 CurrentLeaveName = $(editRow).parent().parent().find('.disabledtxt').find('.txtLTypeName').val();
3586 //alert(CurrentLeaveName);
3587
3588 Edited();
3589 $('.Delete, .Edit').show();
3590 $('.Delete, .View_btn').show();
3591 $('.btnSaveLeave, .btnCancelEditLeave').hide();
3592 $('.txtLTypeName').prop('disabled', true).css('border', '0');
3593 $('#txtLeaveName').prop('readonly', true).css('text-align', 'center');
3594 $(editRow).hide();
3595 $(editRow).parent().parent().find('.LtypeDel').find('.Delete').hide();
3596 $(editRow).parent().parent().find('.LtypeDel').find('.btnSaveLeave').show();
3597 $(editRow).parent().find('.btnCancelEditLeave').show();
3598 $(editRow).parent().parent().find('.disabledtxt').find('#txtLType' + editRowID).removeAttr('disabled');
3599 $(editRow).parent().parent().find('.disabledtxt').find('#txtLType' + editRowID).css('border', '1px solid gray');
3600 $('#HiddenBtnNextSave').removeClass('hidden');
3601 $('#saveHidden').removeClass('hidden');
3602
3603
3604 }
3605
3606 function cancelEditLName(CancelRow, CancelRowID) {
3607 CancelRowID = CancelRowID.replace(/^\D+/g, '');
3608 $('#inputname' + CancelRowID).css('display', 'block');
3609 $('#inputneym' + CancelRowID).css('display', 'none');
3610 $('#inputnamecheck' + CancelRowID).css('display', 'none');
3611 $(CancelRow).hide();
3612 $(CancelRow).parent().parent().find('.LtypeDel').find('.btnSaveLeave').hide();
3613
3614 $(CancelRow).parent().find('.Edit').show();
3615 $(CancelRow).parent().find('.View_btn').show();
3616 $(CancelRow).parent().parent().find('.LtypeDel').find('.Delete').show();
3617
3618 //console.log(parseInt(CancelRowID.match(/\d+/)));
3619 $(CancelRow).parent().parent().find('.disabledtxt').find('#txtLType' + parseInt(CancelRowID.match(/\d+/))).prop('disabled', true);
3620 $(CancelRow).parent().parent().find('.disabledtxt').find('#txtLType' + parseInt(CancelRowID.match(/\d+/))).css('border', '0');
3621
3622 CurrentEditedLeaveSelected = '';
3623 $(CancelRow).parent().parent().find('.disabledtxt').find('#txtLType' + parseInt(CancelRowID.match(/\d+/))).val(CurrentLeaveName);
3624 }
3625 var DelLeaveID = '';
3626 function delBenefit(lTypeIdd) {
3627 DelLeaveID = $(lTypeIdd).parent().parent().find('.LTypeIDD').find('.Edit').attr('id');
3628 $('#delApproverModal').addClass('active');
3629 }
3630
3631 $(".close_mod").click(function () {
3632 $('#delApproverModal').removeClass('active');
3633 });
3634
3635 function Edited() {
3636 //add textbox here
3637
3638
3639 }
3640
3641 function saveNewLTypeName(NewLeaveName) {
3642 var SelectedCLeave = $(NewLeaveName).parent().parent().find('.inpuuteditbenNeym').val();
3643 if (SelectedCLeave.trim() == '') {
3644 alertify.warning("Please insert name.");
3645 return false;
3646 }
3647 var customerId;
3648 var samesame = 'no';
3649 $('.inpuuteditbenNamecheck').each(function () {
3650 if (SelectedCLeave.toUpperCase().trim() == $(this).val().toUpperCase().trim()) {
3651 samesame = 'same';
3652 }
3653 })
3654 if (samesame == 'same') {
3655 alertify.warning("Process already exists.");
3656
3657 return false;
3658 }
3659
3660 else {
3661 $.ajax({
3662 async: false,
3663 type: 'POST',
3664 url: 'MasterControl-ExitProcess.aspx/EditExit',
3665 data: "{'LeaveIDEdit': " + JSON.stringify(CurrentEditedLeaveSelected) +
3666 ",'NewLName': " + JSON.stringify(SelectedCLeave) +
3667 "}",
3668 processData: false,
3669 contentType: 'application/json',
3670 success: function (result) {
3671 if (result.d == "0") {
3672 alertify.error('Schedule type name already exists.');
3673
3674 }
3675 else {
3676 alertify.success('Successfully Updated.');
3677
3678 $(NewLeaveName).hide();
3679 $(NewLeaveName).parent().parent().find('.LTypeIDD').find('.btnCancelEditLeave').hide();
3680
3681 $(NewLeaveName).parent().find('.Delete').show();
3682 $(NewLeaveName).parent().parent().find('.LTypeIDD').find('.Edit').show();
3683
3684 $(NewLeaveName).parent().parent().find('.disabledtxt').find('.txtLTypeName').prop('disabled', true).css('border', '0');
3685
3686 $('#txtLeaveName').val(SelectedCLeave);
3687 //document.getElementById("lblLeaveNamePreview").innerText = SelectedCLeave;
3688 }
3689 },
3690 failure: function (response) {
3691 console.log(response.d);
3692 },
3693 error: function (response) {
3694 console.log(response.responseText);
3695 }
3696 });
3697 }
3698
3699 }
3700
3701 function canceldel() {
3702 $('#delApproverModal').removeClass('active');
3703 $('#schedTypeMD').removeClass('active');
3704
3705 }
3706
3707 function canceldel2() {
3708 $('#delApproverModal').removeClass('active');
3709 $('#schedTypeMD').removeClass('active');
3710
3711 }
3712
3713 //===========================================================================//
3714 //===========================================================================//
3715
3716 var DeleteID;
3717 function delSwap(SwapSchedTypeID) {
3718 DeleteID = SwapSchedTypeID;
3719 $('#delApproverModal').addClass('active');
3720 }
3721
3722 function deleteConfirm() {
3723 $.ajax({
3724 async: false,
3725 type: 'POST',
3726 url: 'MasterControl-ExitProcess.aspx/DeleteExit',
3727 data: "{'procID': '" + DeleteID + "'}",
3728 processData: false,
3729 contentType: 'application/json',
3730 success: function (result) {
3731 $('#delApproverModal').removeClass('active');
3732 alertify.success('Successfully Deleted');
3733 $("#LeavesList").find("tbody").empty();
3734 getLeaveType();
3735 return false;
3736 },
3737 error: function (response) {
3738 console.log(response.responseText);
3739 },
3740 failure: function (response) {
3741
3742 console.log(response.responseText);
3743 }
3744 })
3745 return true;
3746 }
3747
3748 $('#lnbtnAddProc').click(function () {
3749 var procID = "";
3750 var newExit = $('#txtNewProc').val();
3751 var duplicate = "";
3752
3753 $.ajax({
3754 async: false,
3755 type: 'POST',
3756 url: 'MasterControl-ExitProcess.aspx/CheckExitProcessList',
3757 data: "{procName: '" + newExit + "'}",
3758 processData: false,
3759 contentType: 'application/json',
3760 success: function (result) {
3761 duplicate = result.d;
3762 },
3763 failure: function (response) {
3764 console.log(response.d);
3765 },
3766 error: function (response) {
3767 console.log(response.responseText);
3768 alert(response.responseText)
3769 return false;
3770 }
3771 });
3772
3773 if (newExit == '') {
3774 alertify.warning("Please enter an exit process name.");
3775 }
3776
3777 else if (duplicate == "false") {
3778 alertify.warning("Exit process name already exists.");
3779 }
3780
3781 else {
3782 $.ajax({
3783 async: false,
3784 type: 'POST',
3785 url: 'MasterControl-ExitProcess.aspx/AddExitProcess',
3786 data: "{procName: '" + newExit + "'}",
3787 processData: false,
3788 contentType: 'application/json',
3789 success: function (result) {
3790 alertify.success('Successfully Added');
3791 $("#LeavesList").find("tbody").empty();
3792 getLeaveType();
3793 },
3794 failure: function (response) {
3795 console.log(response.d);
3796 },
3797 error: function (response) {
3798 console.log(response.responseText);
3799 alert(response.responseText)
3800 return false;
3801 }
3802 });
3803 }
3804
3805
3806 });
3807
3808
3809
3810 </script>
3811
3812 <div class="modal_container" id="delApproverModal">
3813 <div class="modal_box modal_SM">
3814 <div class="modal_title">
3815 <label>Delete Swap Schedulte Type </label>
3816 <a href="#" onclick="return canceldel()" title="Close Modal" class="modal_close_btn">×</a>
3817 </div>
3818 <div class="modal_content">
3819 <h4 class="text-center" style="padding-top:50px;">Are you sure you want to delete this?</h4>
3820
3821 <div class="modal_btn_container">
3822
3823 <a href="#" ID="btnConfirmDelete" OnClick="return deleteConfirm();" Class="ConfirmBtn Green_btn"><i class="fa fa-check fa-fw"></i> Confirm</a>
3824 <a href="#" id="btnCancelDelete" class="close_mod CancelBtn Red_btn" onclick="return canceldel()" ><i class="fa fa-times fa-fw"></i> Cancel</a>
3825
3826
3827 </div>
3828 </div>
3829 </div>
3830 </div>
3831
3832
3833
3834
3835 <div id="DeleteModal" runat="server" class="modal_container">
3836 <div class="modal_box modal_SM">
3837 <div class="modal_title bg-warning">
3838 <label>Delete Process Name</label>
3839 <asp:LinkButton ID="closedbtn" OnClick="CANCELbtn_Click" class="modal_close_btn" runat="server">×</asp:LinkButton>
3840 </div>
3841 <div class="modal_content">
3842 <h4 class="text-center" style="padding-top:70px;">Are you sure you want to delete?</h4>
3843 <div class="confirm_container">
3844 <asp:LinkButton class="btn-success ConfirmBtn" ID="CONFIRMbtn" OnClick="CONFIRMbtn_Click" OnClientClick="CloseModalConfirmed()" runat="server"><i class="fa fa-check fa-fw"></i>Confirm</asp:LinkButton>
3845 <asp:LinkButton class="btn-danger CancelBtn" ID="CANCELbtn" OnClick="CANCELbtn_Click" OnClientClick="CloseModalcancel()" runat="server"><i class="fa fa-times fa-fw"></i>Cancel</asp:LinkButton>
3846 </div>
3847 </div>
3848
3849 <div class="modal_footer">
3850 </div>
3851
3852 <div class="modal_state">
3853
3854 <div id="qoutation" runat="server" class="state_loader">
3855
3856 <div class="confirm">
3857 <i class="fa fa-paper-plane fa-fw"></i>
3858 </div>
3859 <div class="cancel">
3860 <i class="fa fa-times-circle fa-fw"></i>
3861 </div>
3862 </div>
3863
3864 <div class="name-state">
3865 <label class="confirm-name">SUCCESFULLY REMOVED!</label>
3866 <label class="cancel-name">CANCELLED</label>
3867 </div>
3868
3869 </div>
3870
3871 </div>
3872
3873 </div>
3874
3875 </form>
3876</body>
3877
3878
3879
3880</html>