<!-- TITLE -->
    <div>
        <?php 
$prefix = substr($form_action, 0, 6) == 'insert' ? Crudderconfig::get_string('insert_label') : Crudderconfig::get_string('update_label');
echo "<h3>{$prefix} " . Crudderconfig::get_string('edit_register_title_part') . " {$table_display_name} <small>" . Crudderconfig::get_string('edit_register_subtitle') . "</small></h3>\n";
?>
    </div>

    <div>

    <!-- VALIDATION INFO -->
    <div>
        <?php 
Crudder::get_instance()->validation_set_error_delimiters('<li>', '</li>');
$errors = Crudder::get_instance()->validation_errors_build_snippet();
if ($errors != '') {
    echo '<div class="alert alert-danger">';
    echo '' . $errors . '';
    echo "</div>\n";
}
?>
    </div>

    <!-- FIELDS -->
    <!--table class="table table-striped"-->
    
    <?php 
$uri = "crudder/record_edit_{$form_action}";
echo form_open($uri, 'class="form-horizontal" role="form"');
echo form_hidden('crudder_id_table', $id_table);
Example #2
0
 /**
  * Crudder callback field checking for database inserts and updates (more powerful than CI is_unique)
  * 
  * (fields validation specification - application logic implementation)
  * 
  * There is no need to add the validation error in each callback method; this is done automatically
  * 
  * Checks if 'value' is already used in 'field_name' of 'table_name'; this for inserts and also for updates that change the value
  * 
  * If 'action' is 'update' and no 'orig_value' is passed, this method can't work properly and will return true
  * 
  * This is for: all applications based on Crudder
  * 
  * Important: don't change the code of this method - it's optimized in the main Crudder class
  *
  * @access	public
  * @param	array   validation rule in fields metatable is like "crudder_is_unique[cat_municipios,code,action]"; this will check the "value" for being unique in table "cat_municipios" for the specified "action" (that is assigned by the main Crudder class and can be an insert or an update, with some internals tweaks)
  * @param   string  value to be checked (assigned by the Crudder logic)
  * @param	integer id of the record being checked in the table named as "cat_municipios" in the above example (first argument; assigned by the Crudder logic)
  * @return  boolean 
  */
 public function crudder_is_unique($field_validation_specs, $value, $id_record = false)
 {
     return Crudder::get_instance()->crudder_is_unique($field_validation_specs, $value, $id_record);
 }