81 lines
3.3 KiB
PHP
81 lines
3.3 KiB
PHP
<?php
|
|
include('pdf_header.php');
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
//include('includes/config/config.php');
|
|
//include('includes/functions.php');
|
|
include("pdf_ohc_header.php");
|
|
?>
|
|
<table width="100%" >
|
|
<tr><div style="font-size:12px">
|
|
<td width="25%" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
|
|
<td width="50%" align="center" style="font-size:20px"><strong>Assign Training Pdf</strong></td>
|
|
<td width="25%" align="left"> User : <?php echo $username ?></td>
|
|
</tr>
|
|
</table>
|
|
<table border="1">
|
|
<?php
|
|
$sql=base64_decode($filterkey);
|
|
error_log("query: ".$sql);
|
|
$result = @mysqli_query($conn,$sql);
|
|
//echo $result;
|
|
|
|
?><tr bgcolor='#eeeeee'><th width=5%>Id</th><th width=15%>Credit To</th><th width=20%>Employee Categories</th><th width=20%>Employee Name</th><th width=25%>Training Schedule</th><th width=15%>Assign Date</th>
|
|
</tr><?php
|
|
while($row_traning=mysqli_fetch_array($result)){
|
|
$date_assigned= date_format(date_create($row_traning['date_assigned']),"d-M-Y");
|
|
$credit_to=$row_traning['credit_to'];
|
|
$credit_to_name="";
|
|
if($credit_to=="1"){
|
|
$credit_to_name="All Employees";
|
|
|
|
}else if($credit_to=="2"){
|
|
$credit_to_name="Employee Categories";
|
|
}else if($credit_to=="3"){
|
|
$credit_to_name="Specific Employee";
|
|
}
|
|
|
|
$employee_categories="";
|
|
$emp_cat_ids=array();
|
|
if($row_traning['emp_cat_id']!=null && $row_traning['emp_cat_id']!=""){
|
|
$emp_cat_ids= explode(",",$row_traning['emp_cat_id']);
|
|
|
|
for($i=0;$i<count($emp_cat_ids);$i++){
|
|
if($i==count($emp_cat_ids)-1)
|
|
$employee_categories.=getTableFieldValue('employee_category','emp_cat_name','emp_cat_id',$emp_cat_ids[$i]);
|
|
else
|
|
$employee_categories.=getTableFieldValue('employee_category','emp_cat_name','emp_cat_id',$emp_cat_ids[$i]).",";
|
|
}
|
|
}
|
|
|
|
$employee_name="";
|
|
$emp_name_ids=array();
|
|
if($row_traning['employee_id']!=null && $row_traning['employee_id']!=""){
|
|
$emp_name_ids= explode(",",$row_traning['employee_id']);
|
|
|
|
for($i=0;$i<count($emp_name_ids);$i++){
|
|
if($i==count($emp_name_ids)-1)
|
|
$employee_name.=getTableFieldValue('patient_master','patient_name','id',$emp_name_ids[$i]);
|
|
else
|
|
$employee_name.=getTableFieldValue('patient_master','patient_name','id',$emp_name_ids[$i]).",";
|
|
}
|
|
}
|
|
|
|
$training_schedule="";
|
|
$query_schedule = "select * from training_schedule where schedule_id='".$row_traning['training_schedule_id']."' ";
|
|
//echo $query_schedule;
|
|
$result_schedule = @mysqli_query($conn,$query_schedule);
|
|
// echo $result_schedule ;
|
|
while($rows_schedule = mysqli_fetch_assoc($result_schedule)){
|
|
$training_name=getTableFieldValue('training_master','training_name','training_master_id',$rows_schedule['training_id']);
|
|
$training_schedule= $training_name.'('.$rows_schedule['trainer_name'].','.date_format(date_create($rows_schedule['from_date']),"d-M-Y").' '.date_format(date_create($rows_schedule['to_date']),"d-M-Y").')';
|
|
// echo $training_schedule;
|
|
}
|
|
|
|
?><tr><td><?php echo $row_traning['assign_training_id']?></td><td><?php echo $credit_to_name?></td><td><?php echo $employee_categories?></td><td><?php echo $employee_name?></td><td><?php echo $training_schedule ?></td><td><?php echo $date_assigned?></td>
|
|
</tr><?php
|
|
}
|
|
?>
|
|
</table>
|
|
<?php
|
|
include('pdf_footer.php');
|
|
?>
|