<td><?php echo draw_form_text("varchar_09", @$i["fax"], false, 14, "width:120px;"); ?> </td> </tr> <tr> <td class="left">Cell</td> <td><?php echo draw_form_text("varchar_10", @$i["cell"], false, 14, "width:120px;"); ?> </td> </tr> <tr> <td class="left">E-mail Address</td> <td><?php echo draw_form_text("varchar_11", @$i["email"], false, 255, "width:250px;"); ?> </td> </tr> <tr valign="top"> <td class="left">Notes</td> <td><?php echo draw_form_textarea("text_01", @$i["notes"]); ?> </td> </tr> <tr class="group"> <td colspan="2"><br>Tags</td> </tr> <?php $tags = db_query("select \r\n\t\t\t\t\tf.tagTypeID,\r\n\t\t\t\t\tf.name,\r\n\t\t\t\t\tf.fieldTypeID,\r\n\t\t\t\t\tf.isRequired\r\n\t\t\t\tfrom contacts_fields f\r\n\t\t\t\tjoin contacts_tags_types t on f.tagTypeID = t.id\r\n\t\t\t\twhere f.objectTypeID = 22 and t.is_active = 1 \r\n\t\t\t\torder by f.precedence");
<td><?php echo draw_form_text("laptopOffice", @$r["laptopOffice"]); ?> </td> </tr> <tr> <td class="left">Wireless?</td> <td><?php echo draw_form_checkbox("laptopIsWireless", @$r["laptopIsWireless"]); ?> (check if yes)</td> </tr> <tr> <td class="left">MAC Address</td> <td><?php echo draw_form_text("laptopMACAddress", @$r["laptopMACAddress"]); ?> </td> </tr> <tr> <td class="left">Accessories</td> <td> <table class="nospacing"> <?php if (isset($_GET["id"])) { $accessories = db_query("SELECT \r\n\t\t\t\t\ta.id, \r\n\t\t\t\t\ta.name,\r\n\t\t\t\t\t(SELECT COUNT(*) FROM it_laptops_2_accessories i2t WHERE i2t.accessoryID = a.id AND i2t.laptopID = {$_GET["id"]}) checked\r\n\t\t\t\t\tFROM it_laptops_accessories a ORDER BY a.name"); } else { $accessories = db_query("SELECT \r\n\t\t\t\t\ta.id, \r\n\t\t\t\t\ta.name\r\n\t\t\t\t\tFROM it_laptops_accessories a ORDER BY a.name"); } while ($a = db_fetch($accessories)) { ?>
function addRow($type, $title, $name = "", $value = "", $default = "", $required = false, $maxlength = 50, $onchange = false) { global $rows, $js, $months, $month, $today, $year, $_josh; $textlength = $maxlength > 50 ? 50 : $maxlength; $value = trim($value); if ($type == "raw") { $rows .= $title; } else { $rows .= '<tr>'; if ($type != "button" && $type != "submit" && $type != "hidden" && $type != "raw") { $rows .= '<td class="left">' . $title . '</td>'; } if ($type == "text") { //output text, no form element $rows .= '<td>' . $value . '</td>'; } elseif ($type == "date") { $rows .= '<td>' . draw_form_date($name, $value, false, false, $required) . '</td>'; } elseif ($type == "datetime") { $rows .= '<td>' . draw_form_date($name, $value, true) . '</td>'; } elseif ($type == "checkbox") { $rows .= '<td>' . draw_form_checkbox($name, $value) . '</td>'; } elseif ($type == "itext") { $rows .= '<td>' . draw_form_text($name, $value, false, $maxlength) . '</td>'; if ($required) { $js .= "if (!form." . $name . ".value.length) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "phone") { $rows .= '<td>' . draw_form_text($name, $value, 14, $maxlength) . '</td>'; if ($required) { $js .= "if (!form." . $name . ".value.length) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "extension") { $rows .= '<td>' . draw_form_text($name, $value, 4, $maxlength) . '</td>'; if ($required) { $js .= "if (!form." . $name . ".value.length) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "password") { $rows .= '<td>' . draw_form_password($name, $value, $textlength, $maxlength) . '</td>'; if ($required) { $js .= "if (!form." . $name . ".value.length) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "select") { $rows .= '<td>'; $rows .= draw_form_select($name, $value, $default, $required, false, $onchange); $rows .= '</td>'; } elseif ($type == "user") { $result = db_query("SELECT \n\t\t\t\t\t\t\t\t\t\t\tuserID, \n\t\t\t\t\t\t\t\t\t\t\tISNULL(nickname, firstname) first,\n\t\t\t\t\t\t\t\t\t\t\tlastname last \n\t\t\t\t\t\t\t\t\t\tFROM intranet_users\n\t\t\t\t\t\t\t\t\t\tWHERE isActive = 1\n\t\t\t\t\t\t\t\t\t\tORDER by lastname"); while ($r = db_fetch($result)) { $options[$r["userID"]] = $r["first"] . ", " . $r["last"]; } $rows .= '<td>'; $rows .= draw_form_select($name, $options, $default, $required, false, $onchange); $rows .= '</td>'; } elseif ($type == "department") { $rows .= '<td><select name="' . $name . '">'; $result = db_query("SELECT \n\t\t\t\t\t\t\t\t\t\t\tdepartmentID,\n\t\t\t\t\t\t\t\t\t\t\tdepartmentName,\n\t\t\t\t\t\t\t\t\t\t\tquoteLevel\n\t\t\t\t\t\t\t\t\t\tFROM intranet_departments\n\t\t\t\t\t\t\t\t\t\tWHERE isActive = 1\n\t\t\t\t\t\t\t\t\t\tORDER by precedence"); while ($r = db_fetch($result)) { $rows .= '<option value="' . $r["departmentID"] . '"'; if ($r["departmentID"] == $default) { $rows .= ' selected'; } $rows .= '>'; if ($r["quoteLevel"] == 2) { $rows .= " · "; } elseif ($r["quoteLevel"] == 3) { $rows .= " - "; } $rows .= $r["departmentName"] . '</option>'; } $rows .= '</select></td>'; } elseif ($type == "userpic") { $rows .= '<td>' . drawName($name, $value, $default, true, " ") . '</td>'; } elseif ($type == "textarea") { $rows .= '<td>' . draw_form_textarea($name, $value) . '</td>'; $js .= " tinyMCE.triggerSave();" . $_josh["newline"]; if ($required) { $js .= "if (!form." . $name . ".value.length || (form." . $name . ".value == '<p> </p>')) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "textarea-plain") { $rows .= '<td>' . draw_form_textarea($name, $value, "noMceEditor") . '</td>'; if ($required) { $js .= "if (!form." . $name . ".value.length) errors[errors.length] = 'the \\'" . $title . "\\' field is empty';" . $_josh["newline"]; } } elseif ($type == "hidden") { $rows .= draw_form_hidden($name, $value); } elseif ($type == "submit") { $rows .= '<td colspan="2" align="center" class="bottom">' . draw_form_submit($title, "button") . '</td>'; } elseif ($type == "button") { $rows .= '<td colspan="2" align="center" class="bottom">' . draw_form_button($title, $value, "button") . '</td>'; } elseif ($type == "file") { $rows .= '<td>' . draw_form_file($name) . '</td>'; } $rows .= '</tr>' . $_josh["newline"]; } }
function addRow($field) { global $_josh; extract($field); $return = ""; if ($type == "hidden") { $return .= draw_form_hidden($name, $value); } else { if ($label) { $return .= '<dt class="' . $type . '">' . $label; if ($additional && $type == "checkboxes") { $return .= $additional; } $return .= '</dt>' . $_josh["newline"]; } $return .= '<dd class="' . $type . '">'; if ($type == "checkbox") { $return .= '<div class="checkbox_option">' . draw_form_checkbox($name, $value) . '<span class="option_name" onclick="javascript:form_checkbox_toggle(\'' . $name . '\');">' . $additional . '</span></div>'; } elseif ($type == "checkboxes") { if ($value) { $options = db_query("SELECT o.id, o.name, (SELECT COUNT(*) FROM {$linking_table} l WHERE l.option_id = o.id AND l.object_id = {$value}) checked FROM {$options_table} o ORDER BY o.name"); } else { $options = db_query("SELECT id, name, 0 checked FROM {$options_table} ORDER BY name"); } while ($o = db_fetch($options)) { $name = "chk_" . str_replace("_", "-", $options_table) . "_" . $o["id"]; $return .= '<div class="checkbox_option">' . draw_form_checkbox($name, $o["checked"]) . '<span class="option_name" onclick="javascript:form_checkbox_toggle(\'' . $name . '\');">' . $o["name"] . '</span></div>'; } } elseif ($type == "date") { $return .= draw_form_date($name, $value, false) . $additional; } elseif ($type == "datetime") { $return .= draw_form_date($name, $value, true) . $additional; } elseif ($type == "note") { $return .= "<div class='note'>" . $additional . "</div>"; } elseif ($type == "password") { $return .= draw_form_password($name, $value, $class, 255, false) . $additional; } elseif ($type == "radio") { if (!$options) { if (!$sql) { $sql = "SELECT id, name FROM options_" . str_replace("_id", "", $name); } $options = db_array($sql); } if ($append) { while (list($addkey, $addval) = each($append)) { $options[$addkey] = $addval; } } foreach ($options as $id => $description) { $return .= '<div class="radio_option">' . draw_form_radio($name, $id, $value == $id, $class) . $description . '</div>'; } } elseif ($type == "select") { if (!$options) { if (!$sql) { $sql = "SELECT id, name FROM options_" . str_replace("_id", "", $name); } $options = db_array($sql); } if ($append) { while (list($addkey, $addval) = each($append)) { $options[$addkey] = $addval; } } $return .= draw_form_select($name, $options, $value, $required, $class, $action); } elseif ($type == "submit") { $return .= draw_form_submit($value, $class) . $additional; } elseif ($type == "text") { $return .= draw_form_text($name, $value, $class, $maxlength, false, false) . $additional; } elseif ($type == "textarea") { $return .= draw_form_textarea($name, $value, $class) . $additional; } $return .= '</dd>' . $_josh["newline"]; } return $return; }
} echo drawThreadCommentForm(true); echo '</table>'; ?> <table class="left" cellspacing="1"> <?php echo drawHeaderRow("Attach Document", 2); ?> <form enctype="multipart/form-data" action="<?php echo $request["path_query"]; ?> " method="post" onsubmit="javascript:return validateAttachment(this);"> <tr> <td class="left">Document Name</td> <td><?php echo draw_form_text("title", @$d["name"]); ?> </td> </tr> <tr> <td class="left">File</td> <td><input type="file" name="userfile" size="40" class="field" value=""></td> </tr> <tr> <td class="bottom" align="center" colspan="2"><?php echo draw_form_submit("Attach Document"); ?> </td> </tr> </form> </table>
?> "><?php echo $r["awardTitle"]; ?> </a></b> (awarded by <b><a href="resources_funder_view.php?id=<?php echo $r["funderID"]; ?> "><?php echo $r["name"]; ?> </a></b>)</td> </tr> <tr class="helptext" bgcolor="#FFFFFF"> <td bgcolor="#F6F6F6"><nobr>Activity Title:</nobr></td> <td colspan="2" width="99%"><?php echo draw_form_text("activityTitle", $r["activityTitle"]); ?> </b></td> </tr> <tr class="helptext" bgcolor="#FFFFFF"> <td bgcolor="#F6F6F6"><nobr>Activity Date:</nobr></td> <td colspan="2" width="99%"><?php echo draw_form_date("activityDate", $r["activityDate"]); ?> </td> </tr> <tr class="helptext" bgcolor="#FFFFFF"> <td bgcolor="#F6F6F6"><nobr>Staff Responsible:</nobr></td> <td colspan="2" width="99%"> <?php echo drawSelectUser("activityAssignedTo", $r["activityAssignedTo"]);
<table class="left" cellspacing="1"> <form action="<?php echo $_josh["request"]["path_query"]; ?> " method="post" onsubmit="javascript: return validate(this);" name="frmActivity"> <tr> <td class="head">Add Activity to this Award</td> </tr> <tr> <td><br> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="small"> <tr> <td width="50%" height="50"> ACTIVITY TITLE<br> <?php echo draw_form_text("txtTitle", "", false, 35); ?> </td> <td width="50%"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="small"> <tr> <td width="16"><input type="checkbox" name="chkActionItem" onclick="javascript:checkInternal(this);"></td> <td width="99%">Is this an Action Item?</td> </tr> </table> </td> </tr> <tr> <td width="50%" height="50"> DATE<br> <?php
<td><?php echo draw_form_text("zip", @$r["zip"], 5, 5); ?> </td> </tr> <tr> <td class="left">Phone</td> <td><?php echo draw_form_text("phone", @$r["phone"], 14, 14); ?> </td> </tr> <tr> <td class="left">Hours of Operation</td> <td><?php echo draw_form_text("hours", @$r["hours"]); ?> </td> </tr> <tr valign="top"> <td class="left">Services</td> <td> <table class="nospacing"> <?php $services = db_query("SELECT s.id, s.name, \n\t\t\t\t\t\t(SELECT count(*) FROM web_organizations_2_services o2s WHERE o2s.organizationID = {$_GET["id"]} AND o2s.serviceID = s.id) as checked\n\t\t\t\t\t\tFROM web_services s ORDER BY s.name"); while ($s = db_fetch($services)) { ?> <tr> <td width="25"><?php echo draw_form_checkbox("chks_" . $_GET["id"] . "_" . $s["id"], $s["checked"]); ?>
<?php } ?> </form> </table> <br> <table width="100%" cellpadding="3" cellspacing="1" border="0" bgcolor="#EEEEEE"> <tr> <td class="bold" bgcolor="#F6F6F6" colspan="2">Add New Tag</td> </tr> <form method="post" action="<?php echo $request["path_query"]; ?> " onsubmit="return validate(this);"> <tr class="helptext" bgcolor="#FFFFFF"> <td bgcolor="#F6F6F6">Name:</td> <td><?php echo draw_form_text("tag"); ?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#F6F6F6"><?php echo draw_form_submit("Add Tag"); ?> </td> </tr> </form> </table> <?php echo drawBottom();
<table class="left" cellspacing="1"> <form name="frmFunder" action="<?php echo $_josh["request"]["path_query"]; ?> " method="post" onsubmit="javascript:return validate(this);"> <?php if (isset($_GET["id"])) { echo drawHeaderRow("Edit Funder", 2); } else { echo drawHeaderRow("Add Funder", 2); } ?> <tr> <td width="18%" class="gray">Name:</td> <td width="82%"><?php echo @draw_form_text("name", $r["name"]); ?> </td> </tr> <tr> <td class="gray"><nobr>Type:</nobr></td> <td><?php echo draw_form_select("cboFunderTypes", "SELECT funderTypeID, funderTypeDesc FROM funders_Types", @$r["funderTypeID"]); ?> </td> </tr> <tr> <td class="gray"><nobr>Status:</nobr></td> <td><?php echo draw_form_select("cboFunderStatuses", "SELECT funderStatusID, funderStatusDesc FROM funders_Statuses", @$r["funderStatusID"]); ?>
$program = db_grab("SELECT programDesc FROM funders_programs WHERE programID = " . $_GET["id"]); $title = "Edit Program"; } else { $title = "Add New Program"; } ?> <table class="left" cellspacing="1"> <form method="post" action="<?php echo $_josh["request"]["path_query"]; ?> "> <?php echo drawHeaderRow($title, 2); ?> <tr> <td class="left">Name</td> <td><?php echo draw_form_text("programDesc", @$program); ?> </td> </tr> <tr> <td class="bottom" colspan="2"><?php echo draw_form_submit("save changes"); ?> </td> </tr> </form> </table> <?php echo drawBottom();