<?php

$string = '<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>' . ucfirst($table_name) . ' <small>different form elements</small></h2>
              
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <br>';


$string.= "
        <form action=\"<?php echo \$action; ?>\" method=\"post\"novalidate=\"\" id=\"demo-form2\" data-parsley-validate=\"\" class=\"form-horizontal form-label-left\"\">";
foreach ($non_pk as $row) {
    if ($row["data_type"] == 'text') {
        $string .= "\n\t    <div class=\"form-group\">
            <label class=\"control-label col-md-3 col-sm-3 col-xs-12\" for=\"" . $row["column_name"] . "\">" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></label>
                <div class=\"col-md-6 col-sm-6 col-xs-12\">
            <textarea class=\"form-control\" rows=\"3\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\"><?php echo $" . $row["column_name"] . "; ?></textarea>
                        </div>
        </div>";
    } else {
        $string .= "\n\t    <div class=\"form-group\">
            <label class=\"control-label col-md-3 col-sm-3 col-xs-12\" for=\"" . $row["data_type"] . "\">" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></label>
                <div class=\"col-md-6 col-sm-6 col-xs-12\">
            <input type=\"text\" class=\"form-control\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\" value=\"<?php echo $" . $row["column_name"] . "; ?>\" />
              </div>  
        </div>";
    }
}
$string .= '<div class="ln_solid"></div>;
                    <div class="form-group">     
                    <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">';
$string .= "\n\t    <input type=\"hidden\" name=\"" . $pk . "\" value=\"<?php echo $" . $pk . "; ?>\" /> ";
$string .= "\n\t    <button type=\"submit\" class=\"btn btn-primary\"><i class=\"fa fa-floppy-o\"></i> <?php echo \$button ?></button> ";
$string .= "\n\t    <a href=\"<?php echo site_url('" . $c_url . "') ?>\" class=\"btn btn-default\"> <i class=\"fa fa-reply-all\"></i> Cancel</a>";
$string .= "\n\t</div>
                    </div></form>
    ";
$string.=' </div>
        </div>
    </div>
</div>';

$hasil_view_form = createFile($string, $target . "views/" . $c_url . "/" . $v_form_file);
?>