".__('Field successfully created').""; } else { echo "

".__('There was a problem creating field')."

"; } } /* Update field */ if ($update_field) { /*Check if name field is empty*/ if( $name != "") { $sql = sprintf ('UPDATE tagent_custom_fields SET name = "%s", display_on_front = %d WHERE id_field = %d', $name, $display_on_front, $id_field); $result = process_sql ($sql); } else { $result = false; } if ($result !== false) { echo "

".__('Field successfully updated')."

"; } else { echo "

".__('There was a problem modifying field')."

"; } } /* Delete field */ if ($delete_field) { $sql = sprintf ('DELETE FROM tagent_custom_fields WHERE id_field = %d', $id_field); $result = process_sql ($sql); if (!$result) echo "

".__('There was a problem deleting field')."

"; else echo "

".__('Field successfully deleted')."

"; } $table->width = '65%'; $table->head = array (); $table->head[0] = __('Field'); $table->head[1] = __('Display on front').print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true); $table->head[2] = __('Actions'); $table->align = array (); $table->align[1] = 'center'; $table->align[2] = 'center'; $table->data = array (); $fields = get_db_all_fields_in_table('tagent_custom_fields'); if($fields === false) $fields = array(); foreach ($fields as $field) { $data[0] = ''.$field['name'].''; if($field['display_on_front']) { $data[1] = print_image('images/tick.png', true); }else { $data[1] = print_image('images/delete.png', true); } $data[2] = '' . __('Edit') . ''; $data[2] .= '' . __('Delete') . ''; array_push ($table->data, $data); } print_table ($table); echo '
'; echo '
'; print_submit_button (__('Create field'), 'crt', false, 'class="sub next"'); echo '
'; echo '
'; ?>