Advertisement
Guest User

index.php

a guest
Feb 6th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.84 KB | None | 0 0
  1. <?php
  2. $show_detail = FALSE;
  3.  
  4. if (isset($_GET['rid'])) {
  5.     $reference_id = $_GET['rid'];
  6.  
  7.     $result  = [];
  8.     if (($handle = fopen("users.csv", "r")) !== FALSE) {
  9.         while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
  10.             // echo "reference_id = " . $reference_id;
  11.             // echo "<br>";
  12.             // echo "data[0] = " . $data[0];
  13.             // echo "<hr>";
  14.             if ($data[0] === $reference_id) {
  15.                 $show_detail = TRUE;
  16.                 $result = $data;
  17.                 break;
  18.             }
  19.         }
  20.         fclose($handle);
  21.         // var_dump($result);
  22.         $certificate_number = $result[1];
  23.         $name = $result[2];
  24.         $designation = $result[3];
  25.         $institute = $result[4];
  26.         $workshop_orgeniser = $result[5];
  27.         $workshop_name = $result[6];
  28.         $workshop_date = $result[7];
  29.         $avatar = ($result[8] == '') ? "https://i.stack.imgur.com/34AD2.jpg" : $result[8];
  30.     }
  31. }
  32. ?>
  33.  
  34. <html>
  35.  
  36. <head>
  37.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  38.     <!-- Latest compiled and minified CSS -->
  39.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  40.     <style>
  41.         .inf-content {
  42.             border: 1px solid #DDDDDD;
  43.             -webkit-border-radius: 10px;
  44.             -moz-border-radius: 10px;
  45.             border-radius: 10px;
  46.             box-shadow: 7px 7px 7px rgba(0, 0, 0, 0.3);
  47.         }
  48.     </style>
  49. </head>
  50.  
  51. <body>
  52.     <div class="container bootstrap snippet">
  53.         <h1>Cerificate Details</h1>
  54.         <div class="panel-body inf-content">
  55.             <div class="row">
  56.                 <?php
  57.                 if ($show_detail) {
  58.                 ?>
  59.                     <div class="col-md-3 text-center">
  60.                         <!-- <img alt="" style="width:250px;" title="" class="img-circle img-thumbnail isTooltip" src="https://bootdey.com/img/Content/avatar/avatar7.png" data-original-title="Usuario"> -->
  61.                         <img alt="" style="width:250px;height:250px;" title="" class="img-circle img-thumbnail isTooltip" src="<?php echo $avatar; ?>" data-original-title="Usuario">
  62.                     </div>
  63.                     <div class="col-md-9">
  64.                         <strong>Information</strong><br>
  65.                         <div class="table-responsive">
  66.                             <table class="table table-user-information">
  67.                                 <tbody>
  68.                                     <tr>
  69.                                         <td><strong>Certificate Number</strong></td>
  70.                                         <td class="text-primary"><?php echo $certificate_number; ?></td>
  71.                                     </tr>
  72.                                     <tr>
  73.                                         <td><strong>Name</strong></td>
  74.                                         <td class="text-primary"><?php echo $name; ?></td>
  75.                                     </tr>
  76.                                     <tr>
  77.                                         <td><strong>Designation</strong></td>
  78.                                         <td class="text-primary"><?php echo $designation; ?></td>
  79.                                     </tr>
  80.                                     <tr>
  81.                                         <td><strong>Institute</strong></td>
  82.                                         <td class="text-primary"><?php echo $institute; ?></td>
  83.                                     </tr>
  84.                                     <tr>
  85.                                         <td><strong>Workshop Orgeniser</strong></td>
  86.                                         <td class="text-primary"><?php echo $workshop_orgeniser; ?></td>
  87.                                     </tr>
  88.                                     <tr>
  89.                                         <td><strong>Workshop Name</strong></td>
  90.                                         <td class="text-primary"><?php echo $workshop_name; ?></td>
  91.                                     </tr>
  92.                                     <tr>
  93.                                         <td><strong>Workshop Date</strong></td>
  94.                                         <td class="text-primary"><?php echo $workshop_date; ?></td>
  95.                                     </tr>
  96.                                 </tbody>
  97.                             </table>
  98.                         </div>
  99.                     </div>
  100.                 <?php
  101.                 } else {
  102.                 ?>
  103.                     <div class="col-md-12 text-center">
  104.                         Nothing to show...
  105.                     </div>
  106.                 <?php
  107.                 }
  108.                 ?>
  109.             </div>
  110.         </div>
  111.     </div>
  112. </body>
  113.  
  114. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement