<p> <?php echo edit_field("status", $asset->status, "Status", "asset", $asset->id, array("envelope" => "span")); ?> <?php if ($asset->status != "Active" && $asset->status != "Inactive") { ?> <?php echo edit_field("year_removed", $asset->year_removed, " in ", "asset", $asset->id, array("envelope" => "span")); ?> <?php if ($asset->status == "Sold") { ?> <?php echo edit_field("sale_price", $asset->sale_price, " for ", "asset", $asset->id, array("money" => TRUE, "envelope" => "span")); ?> <?php } ?> <?php } ?> </p> <?php if (get_value($asset, "po")) { ?> <p> <b>Purchase Order: </b>
define('MAIN_PAGE', 'Custom Field'); } if (!defined('SUB_PAGE')) { define('SUB_PAGE', 'Edit Custom Field'); } if (isset($_GET['edit_customfield'])) { $id = $_GET['edit_customfield']; $listing_custom = view_customfield_detail($id); assign('listing_custom', $listing_custom); } if (isset($_POST['update_field'])) { $edit_id = $_POST['field_id']; $field_name = $_POST['field_name']; $field_type = $_POST['field_type']; $field_title = $_POST['field_title']; $default_value = $_POST['default_value']; $olddbfield_name = $_POST['olddbfield_name']; $db_field = $_POST['db_field']; $page_type = $_POST['page_type']; edit_field($field_name, $field_title, $field_type, $db_field, $default_value, $edit_id); if ($page_type == 'signup') { $db->execute("ALTER TABLE " . tbl('users') . " CHANGE {$olddbfield_name} {$db_field} TEXT NOT NULL"); } else { $db->execute("ALTER TABLE " . tbl('video') . " CHANGE {$olddbfield_name} {$db_field} TEXT NOT NULL"); } //ALTER TABLE cb_video CHANGE Addr myaddress TEXT NOT NULL e(lang("Custom field Update successfully"), "m"); //header('Refresh: 1;url=plugin.php?folder=customfield/admin&file=edit_field.php&edit_customfield='.$_GET['edit_customfield']); } template_files('edit_field.html', CB_CUSTOM_FIELDS_PLUG_DIR . '/admin'); //template_files(PLUG_DIR.'/customfield/admin/edit_field.html',true);
manage_fields(); break; case 'insert_field': $result = insert_field(); if ($result === TRUE) { manage_fields(); } else { add_field(); } break; case 'update_field': $result = update_field(); if ($result === TRUE) { manage_fields(); } else { edit_field($result); } break; case 'options': show_options(); break; case 'show_messages': show_messages(); break; case 'edit_message': $result = edit_message(); if ($result === TRUE) { show_messages(); } break; case 'delete_message':
function inline_field($field_name, $object, $table, $options = array()) { $value = $object->{$field_name}; $id = $object->id; $label = ucfirst(clean_string($field_name)); if (array_key_exists("id", $options)) { $id = $options['id']; } if (array_key_exists("label", $options)) { $label = $options['label']; } if (!array_key_exists("class", $options)) { $options['class'] = "editable"; } return edit_field($field_name, $value, $label, $table, $id, $options); }