| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- if(isset($_POST["dir"])){
- include("../connectSQL_Component.php");
- $tables = [];
- $file_tables = [];
- $dir_tables = [];
- $dir = $_POST["dir"];
- $sql = "SELECT [title], [file_path] FROM [BIMComponents].[dbo].[Video_Table] WHERE dir_name = '".$dir."'";
- $fetchResult = sqlsrv_query($conn, $sql);
- while ($row = sqlsrv_fetch_array($fetchResult)) {
- array_push($file_tables,$row);
- }
- $sql = "SELECT [dir_name] FROM [BIMComponents].[dbo].[Video_Node] WHERE parent = '".$dir."'";
- $fetchResult = sqlsrv_query($conn, $sql);
- while ($row = sqlsrv_fetch_array($fetchResult)) {
- array_push($dir_tables,$row);
- }
- echo json_encode($dir_tables);
- sqlsrv_close($conn);
- }
- /*
- foreach($tables as $table){
- $rootpath = $rootpath."/".$table["dir_name"];
- $sql = "IF EXISTS(SELECT * FROM [BIMComponents].[dbo].[Video_Table] WHERE dir_name = '".$table["dir_name"]."')
- BEGIN
- SELECT * FROM [BIMComponents].[dbo].[Video_Table] WHERE dir_name = '".$table["dir_name"]."'
- END
- ELSE
- BEGIN
- SELECT * FROM [BIMComponents].[dbo].[Video_Node] WHERE parent = '".$table["dir_name"]."'
- END";
- $fetchResult = sqlsrv_query($conn, $sql);
- while ($row = sqlsrv_fetch_array($fetchResult)) {
- if(isset($row["file_path"])){
- echo "video listing"."<br>";
- echo json_encode($row["file_path"],JSON_UNESCAPED_UNICODE)."<br>";
- }else{
- echo "<p>";
- echo "<a href='#'><i class='fa fa-folder'></i>" . $row["title"] . "</a>";
- echo "</p>";
- }
- }
- }
- */
-
|