single-faculty.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <?php
  2. /**
  3. * The template for displaying all single faculty posts
  4. *
  5. * @package UIU_CSE
  6. */
  7. get_header(); ?>
  8. <?php while (have_posts()) : the_post();
  9. $auth_token = get_field('auth_token', 'option');
  10. $client_id = get_field('client_id', 'option');
  11. $employee_info_api = get_field('employee_info_api', 'option');
  12. $journal_api = get_field('journal_api', 'option');
  13. $conference_api = get_field('conference_api', 'option');
  14. $login_id_e = "";
  15. if (function_exists('get_field')) {
  16. $pid_content = get_post();
  17. if (has_blocks($pid_content)) {
  18. $blocks = parse_blocks($pid_content->post_content);
  19. foreach ($blocks as $block) {
  20. if ($block["blockName"] == "acf/faculty-member") {
  21. $login_id_e = $block["attrs"]["data"]["login_id"];
  22. }
  23. }
  24. }
  25. }
  26. $response_employeeInfo = wp_remote_post(
  27. $employee_info_api,
  28. array(
  29. 'body' => array(
  30. 'user_login_id' => $client_id,
  31. 'login_id' => $login_id_e,
  32. 'auth_token' => $auth_token
  33. )
  34. )
  35. );
  36. $employeeInfo = json_decode(wp_remote_retrieve_body($response_employeeInfo), true);
  37. $response_employeeJournal = wp_remote_post(
  38. $journal_api,
  39. array(
  40. 'body' => array(
  41. 'employee_id' => $login_id_e,
  42. "year" => "",
  43. 'user_login_id' => $client_id,
  44. 'auth_token' => $auth_token
  45. // 'page' => 1,
  46. // 'limit' => 1
  47. )
  48. )
  49. );
  50. $employeeJournal = json_decode(wp_remote_retrieve_body($response_employeeJournal), true);
  51. $response_employeeConference = wp_remote_post(
  52. $conference_api,
  53. array(
  54. 'body' => array(
  55. 'employee_id' => $login_id_e,
  56. "year" => "",
  57. 'user_login_id' => $client_id,
  58. 'auth_token' => $auth_token
  59. // 'page' => 1,
  60. // 'limit' => 1
  61. )
  62. )
  63. );
  64. $employeeConference = json_decode(wp_remote_retrieve_body($response_employeeConference), true);
  65. ?>
  66. <section class="static-banner">
  67. <div class="static-banner-underlay">
  68. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  69. </div>
  70. <div class="static-banner-overlay"></div>
  71. </section>
  72. <main>
  73. <section class="profile-header">
  74. <div class="profile-main">
  75. <div class="container">
  76. <div class="top-row">
  77. <div class="profile-img-container">
  78. <img src="<?php the_field('profile_photo'); ?>" alt="">
  79. </div>
  80. <div class="profile-header-text">
  81. <!-- <h3 class="sub-title">Faculty profile</h3> -->
  82. <h1 class="profile-name">
  83. <?php echo $employeeInfo[0]['Title'];
  84. echo " " . $employeeInfo[0]['FullName'];
  85. ?>
  86. </h1>
  87. <h2 class="profile-des">
  88. <?php echo $employeeInfo[0]['Designation'];
  89. echo ", " . $employeeInfo[0]['Office'];
  90. ?>
  91. </h2>
  92. <span class="contact-dets"><?php echo "ROOM: " . $employeeInfo[0]['Room']; ?></span>
  93. <span class="contact-dets"><?php echo "PABX: " . $employeeInfo[0]['PABX']; ?></span>
  94. <br />
  95. <span class="contact-dets"><?php echo $employeeInfo[0]['Phone']; ?></span>
  96. <span class="contact-dets"><?php echo $employeeInfo[0]['Email']; ?></span>
  97. <?php if (have_rows('contact_details')) : ?>
  98. <?php while (have_rows('contact_details')) : the_row(); ?>
  99. <span class="contact-dets"><?php the_sub_field('contact_info'); ?></span>
  100. <?php endwhile; ?>
  101. <?php endif; ?>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </section>
  107. <section class="profile-body primary-c">
  108. <div class="container">
  109. <div class="profile-second-row">
  110. <div class="left-col">
  111. <ul class="profile-choices">
  112. </ul>
  113. </div>
  114. <div class="profile-main-description">
  115. <?php if (have_rows('main_information')) : ?>
  116. <?php while (have_rows('main_information')) : the_row(); ?>
  117. <span class="contact-dets"></span>
  118. <div class="bio desc-block">
  119. <h2 class="m-text"><?php the_sub_field('title'); ?></h2>
  120. <p class="m-text">
  121. <?php the_sub_field('contents'); ?>
  122. </p>
  123. </div>
  124. <?php endwhile; ?>
  125. <?php endif; ?>
  126. <div class="bio desc-block">
  127. <h2 class="m-text">Publication</h2>
  128. <p class="m-text">
  129. <h3 class="paper-type">Journal Papers</h3>
  130. <?php
  131. foreach ($employeeJournal as $item) {
  132. // Access individual elements of each response
  133. echo "<div class='paper-details'>";
  134. echo "<span class='paper-year'>{$item['Year']}</span>";
  135. // Iterate over the JournalList array within each item
  136. foreach ($item['JournalList'] as $journal) {
  137. // Access individual elements of each journal
  138. echo "<a href='{$journal['JournalLink']}'>";
  139. echo "<h2 class='paper-title'>{$journal['PaperTitle']}</h2>";
  140. echo "</a>";
  141. echo "<p class='paper-tags'>";
  142. $journalKeyword = explode(',', $journal['Keyword']);
  143. foreach ($journalKeyword as $keyword) {
  144. if ($keyword) {
  145. echo "<span class='tag'>{$keyword}</span>";
  146. }
  147. }
  148. echo "</p>";
  149. echo "<p class='paper-event'>Publication: {$journal['JournalTitle']}</p>";
  150. echo "<p class='paper-contributors'>";
  151. echo "Author List: ";
  152. // Iterate over the Author array within each journal
  153. foreach ($journal['Author'] as $author) {
  154. // Access individual elements of each author
  155. $authorName = $author['AuthorName'];
  156. // Process or output the values as needed
  157. echo " $authorName,";
  158. }
  159. echo "</p>";
  160. }
  161. echo "</div>";
  162. }
  163. ?>
  164. <h3 class="paper-type">Conference Papers</h3>
  165. <?php
  166. foreach ($employeeConference as $item) {
  167. // Access individual elements of each response
  168. $item_count = "single";
  169. if (count($item['ConferenceList']) > 1) {
  170. $item_count = "multiple";
  171. }
  172. echo "<div class='paper-details {$item_count}'>";
  173. echo "<span class='paper-year'>{$item['Year']}</span>";
  174. // Iterate over the JournalList array within each item
  175. foreach ($item['ConferenceList'] as $conference) {
  176. // Access individual elements of each journal
  177. echo "<a href='{$conference['Link']}'>";
  178. echo "<h2 class='paper-title'>{$conference['PaperTitle']}</h2>";
  179. echo "</a>";
  180. echo "<p class='paper-tags'>";
  181. $conferenceKeyword = explode(',', $conference['Keyword']);
  182. foreach ($conferenceKeyword as $keyword) {
  183. if ($keyword) {
  184. echo "<span class='tag'>{$keyword}</span>";
  185. }
  186. }
  187. echo "</p>";
  188. echo "<p class='paper-event'>Conference: {$conference['ConferenceName']}</p>";
  189. echo "<p class='paper-contributors'>";
  190. echo "Author List: ";
  191. // Iterate over the Author array within each journal
  192. foreach ($conference['Author'] as $author) {
  193. // Process or output the values as needed
  194. echo " {$author['AuthorName']},";
  195. }
  196. echo "</p>";
  197. }
  198. echo "</div>";
  199. }
  200. ?>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </section>
  206. </main>
  207. <!-- #main -->
  208. <?php endwhile; // end of the loop.
  209. ?>
  210. <style>
  211. header {
  212. margin: 0px !important;
  213. padding: 0px !important;
  214. height: 350px;
  215. overflow: hidden;
  216. }
  217. main {
  218. min-height: calc(100vh - 400px);
  219. position: relative;
  220. padding: 0px !important;
  221. background: rgb(56, 32, 23);
  222. background: linear-gradient(180deg, rgb(48, 18, 7) 0%, rgb(40, 21, 13) 22%, rgb(5, 0, 6) 100%);
  223. height: 100%;
  224. }
  225. h1 {
  226. font-family: "DM Serif Text", serif;
  227. font-size: 40px !important;
  228. letter-spacing: 2px !important;
  229. line-height: 110%;
  230. color: #fff;
  231. width: 100%;
  232. margin: 20px auto !important;
  233. text-align: left;
  234. }
  235. h2 {
  236. font-family: "DM Serif Text", serif;
  237. font-size: 40px;
  238. line-height: 45px;
  239. color: #ffc3c3;
  240. width: 100%;
  241. margin: 20px auto;
  242. text-align: left;
  243. }
  244. p {
  245. max-width: 1200px;
  246. font-size: 18px;
  247. color: #ffc3c3;
  248. /* margin: 50px 15px !important; */
  249. }
  250. .desc-block ul>li {
  251. list-style: none;
  252. font-size: 16px;
  253. line-height: 20px;
  254. font-size: 18px;
  255. color: #ffc3c3;
  256. }
  257. .static-banner {
  258. position: relative;
  259. }
  260. .static-banner .static-banner-underlay {
  261. position: fixed;
  262. height: 100%;
  263. width: 100%;
  264. top: 0px;
  265. }
  266. .static-banner .static-banner-underlay img {
  267. height: 100%;
  268. width: 100%;
  269. -o-object-fit: cover;
  270. object-fit: cover;
  271. -o-object-position: bottom;
  272. object-position: bottom;
  273. }
  274. .static-banner .static-banner-overlay {
  275. position: fixed;
  276. width: 100%;
  277. height: 100%;
  278. background-color: #0b1419;
  279. opacity: 0.8;
  280. }
  281. .profile-header {
  282. position: absolute;
  283. top: -300px;
  284. width: 100%;
  285. }
  286. .top-row {
  287. display: flex;
  288. flex-direction: row;
  289. margin-top: 50px;
  290. }
  291. @media screen and (max-width: 600px) {
  292. .top-row {
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: center;
  296. align-items: center;
  297. margin-top: -10px;
  298. }
  299. }
  300. .profile-img-container {
  301. flex-basis: 200px;
  302. border-radius: 50%;
  303. border: 2px solid #F68B1F;
  304. overflow: hidden;
  305. }
  306. .profile-img-container img {
  307. height: 100%;
  308. width: 100%;
  309. -o-object-position: top;
  310. object-position: top;
  311. -o-object-fit: cover;
  312. object-fit: cover;
  313. }
  314. @media screen and (max-width: 600px) {
  315. .profile-img-container {
  316. flex-basis: 100px;
  317. width: 100px !important;
  318. height: 100px !important;
  319. border-radius: 50%;
  320. border: 2px solid #F68B1F;
  321. overflow: hidden;
  322. }
  323. }
  324. .profile-header-text {
  325. margin: 20px 0px 0px 50px !important;
  326. }
  327. @media screen and (max-width: 600px) {
  328. .profile-header-text {
  329. margin: 20px 0px !important;
  330. }
  331. }
  332. .profile-header-text h1 {
  333. font-size: 40px !important;
  334. margin: 5px 0px !important;
  335. }
  336. .profile-header-text h2 {
  337. font-size: 20px !important;
  338. line-height: 24px !important;
  339. color: #fff;
  340. letter-spacing: 2px;
  341. font-weight: normal;
  342. margin: 5px 0px !important;
  343. }
  344. .profile-header-text .contact-dets {
  345. display: inline-block;
  346. font-size: 12px;
  347. margin-top: 15px !important;
  348. margin-right: 20px !important;
  349. font-weight: lighter;
  350. color: #fff;
  351. letter-spacing: 2px;
  352. }
  353. .profile-header-text h3 {
  354. font-size: 14px !important;
  355. text-transform: uppercase;
  356. text-decoration: none !important;
  357. font-family: "Open Sans", sans-serif;
  358. letter-spacing: 2px;
  359. text-align: center !important;
  360. font-weight: normal;
  361. margin: 5px 0px 0px 0px !important;
  362. text-align: left !important;
  363. }
  364. @media screen and (max-width: 700px) {
  365. .profile-header-text {
  366. text-align: center;
  367. }
  368. .profile-header-text h1 {
  369. font-size: 20px !important;
  370. margin: 5px 0px 0px 0px !important;
  371. text-align: center;
  372. }
  373. .profile-header-text h2 {
  374. font-size: 14px !important;
  375. line-height: 16px !important;
  376. color: #fff;
  377. letter-spacing: 2px;
  378. font-weight: normal;
  379. margin: 5px 0px 10px 0px !important;
  380. text-align: center;
  381. }
  382. .profile-header-text h3 {
  383. font-size: 14px !important;
  384. text-transform: uppercase;
  385. text-decoration: none !important;
  386. font-family: "Open Sans", sans-serif;
  387. letter-spacing: 2px;
  388. text-align: center !important;
  389. font-weight: normal;
  390. margin: 5px 0px 0px 0px !important;
  391. text-align: center;
  392. }
  393. .profile-header-text .contact-dets {
  394. display: block;
  395. font-size: 12px;
  396. margin-top: 5px !important;
  397. font-weight: lighter;
  398. color: #fff;
  399. letter-spacing: 1px;
  400. }
  401. }
  402. .profile-second-row {
  403. display: flex;
  404. flex-direction: row;
  405. justify-content: space-between;
  406. }
  407. .left-col {
  408. margin-right: 30px;
  409. width: 400px;
  410. }
  411. @media screen and (max-width: 650px) {
  412. .left-col {
  413. display: none;
  414. }
  415. }
  416. ul.profile-choices>li {
  417. list-style: none;
  418. border-radius: 5px;
  419. overflow: hidden;
  420. height: 50px;
  421. }
  422. ul.profile-choices>li a {
  423. padding: 5px 10px;
  424. font-size: 20px;
  425. line-height: 40px;
  426. font-weight: lighter;
  427. color: #fff;
  428. display: flex;
  429. flex-direction: row;
  430. justify-content: space-between;
  431. transition-duration: 0.5s;
  432. height: 50px !important;
  433. }
  434. ul.profile-choices>li a:after {
  435. content: "chevron_right";
  436. font-family: "Material Icons";
  437. font-size: 20px;
  438. margin-right: 10px;
  439. }
  440. ul.profile-choices>li a:hover {
  441. color: #000;
  442. text-decoration: none;
  443. background-color: rgba(255, 255, 255, 0.2039215686);
  444. }
  445. .pickr {
  446. display: inline-block;
  447. margin-right: 6px !important;
  448. }
  449. .profile-des {
  450. font-family: "Open Sans", sans-serif;
  451. font-size: 25px;
  452. font-weight: normal;
  453. margin: 5px 0px;
  454. color: #fff;
  455. }
  456. details {
  457. margin-left: 0px !important;
  458. }
  459. .accordions {
  460. margin-top: 100px;
  461. }
  462. .sub-title {
  463. font-family: "Open Sans", sans-serif !important;
  464. font-size: 14px;
  465. letter-spacing: 5px;
  466. }
  467. b {
  468. font-weight: 500 !important;
  469. font-size: 22px !important;
  470. }
  471. i {
  472. font-size: 14px;
  473. margin-bottom: 130px !important;
  474. border-bottom: 1px solid #fff;
  475. }
  476. ul {
  477. margin-top: 20px !important;
  478. margin-bottom: 50px !important;
  479. }
  480. ul>li {
  481. list-style: none;
  482. font-size: 16px;
  483. line-height: 20px;
  484. }
  485. h2.m-text {
  486. font-size: 30px;
  487. margin-left: 0px;
  488. font-weight: normal;
  489. }
  490. .desc-block {
  491. opacity: 1;
  492. transition-duration: 0.4s;
  493. overflow: none;
  494. }
  495. .desc-block-hidden {
  496. display: none;
  497. }
  498. .desc-active {
  499. text-decoration: none;
  500. background-color: rgba(255, 255, 255, 0.2039215686);
  501. }
  502. .desc-active a {
  503. color: #000;
  504. }
  505. ul.m-text {
  506. margin-top: 10px !important;
  507. }
  508. /* The Overlay (background) */
  509. .overlay {
  510. /* Height & width depends on how you want to reveal the overlay (see JS below) */
  511. height: 0%;
  512. width: 100%;
  513. position: fixed;
  514. /* Stay in place */
  515. z-index: 1100;
  516. /* Sit on top */
  517. left: 0;
  518. top: 0;
  519. background-color: rgb(0, 0, 0);
  520. /* Black fallback color */
  521. background-color: rgba(0, 0, 0, 0.9);
  522. /* Black w/opacity */
  523. overflow-x: hidden;
  524. /* Disable horizontal scroll */
  525. transition: 0.5s;
  526. /* 0.5 second transition effect to slide in or slide down the overlay (height or width, depending on reveal) */
  527. }
  528. /* Position the content inside the overlay */
  529. .overlay-content {
  530. position: relative;
  531. height: 100%;
  532. top: 25%;
  533. /* 25% from the top */
  534. width: 100%;
  535. /* 100% width */
  536. text-align: center;
  537. /* Centered text/links */
  538. margin-top: 30px;
  539. /* 30px top margin to avoid conflict with the close button on smaller screens */
  540. }
  541. /* The navigation links inside the overlay */
  542. .overlay a {
  543. padding: 8px;
  544. text-decoration: none;
  545. font-size: 18px;
  546. color: white;
  547. display: block;
  548. /* Display block instead of inline */
  549. transition: 0.3s;
  550. /* Transition effects on hover (color) */
  551. }
  552. .overlay h1 {
  553. color: white;
  554. font-size: 20px;
  555. font-weight: lighter;
  556. margin-bottom: 10px;
  557. text-decoration: underline;
  558. }
  559. /* When you mouse over the navigation links, change their color */
  560. .overlay a:hover,
  561. .overlay a:focus {
  562. color: #f1f1f1;
  563. }
  564. /* Position the close button (top right corner) */
  565. .overlay .closebtn {
  566. position: absolute;
  567. top: 20px;
  568. right: 45px;
  569. font-size: 60px;
  570. }
  571. /* added by rousnay */
  572. .profile-header-text h2 {
  573. margin: 5px 0px 10px !important;
  574. }
  575. .profile-header-text .contact-dets {
  576. margin-top: 0px !important;
  577. margin-right: 10px !important;
  578. }
  579. h3.paper-type {
  580. margin: 40px 0 0;
  581. text-decoration: underline;
  582. color: antiquewhite;
  583. font-family: "DM Serif Text", serif;
  584. letter-spacing: 1px;
  585. font-size: 1.4em;
  586. }
  587. .paper-details {
  588. padding: 30px 0px;
  589. border-bottom: 1px solid rgba(51, 51, 51, 0.1764705882);
  590. }
  591. .paper-details .paper-year {
  592. font-size: 14px;
  593. display: block;
  594. color: antiquewhite;
  595. }
  596. .paper-details a {
  597. text-decoration: none;
  598. }
  599. .paper-details p {
  600. line-height: 1.8em !important;
  601. }
  602. .paper-details .paper-title {
  603. font-size: 18px;
  604. margin: 10px 0px;
  605. font-family: "Open Sans", sans-serif;
  606. line-height: 1.7em;
  607. letter-spacing: 0.5px;
  608. color: antiquewhite;
  609. }
  610. .paper-details .paper-tags {
  611. /* margin: 20px 0px; */
  612. }
  613. .paper-details .paper-tags .tag {
  614. font-size: 14px;
  615. border: 1px solid rgba(17, 124, 247, 0.431372549);
  616. padding: 3px 8px;
  617. border-radius: 10px;
  618. }
  619. .paper-details p {
  620. margin: 5px;
  621. font-size: 14px;
  622. }
  623. .paper-details .paper-contributors {
  624. /* color: #222222; */
  625. }
  626. .paper-details.multiple .paper-contributors {
  627. margin-bottom: 45px;
  628. }
  629. </style>
  630. <?php get_footer(); ?>