/** * returns Heurist record id by faims id * * @param mixed $faims_id */ function getRecordByFaimsId($faims_id) { global $mysqli, $dt_SourceRecordID; return mysqli__select_value($mysqli, "select dtl_RecID from recDetails where dtL_DetailTypeID={$dt_SourceRecordID} and dtl_Value={$faims_id}"); }
if (!file_exists($imgfolder) && !mkdir($imgfolder, 0777, true)) { print "<p class='error'>'Failed to create folder: " . $imgfolder . "</p>"; } else { $imgfolder = $imgfolder . "/" . $row[4]; if (!file_exists($imgfolder)) { if (!mkdir($imgfolder, 0777, true)) { print "<p class='error'>'Failed to create folder: " . $imgfolder . "</p>"; } else { if (file_exists($row[5] . $row[6])) { $filename = $imgfolder . "/" . $filename_orig; //copy file copy($row[5] . $row[6], $filename); $f_name = mysqli__select_value($mysqli, 'select dtl_Value from recDetails where dtl_RecID=' . $recid . ' and dtl_DetailTypeID=' . DT_NAME); $f_desc = mysqli__select_value($mysqli, 'select dtl_Value from recDetails where dtl_RecID=' . $recid . ' and dtl_DetailTypeID=' . DT_SHORT_SUMMARY); if (!$f_desc) { $f_desc = mysqli__select_value($mysqli, 'select dtl_Value from recDetails where dtl_RecID=' . $recid . ' and dtl_DetailTypeID=' . DT_EXTENDED_DESCRIPTION); } if (!$f_name) { $f_name = $dtype . ' id ' . $row[4]; } if (!$f_desc) { $f_desc = $dtype . ' from Heurist db ' . HEURIST_DBNAME; } //create metadata $meta = getMetadata($f_name, $f_desc, $dtype); $metadata_content = $meta->asXML(); $metadata_file = $imgfolder . "/" . strtolower($dtype) . ".xml"; file_put_contents($metadata_file, utf8_encode($metadata_content)); //add command line to batch file $batch = $batch . "\n java -cp org.tdar.utils.CommandLineAPITool -http -username {$fusername} -password {$fpwd} -file " . $imgfolder . "/ -host " . $host . " -projectid " . $projectId; addRegistration($dtype, $metadata_file, $metadata_content, $filename, $filename_orig);