hrmis /promotion/func.php

Language PHP Lines 534
MD5 Hash 2e67d1b14a6eb9ab78ce303e092ba5de Estimated Cost $11,764 (why?)
Repository https://bitbucket.org/lecturer34/hrmis View Raw File View Project SPDX
  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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
<?php
function getlastpromotiondate($personnelid) {
$sql = "SELECT * FROM  tblpromotions where employeeid='$personnelid'  and promtiontypeid in(1,2,3,4,5) order by effectivedate DESC" ;
    $result = mysql_query($sql);
	if(mysql_num_rows($result)>0){
	return mysql_result($result,0,'effectivedate');
	}
	else
	{
	return "--";
	}

}
function getpnumber($personnelid) {
$sql = "SELECT * FROM  tblpromotions where employeeid='$personnelid'  order by effectivedate DESC" ;
    $result = mysql_query($sql);
	if(mysql_num_rows($result)>0){
	return mysql_result($result,0,'personnelno');
	}
	else
	{
	return "--";
	}

}



function getYear() {
$year = date('Y');
$endyear=$year-10;
    while($year > $endyear){
        echo '<option value = "'.$year.'">'.$year.'</option>';
		$year--;
    }
}

function getCadre() {
    $sql = "SELECT * FROM  tblcadre order by name ASC" ;
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $cadreid = $row['cadreid'];
        $name = $row['name'];
        echo '<option value = "'.$cadreid.'">'.$name.'</option>';
    }
}

function getComplex() {
    $sql = "SELECT * FROM  tblcomplex order by name ASC";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $complexid = $row['complexid'];
        $name = $row['name'];
        echo '<option value = "'.$complexid.'">'.$name.'</option>';
    }
}

function getFaculty() {
    $sql = "SELECT * FROM  tblfaculty";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $facultyid = $row['facultyid'];
        $name = $row['name'];
        echo '<option value = "'.$facultyid.'">'.$name.'</option>';
    }
}

function getDepartment() {
    $sql = "SELECT * FROM tbldepartment JOIN tblfaculty ON ";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $departmentid = $row['departmentid'];
        $name = $row['name'];
        echo '<option value = "'.$departmentid.'">'.$name.'</option>';
    }
}
function getFaculties() {
    $sql = "SELECT * FROM  tblfaculty";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $facultyid = $row['facultyid'];
        $name = $row['name'];
        echo '<option value = "'.$facultyid.'">'.$name.'</option>';
    }
}

function getDepartments($facid) {
    $sql = "SELECT * FROM tbldepartment where facultyid = $facid";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $departmentid = $row['departmentid'];
        $name = $row['name'];
        echo '<option value = "'.$departmentid.'">'.$name.'</option>';
    }
}
function getStaffs($deptid) {
    $sql = "SELECT * FROM tblemployee where department = $deptid";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
		$fullname = $row['surname']." ". $row['firstname']." ". $row['othernames'];
		$name = $row['name'];
		$empid= $row['employeeid'];
        echo '<option value = "'.$empid.'">'.$fullname.'</option>';
    }
}

function getUnit() {
    $sql = "SELECT * FROM tblunits";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $unitid = $row['unitid'];
        $unitname = $row['unitname'];
        echo '<option value = "'.$unitid.'">'.$unitname.'</option>';
    }
}


function getReason() {
    $sql = "SELECT * FROM tblnotqualifiedreason";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $reasonid = $row['reasonid'];
        $reasondesc = $row['reasondesc'];
        echo '<option value = "'.$reasonid.'">'.$reasondesc.'</option>';
    }
}

function getRank() {
    $sql = "SELECT * FROM tblrank";
    $result = mysql_query($sql);
    while($row = mysql_fetch_array($result)) {
        $rankid = $row['rankid'];
        $rankname = $row['name'];
        echo '<option value = "'.$rankid.'">'.$rankname.'</option>';
    }
}

function getRankName($rid) {
    $sql = "SELECT name FROM tblrank where rankid = $rid limit 1";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
        $rankname = $row['name'];
		return $rankname;
    }

function getStep() {
    for($i=1; $i<16; $i++){
        echo '<option value = "'.$i.'">'.$i.'</option>';
    }
}


function getCurSalary($empid, $gr, $yr)
	{
		//queries the categoryid (academic or non academic) from the database
		$sql= "select categoryid from tblpromotions inner join tblrank on (tblpromotions.rank = tblrank.rankid) inner join tblcadre on (tblrank.cadreid = tblcadre.cadreid) where employeeid = $empid limit 1";
		$result = mysql_query($sql);
		$row= mysql_fetch_array($result);
		$category = $row['categoryid'];
		$category2= ($category== 1)?"CONUASS":"CONTISS";
				
		//gets the latest salary implementation before or during $yr for the above category
		$cat = ($category== 1)?'CONUASS':'CONTISS';
		$sql= "select * from tblsalarytable where year(effectivedate) <= '$yr' && category = '$cat' order by effectivedate desc limit 1";
		$result = mysql_query($sql);
		$row= mysql_fetch_array($result);
		$imp_dt = $row['effectivedate'];
		$salaryid =$row['salaryid'];
		
		$sql = "select tblpromotions.rank, step, tblsalarytable.salaryid, tblpromotions.effectivedate, tblrank.grade
				from tblpromotions inner join tblrank on(tblpromotions.rank = tblrank.rankid) inner join tblcadre on (tblrank.cadreid=tblcadre.cadreid) inner join tblsalarytable on (tblsalarytable.salaryid = tblpromotions.salaryid) where tblpromotions.employeeid = $empid && tblpromotions.effectivedate <= '$imp_dt'order by tblpromotions.effectivedate desc ";
		//echo $sql;
		$result = mysql_query($sql);
		if (mysql_num_rows($result)==0) return;
		$row = mysql_fetch_array($result);
		$grade = $row['grade'];
		$level = $row['step'];
		//$effdt = $row['effectivedate'];
		
		$grade2 = ($grade<10)?"0".$grade:$grade;
		
		$sql2="select amount from tblsalaryplacement where salaryid = $salaryid && grade= '$grade' && step = '$level'";
		//echo $sql2;
		$result2 = mysql_query($sql2);
		$row2 =mysql_fetch_array($result2);
		$curamt = $row2["amount"];	
		
		$sql3="select step, amount from tblsalaryplacement where amount> $curamt && salaryid= $salaryid && grade = '$gr' order by grade, step limit 1";
		//echo $sql3;
		$result3 = mysql_query($sql3);
		$row3 =mysql_fetch_array($result3);
		$newlvl = $row3["step"];
		$newamt = $row3["amount"];
		$arr = array("grade" => $grade, "grade2" => $grade2, "step" => $level, "category" => $category, "category2" => $category2, "empid" => $empid, "newlvl" => $newlvl, "curamt" => $curamt, "newamt" => $newamt, "sid"=> $salaryid);
		
		return $arr;
	}
	
function getSalary($g, $l, $sid)
	{
		$sql2="select amount from tblsalaryplacement where grade= '$g' && step = '$l' && salaryid = '$sid' limit 1";
		$result2 = mysql_query($sql2);
		$row2 =mysql_fetch_array($result2);
		$curamt = $row2["amount"];	
		
		return $curamt;
	}
	
function getCadreCategory($cadre){
//$cadre=$_SESSION['A_cadre'];
$categ = "";
$query = "SELECT categoryid FROM tblcadre WHERE cadreid = '$cadre'";
$result = @mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)>0){
		$row = mysql_fetch_array($result);
		if ($row['categoryid'] == 1)
			$categ = 'CONUASS'; 
		elseif ($row['categoryid'] == 2)
			$categ = 'CONTISS';
	return $categ;
	}
}

function getComplexName($complex){
	$query = "SELECT name FROM tblcomplex WHERE complexid = '$complex'";
	$result = @mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($result)>0){
		$row = mysql_fetch_array($result);
		$complexname = $row['name'];
		return $complexname; 
	}
}

function getDepartmentName($dept){
	$query = "select name from tbldepartment where departmentid = '$dept'";
	$result = @mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($result)>0){
		$row = mysql_fetch_array($result);
		$deptname = $row['name'];
		return $deptname;
	}
}

function getComplexChairman($complex){
	$complexchairname=""; 
	$query = "SELECT tblemployee.firstname, tblemployee.surname, tblemployee.othernames FROM tblemployee
	INNER JOIN tblpromotions ON tblpromotions.employeeid = tblemployee.employeeid 
	INNER JOIN tblusers_n ON tblusers_n.Pjpno = tblpromotions.personnelno
	WHERE (tblusers_n.complexid = '$complex' AND tblusers_n.mosition = 'Chairman')";
	
	$result = @mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($result)>0){
		$row = mysql_fetch_array($result);
	}
	$complexchairname = $row['firstname']." ".$row['othernames']." ".strtoupper($row['surname']);
	return $complexchairname;
}

function getHOD($dept){
	$hodname ="";
	$query = "SELECT tblemployee.firstname, tblemployee.surname, tblemployee.othernames FROM tblemployee
	inner join tblpromotions on tblpromotions.employeeid = tblemployee.employeeid 
	INNER JOIN tbldepartment ON tbldepartment.departmentid=tblemployee.department
	INNER JOIN tblhods ON tblhods.personnelno = tblpromotions.personnelno
	WHERE (tblhods.departmentid = '$dept')";
	$result = @mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($result)>0){
		$row = mysql_fetch_array($result);
	}
	$hodname = $row['firstname']." ".$row['othernames']." ".strtoupper($row['surname']);
	return $hodname;
}


function generateSummary($employeeid, $year,$cadre, $complex, $dept){
//global $cadre, $complex, $faculty,$dept,$year;
//echo $complex."complex , ".$cadre." ".$faculty." ".$dept." ".$year.",".$employeeid;


$t = getCadreCategory($cadre);
$complexchair = getComplexChairman($complex);
$hod = getHOD($dept);
$complexname = getComplexName($complex);
echo '
<table border = "1" style ="width:90%" align = "center"> 
<caption><h4 style="text-align:center">AHMADU BELLO UNIVERSITY, ZARIA-NIGERIA<br /><br /><br />Case of Recomendation for the year ' .$year. ' Promotion Exercise</h4>
<br /><h4 style = "text-align:left;">SUMMARY SHEET<br /><br />COMPLEX:'.$complexname.'</h4><br /><br /></caption> 
<tr>  
            <th >Title</th>  
            <th>Name:</th>  
            <th>P. No:</th>  
            <th width="15%">Qualification with Dates</th>  
            <th>Date of First Appointment and Rank</th>  
            <th>Date of confirmation of Appointment</th>  
            <th>Present Rank and Salary with step</th>  
            <th>Date of last promotion and number of publications since then</th>  
            <th>1998 guideline requirements for promotion and candidates&acute; Attainment/Performance</th>  
            <th>No. of Students supervised. i.e Ph.D and /Master and level reached to date</th>  
            <th>Complex Recommendation</th>  
          </tr> ';
//query to employee details
$query = "SELECT tblemployee.firstname, tblemployee.surname, tblemployee.othernames, tblrank.name as rankname, 
tblemployee.dateoffirstappointment, tblconfirmation.dateofconfirmation, tblpromotions.personnelno
FROM tblemployee INNER JOIN tblpromotions ON tblpromotions.employeeid = tblemployee.employeeid
LEFT JOIN tblconfirmation ON tblemployee.employeeid = tblconfirmation.employeeid
INNER JOIN tblrank ON tblrank.rankid = tblemployee.rankonemployment
INNER JOIN tblrecommendations ON tblrecommendations.employeeid = tblemployee.employeeid 
WHERE tblrecommendations.year = '$year' AND tblemployee.employeeid = '$employeeid'";
//echo $query;

$result = @mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)>0){
$row = mysql_fetch_array($result);
$empfirstname = $row['firstname'];
$empsurname = $row['surname'];
$empothernames = $row['othernames'];
$rankonemployment = $row['rankname'];
$firstappointmentdate = $row['dateoffirstappointment'];
$confirmationdate = $row['dateofconfirmation'];
$pno = $row['personnelno'];
}
 
$query = "SELECT tblrank.name, tblrank.grade, tblrecommendations.effectivedate FROM tblrank 
INNER JOIN tblrecommendations ON tblrecommendations.rankinview = tblrank.rankid 
INNER JOIN tblemployee ON tblemployee.employeeid = tblrecommendations.employeeid
WHERE (tblrank.cadreid = '$cadre' and tblemployee.employeeid = '$employeeid' and tblrecommendations.year = '$year')"; 
$result = @mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)>0){
$row = mysql_fetch_array($result);
$rankinview = $row['name'];
$gradeinview = $row['grade'];
$effectivedate=$row['effectivedate'];
}


$currank=curentrank($employeeid, $year);
$presentrank = $currank[1];
$presentgrade = $currank[2];
$presentstep=$currank[3];

        
echo  '<tr><td></td><td>'.$empsurname.',&nbsp;'.$empfirstname.'&nbsp;'.$empothernames.'</td><td>'.$pno.'</td>'; 
$query = "SELECT YEAR(tblqualification.yearobtained) as yearobtained , tblqualification.institutionobtained,
tblqualification.course, tblqualificationtypes.description FROM tblqualification
INNER JOIN tblemployee ON tblqualification.employeeid = tblemployee.employeeid
INNER JOIN tblqualificationtypes ON tblqualificationtypes.id=tblqualification.qualificationtype 
WHERE tblemployee.employeeid = '$employeeid'";
$result = @mysql_query($query) or die(mysql_error());			
            echo '<td width="15%">';
			if (mysql_num_rows($result)>0){
			while ($row = mysql_fetch_array($result))
			echo $row['description'].'('.$row['course'].')<br />'.$row['institutionobtained']. 
			  '<br />'.$row['yearobtained'].'<br />';
			  } 
			echo '</td>`<td>'.$firstappointmentdate.'&nbsp;'.$rankonemployment.'</td>  
            <td>'.$confirmationdate.'</td>'; 
            echo '<td>'.$presentrank.'<br />'.$t.' '.$presentgrade.'/'.$presentstep.'</td>';  
			
			$query = "SELECT MAX(effectivedate) AS lastpromotiondate FROM tblpromotions WHERE personnelno = '$pno' ORDER BY date DESC LIMIT 1 " ;
            $result = @mysql_query($query) or die(mysql_error());
			if (mysql_num_rows($result)>0){
			$row = mysql_fetch_array($result);
			$lastpromotiondate = $row['lastpromotiondate'];
			}
			echo '<td>'.$lastpromotiondate.'<br />';
			
			$query = "SELECT eventoractivity, count(eventoractivity) as pubcountsincelastpromotion FROM tblpublictiontype INNER JOIN tbljournalspublication ON 
tbljournalspublication.typeid = tblpublictiontype.publictiontypeid
INNER JOIN tblemployee ON tblemployee.employeeid = tbljournalspublication.employeeid
WHERE tblemployee.employeeid = '$employeeid' AND tbljournalspublication.publicationdate >= '$lastpromotiondate' GROUP BY tblpublictiontype.eventoractivity";
$result = @mysql_query($query) or die(mysql_error());
			if (mysql_num_rows($result)>0){
			while ($row = mysql_fetch_array($result))
				echo $row['pubcountsincelastpromotion']." ".$row['eventoractivity'].'<br />';
			}
			echo '</td>';  
			
			$query = "SELECT eventoractivity, count(eventoractivity) as pubcount FROM tblpublictiontype INNER JOIN tbljournalspublication ON 
tbljournalspublication.typeid = tblpublictiontype.publictiontypeid
INNER JOIN tblemployee ON tblemployee.employeeid = tbljournalspublication.employeeid
WHERE tblemployee.employeeid = '$employeeid' GROUP BY tblpublictiontype.eventoractivity";
$result = @mysql_query($query) or die(mysql_error());
            echo '<td>';
			if (mysql_num_rows($result)>0){
			while ($row = mysql_fetch_array($result))
				echo $row['pubcount']." ".$row['eventoractivity'].'<br />';
			  }
			echo '</td>'; 
			
$query = "SELECT  count(tblsupervision.stdegree) AS numbersupervised, tblqualifications_lookup.certificate, tblsupervision.supervisortype, tblsupervision.status FROM tblsupervision INNER JOIN
tblemployee on tblemployee.employeeid = tblsupervision.employeeid
INNER JOIN tblqualifications_lookup ON tblqualifications_lookup.id = tblsupervision.stdegree
 WHERE tblemployee.employeeid = '$employeeid' GROUP BY stdegree, supervisortype,  status ORDER BY status DESC";	
$result = @mysql_query($query) or die(mysql_error());		
           echo ' <td>'; 
			if (mysql_num_rows($result)>0){
			while ($row = mysql_fetch_array($result))
				echo $row['numbersupervised'].'&nbsp;'.$row['certificate'].'&nbsp;'.$row['supervisortype'].'&nbsp;'.$row['status'].'<br />';
			}
			echo '</td>';  
			
           echo '<td>Recommended for promotion to the rank of '.$rankinview.' with from effective date '.$effectivedate.' on salary
			'.$t." ".$gradeinview.'</td> </tr> </table>  ';
			echo '  <br /><br /><div class="row "><div class="pull-left ">'.$hod.'<br />Head of Department</div>
			<div class="pull-right">'.$complexchair.'<br />Chairman,'.$complexname.'Complex</div></div>';
   
}





function generatePromotionLetter($employeeid, $year){
//$cadre=$_SESSION['A_cadre'];
global $cadre, $complex, $faculty,$dept,$year;

$t = getCadreCategory($cadre);

//query to employee details
$query = "SELECT tblemployee.firstname, tblemployee.surname, tblemployee.othernames, tblpromotions.personnelno,
tblrank.name AS newrank, tblrank.grade AS newgrade, tblrecommendations.effectivedate, 
YEAR(tblrecommendations.effectivedate) AS nyear, tbldepartment.name AS deptname
FROM tblemployee INNER JOIN tblpromotions ON tblpromotions.employeeid = tblemployee.employeeid
INNER JOIN tblrecommendations ON tblrecommendations.employeeid = tblemployee.employeeid
INNER JOIN tbldepartment ON tbldepartment.departmentid = tblemployee.department
INNER JOIN tblrank ON tblrank.rankid = tblrecommendations.rankinview
WHERE tblrecommendations.year = '$year' AND tblemployee.employeeid = '$employeeid' AND tblrank.cadreid = '$cadre'";
$result = @mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)>0){
$row = mysql_fetch_array($result);
$empfirstname = $row['firstname'];
$empsurname = $row['surname'];
$empothernames = $row['othernames'];
$newrank = $row['newrank'];
$newgrade = $row['newgrade'];
$effectivedate = $row['effectivedate'];
$pno = $row['personnelno'];
$nextyear = $row['nyear']+1;
$deptname = $row['deptname'];
}
echo '<table width="70%" align="center"><tr><td>
<br /><br /><br /><br />
<div class="row span9"><div class="pull-left"><h4>'.$pno.'</h4></div><div class="pull-right"><h4>'.date('Y-m-d').'</h4></div></div>
<p>'.$empfirstname." ".$empothernames." ".$empsurname.'<br /> Department of '.$deptname.'<br />Ahmadu Bello Uinersity, <br />Zaria.<br /><br />Dear Sir/Madam,<br /><br /></p>
<h3>PROMOTION</h3><br /><br />
<p>I am writing to inform you that the Appointments and Promotions Committee has approved your 
promotion to the rank of '.$newrank.' on '.$t.' '.$newgrade.' at the salray of ...... per annum with 
effect from '.$effectivedate.' your next increment is effective on 1<sup>st</sup> October, '.$nextyear.'</p><br /><br />
<p>All the remaining conditions of your present appointment remain unchanged.</p>
<p>Please, accept my congratulations.</p>
<p>Yours faithfully,</p>
<br /><br />
<h4>Name here </h4>
<p>Deputy Registrar<br />
Human Resources Development</p>
<br /><br />
<p>
cc:Vice-Chancellor<br />
cc:Bursar<br />
cc:CHief Internal Auditor<br />
cc:Head, Department of '.$deptname.'<br />
cc:Chairman, '.getComplexName($_SESSION['A_complex']).'<br />
cc:Housing and Passages<br />
cc:Coordinator, M.I.S.<br />
cc:Computer Room, Registry
</p>

<p>&nbsp;&nbsp;&nbsp;Case No. ....</p>

</td></tr></table>';
} 

function generateNotificationLetter($employeeid, $year){
//$cadre=$_SESSION['A_cadre'];
global $cadre, $complex, $faculty,$dept,$year;

$t = getCadreCategory($cadre);

//query to employee details
$query = "SELECT tblemployee.firstname, tblemployee.surname, tblemployee.othernames, tblpromotions.personnelno,
tblrank.name AS newrank, tblrank.grade AS newgrade, tblrecommendations.effectivedate, 
YEAR(tblrecommendations.effectivedate) AS nyear, tbldepartment.name AS deptname
FROM tblemployee INNER JOIN tblpromotions ON tblpromotions.employeeid = tblemployee.employeeid
INNER JOIN tblrecommendations ON tblrecommendations.employeeid = tblemployee.employeeid
INNER JOIN tbldepartment ON tbldepartment.departmentid = tblemployee.department
INNER JOIN tblrank ON tblrank.rankid = tblrecommendations.rankinview
WHERE tblrecommendations.year = '$year' AND tblemployee.employeeid = '$employeeid' AND tblrank.cadreid = '$cadre'";
$result = @mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)>0){
$row = mysql_fetch_array($result);
$empfirstname = $row['firstname'];
$empsurname = $row['surname'];
$empothernames = $row['othernames'];
$newrank = $row['newrank'];
$newgrade = $row['newgrade'];
$effectivedate = $row['effectivedate'];
$pno = $row['personnelno'];
$nextyear = $row['nyear']+1;
$deptname = $row['deptname'];
}
echo '<table width="70%" align="center"><tr><td>
<br /><br /><br /><br />
<div class="row span9"><div class="pull-left"><h4>'.$pno.'</h4></div><div class="pull-right"><h4>'.date('Y-m-d').'</h4></div></div>
<p>'.$empfirstname." ".$empothernames." ".$empsurname.'<br /> Department of '.$deptname.'<br />Ahmadu Bello Uinersity, <br />Zaria.<br /><br />Dear Sir/Madam,<br /><br /></p>
<h3>NOTIFICATION</h3><br /><br />
<p>I am writing to inform you that the Appointments and Promotions Committee has approved your 
promotion to the rank of '.$newrank.' on '.$t.' '.$newgrade.' at the salray of ...... per annum with 
effect from '.$effectivedate.' your next increment is effective on 1<sup>st</sup> October, '.$nextyear.'</p><br /><br />
<p>All the remaining conditions of your present appointment remain unchanged.</p>
<p>Please, accept my congratulations.</p>
<p>Yours faithfully,</p>
<br /><br />
<h4>Name here </h4>
<p>Deputy Registrar<br />
Human Resources Development</p>
<br /><br />
<p>
cc:Vice-Chancellor<br />
cc:Bursar<br />
cc:CHief Internal Auditor<br />
cc:Head, Department of '.$deptname.'<br />
cc:Chairman, '.getComplexName($_SESSION['A_complex']).'<br />
cc:Housing and Passages<br />
cc:Coordinator, M.I.S.<br />
cc:Computer Room, Registry
</p>

<p>&nbsp;&nbsp;&nbsp;Case No. ....</p>

</td></tr></table>';
} 

?>
Back to Top