Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Nilai Siswa</title>
- <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
- </head>
- <body>
- <?php
- include ('admin_header.php');
- include ('menu_nilai.php');
- ?>
- <font color="000">
- <div align="left">
- <h3>Nilai Siswa - Masukkan Nilai Tengah Semester</h3></div>
- <hr size=1 width=100% align="left">
- </font>
- <div align="left">
- <?php
- include('menu_masukan_nilai.php');
- ?>
- </div>
- <div align="left">
- <?php
- require "koneksi.php";
- include "config.php";
- require_once 'biff-reader-2010-10-07/CompoundDocument.inc.php';
- require_once 'biff-reader-2010-10-07/BiffWorkbook.inc.php';
- $fileName = $_POST['usefile'];
- if (!is_readable ($fileName)) die ('Cannot read ' . $fileName);
- $doc = new CompoundDocument ('utf-8');
- $doc->parse (file_get_contents ($fileName));
- $wb = new BiffWorkbook ($doc);
- $wb->parse ();
- $s='';
- foreach ($wb->sheets as $sheetName => $sheet)
- {
- echo '<table cellspacing = "0">';
- for ($row = 0; $row < $sheet->rows (); $row ++)
- {
- echo '<tr>';
- $teks='';
- for ($col = 1; $col < $sheet->cols (); $col ++)
- {
- $cell = (!isset ($sheet->cells [$row][$col])?$sheet->cells [$row][$col]:NULL);
- $teks.=($col==1?'':',').(isset($cell)?"'".$cell->value."'":"''");
- echo (isset($cell)?'<td style = "'.$cell->style->css ().'" rowspan = "'
- .$cell->rowspan.'" colspan = "'.$cell->colspan .'">':'<td>';
- echo (isset($cell->value) && !empty($cell->value)? $cell->value:' ');
- echo '</td>';
- }
- $query = "INSERT INTO nilai (no_induk, nama, kode_mapel, ulangan_mid, semester, kelas) VALUES ($teks)";
- $s.=$query."<br>";
- $hasil = mysql_query($query);
- }
- echo '</table>';
- }
- ?>
- </div>
- <?php
- include ('bawah.php');
- echo $s;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement