-
Notifications
You must be signed in to change notification settings - Fork 0
/
addprojstakeholders.php
executable file
·365 lines (313 loc) · 8.74 KB
/
addprojstakeholders.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<?php
session_name("Project");
session_start();
require_once('dbconn.php');
if(!checkUserSession($_SESSION["user"]))
{
header("Location:login.php");
}
if(checkProjectPermission("STAKE") == false)
{
header("Location:error.php");
}
$projid=$_GET["proj_id"];
$coned=getConnection();
$sqled="
select id,b.project_type,c.name customer,project_name,
concat(d.emp_firstname,' ',d.emp_lastname) pm,base_product,
ifnull(Budget,0) budget , ifnull(Excess_budget,0) excess_budget,
Contract_value,License_value,
tlr,extension,
concat(e.emp_firstname,' ',e.emp_lastname) crt_by,
a.status, c.customer_id,report_type,b.project_type_id,project_manager_id,project_director_id,
Planned_start_date,Planned_End_date,Actual_Start_Date sdt,Actual_End_Date edt,
Objectives, Scope, success_factor, docurl
from project_details a
inner join project_type b on a.project_type_id = b.project_type_id
inner join hr_mysql_live.ohrm_customer c on a.ohrm_customer_id= c.customer_id
inner join hr_mysql_live.hs_hr_employee d on a.project_manager_id= d.emp_number
inner join hr_mysql_live.hs_hr_employee e on a.Project_created_by= e.emp_number
where id = ".$projid ;
$resulted = mysqli_query($coned,$sqled) or debug($sqled." failed <br/><br/>".mysql_error());
$rowed = mysqli_fetch_array($resulted);
?>
<html>
<head>
<script>
function show()
{
alert('hello');
return;
document.getElementById('txtDetails').removeChild(document.getElementById('finance'));
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById('txtDetails').removeChild(document.getElementById('ajaxloader'));
document.getElementById("txtDetails").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getrisklist.php?q="+str,true);
function BeginLoading(){
var eLoader = document.createElement("img");
eLoader.src = "images/loader.gif";
eLoader.alt = "";
eLoader.id = "ajaxloader";
document.getElementById('txtDetails').appendChild(eLoader);
xmlhttp.send();
}
BeginLoading();
}
function showProjectType()
{
alert('hello');
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtType").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getprojtype.php",true);
xmlhttp.send();
}
function showPM()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtProjMan").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getemp.php?emptype=empPM",true);
xmlhttp.send();
}
function showPD()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtProjDir").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getemp.php?emptype=empPD",true);
xmlhttp.send();
}
function showProject(str)
{
if(str=='Choose..')
return;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtProj").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getprojectnew.php?q="+str,true);
xmlhttp.send();
}
function showCustomer()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtCust").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getcustomer.php",true);
xmlhttp.send();
}
</script>
</head>
<body>
<?php
include 'header.php';
?>
<tr>
<br>
<td>
<font size="3" face="arial"><b>Update Project Stakeholders</b></font>
</td>
<?php
if($rowed[tlr]=="GREEN")
echo "<td ><img src='images/green.jpg' alt='red' width='40' height='40'</img></td>";
if($rowed[tlr]=="RED")
echo "<td ><img src='images/red.jpg' alt='red' width='40' height='40'</img></td>";
if($rowed[tlr]=="AMBER")
echo "<td ><img src='images/amber.jpg' alt='red' width='40' height='40'</img></td>";
$_GET['projid']=$projid;
include 'operproj.php';
?>
</tr>
<form name="projectForm" action="updateprojstake.php" method="post" onsubmit="return formSubmit();" >
<table>
<tr>
<td>Project Type : </td>
<td>
<?php
include 'getprojtype.php'; ?>
</td>
<td>Base Product : </td>
<td>
<?php
include 'getprodtype.php'; ?>
</td>
</tr>
<tr>
<td>Report Period : </td>
<td>
<select id='rpttype' name='rpttype' value =''>
<option value='Choose..' selected='selected'>Choose...</option>
<option value='WEEKLY'>WEEKLY</option>
<option value='FORTNIGHTLY'>FORTNIGHTLY</option>
<option value='MONTHLY'>MONTHLY</option>
<option value='QUARTERLY'>QUARTERLY</option>
</select>
<?php
echo "<b><input name='proj_id' id='proj_id' type='hidden' value='$projid'></b>";
echo "<b><input name='prevstatus' id='prevstatus' type='hidden' value='$rowed[status]'></b>";
echo "<b><input name='byFld' id='byFld' type='hidden' value='project_modified_by'></b>";
echo "<b><input name='statuschg' id='statuschg' type='hidden' value='ACTIVE'></b>";
echo "<b><input name='onFld' id='onFld' type='hidden' value='project_modified_on'></b>";
?>
</td>
</tr>
<?php
echo "<script>document.getElementById('projtype').value = '$rowed[project_type_id]';</script>";
echo "<script>document.getElementById('projtype').disabled=true;</script>";
echo "<script>document.getElementById('rpttype').value = '$rowed[report_type]';</script>";
echo "<script>document.getElementById('rpttype').disabled=true;</script>";
echo "<script>document.getElementById('prod').value = '$rowed[base_product]';</script>";
echo "<script>document.getElementById('prod').disabled=true;</script>";
?>
<tr>
<td>Customer : </td>
<td>
<?php
include 'getcustomer.php'; ?>
</td>
<td>Project : </td>
<td> <input type = "text" id='proj' name='proj' size='50'></td>
</tr>
<tr>
</tr>
<?php
echo "<script>document.getElementById('cust').value = '$rowed[customer_id]';</script>";
echo "<script>document.getElementById('cust').disabled=true;</script>";
echo "<script>document.getElementById('proj').value = '$rowed[project_name]';</script>";
echo "<script>document.getElementById('proj').disabled=true;</script>";
?>
<tr>
<td>Project Manager : </td>
<td>
<?php
$_GET['q']='pm';
include 'getemp.php'; ?>
</td>
<td>Project Director : </td>
<td>
<?php
$_GET['q']='pd';
include 'getemp.php'; ?>
</td>
</tr>
<?php
echo "<script>document.getElementById('pm').value = '$rowed[project_manager_id]';</script>";
echo "<script>document.getElementById('pm').disabled=true;</script>";
echo "<script>document.getElementById('pd').value = '$rowed[project_director_id]';</script>";
echo "<script>document.getElementById('pd').disabled=true;</script>";
?>
<tr>
<td>Project Status : </td>
<td>
<select id='statusx' name='statusx' value =''>
<option value='Choose..' selected='selected'>Choose...</option>
<option value='INITIATED'>INITIATED</option>
<option value='ACTIVE'>ACTIVE</option>
<option value='CLOSED'>CLOSED</option>
<option value='INITIATE CLOSURE'>INITIATE CLOSURE</option>
<option value='AUTHORISE CLOSURE'>AUTHORISE CLOSURE</option>
<option value='WARRANTY'>WARRANTY</option>
<option value='DELIVERED'>DELIVERED</option>
<option value='AUTHORISED'>AUTHORISED</option>
<option value='APPROVED'>APPROVED</option>
</select>
</td>
<?php
echo "<script>document.getElementById('statusx').value = '$rowed[status]';</script>";
echo "<script>document.getElementById('statusx').disabled=true;</script>";
?>
</tr>
<tr>
<td>Project Stakeholder : </td>
<td>
<?php
$_GET['q']='';
include 'getemp1.php'; ?>
</td>
<td>
<input type="submit" value="Update Stakeholder">
</td>
</tr>
<tr>
<td><div id="txtDetails"><b></b></div></td>
<?php echo"<script>show();</script>";?>
</tr>
</table>
<td>
</td>
</form>
</body>
</html>