File manager - Edit - /home/autoph/public_html/portal/portal/hrd_update_summary.php
Back
<html> <head> <title>AUTOHUB GROUP</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/portal.css"> <link rel="stylesheet" href="ajs/vendors/jQueryUI/jquery-ui.css"> <script src="ajs/vendors/jQueryUI/jquery-1.12.4.js"></script> <script src="ajs/vendors/jQueryUI/jquery-ui.js"></script> <script type="application/javascript"> function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } </script> </head> </html> <center> <?php if(isset($_POST['SubmitRatings'])){ $recID=$_POST['recID']; $myRating=$_POST['myRating']; $myComment=$_POST['myComment']; $myComment = mysql_real_escape_string($myComment); if($myRating > 100){ $myActualRate = 100; }else{ $myActualRate = $myRating; } $sql="INSERT INTO `hrd_updates_ratings` (`id`,`rec_id`,`emp_id`,`emp_rating`,`comment`,`date`,`time`) VALUES('','$recID','$myEMPID','$myActualRate','$myComment','$toDate','$currentTime')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); }else{ echo "<div id='dialog' title='NEW RECORD CREATED' style='background:#FAFAFA;z-index:20000'> <p>Record has been saved. </p> <center><a href='myportal.php?window=4'><input type='button' class='submit' name='Exit' value='Close'></a></center> </div>"; } } if(isset($_POST['SubmitComment'])){ $recID=$_POST['recID']; $myComment=$_POST['smyComment']; $myComment = mysql_real_escape_string($myComment); $sql="INSERT INTO `hrd_updates_comments` (`id`,`rec_id`,`emp_id`,`comment`,`date`,`time`) VALUES('','$recID','$myEMPID','$myComment','$toDate','$currentTime')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); }else{ echo "<div id='dialog' title='YOUR COMMENT HAS BEEN SENT' style='background:#FAFAFA;z-index:20000'> <p>Record has been saved. </p> <center><a href='myportal.php?window=4'><input type='button' class='submit' name='Exit' value='Close'></a></center> </div>"; } } if(isset($_GET['rate'])){ echo "<form action='' method='POST'>"; echo "<input type='hidden' name='recID' value='".$_GET['rate']."'>"; echo "<div align='left' style='position:absolute;width:700px;height:300px;border:1px solid gray;background:white;z-index:100;top:60px;left:260px'>"; echo "<h3 style='margin:0px;font-family:Calibri Light;font-size:18px;font-weight:bold;color:white;padding:5px' class='redGradient'>RATE THIS UPDATE</h3>"; echo "<p style='font-family:Calibri Light, font-size:14px;padding:0px;padding-top:5px;border:0px solid gray;margin:20px;margin-bottom:.0px;margin-top:0px'>TYPE YOUR COMMENTS HERE...</p>"; echo "<div style='font-family:Calibri Light, font-size:14px;padding:5px;border:1px solid gray;margin:20px;margin-top:0px;min-height:80px;margin-bottom:10px'> <textarea name='myComment' style='width:100%;padding:10px;font-family:Calibri Light;font-size:12px;border:1px solid lightgray'></textarea> </div>"; echo "<p style='font-family:Calibri Light, font-size:14px;padding:0px;padding-top:5px;border:0px solid gray;margin:20px;margin-bottom:.0px;margin-top:0px'> SUBMIT YOUR RATINGS [0 - 100] where 100 is the highest rating:</p>"; echo "<div style='font-family:Calibri Light, font-size:14px;padding:5px;border:0px solid gray;margin:20px;margin-top:0px;min-height:80px;margin-bottom:0px'> <input type='text' name='myRating' onkeypress=\"return isNumberKey(event)\" maxlength=\"3\" required style='border:1px solid lightgray;width:100px;font-family:Calibri;font-size:20px;color:blue;padding:5px;text-align:center;' placeholder='0 - 100'><br><br>"; echo "<input type='submit' name='SubmitRatings' class='submit' value='Submit Comment' style='margin-right:10px;width:120px;height:30px;padding:3px;border:1px solid lightgray'>"; echo "<a href='myportal.php?window=4'> <input type='button' name='close' class='submit' value='Exit' style='width:100px;height:30px;padding:3px;border:1px solid lightgray'></a>"; echo "</div>"; echo"</div>"; echo "</form>"; } if(isset($_GET['react'])){ echo "<form action='' method='POST'>"; echo "<input type='hidden' name='recID' value='".$_GET['react']."'>"; echo "<div align='left' style='position:absolute;width:700px;height:300px;border:1px solid gray;background:white;z-index:100;top:60px;left:260px'>"; echo "<h3 style='margin:0px;font-family:Calibri Light;font-size:18px;font-weight:bold;color:white;padding:5px' class='redGradient'>COMMENT BOX</h3>"; echo "<p style='font-family:Calibri Light, font-size:14px;padding:0px;padding-top:5px;border:0px solid gray;margin:20px;margin-bottom:.0px;margin-top:0px'>TYPE YOUR COMMENTS HERE...</p>"; echo "<div style='font-family:Calibri Light, font-size:14px;padding:5px;border:1px solid gray;margin:20px;margin-top:0px;min-height:80px;margin-bottom:10px'> <textarea rows='6' name='smyComment' style='width:100%;padding:10px;font-family:Calibri Light;font-size:12px;border:1px solid lightgray'></textarea> </div>"; echo "<br><div style='font-family:Calibri Light, font-size:14px;padding:5px;border:0px solid gray;margin:20px;margin-top:0px;min-height:80px;margin-bottom:0px'>"; echo "<input type='submit' name='SubmitComment' class='submit' value='Submit' style='margin-right:10px;width:120px;height:30px;padding:3px;border:1px solid lightgray'>"; echo "<a href='myportal.php?window=4'> <input type='button' name='close' class='submit' value='Exit' style='width:100px;height:30px;padding:3px;border:1px solid lightgray'></a>"; echo "</div>"; echo"</div>"; echo "</form>"; } //VIEW COMMENTS if(isset($_GET['view'])){ $recID = $_GET['view']; echo "<div align='left' style='position:absolute;width:700px;height:490px;border:1px solid gray;background:white;z-index:100;top:60px;left:260px'>"; echo "<h3 style='margin:0px;font-family:Calibri Light;font-size:18px;font-weight:bold;color:white;padding:5px' class='redGradient'>COMMENT BOX</h3>"; echo "<div style='position:absolute;top:2px;left:93%;font-family:Calibri Light, font-size:14px;padding:5px;border:0px solid gray;margin:20px;margin-top:0px;min-height:80px;margin-bottom:0px'>"; echo "<a href='myportal.php?window=4' style='padding:2px;border:1px solid black;padding-left:5px;padding-right:5px;border-radius:2px' class='titleBlack'> X </a>"; echo "</div>"; echo "<p style='font-family:Calibri Light; font-weight:bold;font-size:14px;padding:0px;padding-top:5px;border:0px solid gray;margin:20px;margin-bottom:.0px;margin-top:0px'>USER'S FEEDBACK</p>"; echo "<div style='font-family:Calibri Light, font-size:14px;padding:2px;border:0px solid gray;margin:20px;margin-top:0px;min-height:420px;margin-bottom:10px;overflow:auto`'>"; $getCom = mysql_query("SELECT * FROM `hrd_updates_comments` WHERE `rec_id`='$recID' ORDER BY `id` DESC "); while($cRow = mysql_fetch_array($getCom)){ $empID = $cRow['emp_id']; $fName = mysql_result(mysql_query("SELECT `u_fname` FROM `c_users` WHERE `emp_id`='$empID'"),0); echo "<div style='width:100%;padding:3px;border:1px solid white;border-bottom:1px dashed lightgray;margin-bottom:5px;'>"; echo "<p style='padding:0px;margin:0px;font-family:Calibri;font-size:14px;color:#2E2E2E'>". $cRow['comment']."</p>"; echo "<p style='padding:0px;margin:0px;font-family:Calibri;font-size:12px;color:gray'>Comment by: ". $fName." | Date: " .$cRow['date']. " ".$cRow['time']."</p>"; echo "</div>"; } echo "</div>"; echo"</div>"; echo "</form>"; } if(isset($_GET['up'])){ $id=$_GET['up']; $checkIfLikeExist = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_likers` WHERE `rec_id`='$id' AND `emp_id`='$myEMPID'"),0); if($checkIfLikeExist > 0){ }else{ $sql="INSERT INTO `hrd_updates_likers` (`id`,`rec_id`,`emp_id`,`like`,`dislike`,`date`,`time`) VALUES('','$id','$myEMPID','1','0','$toDate','$currentTime')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); } } } if(isset($_GET['td'])){ $id=$_GET['td']; $checkIfLikeExist = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_likers` WHERE `rec_id`='$id' AND `emp_id`='$myEMPID'"),0); if($checkIfLikeExist > 0){ }else{ $sql="INSERT INTO `hrd_updates_likers` (`id`,`rec_id`,`emp_id`,`like`,`dislike`,`date`,`time`) VALUES('','$id','$myEMPID','0','1','$toDate','$currentTime')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); } } } $empID = $user_data['emp_id']; $trCountOpen = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `pod_training_list` WHERE `status` ='1' AND `grouping`='OPEN' "),0); $trCountInvites = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `pod_training_invites` WHERE `status` ='1' AND `employee_id`='$empID' "),0); $totalEnrolledTraining = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `pod_training_enrollees` WHERE `status` ='1' AND `employee_id`='$empID' "),0); $totalTrainingCount = $trCountOpen + $trCountInvites; //$averageAnswer = mysql_result(mysql_query("SELECT SUM(`score`) FROM `pod_exam_true_false_answer` WHERE `employee_id`='$empID'"),0); //$averageMaxAnswer = mysql_result(mysql_query("SELECT SUM(`score`) FROM `pod_exam_true_false_answer` WHERE `employee_id`='$empID'"),0); echo "<div style='padding:1px;min-width:250px;position:relative;width:100%;min-height:890px;border:0px solid red;background:white;z-index:5;border-radius:3px'>"; echo "<div style='min-width:250px;position:relative;width:100%;height:780px;border:0px solid lightgray;background:white;z-index:5;border-radius:3px;top:50px;'>"; echo "<table style='border-collapse:collapse;width:100%;height:100%'>"; echo "<tr style='background:white;'>"; echo "<td colspan='1' align='center' valign='top' style='background:white;width:25%;height:320px;background:white;border:1px solid #F2F2F2;'>"; echo "<div class='lightGradient' align='left' style='padding-left:10px;width:100%;top:0px;left:0px;position:relative;z-index:2;font-family:Calibri Light;font-size:22px;font-weight:normal;color:red'> THE HUMAN RESOURCE DEPARTMENT - NEWS & UPDATES </div>"; echo "<div style='position:relative;width:100%;height:800px;border:0px solid blue;background:white;z-index:5;border-radius:3px;top:5px;padding:5px;overflow:auto'>"; echo "<table style='border-collapse:collapse;width:100%'>"; $getUpdate = mysql_query("SELECT * FROM `hrd_updates` WHERE `status`='1' ORDER BY `id` DESC"); while($urow=mysql_fetch_array($getUpdate)){ $recID = $urow['id']; echo "<tr>"; echo "<td align='left' style='background:white;width:90%;padding:1px;padding-left:10px;padding-right:50px;border:0px solid white;border-bottom:1px dashed lightgray;margin-bottom:10px;padding-bottom:15px;'>"; echo "<b style='font-family:Calibri;font-size:14px;color:gray;font-weight:bold'><a href='".$urow['image_path']."' style='font-family:Calibri Light;font-size:18px;color:blue;font-weight:bold;padding:5px;padding-left:0px;margin-top:10px;'>".$urow['title']."</a></b><br>"; if($urow['image_path']!=''){ echo "<img src='images/icon/pdf.png' width='15px' ></img> <a href='hrd_files/".$urow['image_path']."' target='_Blank' style='font-weight:normal'>View Attachment</a></b><br>"; } echo "<b style='font-family:Calibri;font-size:11px;color:gray;font-weight:normal'>".substr($urow['description'],0,250)."<a href='myportal.php?window=4&react=".$urow['id']."&more=true' style='margin-left:10px;color:blue'> more...</a></b><br>"; echo "<b style='font-family:Calibri;font-size:11px;color:gray;font-weight:normal'> Date: ".$urow['date']." | ".$urow['time']."</b><br>"; echo "<b style='font-family:Calibri;font-size:11px;color:gray;font-weight:normal'> Uploaded by: ".$urow['created_by']."<b><br>"; $comments = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_comments` WHERE `rec_id`='$recID'"),0); $getLike = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_likers` WHERE `rec_id`='$recID' AND `like`='1'"),0); $getDisLike = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_likers` WHERE `rec_id`='$recID' AND `dislike`='1'"),0); $checkIfLikeExist = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_likers` WHERE `rec_id`='$recID' AND `emp_id`='$myEMPID'"),0); $chkIfRated = mysql_result(mysql_query("SELECT COUNT('id') FROM `hrd_updates_ratings` WHERE `emp_id`='$myEMPID' AND `rec_id`='$recID'"),0); if($chkIfRated > 0){ echo "<a href='#' style='font-weight:normal;color:gray;margin-right:10px;font-weight:normal'>Rate Us!</a> "; }else{ echo "<a href='myportal.php?window=4&rate=".$urow['id']."' style='font-weight:normal;color:red;margin-right:10px;'>Rate Us!</a> "; } echo " <b style='font-weight:normal'>|</b> "; if($checkIfLikeExist > 0){ echo $getLike. "<a href='#' disabled style='margin:5px'><img src='images/icon/tup.png' width='12px' ></img></a>"; echo $getDisLike. "<a href='#' disabled style='margin:5px'><img src='images/icon/tdown.png' width='12px' ></img></a>"; }else { echo $getLike. "<a href='myportal.php?window=4&up=".$urow['id']."' style='margin:5px'><img src='images/icon/tup.png' width='12px' ></img></a>"; echo $getDisLike. "<a href='myportal.php?window=4&td=".$urow['id']." 'style='margin:5px'><img src='images/icon/tdown.png' width='12px' ></img></a>"; } echo "<b style='font-weight:normal'>| <a href='myportal.php?window=4&view=".$urow['id']."' style='margin:5px'>[ ". $comments. " ] <img src='images/icon/salesJournal.png' width='15px' > View Comments</a>| <a href='myportal.php?window=4&react=".$urow['id']."' style='margin:5px'>Add Comment</img></a>"; echo "</td>"; echo "<td align='left' style='background:white;width:10%;padding:0px;border:1px solid white;border-bottom:1px dashed lightgray;font-family:Arial Light;font-size:20px;color:orange;font-weight:normal'>"; //echo "<b style='font-size:14px;color:red'>Ratings</b><br>"; $myActualRatingRate = mysql_result(mysql_query("SELECT AVG(`emp_rating`) FROM `hrd_updates_ratings` WHERE `rec_id`='$recID'"),0); echo "<p style='font-family:Calibri Light;font-size:16px;color:red'>Rating</p>". number_format($myActualRatingRate,1,'.','')." %"; echo "</td>"; echo "</tr>"; } echo "</table>"; echo "</div>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; //===================================//===================================//===================================//===================================//=================================== echo "</center>"; echo "</div>"; echo "</div>"; if(isset($_GET['more'])){ $id=$_GET['react']; $desc = mysql_result(mysql_query("SELECT `description` FROM `hrd_updates` WHERE `id`='$id'"),0); ?> <div id="dialog" title="Description"> <p><?php echo $desc;?></p> </div> <?php } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings