Created
November 25, 2019 20:43
-
-
Save santiagobazanb/86ae60be5945017a0f3f0366f66c2838 to your computer and use it in GitHub Desktop.
Sample PHP Code for Job Application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function that is in charge of rendering contents to the screen. It's a function that gets called automatically by other | |
* PHP files looking for the specific keyword in the function render. It can usually accept any parameters that we might wanna pass to the | |
* function. | |
* | |
* @return string | |
*/ | |
function render($class = '', $class_def = '') { | |
global $sess,$_db; | |
$name = ($sess['auth']['fullname'] ? $sess['auth']['fullname'] : $sess['auth']['fname'].' '.$sess['auth']['lname']); | |
$date = date('D, F d, Y').' | '.date('g:i a'); | |
$role = $sess['auth']['rolename']; | |
$notifications_array = $this->getNotifications(); | |
$notification_data = $this->returnNotificationData($notifications_array); | |
$html .= '<div class="float-right mt-1"> | |
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'.$name.'</a> | |
<div class="dropdown-menu dropdown-menu-right bg-white" aria-labelledby="navbarDropdownMenuLink"> | |
<a class="dropdown-item" href="/applicant/account?mode=list&tab=account">My Account</a> | |
<a class="dropdown-item" href="/applicant/career_office?mode=list&tab=office">My Law School</a> | |
<a class="dropdown-item" href="#">Preferences</a> | |
</div> | |
</div>'; | |
$html .= '<div class="float-right mt-1"> | |
<div class="dropdown notifications-dropdown"> | |
<button class="nav-notifications mr-5" type="button" id="notificationsMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
' . (($notification_data['count_unread'] > 0) ? $notification_data['count_unread'] : '<span class="icn icn-alarm"></span>') . ' | |
</button> | |
<div class="dropdown-menu bg-white" data-user="' . $sess['auth']['user_id'] . '" aria-labelledby="dropdownMenuButton"> | |
<div class="' . ((count_array($notifications_array)) ? 'border-bottom ' : '') . 'p-5 d-flex justify-content-between align-baseline"> | |
<h2 class="heading my-0 mr-6">Notifications</h2><a href="/' . $this->getLink(strtolower($role)) . '?tab=preference"><span class="settings icn-gear"></span></a> | |
</div> | |
' . $notification_data['html'] . ' | |
</div> | |
</div> | |
</div>'; | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment