Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class Student {
  3.     public $strStudentID;
  4.     public $strName;
  5.     public $strBirthday;
  6.     public $strAdress;
  7.     public $strCity;
  8.     public $strEmail;
  9.     public $strPhone;
  10.     public $strMobile;
  11.  
  12.     public function ShowFiche($strStudentid){
  13.         $this->GetStudent("oef6/studentgegevens.csv",$strStudentid);
  14.         echo'<table border="0">
  15.              <tr>
  16.                 <td colspan="2" align="center"><img src="oef6/fotos/'.$this->strStudentID.'.jpg"alt="niels"/></td>
  17.              </tr>
  18.              <tr>
  19.                 <td>
  20.                    id  <br />
  21.                    naam  <br />
  22.                    geboortedatum  <br />
  23.                    Adress  <br />
  24.                    Stad  <br />
  25.                    E-mail <br />
  26.                    tel. <br />
  27.                    gsm  <br />
  28.                 </td>
  29.                 <td>
  30.                    '.$this->strStudentID.'<br />
  31.                    '.$this->strName.'<br />
  32.                    '.$this->strBirthday.'<br />
  33.                    '.$this->strAdress.'<br />
  34.                    '.$this->strCity.'<br />
  35.                    '.$this->strEmail.'<br />
  36.                    '.$this->strPhone.'<br />
  37.                    '.$this->strMobile.'<br />
  38.                 </td>
  39.              </tr>
  40.             </table>';
  41.     }
  42.  
  43.     public function GetStudent($strFile,$strStudentid){
  44.       if (($rscFileHandle = fopen($strFile,"r")) !== FALSE){
  45.           while(($arrStudentData = fgetcsv($rscFileHandle,1000,";")) !== FALSE){
  46.             if($arrStudentData[0]==$strStudentid){
  47.                 $this->strStudentID = $arrStudentData[0];
  48.                 $this->strName = $arrStudentData[1];
  49.                 $this->strBirthday = $arrStudentData[2];
  50.                 $this->strAdress = $arrStudentData[3];
  51.                 $this->strCity = $arrStudentData[4];
  52.                 $this->strEmail = $arrStudentData[5];
  53.                 $this->strPhone = $arrStudentData[6];
  54.                 $this->strMobile = $arrStudentData[7];
  55.             }
  56.           }
  57.       }
  58.       fclose($rscFileHandle);
  59.     }
  60. }
  61.  
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement