<?php
include("./script/php/connectSQL_Component.php");
$root = './assets/API/Universal/Dynamo/';

$paths = array_diff(scandir($root), array('.', '..'));

for ($i = 0; $i < count($paths); $i++) {
    $splits = explode(")",$paths[$i]);
    $name = $splits[1];
    $id = $splits[0].')';
    $sql = "INSERT INTO [BIMComponents].[dbo].[API_Table]
([APIName]
,[software]
,[dynamoVersion]
,[revitVersion]
,[filePath]
,[APIID])
VALUES
('".$name."'
,'Dynamo'
,'1.3.2'
,'2017'
,'".$root.$paths[$i]."'
,'".$id."');";

    //sqlsrv_query($conn, $sql);
    echo($sql."<br>");
}

sqlsrv_close($conn);
