TIME_DATA_TKS_BOSS.jsp 14.3 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ page import="com.csc.library.database.*,com.csc.library.session.*,com.csc.library.utilities.*,com.csc.library.utility.*"  %>
<%@ include file="../CHECKPROFILE.jsp" %>
<% request.setCharacterEncoding("UTF-8"); %>
<%
	CheckNull chk = new CheckNull();
	CscCalendar now = new CscCalendar();

	UProfile up = null;
	if (session != null){
		up = (UProfile)session.getAttribute("userprofile");
	}

	if (up == null){
		return ;
	}

%>

<html xmlns="http://www.w3.org/1999/xhtml" ng-app='myHR'>
	<head>
		<title>Employee View</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<%=request.getContextPath()%>/EMPVIEW/css/APP_UP/style_apsup.css" />
	</head>
	<body ng-controller='WorkTimeDataForm'>
		<div class='bg-com'></div>
		<div class="emv-headmenu"><jsp:include page="EMV_HEADMENU.jsp" flush="true" /></div>
		
		<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
		<script type='text/javascript' src="../JS/bootstrap.js"></script>
		<script type="text/javascript" src="../JS/SCREEN.js"></script>
		<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
		<script type='text/javascript' src="../public/lib/angular-resource/angular-resource.min.js"></script>
		<script type='text/javascript' src='JS/TIME_DATA_TKS/Module.Controller.js'></script>
		<script type='text/javascript' src='JS/TIME_DATA_TKS/services.js'></script>
		<script type='text/javascript' src='JS/TIME_DATA_TKS/WorkTimeDataForm.Controller.js'></script>
		<script type='text/javascript'>setLang('<%=up.get("lang")%>')</script>
<style>
table {
	display: block;
	overflow-x: auto;
	white-space: nowrap;
	width: 100%;
	background: rgba(84, 163, 255, 0.85);
}
.csc-block-tks {
  display: block;
  float: left;
  width: 100%;
  height: inherit;
  border: 2px solid rgba(84, 163, 255, 0.85);
  background: rgba(84, 163, 255, 0.85);
  margin-bottom: 20px; }
</style>
		<script type='text/javascript'>
		
			function goHelp(helpName,inputName){
				var helpReturn;
			//	var actid = "<%//=actorid%>";
				//var con = "employeeid = '1000180'";
			//	var con = "employeeid = '" + actid + "' or employeeid in (select employeeid from msupervisor where supervisor like ',%25"+actid+"%25,')";
				var con = "bossid='<%=up.get("employeeid")%>'";
				helpReturn="employeeid:employeeid,fullname:fullname";
				linkHelp_Return(helpName, helpReturn, con);
			}
		
		</script>
		
		<section>
			<div class="container csc-content">
				<form name="cscform" class="form-horizontal" method="post" >
					<input type="hidden" name="__cmd" value="">
					<input type="hidden" name="__screen"  value="TIME_DATA_TKS_BOSS">
					<input type="hidden" name="__help" value="">
					<input type="hidden" name="__goPage" value="">
					<input type="hidden" name="__helpReturn" value="">
					<input type="hidden" name="__helpName" value="">
					<input type="hidden" name="__pageCall" >
					<input type="hidden" name="__referPage" value="">
					<input type="hidden" name="__calendar">
					<script language="javascript">getInputFormatDate();</script>
					<input type="hidden" name="__companyid"  value="<%=up.get("companyid")%>">
					<input type="hidden" name="__fixCon" value="">
					<input type="hidden" name="__language" value="<%=up.get("lang")%>">
					<input type="hidden" name="__childFilter" >

					<div>
						<div class='loading-page'>
							<div class='spiner'></div>
						</div>
						
						<div class="form-horizontal">
							<table class="table">
								<tr>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">Working Report (Voucher)</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">
											<input class="form-control" ng-model='employeeid' name="employeeid" readonly value='<%//=up.get("employeeid")%>' size="7">
											<a class="input-group-addon" href="javascript:goHelp('MEMPLOYEEHELP','employeeid')">
												<i class="fa fa-search"></i>
											</a>
											<input class="form-control" name='fullname' readonly value='<%//=up.get("fullname")%>' size="25">
										</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">From</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">
											 <input class="form-control" ng-model='startdate' name="startdate" value='21-09-2017' size="7">
											<a class="input-group-addon" href="javascript:viewCal('startdate')">
												<i class="fa fa-calendar"></i>
											</a>
										</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">To</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">
											<input class="form-control" ng-model='enddate' name="enddate" value='20-10-2017' size="7">
											<a class="input-group-addon" href="javascript:viewCal('enddate')">
												<i class="fa fa-calendar"></i>
											</a>
										</div>
									</th>
									<th font-size='9px' bgcolor='#4B95E6' padding='5px' max-width='100%'> 
										<div class="input-group">
											<button type="button" class="btn btn-primary search-button" ng-click="search()">Search</button>
										</div>
									</th>
								</tr>
							</table>
						</div>

						<div class="form-horizontal">
							<table class="table table-head table-bordered table-title-left" >
								<tbody>
									<tr>
										<th rowspan='2' align='center'>No.</th>
										<th rowspan='2' align='center'>Km.</th>
										<th rowspan='2' align='center'>Project<br>No.<br>(Budget)</th>
										<th align='center'>Site Name<br>(Work Description)</th>
										<th align='center'>Date</th>
										<th ng-repeat='WorkTime in WorkTime'>{{ WorkTime.date }}</th>
										<th rowspan='2' align='center'>Total</th>
									</tr>
									<tr>
										<th align='right'>Address</th>
										<th align='right'>Start:<br>Finish:</th>
										<td ng-repeat='WorkTime in WorkTime'><div align='right'>{{ WorkTime.time_in }}<br>{{ WorkTime.time_out }}</div></td>
									</tr>
								</tbody>
								<tbody ng-repeat='Workplace in Workplace'>
									<tr>
										<td rowspan='4'>{{ Workplace.no }}</td>
										<td rowspan='4'>
											<label><input type="radio" ng-model="Workplace.type" ng-disabled='true' value="A">A</label><br>
											<label><input type="radio" ng-model="Workplace.type" ng-disabled='true' value="B">B</label><br>
											<label><input type="radio" ng-model="Workplace.type" ng-disabled='true' value="C">C</label><br>
											<label><input type="radio" ng-model="Workplace.type" ng-disabled='true' value="D">D</label>
										</td>
										<td rowspan='4' align='center'>{{ Workplace.workplaceid }}</td>
										<td rowspan='4' align='center'>{{ Workplace.sitename }}<br>{{ Workplace.location }}</td>
										<th>Normal</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div ng-if='chkShow(workPlaceDaily.workplaceid, Workplace.workplaceid)' align='center'>{{ chkZero(workPlaceDaily.hour_d, '-') }}</div></td>
										<td align='right'>{{ getTotal(Workplace, 'hour_d') }}</td>
									</tr>
									<tr>
										<th>OT1</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div ng-if='chkShow(workPlaceDaily.workplaceid, Workplace.workplaceid)' align='center'>{{ chkZero(workPlaceDaily.ot1, '-') }}</div></td>
										<td align='right'>{{ getTotal(Workplace, 'ot1') }}</td>
									</tr>
									<tr>
										<th>OT1.5</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div ng-if='chkShow(workPlaceDaily.workplaceid, Workplace.workplaceid)' align='center'>{{ chkZero(workPlaceDaily.ot5, '-') }}</div></td>
										<td align='right'>{{ getTotal(Workplace, 'ot5') }}</td>
									</tr>
									<tr>
										<th>OT3</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div ng-if='chkShow(workPlaceDaily.workplaceid, Workplace.workplaceid)' align='center'>{{ chkZero(workPlaceDaily.ot3, '-') }}</div></td>
										<td align='right'>{{ getTotal(Workplace, 'ot3') }}</td>
									</tr>
								</tbody>
								<tbody>
									<tr>
										<th colspan='4' rowspan='5'><div align='right'>Working Hour</div></th>
										<th>Normal</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ chkZero(workPlaceDaily.hour_d, '-') }}</div></td>
										<td align='right'>{{ getSumTotal(Workplace, 'hour_d') }}</td>
									</tr>
									<tr>
										<th>OT1</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ chkZero(workPlaceDaily.ot1, '-') }}</div></td>
										<td align='right'>{{ getSumTotal(Workplace, 'ot1') }}</td>
									</tr>
									<tr>
										<th>OT1.5</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ chkZero(workPlaceDaily.ot5, '-') }}</div></td>
										<td align='right'>{{ getSumTotal(Workplace, 'ot5') }}</td>
									</tr>
									<tr>
										<th>OT3</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ chkZero(workPlaceDaily.ot3, '-') }}</div></td>
										<td align='right'>{{ getSumTotal(Workplace, 'ot3') }}</td>
									</tr>
									<tr>
										<th>Total</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ getTotalWorkPlaceDaily(workPlaceDaily) }}</div></td>
										<td align='right'>{{ getSumTotalWorkPlaceDaily(Workplace) }}</td>
									</tr>
								</tbody>
								<tbody>
									<tr>
										<th colspan='5'><div align='right'>Approve Status</div></th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>
											<label><input type="radio" ng-model="workPlaceDaily.approve_status" value="0">No&nbsp;</label><br>
											<label><input type="radio" ng-model="workPlaceDaily.approve_status" value="1">Yes</label>
										</div></td>
										<td align='right'></td>
									</tr>
								</tbody>
								<tbody>
									<tr>
										<th colspan='5'><div align='right'>Direct Construction Allowance</div></th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center'>{{ chkZero(workPlaceDaily.direct_con, '-') }}</div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'direct_con') }}</td>
									</tr>
								</tbody>
								<tbody>
									<tr>
										<th colspan='4' rowspan='3'><div align='right'>Up Country Allowance</div></th>
										<th>100 - 300 Km.</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.type=="B"'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.up_country'/></div></td>
										<td rowspan='3' align='right'>{{ getSumTotal(workPlaceDaily, 'up_country') }}</td>
									</tr>
									<tr>
										<th>301 - 600 Km.</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.type=="C"'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.up_country'/></div></td>
									</tr>
									<tr>
										<th>Over 600 Km.</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.type=="D"'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.up_country'/></div></td>
									</tr>
								</tbody>
								<tbody>
									<tr>
										<th colspan='4' rowspan='6'><div align='right'>Car Expense</div></th>
										<th>Date</th>
										<th ng-repeat='WorkTime in WorkTime'>{{ WorkTime.date }}</th>
										<td align='center'>Total</td>
									</tr>
									<tr>
										<th>Gasoline (Baht)</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.distance>0'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.gas_b'/></div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'gas_b') }}</td>
									</tr>
									<tr>
										<th>Gasoline (L)</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.distance>0'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.gas_l'/></div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'gas_l') }}</td>
									</tr>
									<tr>
										<th>Express Way</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.distance>0'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.express_way'/></div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'express_way') }}</td>
									</tr>
									<tr>
										<th>Parking</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.distance>0'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.parking'/></div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'parking') }}</td>
									</tr>
									<tr>
										<th>KM</th>
										<td ng-repeat='workPlaceDaily in workPlaceDaily'><div align='center' ng-if='workPlaceDaily.hour_d>0 && workPlaceDaily.distance>0'><input type='text' size='1' ng-disabled='workPlaceDaily.approve_status=="1"' ng-model='workPlaceDaily.km'/></div></td>
										<td align='right'>{{ getSumTotal(workPlaceDaily, 'km') }}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div align='center'><button type="button" class="btn btn-primary save-button" ng-click="save()">Save</button></div>
						<div class='spece-bot'></div>
					</div>
				</form>
				<a href="#top" id="top-button"><i class="fa fa-angle-up"></i><div class="top-word">Back to top</div></a>
			</div>
		</section>
		<div><jsp:include page="FOOTER.jsp" flush="true" /></div>
	</body>
</html>