Example #1
0
        if ($conn == false) {
            echo "No connection";
            die(FormatErrors(sqlsrv_errors()));
        }
        return $conn;
    } catch (Exception $e) {
        echo "Error!";
    }
}
function WriteData()
{
    try {
        echo "622";
        $conn = OpenConnection();
        $sql = "INSERT dbo.Dog OUTPUT INSERTED.Name VALUES (Rosco Jenkins,10)";
        $stmt = sqlsrv_query($conn, $sql);
        if (!$stmt) {
            echo "Error: Doesn't Query";
        }
        sqlsrv_close($conn);
    } catch (Exception $e) {
        echo "Error!";
    }
}
echo "6";
WriteData();
echo "7";
?>
 </body>
</html>
Example #2
0
                $InF = $Location . $_FILES['file']['name'];
                $OutF = preg_replace('/\\..+$/', '.' . $GLOBALS['OutputExt'], $InF);
                WriteData(ConvInputFileToOutputStr($InF), $OutF);
                echo "File: " . $Location . $_FILES['file']['name'] . " is uploaded & converted.<br />";
            } else {
                echo "Wrong extention, allowd extentions are:<b>";
                for ($I = 0; $I < count($Allowed); $I++) {
                    echo " ." . $Allowed[$I];
                }
                echo "</b>";
            }
        } else {
            echo "Upload has failed!!!";
        }
    }
} else {
    $InF = $argv[1];
    //input file as command line input
    $OutF = preg_replace('/\\..+$/', '.' . $GLOBALS['OutputExt'], $InF);
    WriteData(ConvInputFileToOutputStr($InF), $OutF);
    echo "Conversion Completed\n";
    exit;
}
?>
<h3>x3d upload interface for CAD2SL</h3>
<br />
<form method="post" action="" enctype="multipart/form-data">
<input type="file" name="file" /><br />
<input type="submit" name="upload" value="Uploaden!" />
</form>
Example #3
0
                    if ((int) $DrownWindow < (int) $LeftWindow && (int) $DrownRight[$j] > (int) $RightBuilding[$Level]) {
                        $sum++;
                    }
                    $j++;
                }
                if (!in_array($LeftWindow, $DrownLeft)) {
                    $DrownLeft[] = $LeftWindow;
                }
                if (!in_array($RightBuilding[$Level], $DrownRight)) {
                    $DrownRight[] = $RightBuilding[$Level];
                }
            }
        }
        $Level++;
    }
    $Result = $sum;
    $OutputText .= "Case #" . $TestCase . ": " . $Result . "\n";
    $DrownLeft = array();
    $DrownRight = array();
    $sum = 0;
    $LeftBuilding = array();
    $RightBuilding = array();
}
//echo $OutputText;
WriteData($OutputText);
echo '<br />Ready !!';
?>