81 lines
2.0 KiB
PHP
81 lines
2.0 KiB
PHP
<?php
|
|
error_reporting(0);
|
|
require_once 'excel_reader2.php';
|
|
|
|
$serverName = "CBM2K12\SQLEXPRESS";
|
|
$uid = "cbmclient";
|
|
$pwd = "ascbm2k";
|
|
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"SugarCaneScale" );
|
|
|
|
/* Connect using SQL Server Authentication. */
|
|
$conn = sqlsrv_connect( $serverName, $connectionInfo);
|
|
if( $conn === false )
|
|
{
|
|
echo "Unable to connect.</br>";
|
|
die( print_r( sqlsrv_errors(), true));
|
|
}
|
|
|
|
$sql = "SELECT CropDay FROM Parameters";
|
|
|
|
$stmt = sqlsrv_query( $conn, $sql );
|
|
if( $stmt === false) {
|
|
die( print_r( sqlsrv_errors(), true) );
|
|
}
|
|
|
|
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) );
|
|
{
|
|
$data = new Spreadsheet_Excel_Reader("C:/Dropbox (LASUCA)/LASUCA Team Folder/MillLab/2018 MILLLABREPORT/CROP DAY "echo htmlspecialchars(<?=$row['CropDay']; ?>)"/cropday4milllab.xls");
|
|
}
|
|
sqlsrv_free_stmt( $stmt);
|
|
sqlsrv_close( $conn);
|
|
?>
|
|
|
|
<html>
|
|
<head>
|
|
<meta name="generator"
|
|
content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
|
|
<meta http-equiv="refresh" content="300" />
|
|
<style>
|
|
|
|
table.excel {
|
|
border-style:ridge;
|
|
border-width:1;
|
|
border-collapse:collapse;
|
|
font-family:sans-serif;
|
|
font-size:16px;
|
|
margin: 0px;
|
|
width: 100%;
|
|
}
|
|
table.excel thead th, table.excel tbody th {
|
|
background:#CCCCCC;
|
|
border-style:ridge;
|
|
border-width:1;
|
|
text-align: center;
|
|
vertical-align:bottom;
|
|
}
|
|
table.excel tbody th {
|
|
text-align:center;
|
|
width:20px;
|
|
}
|
|
table.excel tbody td {
|
|
vertical-align:bottom;
|
|
height:15px;
|
|
}
|
|
table.excel tbody td {
|
|
padding: 0 3px;
|
|
border: 1px solid #000;
|
|
}
|
|
table tr {
|
|
padding: 0 3px;
|
|
border: 1px solid #000;
|
|
line-height: 20px;
|
|
border-collapse: collapse;
|
|
}
|
|
</style>
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<?php echo $data->dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel'); ?>
|
|
</body>
|
|
</html>
|