Browse Source

curl implemented

Md Mozahidur Rahman 1 year ago
parent
commit
0ecbcf9162
2 changed files with 94 additions and 179 deletions
  1. 89 175
      page-template/page-journal.php
  2. 5 4
      single-faculty.php

+ 89 - 175
page-template/page-journal.php

@@ -12,20 +12,18 @@ get_header(); ?>
 
     $auth_token = get_field('auth_token', 'option');
     $client_id = get_field('client_id', 'option');
-    $employee_info_api = get_field('employee_info_api', 'option');
     $journal_api = get_field('journal_api', 'option');
-    $conference_api = get_field('conference_api', 'option');
 
     $response_employeeJournal = wp_remote_post(
         $journal_api,
         array(
             'body' => array(
-                'employee_id' => "",
+                // 'employee_id' => "SS",
                 "year"  => "",
                 'user_login_id' => $client_id,
-                'auth_token' => $auth_token
-                // 'page' : 1,
-                // 'limit' : 1
+                'auth_token' => $auth_token,
+                'page' => 1,
+                'limit' => 2
             )
 
         )
@@ -92,12 +90,8 @@ get_header(); ?>
                 <div class="sections">
 
 
-
-
-
                     <section id="conference-papers-section" class="container generic-content" data-theme="light">
 
-
                         <div class="generic-para shadowed">
                             <h3>Journal Papers</h3>
 
@@ -119,182 +113,102 @@ get_header(); ?>
 
                             </div>
 
+                            <?php
+
+                            // echo $auth_token;
+                            // var_dump($employeeJournal);
+
+                            // echo '<pre>';
+                            // print_r($employeeJournal);
+
+                            ?>
+
+                            <?php
+
+                            $curl = curl_init();
+
+                            curl_setopt_array($curl, array(
+                                CURLOPT_URL => 'http://103.109.52.3/webapi/api/EmployeeJournal',
+                                CURLOPT_RETURNTRANSFER => true,
+                                CURLOPT_ENCODING => '',
+                                CURLOPT_MAXREDIRS => 10,
+                                CURLOPT_TIMEOUT => 0,
+                                CURLOPT_FOLLOWLOCATION => true,
+                                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+                                CURLOPT_CUSTOMREQUEST => 'POST',
+                                CURLOPT_POSTFIELDS => '{
+                                    "employee_id" : " ",
+                                    "year" : "2022",
+                                    "user_login_id" : "api_user",
+                                    "auth_token" : "api_user20230419045143",
+                                    "page" : 1,
+                                    "limit" : 3
+                                }',
+                                CURLOPT_HTTPHEADER => array(
+                                    'Content-Type: application/json'
+                                ),
+                            ));
+
+                            $response = curl_exec($curl);
+                            curl_close($curl);
+
+                            $elm = json_decode($response, true);
+                            echo '<pre>';
+                            print_r($elm[0]["Year"]);
+                            echo '<br>';
+                            print_r($elm[0]["JournalList"][0]["PaperTitle"]);
+                            echo '<br>';
+                            print_r($elm[0]["JournalList"][0]["JournalLink"]);
+                            echo '<br>';
+                            print_r($elm[0]["JournalList"][0]["Keyword"]);
+                            echo '<br>';
+                            print_r($elm[0]["JournalList"][0]["JournalTitle"]);
+                            echo '<br>';
+                            print_r($elm[0]["JournalList"][0]["Author"][0]["AuthorName"]);
+                            // echo '<br>';
+                            // print_r($elm[0]["JournalList"][0]["Author"]);
+                            // echo '<br>';
+                            // print_r($elm[0]["JournalList"][0]);
+                            // echo '<br>';
+                            // print_r($elm[0]);
+                            ?>
 
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2014</span>
-
-                                <h2 class="paper-title">Study of Optical Radiation Efficiency of Nanoparticles</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Nano-Optics</span>
-                                </p>
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>Nanoscience&Nanotechnololy Letter. Volume 6, Number 2, February 2014 , pp. 170-173(4)
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Nurain, N., Kabir, T., and Kabir, M. H.
-                                </p>
-
-                            </div>
-
-
-
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2014</span>
-
-                                <h2 class="paper-title">Improving Speech Signal Intelligibility by Optimal Computation using Single-Channel Adaptive Filtering</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Machine Translation</span> <span class="tag">Speech Synthesis and Recognition</span>
-                                </p>
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>ISBN : 973-93-80883-71-7, IJCA November 2014 Edition, November 18, 2014
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Ohidujjaman, Mahmudul Hasan, and Mohammad Nurul Huda
-                                </p>
-
-                            </div>
-
-
-
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2015</span>
-
-                                <h2 class="paper-title">Data Compression Considering Text Files</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Data Compression</span>
-                                </p>
-
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>International Journal of Computer Applications (IJCA) March 2014 Edition
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Kashfia Sailunaz, Mohammed Rokibul Alam Kotwal and Mohammad Nurul Huda
-                                </p>
-
-                            </div>
-
-                            <div class="paper-details">
-                                <span class="paper-year">2015</span>
-
-                                <h2 class="paper-title">Target Coverage Through Distributed Clustering in Directional Sensor Networks</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Wireless Communications</span>
-                                </p>
-
-                                <p class="paper-event">
-                                    <i>Publication: </i> Eurasip Journal on Wireless Communications and Networking, April 2015 (in Press). SCIE,
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i> Md. Mofijul Islam, Md. Ahasanuzzaman, Md. Abdur Razzaque, M. M. Hassan, Abdulhameed Alelaiwi, Yang Xiang
-                                </p>
-
-                            </div>
-
-
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2014</span>
-
-                                <h2 class="paper-title">Study of Optical Radiation Efficiency of Nanoparticles</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Nano-Optics</span>
-                                </p>
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>Nanoscience&Nanotechnololy Letter. Volume 6, Number 2, February 2014 , pp. 170-173(4)
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Nurain, N., Kabir, T., and Kabir, M. H.
-                                </p>
-
-                            </div>
-
-
-
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2014</span>
-
-                                <h2 class="paper-title">Improving Speech Signal Intelligibility by Optimal Computation using Single-Channel Adaptive Filtering</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Machine Translation</span> <span class="tag">Speech Synthesis and Recognition</span>
-                                </p>
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>ISBN : 973-93-80883-71-7, IJCA November 2014 Edition, November 18, 2014
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Ohidujjaman, Mahmudul Hasan, and Mohammad Nurul Huda
-                                </p>
-
-                            </div>
-
-
-
-
-
-
-                            <div class="paper-details">
-                                <span class="paper-year">2014</span>
-
-                                <h2 class="paper-title">Data Compression Considering Text Files</h2>
-                                <p class="paper-tags">
-                                    <span class="tag">Data Compression</span>
-                                </p>
-
-
-                                <p class="paper-event">
-                                    <i>Publication: </i>International Journal of Computer Applications (IJCA) March 2014 Edition
-                                </p>
-
-                                <p class="paper-contributors">
-                                    <i>Authors: </i>Kashfia Sailunaz, Mohammed Rokibul Alam Kotwal and Mohammad Nurul Huda
-                                </p>
-
-                            </div>
                         </div>
                     </section>
-
-
-
-
-
-
                 </div>
-
-
-
             </div>
         </div>
+    </main>
+    <!-- #main -->
 
 
+    <script>
+        // var myHeaders = new Headers();
+        // myHeaders.append("Content-Type", "application/json");
 
+        // var raw = JSON.stringify({
+        //     "employee_id": "",
+        //     "year": "",
+        //     "user_login_id": "api_user",
+        //     "auth_token": "api_user20230419045143",
+        //     "page": 1,
+        //     "limit": 3
+        // });
+
+        // var requestOptions = {
+        //     method: 'POST',
+        //     headers: myHeaders,
+        //     body: raw,
+        //     redirect: 'follow'
+        // };
+
+        // fetch("http://103.109.52.3/webapi/api/EmployeeJournal", requestOptions)
+        //     .then(response => response.text())
+        //     .then(result => console.log(result))
+        //     .catch(error => console.log('error', error));
+    </script>
 
 
-    </main>
-    <!-- #main -->
 
 <?php endwhile; // end of the loop.
 ?>

+ 5 - 4
single-faculty.php

@@ -50,8 +50,8 @@ get_header(); ?>
 				"year"  => "",
 				'user_login_id' => $client_id,
 				'auth_token' => $auth_token
-				// 'page' : 1,
-				// 'limit' : 1
+				// 'page' => 1,
+				// 'limit' => 1
 			)
 
 		)
@@ -66,8 +66,8 @@ get_header(); ?>
 				"year"  => "",
 				'user_login_id' => $client_id,
 				'auth_token' => $auth_token
-				// 'page' : 1,
-				// 'limit' : 1
+				// 'page' => 1,
+				// 'limit' => 1
 			)
 
 		)
@@ -158,6 +158,7 @@ get_header(); ?>
 							<h2 class="m-text">Publication</h2>
 							<p class="m-text">
 								<?php
+								echo '<pre>';
 								print_r($employeeInfo);
 								print_r($employeeJournal);
 								print_r($employeeConference);