Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 19th, 2018 68 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1.     public function excelkegiatan()
  2.     {
  3.         $kegiatan = DB::table('kegiatan')->get();
  4.  
  5.         $kegData = "";
  6.  
  7.         if(count($kegiatan) >0 ){
  8.             $kegData .= '<table>
  9.             <tr>
  10.             <th style="border:1px solid #000; background-color:#255255255;">No</th>
  11.             <th style="border:1px solid #000; background-color:#255255255;">Kegiatan</th>
  12.             <th style="border:1px solid #000; background-color:#255255255;">Tahun</th>
  13.             </tr>';
  14.  
  15.             foreach ($kegiatan as $kegiatan) {
  16.                 $kegData .= '
  17.                 <tr>
  18.                 <td style="border:1px solid #000; background-color:#255255255">'.$kegiatan->id_kegiatan.'</td>
  19.                 <td style="border:1px solid #000; background-color:#255255255">'.$kegiatan->nama_kegiatan.'</td>
  20.                 <td style="border:1px solid #000; background-color:#255255255">'.$kegiatan->tahun_kegiatan.'</td>
  21.                 </tr>';
  22.             }
  23.             $kegData .='</table>';
  24.         }
  25.  
  26.         header('Content-Type: application/xls');
  27.         header('Content-Disposition: attachment; filename=kegiatan.xls');
  28.         echo $kegData;
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top