Esempio n. 1
0
					        <h3 class="panel-title">Research Data Switchboard API: Registration Form</h3>
						<br/>
						<p>Please complete the following registration form. We will contact you shortly after receiving your registration form to provide you with the API key.</p>
					    </div>
						<div class="panel-body">
							<div class="container-fluid">
								<form action="" method="post">
									<input type="hidden" name="posted" value="1" />
								<table>
									<tbody>
<?php 
    formElement("company", "text", "Organisation Name", "Name of your organisation or university.", "Please enter name of your organisation or university.", $company, $posted);
    formElement("website", "text", "Organisation Website", "Web address for your organisation.", "Please enter web address for your organisation.", $website, $posted);
    formElement("name", "text", "Contact Name", "Your title and name.", "Please enter your name.", $name, $posted);
    formElement("email", "email", "Contact Email", "Your email address.", "Please enter your email address.", $email, $posted);
    formElement("phone", "tel", "Contact Phone", "Your contact number.", null, $phone, $posted);
    formTextElement("reason", "Purpose&nbsp;of the&nbsp;access to&nbsp;RD-Switchboard&nbsp;API", "What cool things are you going to do? Or just enter the name of your project.", "Please enter name of your project.", $reason, $posted);
    ?>
										<tr><td>&nbsp;</td><td><input type="submit" /></td></tr>
									</tbody>
								</table>
								</form>
							</div>
						</div>
<?php 
}
?>
					</div>
				</div>
			</div>
		</div>
Esempio n. 2
0
            }
            // Form element
            $optionValue = getOption('loadSheet', $tSheets[0]);
            print formElement(formLabel('loadSheet', 'Excel sheet'), formSelect('loadSheet', $optionValue, $sheets));
            // Apply sheet
            $loadSheet = $optionValue;
            $reader->setOption('loadSheet', $optionValue);
            break;
    }
}
function getOption($name, $default = null)
{
    global $sessionOptions;
    return array_key_exists($name, $sessionOptions) ? $sessionOptions[$name] : $default;
}
print formElement('', formSubmit('filter', 'Save options'));
print formEnd();
########################################################################################################################
## Print Excel sheet ###################################################################################################
########################################################################################################################
echo '<h2>Preview</h2>';
$workbook = $reader->load($excelFile);
$sheet = $workbook->getSheet($loadSheet);
print '<table border="1" cellpadding="1" cellspacing="0">';
for ($row = 0; $row < min(10, $sheet->getNumRows()); $row++) {
    print '<tr>';
    for ($col = 0; $col < $sheet->getNumColumns(); $col++) {
        print '<td>' . $sheet->getCellValue($row, $col) . '</td>';
    }
    print '</tr>';
}