page-journal.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <?php
  2. /**
  3. * Template Name: Journal
  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. $journal_api = get_field('journal_api', 'option');
  12. $curl = curl_init();
  13. curl_setopt_array($curl, array(
  14. CURLOPT_URL => $journal_api,
  15. CURLOPT_RETURNTRANSFER => true,
  16. CURLOPT_ENCODING => '',
  17. CURLOPT_MAXREDIRS => 10,
  18. CURLOPT_TIMEOUT => 0,
  19. CURLOPT_FOLLOWLOCATION => true,
  20. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  21. CURLOPT_CUSTOMREQUEST => 'POST',
  22. CURLOPT_POSTFIELDS => '{
  23. "auth_token" : "' . $auth_token . '",
  24. "user_login_id" : "' . $client_id . '"
  25. }',
  26. CURLOPT_HTTPHEADER => array(
  27. 'Content-Type: application/json'
  28. ),
  29. ));
  30. $response = curl_exec($curl);
  31. curl_close($curl);
  32. $response = json_decode($response, true);
  33. ?>
  34. <main id="main" class="site-main" role="main">
  35. <section id="archive-hero">
  36. <div class="container">
  37. <!-- breadcrumb -->
  38. <nav aria-label="breadcrumb">
  39. <ul>
  40. <li><a href="#"> Home </a></li>
  41. <li><a href="#">Research</a></li>
  42. <li>Journal Paper</li>
  43. </ul>
  44. </nav>
  45. <div class="content">
  46. <!-- left content -->
  47. <div class="left-content">
  48. <div class="main-title">Journal Paper</div>
  49. <div class="short-details">
  50. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dolor ducimus eius magni non.
  51. </div>
  52. <div class="links">
  53. <!-- message -->
  54. <a href="#">
  55. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  56. </a>
  57. <!-- printer -->
  58. <a href="#">
  59. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  60. </a>
  61. <!-- facebook -->
  62. <a href="#">
  63. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  64. </a>
  65. <!-- twitter -->
  66. <a href="#">
  67. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  68. </a>
  69. <!-- linkedin -->
  70. <a href="#">
  71. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  72. </a>
  73. </div>
  74. </div>
  75. <!-- right content -->
  76. <div class="right-content">
  77. <img src="<?php echo (get_template_directory_uri()) ?>/img/journal-paper.jpg" alt="">
  78. </div>
  79. </div>
  80. </div>
  81. </section>
  82. <div class="container">
  83. <section id="resarch-paper-container">
  84. <!-- side component -->
  85. <div class="side-comp">
  86. <div class="filter">
  87. <!-- title -->
  88. <div class="filter-title">
  89. Refine Your Search
  90. </div>
  91. <div class="filter-criteria">
  92. <h6>Year :</h6>
  93. <form id="year-input" action="">
  94. </form>
  95. <h6>Author :</h6>
  96. <form id="author-input" action="">
  97. </form>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- main component -->
  102. <div class="main-comp">
  103. <article class="generic-para ">
  104. <h3>Conference Papers</h3>
  105. <div id="conference-paper">
  106. </div>
  107. </article>
  108. </div>
  109. </section>
  110. </div>
  111. </main>
  112. <!-- #main -->
  113. <?php endwhile; // end of the loop.
  114. ?>
  115. <style>
  116. #archive-hero {
  117. padding: 2rem 0;
  118. background: #f3f0ec;
  119. }
  120. #archive-hero .content {
  121. display: flex;
  122. align-items: start;
  123. }
  124. #archive-hero .content .left-content {
  125. padding: 1rem;
  126. padding-left: 0 !important;
  127. flex: 1;
  128. }
  129. #archive-hero .content .left-content .main-title {
  130. font-size: 2.2rem;
  131. font-weight: 500;
  132. color: #000000;
  133. }
  134. #archive-hero .content .left-content .short-details {
  135. margin-top: 1.5rem;
  136. font-size: 1.1rem;
  137. font-weight: 400;
  138. }
  139. #archive-hero .content .left-content .links {
  140. margin-top: 2rem;
  141. display: flex;
  142. gap: 1.8rem;
  143. }
  144. #archive-hero .content .left-content .links a {
  145. height: 1.3rem;
  146. }
  147. #archive-hero .content .left-content .links a:hover {
  148. transform: scale(1.1);
  149. opacity: 1 !important;
  150. }
  151. #archive-hero .content .left-content .links a img {
  152. height: 100%;
  153. }
  154. #archive-hero .content .right-content {
  155. padding: 0 0 1rem 2rem !important;
  156. flex: 1;
  157. align-self: end;
  158. }
  159. #archive-hero .content .right-content img {
  160. width: 100%;
  161. }
  162. #resarch-paper-container {
  163. margin-top: 3rem;
  164. display: flex;
  165. gap: 1rem;
  166. }
  167. @media (max-width: 1000px) {
  168. #resarch-paper-container {
  169. flex-direction: column;
  170. }
  171. }
  172. #resarch-paper-container .main-comp {
  173. flex: 7;
  174. padding: 0 0.75rem 1rem 0;
  175. }
  176. @media (max-width: 1000px) {
  177. #resarch-paper-container .main-comp {
  178. order: 0;
  179. flex: 1;
  180. }
  181. }
  182. #resarch-paper-container .main-comp article {
  183. margin: unset;
  184. }
  185. #resarch-paper-container .main-comp .generic-para {
  186. text-align: left;
  187. padding: 1rem 1.5rem !important;
  188. }
  189. #resarch-paper-container .main-comp .generic-para h2 {
  190. text-align: center;
  191. letter-spacing: 1px;
  192. }
  193. #resarch-paper-container .main-comp .generic-para h3 {
  194. font-family: "DM Serif Text", serif;
  195. margin: 20px 0px !important;
  196. padding-bottom: 0.75rem;
  197. text-align: left;
  198. border-bottom: 3px solid #F68B1F;
  199. }
  200. #resarch-paper-container .main-comp .generic-para p {
  201. text-align: justify;
  202. margin: 30px 0px !important;
  203. font-size: 16px !important;
  204. line-height: 22px;
  205. }
  206. #resarch-paper-container .main-comp .generic-para .prof-name {
  207. color: #485680;
  208. font-weight: 700;
  209. font-size: 18px;
  210. }
  211. #resarch-paper-container .main-comp .generic-para .prof-deg {
  212. font-style: italic;
  213. font-weight: 400;
  214. }
  215. #resarch-paper-container .main-comp .generic-para .prof-des {
  216. font-size: 18px;
  217. font-weight: 700;
  218. }
  219. #resarch-paper-container .main-comp .generic-para .paper-details {
  220. padding: 30px 0px;
  221. border-bottom: 1px solid rgba(51, 51, 51, 0.1764705882);
  222. }
  223. #resarch-paper-container .main-comp .generic-para .paper-title {
  224. font-size: 18px !important;
  225. text-align: left !important;
  226. margin: 10px 0px !important;
  227. font-weight: 400 !important;
  228. text-decoration: underline;
  229. }
  230. #resarch-paper-container .main-comp .generic-para .paper-year {
  231. font-size: 14px;
  232. display: block;
  233. color: rgba(51, 51, 51, 0.4509803922);
  234. }
  235. #resarch-paper-container .main-comp .generic-para p {
  236. margin: 5px !important;
  237. font-size: 14px !important;
  238. }
  239. #resarch-paper-container .main-comp .generic-para .paper-contributors {
  240. color: #222222 !important;
  241. }
  242. #resarch-paper-container .main-comp .generic-para .paper-tags {
  243. margin: 20px 0px !important;
  244. }
  245. #resarch-paper-container .main-comp .generic-para .paper-tags .tag {
  246. font-size: 14px;
  247. border: 1px solid #F68B1F;
  248. padding: 3px 8px !important;
  249. border-radius: 10px;
  250. }
  251. #resarch-paper-container .side-comp {
  252. flex: 2;
  253. padding: 0 0.25rem 1rem 0 !important;
  254. }
  255. @media (max-width: 1000px) {
  256. #resarch-paper-container .side-comp {
  257. order: 1;
  258. flex: 1;
  259. }
  260. }
  261. #resarch-paper-container .side-comp .filter {
  262. margin-bottom: 2rem;
  263. padding: 0;
  264. background-color: aliceblue;
  265. box-shadow: 0 0 10px rgba(0, 0, 0, 0.15), 0 3px 3px rgba(0, 0, 0, 0.15);
  266. }
  267. #resarch-paper-container .side-comp .filter-title {
  268. padding: 1rem 0;
  269. text-align: center;
  270. background-color: #2c5d73;
  271. border-bottom: 3px solid #ff860d;
  272. color: #fff;
  273. font-weight: 400;
  274. font-size: 1rem;
  275. }
  276. #resarch-paper-container .side-comp .filter-criteria {
  277. padding: 1rem;
  278. margin-bottom: 1.25rem;
  279. }
  280. #resarch-paper-container .side-comp .filter-criteria h6 {
  281. font-weight: 500;
  282. margin-bottom: 0.25rem !important;
  283. }
  284. #resarch-paper-container .side-comp .filter-criteria form {
  285. padding: 0.25rem;
  286. width: 100%;
  287. padding-top: 0.25rem;
  288. padding: 0.5rem;
  289. }
  290. #resarch-paper-container .side-comp .filter-criteria form .input-group {
  291. width: 100%;
  292. display: flex;
  293. justify-content: space-between;
  294. margin-bottom: 0.25rem;
  295. }
  296. #resarch-paper-container .side-comp .filter-criteria form .input-group label {
  297. font-size: 0.8rem;
  298. font-weight: 500;
  299. }
  300. #resarch-paper-container .side-comp .filter-criteria form .input-group input {
  301. font-size: 0.8rem;
  302. }
  303. #resarch-paper-container .side-comp .filter-criteria form ul {
  304. margin-bottom: unset;
  305. }
  306. #resarch-paper-container .side-comp .filter-criteria form ul li {
  307. list-style: none;
  308. }
  309. #resarch-paper-container .side-comp .filter-criteria form a {
  310. display: block;
  311. color: #333;
  312. font-size: 0.8rem;
  313. font-weight: 500;
  314. padding: 0.5rem 0;
  315. border-bottom: 1px solid #c5c5c5;
  316. }
  317. #resarch-paper-container .side-comp .filter-criteria form a:hover {
  318. opacity: 1 !important;
  319. color: #ff860d;
  320. }
  321. #resarch-paper-container .side-comp .filter-criteria form .single-item {
  322. display: block;
  323. margin-bottom: 0.75rem;
  324. padding-bottom: 2rem;
  325. border-bottom: 1px solid #2c5d73;
  326. transition: all 0.25s ease-in-out;
  327. }
  328. #resarch-paper-container .side-comp .filter-criteria form .single-item:last-child {
  329. border-bottom: none;
  330. margin-bottom: 0rem;
  331. padding-bottom: 0.25rem;
  332. }
  333. #resarch-paper-container .side-comp .filter-criteria form .single-item .date {
  334. font-size: 0.8rem;
  335. font-weight: 500;
  336. color: #c66f17;
  337. }
  338. #resarch-paper-container .side-comp .filter-criteria form .single-item .single-item-title {
  339. font-size: 0.8rem;
  340. font-weight: 700;
  341. color: #2c5d73;
  342. }
  343. #resarch-paper-container .side-comp .filter-criteria form .single-item .date-container {
  344. display: flex;
  345. align-items: center;
  346. gap: 0.7rem;
  347. }
  348. #resarch-paper-container .side-comp .filter-criteria form .single-item .date-container .date {
  349. font-size: 0.75rem;
  350. }
  351. #resarch-paper-container .side-comp .filter-criteria form .single-item .date-container .icon {
  352. width: 0.75rem;
  353. color: #ffffff;
  354. }
  355. #resarch-paper-container .side-comp .filter-criteria form .single-item .date-container .icon img {
  356. width: 100%;
  357. }
  358. /*# sourceMappingURL=cse-journal-paper.css.map */
  359. </style>
  360. <script>
  361. const payload = {
  362. "user_login_id": "api_user",
  363. "auth_token": "api_user20230419045143"
  364. }
  365. const fetchJournalPaper = async () => {
  366. try {
  367. const res = await fetch("https://ucamapi.uiu.ac.bd/api/EmployeeJournal", {
  368. method: "POST",
  369. headers: {
  370. "Content-Type": "application/json",
  371. },
  372. body: JSON.stringify(payload)
  373. });
  374. const data = await res.json();
  375. return data
  376. } catch (error) {
  377. console.log(`Error: ${error}`)
  378. }
  379. }
  380. fetchJournalPaper()
  381. .then(data => {
  382. // adding menu data into html
  383. addDataToPage(data)
  384. })
  385. function addDataToPage(data) {
  386. const conferencePaper = document.getElementById('conference-paper');
  387. const authorFilterContainer = document.getElementById('author-input');
  388. const yearFilterContainer = document.getElementById('year-input');
  389. if (data) {
  390. let allYears = [];
  391. data.map(data => {
  392. const publishYear = data.Year;
  393. allYears.push(publishYear);
  394. // year add in filter
  395. const allYear = `<div class="input-group">
  396. <span>
  397. <label for=${publishYear}>${publishYear}</label>
  398. </span>
  399. <span>
  400. <input type="radio" id=${publishYear} name="author" value=${publishYear}>
  401. </span>
  402. </div>`
  403. yearFilterContainer.insertAdjacentHTML("beforeend", allYear)
  404. // year add in filter end
  405. // author add in filter
  406. const allAuthor = `<div class="input-group">
  407. <span>
  408. <label for=${data.TeacherCode}>${data.TeacherCode}</label>
  409. </span>
  410. <span>
  411. <input type="radio" id=${data.TeacherCode} name="author" value=${data.TeacherCode}>
  412. </span>
  413. </div>`
  414. authorFilterContainer.insertAdjacentHTML("beforeend", allAuthor)
  415. // author add in filter end
  416. // journallist adding
  417. data.JournalList.map(journal => {
  418. const journalData = `<div class="paper-details">
  419. <span class="paper-year">${publishYear}</span>
  420. <h2 class="paper-title">${journal.PaperTitle}</h2>
  421. <p class="paper-tags">
  422. ${
  423. journal.KeyWords.map(KeyWord => {
  424. return `<span class="tag">${KeyWord}</span>`
  425. })
  426. }
  427. </p>
  428. <p class="paper-event">
  429. <i>Publication: </i> ${journal.JournalTitle}
  430. </p>
  431. <p class="paper-contributors">
  432. <i>Authors: </i> ${
  433. journal.Author.map(author => {
  434. return " " + author.AuthorName
  435. })
  436. }
  437. </p>
  438. </div>`
  439. conferencePaper.insertAdjacentHTML("beforeend", journalData)
  440. })
  441. })
  442. console.log(allYears)
  443. }
  444. }
  445. </script>
  446. <?php get_footer(); ?>