do not require PDO if we're using mocha-dotnet
This commit is contained in:
parent
162cbff537
commit
f20fa1f393
@ -26,7 +26,7 @@
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
$pdoex = $ex;
|
||||
echo($pdoex); die();
|
||||
// echo($pdoex); die();
|
||||
}
|
||||
$basepath = $_SERVER["SERVER_NAME"];
|
||||
|
||||
@ -34,31 +34,33 @@
|
||||
{
|
||||
protected function OnPreRender(CancelEventArgs $e)
|
||||
{
|
||||
global $pdo;
|
||||
global $basepath;
|
||||
|
||||
$e->Cancel = true;
|
||||
|
||||
if ($_POST["reset"] == "1")
|
||||
{
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_attributes WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
global $pdo;
|
||||
if ($pdo !== null) {
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_attributes WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_relationships WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_relationships WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_instances WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_instances WHERE tenant_id > 2");
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_tenant_references WHERE source_tenant_id > 2");
|
||||
$stmt->execute();
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_tenant_references WHERE source_tenant_id > 2");
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_tenants WHERE id > 2");
|
||||
$stmt->execute();
|
||||
$stmt = $pdo->prepare("DELETE FROM mocha_tenants WHERE id > 2");
|
||||
$stmt->execute();
|
||||
|
||||
header("HTTP/1.1 302 Found");
|
||||
header("Location: /suv/suvinfo.html");
|
||||
exit();
|
||||
header("HTTP/1.1 302 Found");
|
||||
header("Location: /suv/suvinfo.html");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$path = System::GetVirtualPath();
|
||||
@ -328,39 +330,40 @@ EOF
|
||||
else
|
||||
{
|
||||
global $pdo;
|
||||
global $basepath;
|
||||
if ($pdo !== null) {
|
||||
global $basepath;
|
||||
|
||||
$query = "SELECT * FROM mocha_tenants";
|
||||
$stmt = $pdo->prepare($query);
|
||||
try
|
||||
{
|
||||
$result = $stmt->execute();
|
||||
$rows = $stmt->fetchAll();
|
||||
foreach ($rows as $values)
|
||||
{
|
||||
if ($values["is_library"] != 0)
|
||||
{
|
||||
continue;
|
||||
$query = "SELECT * FROM mocha_tenants";
|
||||
$stmt = $pdo->prepare($query);
|
||||
try {
|
||||
$result = $stmt->execute();
|
||||
$rows = $stmt->fetchAll();
|
||||
foreach ($rows as $values) {
|
||||
if ($values["is_library"] != 0) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="uwt-external-link" target="_blank" href="<?php echo ("https://" . $basepath . "/" . $values["tenant_name"]); ?>"><?php echo ($values["tenant_name"]); ?></a></td>
|
||||
<td>Active</td>
|
||||
<td>Development</td>
|
||||
<td>Local</td>
|
||||
<td>No Charge</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><?php echo ($values["tenant_purpose"]); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="uwt-external-link" target="_blank" href="<?php echo("https://" . $basepath . "/" . $values["tenant_name"]); ?>"><?php echo ($values["tenant_name"]); ?></a></td>
|
||||
<td>Active</td>
|
||||
<td>Development</td>
|
||||
<td>Local</td>
|
||||
<td>No Charge</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><?php echo($values["tenant_purpose"]); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
} catch (\Exception $ex) {
|
||||
echo ("<tr><td colspan=\"10\">" . $ex . "</td></tr>");
|
||||
}
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
else
|
||||
{
|
||||
echo ("<tr><td colspan=\"10\">" . $ex . "</td></tr>");
|
||||
// FIXME : use mocha-dotnet
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user