( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
$db = new NewsSQL;
//a class to handle database operations
ini_set('max_execution_time', 300000); //300 seconds = 5 minutes
error_reporting(1);
function downloadFile($url, $path)
{
$newfname = $path;
$file = fopen ($url, 'rb');
if ($file) {
$newf = fopen ($newfname, 'wb');
if ($newf) {
while(!feof($file)) {
fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
}
}
}
if ($file) {
fclose($file);
}
if ($newf) {
fclose($newf);
}
}
include("TheBrandZ/data/businesscards.php");
$data = json_decode($json , true);
$count = -1;
$specialID = 15000;
foreach ($data as $row) {
$count++;
$specialID++;
if($count >=0 && $count <=50000) {
$image = $row['Image'];
$preview = $image;
$preview = str_replace('Edwin', "Company", $preview);
$file_name = str_replace('https://dynamic.brandcrowd.com/template/preview/design/', "", $image);
$file_name = explode('/', $file_name)[0];
$template = $file_name;
echo $finalURL = "https://www.brandcrowd.com/maker/api/template/$template<br>";
//end download json
}
}