Process success for Data Document ID = ".$dd_id."


"; }else{ echo "

Process failed for Data Document ID = ".$dd_id."


"; } } } } function processhtmlcodehistories($conn,$file_path){ $file_path = __DIR__."/".$file_path; if(!is_dir($file_path)){ mkdir($file_path,0777,true); } $sql = "select * from html_code_histories Limit 0,100"; $result = mysqli_query($conn,$sql); //count while ($row = mysqli_fetch_assoc($result)){ $member_id = $row['member_id'] ; $client_id = $row['client_id'] ; $dd_id = $row['id'] ; $new_path = $file_path."/".$member_id."/".$client_id; if(!is_dir($new_path)){ mkdir($new_path,0777,true); } $path = $new_path.'/'.$dd_id; if(!empty($row['code']) && !file_exists($path.".html")){ fileWrite($path,$row['code']); $sql1 = "UPDATE data_documents SET is_process=1 WHERE id=".$dd_id; if(1){ echo "

Process success for Data Document ID = ".$dd_id."


"; }else{ echo "

Process failed for Data Document ID = ".$dd_id."


"; } } } } function fileWrite($file_name,$content){ //file_put_contents($file_name.".", $current); try { //$pattern = "/]*>(?:(?!<\/script>)[^])*<\/script>/g"; //$content = preg_replace($pattern, "", $content); $file = fopen($file_name.".html","wb"); fwrite($file,utf8_encode($content)); fclose($file); } catch (Exception $e) { } }