CrudGenUtility::createTemplatesPathIfNotExists($template_path);
$fp = fopen($Settings->settings['TemplatesWriteablePath'] . $template_path, 'w');
# Datalist Content #
$fp1 = fopen(LIBS_PATH . "/templates/editform.tpl", 'r');
$content = fread($fp1, filesize(LIBS_PATH . "/templates/editform.tpl"));
fclose($fp1);
# Datalist Content #
$fp2 = fopen(LIBS_PATH . "/templates/editform_fields.tpl", 'r');
$fields_content = fread($fp2, filesize(LIBS_PATH . "/templates/editform_fields.tpl"));
fclose($fp2);
$s_word = "s";
$content = str_replace("##KeyLabel##", $keyLabel, $content);
$content = str_replace("##KeyLabel-PHP##", '{$' . $keyLabel . '}', $content);
$content = str_replace("##ItemLabel##", $itemLabel, $content);
$content = str_replace("##s_word##", $s_word, $content);
$content = str_replace("##datalistLink", $src_path, $content);
$content = str_replace("##formAction", $editform_action, $content);
$fields_content_str = "";
foreach ($includeArr as $key => $value) {
    $get_fields_content = $fields_content;
    $fieldKey = CrudGenUtility::getField($key);
    $get_fields_content = str_replace("##FieldKey##", $fieldKey, $get_fields_content);
    $get_fields_content = str_replace("##Key##", $key, $get_fields_content);
    $get_fields_content = str_replace("##MemberKey-PHP##", '{$' . $Key . '}', $get_fields_content);
    $fields_content_str .= $get_fields_content;
}
$content = str_replace("##FieldInputs##", $fields_content_str, $content);
fwrite($fp, $content);
fclose($fp);
echo "bbb";
Esempio n. 2
0
$datalist_content = str_replace("##Search-Inputs##", $search_input_str, $datalist_content);
if ($search_input_str != "") {
    $datalist_content = str_replace("##Search-Btn##", '<a href="javascript:void(0)" onclick="$(\'#frmSearch\').submit();" class="btn btn-primary">Search</a>', $datalist_content);
} else {
    $datalist_content = str_replace("##Search-Btn##", '', $datalist_content);
}
##
## Rows - Labels ##
$fp4 = fopen(LIBS_PATH . "/templates/datalist-labelcolumns.tpl", 'r');
$datalist_rowlabels = fread($fp4, filesize(LIBS_PATH . "/templates/datalist-labelcolumns.tpl"));
fclose($fp4);
$row_labels_str = "";
foreach ($resultset[0] as $key => $value) {
    $rowlabels_getrow = $datalist_rowlabels;
    if (in_array($key, $includeArr)) {
        $keyField = CrudGenUtility::getField($key);
        $rowlabels_getrow = str_replace("##Row-Label##", $keyField, $rowlabels_getrow);
        $row_labels_str .= "\n" . $rowlabels_getrow;
    }
}
$datalist_content = str_replace("##Value-Columns##", $row_labels_str, $datalist_content);
##
## Rows - Values ##
$fp5 = fopen(LIBS_PATH . "/templates/datalist-value-eachcolumn.tpl", 'r');
$datalist_row_eachcolumn = fread($fp5, filesize(LIBS_PATH . "/templates/datalist-value-eachcolumn.tpl"));
fclose($fp5);
$get_rowvalue_str = "";
foreach ($resultset[0] as $key => $value) {
    $get_rowvalue = $datalist_row_eachcolumn;
    if (in_array($key, $includeArr)) {
        $content .= "<td>";