single-faculty.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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. $post_blocks = parse_blocks(get_the_content('', false, 166));
  10. foreach ($post_blocks as $block) {
  11. if ($block["blockName"] == "acf/faculty-member") {
  12. if (isset($block['attrs']["data"]["login_id"])) {
  13. $my_block_id = $block['attrs']["data"]["login_id"];
  14. break; // Found a hit, get out of the loop
  15. }
  16. }
  17. var_dump($my_block_id);
  18. }
  19. // if (function_exists('get_field')) {
  20. // $pid = get_post();
  21. // if (has_blocks($pid_content)) {
  22. // $blocks = parse_blocks($pid->post_content);
  23. // var_dump($blocks);
  24. // foreach ($blocks as $block) {
  25. // var_dump($block);
  26. // if ($block["blockName"] == "acf/faculty-member") {
  27. // echo "got it";
  28. // echo $block["attrs"]["data"]["login_id"];
  29. // }
  30. // }
  31. // }
  32. // }
  33. ?>
  34. <section class="static-banner">
  35. <div class="static-banner-underlay">
  36. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  37. </div>
  38. <div class="static-banner-overlay"></div>
  39. </section>
  40. <main>
  41. <section class="profile-header">
  42. <div class="profile-main">
  43. <div class="container">
  44. <div class="top-row">
  45. <div class="profile-img-container">
  46. <img src="<?php the_field('profile_photo'); ?>" alt="">
  47. </div>
  48. <div class="profile-header-text">
  49. <!-- <h3 class="sub-title">Faculty Profile</h3> -->
  50. <h1 class="profile-name">
  51. <?php echo get_the_title(); ?>
  52. </h1>
  53. <h2 class="profile-des">
  54. <?php the_field('designation'); ?>
  55. </h2>
  56. <p><?php //echo $my_block_id;
  57. ?></p>
  58. <?php if (have_rows('contact_details')) : ?>
  59. <?php while (have_rows('contact_details')) : the_row(); ?>
  60. <span class="contact-dets"><?php the_sub_field('contact_info'); ?></span>
  61. <?php
  62. // $sub_field_3 = get_sub_field('sub_field_3');
  63. // do something with $sub_field_3
  64. ?>
  65. <?php endwhile; ?>
  66. <?php endif; ?>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </section>
  72. <section class="profile-body primary-c">
  73. <div class="container">
  74. <div class="profile-second-row">
  75. <div class="left-col">
  76. <ul class="profile-choices">
  77. </ul>
  78. </div>
  79. <div class="profile-main-description">
  80. <?php if (have_rows('main_information')) : ?>
  81. <?php while (have_rows('main_information')) : the_row(); ?>
  82. <span class="contact-dets"></span>
  83. <div class="bio desc-block">
  84. <h2 class="m-text"><?php the_sub_field('title'); ?></h2>
  85. <p class="m-text">
  86. <?php the_sub_field('contents'); ?>
  87. </p>
  88. </div>
  89. <?php endwhile; ?>
  90. <?php endif; ?>
  91. <?php
  92. $employeeid = get_field('employeeid');
  93. $url = 'http://103.109.52.3/webapi/api/EmployeeJournal';
  94. $response = wp_remote_post(
  95. $url,
  96. array(
  97. 'body' => array(
  98. 'employee_id' => $employeeid,
  99. "year" => "",
  100. 'user_login_id' => 'api_user',
  101. 'auth_token' => 'api_user20230419045143'
  102. )
  103. )
  104. );
  105. $data = json_decode(wp_remote_retrieve_body($response), true);
  106. ?>
  107. <?php if (!empty($employeeid)) : ?>
  108. <div class="bio desc-block">
  109. <h2 class="m-text">Publication</h2>
  110. <p class="m-text">
  111. <?php
  112. if (!empty($employeeid)) {
  113. print_r($data);
  114. } else {
  115. echo 'Please insert Login ID of the faculty member</ul></div>';
  116. }
  117. ?>
  118. </div>
  119. <?php endif; ?>
  120. </div>
  121. </div>
  122. </div>
  123. </section>
  124. </main>
  125. <!-- #main -->
  126. <?php endwhile; // end of the loop.
  127. ?>
  128. <style>
  129. header {
  130. margin: 0px !important;
  131. padding: 0px !important;
  132. height: 350px;
  133. overflow: hidden;
  134. }
  135. main {
  136. min-height: calc(100vh - 400px);
  137. position: relative;
  138. padding: 0px !important;
  139. background: rgb(56, 32, 23);
  140. background: linear-gradient(180deg, rgb(48, 18, 7) 0%, rgb(40, 21, 13) 22%, rgb(5, 0, 6) 100%);
  141. height: 100%;
  142. }
  143. h1 {
  144. font-family: "DM Serif Text", serif;
  145. font-size: 40px !important;
  146. letter-spacing: 2px !important;
  147. line-height: 110%;
  148. color: #fff;
  149. width: 100%;
  150. margin: 20px auto !important;
  151. text-align: left;
  152. }
  153. h2 {
  154. font-family: "DM Serif Text", serif;
  155. font-size: 40px;
  156. line-height: 45px;
  157. color: #ffc3c3;
  158. width: 100%;
  159. margin: 20px auto;
  160. text-align: left;
  161. }
  162. p {
  163. max-width: 1200px;
  164. font-size: 18px;
  165. color: #ffc3c3;
  166. margin: 50px 15px !important;
  167. }
  168. .desc-block ul>li {
  169. list-style: none;
  170. font-size: 16px;
  171. line-height: 20px;
  172. font-size: 18px;
  173. color: #ffc3c3;
  174. }
  175. .static-banner {
  176. position: relative;
  177. }
  178. .static-banner .static-banner-underlay {
  179. position: fixed;
  180. height: 100%;
  181. width: 100%;
  182. top: 0px;
  183. }
  184. .static-banner .static-banner-underlay img {
  185. height: 100%;
  186. width: 100%;
  187. -o-object-fit: cover;
  188. object-fit: cover;
  189. -o-object-position: bottom;
  190. object-position: bottom;
  191. }
  192. .static-banner .static-banner-overlay {
  193. position: fixed;
  194. width: 100%;
  195. height: 100%;
  196. background-color: #0b1419;
  197. opacity: 0.8;
  198. }
  199. .profile-header {
  200. position: absolute;
  201. top: -300px;
  202. width: 100%;
  203. }
  204. .top-row {
  205. display: flex;
  206. flex-direction: row;
  207. margin-top: 50px;
  208. }
  209. @media screen and (max-width: 600px) {
  210. .top-row {
  211. display: flex;
  212. flex-direction: column;
  213. justify-content: center;
  214. align-items: center;
  215. margin-top: -10px;
  216. }
  217. }
  218. .profile-img-container {
  219. flex-basis: 200px;
  220. border-radius: 50%;
  221. border: 2px solid #F68B1F;
  222. overflow: hidden;
  223. }
  224. .profile-img-container img {
  225. height: 100%;
  226. width: 100%;
  227. -o-object-position: top;
  228. object-position: top;
  229. -o-object-fit: cover;
  230. object-fit: cover;
  231. }
  232. @media screen and (max-width: 600px) {
  233. .profile-img-container {
  234. flex-basis: 100px;
  235. width: 100px !important;
  236. height: 100px !important;
  237. border-radius: 50%;
  238. border: 2px solid #F68B1F;
  239. overflow: hidden;
  240. }
  241. }
  242. .profile-header-text {
  243. margin: 20px 0px 0px 50px !important;
  244. }
  245. @media screen and (max-width: 600px) {
  246. .profile-header-text {
  247. margin: 20px 0px !important;
  248. }
  249. }
  250. .profile-header-text h1 {
  251. font-size: 40px !important;
  252. margin: 5px 0px !important;
  253. }
  254. .profile-header-text h2 {
  255. font-size: 20px !important;
  256. line-height: 24px !important;
  257. color: #fff;
  258. letter-spacing: 2px;
  259. font-weight: normal;
  260. margin: 5px 0px !important;
  261. }
  262. .profile-header-text .contact-dets {
  263. display: inline-block;
  264. font-size: 12px;
  265. margin-top: 15px !important;
  266. margin-right: 20px !important;
  267. font-weight: lighter;
  268. color: #fff;
  269. letter-spacing: 2px;
  270. }
  271. .profile-header-text h3 {
  272. font-size: 14px !important;
  273. text-transform: uppercase;
  274. text-decoration: none !important;
  275. font-family: "Open Sans", sans-serif;
  276. letter-spacing: 2px;
  277. text-align: center !important;
  278. font-weight: normal;
  279. margin: 5px 0px 0px 0px !important;
  280. text-align: left !important;
  281. }
  282. @media screen and (max-width: 700px) {
  283. .profile-header-text {
  284. text-align: center;
  285. }
  286. .profile-header-text h1 {
  287. font-size: 20px !important;
  288. margin: 5px 0px 0px 0px !important;
  289. text-align: center;
  290. }
  291. .profile-header-text h2 {
  292. font-size: 14px !important;
  293. line-height: 16px !important;
  294. color: #fff;
  295. letter-spacing: 2px;
  296. font-weight: normal;
  297. margin: 5px 0px 10px 0px !important;
  298. text-align: center;
  299. }
  300. .profile-header-text h3 {
  301. font-size: 14px !important;
  302. text-transform: uppercase;
  303. text-decoration: none !important;
  304. font-family: "Open Sans", sans-serif;
  305. letter-spacing: 2px;
  306. text-align: center !important;
  307. font-weight: normal;
  308. margin: 5px 0px 0px 0px !important;
  309. text-align: center;
  310. }
  311. .profile-header-text .contact-dets {
  312. display: block;
  313. font-size: 12px;
  314. margin-top: 5px !important;
  315. font-weight: lighter;
  316. color: #fff;
  317. letter-spacing: 1px;
  318. }
  319. }
  320. .profile-second-row {
  321. display: flex;
  322. flex-direction: row;
  323. justify-content: space-between;
  324. }
  325. .left-col {
  326. margin-right: 30px;
  327. width: 400px;
  328. }
  329. @media screen and (max-width: 650px) {
  330. .left-col {
  331. display: none;
  332. }
  333. }
  334. ul.profile-choices>li {
  335. list-style: none;
  336. border-radius: 5px;
  337. overflow: hidden;
  338. height: 50px;
  339. }
  340. ul.profile-choices>li a {
  341. padding: 5px 10px;
  342. font-size: 20px;
  343. line-height: 40px;
  344. font-weight: lighter;
  345. color: #fff;
  346. display: flex;
  347. flex-direction: row;
  348. justify-content: space-between;
  349. transition-duration: 0.5s;
  350. height: 50px !important;
  351. }
  352. ul.profile-choices>li a:after {
  353. content: "chevron_right";
  354. font-family: "Material Icons";
  355. font-size: 20px;
  356. margin-right: 10px;
  357. }
  358. ul.profile-choices>li a:hover {
  359. color: #000;
  360. text-decoration: none;
  361. background-color: rgba(255, 255, 255, 0.2039215686);
  362. }
  363. .pickr {
  364. display: inline-block;
  365. margin-right: 6px !important;
  366. }
  367. .profile-des {
  368. font-family: "Open Sans", sans-serif;
  369. font-size: 25px;
  370. font-weight: normal;
  371. margin: 5px 0px;
  372. color: #fff;
  373. }
  374. details {
  375. margin-left: 0px !important;
  376. }
  377. .accordions {
  378. margin-top: 100px;
  379. }
  380. .sub-title {
  381. font-family: "Open Sans", sans-serif !important;
  382. font-size: 14px;
  383. letter-spacing: 5px;
  384. }
  385. b {
  386. font-weight: 500 !important;
  387. font-size: 22px !important;
  388. }
  389. i {
  390. font-size: 14px;
  391. margin-bottom: 130px !important;
  392. border-bottom: 1px solid #fff;
  393. }
  394. ul {
  395. margin-top: 20px !important;
  396. margin-bottom: 50px !important;
  397. }
  398. ul>li {
  399. list-style: none;
  400. font-size: 16px;
  401. line-height: 20px;
  402. }
  403. h2.m-text {
  404. font-size: 30px;
  405. margin-left: 0px;
  406. font-weight: normal;
  407. }
  408. .desc-block {
  409. opacity: 1;
  410. transition-duration: 0.4s;
  411. overflow: none;
  412. }
  413. .desc-block-hidden {
  414. display: none;
  415. }
  416. .desc-active {
  417. text-decoration: none;
  418. background-color: rgba(255, 255, 255, 0.2039215686);
  419. }
  420. .desc-active a {
  421. color: #000;
  422. }
  423. ul.m-text {
  424. margin-top: 10px !important;
  425. }
  426. /* The Overlay (background) */
  427. .overlay {
  428. /* Height & width depends on how you want to reveal the overlay (see JS below) */
  429. height: 0%;
  430. width: 100%;
  431. position: fixed;
  432. /* Stay in place */
  433. z-index: 1100;
  434. /* Sit on top */
  435. left: 0;
  436. top: 0;
  437. background-color: rgb(0, 0, 0);
  438. /* Black fallback color */
  439. background-color: rgba(0, 0, 0, 0.9);
  440. /* Black w/opacity */
  441. overflow-x: hidden;
  442. /* Disable horizontal scroll */
  443. transition: 0.5s;
  444. /* 0.5 second transition effect to slide in or slide down the overlay (height or width, depending on reveal) */
  445. }
  446. /* Position the content inside the overlay */
  447. .overlay-content {
  448. position: relative;
  449. height: 100%;
  450. top: 25%;
  451. /* 25% from the top */
  452. width: 100%;
  453. /* 100% width */
  454. text-align: center;
  455. /* Centered text/links */
  456. margin-top: 30px;
  457. /* 30px top margin to avoid conflict with the close button on smaller screens */
  458. }
  459. /* The navigation links inside the overlay */
  460. .overlay a {
  461. padding: 8px;
  462. text-decoration: none;
  463. font-size: 18px;
  464. color: white;
  465. display: block;
  466. /* Display block instead of inline */
  467. transition: 0.3s;
  468. /* Transition effects on hover (color) */
  469. }
  470. .overlay h1 {
  471. color: white;
  472. font-size: 20px;
  473. font-weight: lighter;
  474. margin-bottom: 10px;
  475. text-decoration: underline;
  476. }
  477. /* When you mouse over the navigation links, change their color */
  478. .overlay a:hover,
  479. .overlay a:focus {
  480. color: #f1f1f1;
  481. }
  482. /* Position the close button (top right corner) */
  483. .overlay .closebtn {
  484. position: absolute;
  485. top: 20px;
  486. right: 45px;
  487. font-size: 60px;
  488. }
  489. </style>
  490. <?php get_footer(); ?>