<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><html lang="fa">
<head>
<title>Progress Bar</title>
<style>
body{font:.8em tahoma;direction:rtl;text-align:center} #logo{margin:40px auto 40px auto}
#progress{width:500px;border:1px solid #ccc;padding:8px;margin: 0px auto;}
#progress div{background-color:#C3FF73;padding:4px}
#information{margin: 0px auto;width:500px;text-align:right}
</style>
</head>
<body>
<img src="logo-public.png" id="logo" /><br/>
<span>اسکریپت تبدیل فایل ایکسل به MySQ</span>
<!-- Progress bar holder -->
<div id="progress"></div>
<!-- Progress information -->
<div id="information"><div>
<?php
error_reporting(E_ALL^E_NOTICE);
require_once 'Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
mysql_connect('localhost', 'root', '');
mysql_select_db('xls2sql');
mysql_query('SET NAMES utf8');
$data->read('Senator.xls);
for ($j = 1; $j < $data->sheets[0]['numRows']; $j++)
{
$percent = intval( $j/$data->sheets[0]['numRows'] * 100) . "%";
$f1 = $data->sheets[0]['cells'][$j + 1][1];
$f2 = $data->sheets[0]['cells'][$j + 1][2];
$f3 = $data->sheets[0]['cells'][$j + 1][3];
$f4 = $data->sheets[0]['cells'][$j + 1][4];
mysql_query("insert INTO `xlsx` values('','$f1','$f2','$f3','$f4')");
// Javascript for updating the progress bar and information
echo ' ';
// Send output to browser immediately
ob_flush();
}
?>