<fieldset style="width:720px;"> <legend class="listingmaintext"><b><?php echo TEXT_KB_INFO; ?> </b></legend> <table border=0 width="100%"> <tr><td colspan="5"> </td></tr> <tr> <td width="12%" align="left"> </td> <td width="25%" align="left" class="listingmaintext"><?php echo TEXT_CATEGORY; ?> </td> <td width="22%" align="left" class="listingmaintext"> <?php echo makeDropDownList("cmbCategory", makeCategoryList(0, 0, $var_deptid), $var_category, true, "textbox", "", ""); ?> </td> <td width="41%" align="left" class="listingmaintext"> <?php //modified on October 28, 2006 by Roshith ?> <input name="chkaddtokb" type="checkbox" value="atokb" class="checkbox" onClick="checkaddtokb();" <?php if ($var_addtokb == "atokb") { echo "checked"; } echo $chk_kb_disabled; ?> ><?php echo TEXT_KB_ADD; ?> </td>
<tr><td colspan="3">Dept: <?php echo $var_departmentid; ?> </td></tr> --> <tr><td colspan="3"> </td></tr> <tr> <td width="2%" align="left"> </td> <td width="37%" align="left" class="toplinks"><?php echo TEXT_CATEGORY; ?> <span class="required">*</span> </td> <td width="61%" align="left" class="listingmaintext"> <select name="cmbCategory" size="1" class="comm_input input_width1a" id="cmbCategory" > <?php $categories = makeCategoryList(0, 0, $var_departmentid); //print_r($categories); $catoptions = "<option value='0'"; $catoptions .= ">Select</option>\n"; if (count($categories) > 0) { foreach ($categories as $key => $value) { $catoptions .= "<option value=\"{$key}\""; if ($var_catid == "{$key}") { $catoptions .= " selected=\"selected\""; } $catoptions .= ">" . $value . "</option>\n"; } } echo $catoptions; ?> </select>
function makeCategoryList($current_parentcat_id, $count, $deptid) { static $catlist; if (!isset($current_parentcat_id)) { $current_parentcat_id = 0; } $count = $count + 1; $sql = "SELECT nCatId as id, vCatDesc as name from sptbl_categories where nParentId = '{$current_parentcat_id}' and nDeptId= '{$deptid}' order by name asc"; $get_options = mysql_query($sql); $num_options = mysql_num_rows($get_options); if ($num_options > 0) { while (list($cat_id, $cat_name) = mysql_fetch_row($get_options)) { if ($current_parentcat_id != 0) { $indent_flag = " "; for ($x = 2; $x <= $count; $x++) { $indent_flag .= "--> "; } } $cat_name = $indent_flag . htmlentities($cat_name); $catlist[$cat_id] = $cat_name; makeCategoryList($cat_id, $count, $deptid); } } return $catlist; }
<div class="content_section_subtitle"><h3><?php echo TEXT_KB_INFO; ?> </h3></div> </br> <table border=0 width="100%"> <tr> <td width="6%" align="left" class="fieldnames"><?php echo TEXT_CATEGORY; ?> </td> <td width="3%" align="left" class="listingmaintext"> <?php echo makeDropDownList("cmbCategory", makeCategoryList(0, 0, $var_deptid), $var_category, "comm_input input_width1", "", ""); ?> </td> <td width="31%" align="left" class="listing"> <input name="chkaddtokb" type="checkbox" value="atokb" class="checkbox" onClick="checkaddtokb();" <?php if ($var_addtokb == "atokb") { echo "checked"; } echo $chk_kb_disabled; ?> ><?php echo TEXT_KB_ADD; ?> </td> </tr> </table>
<tr><td colspan="3">Dept: <?php echo $var_departmentid; ?> </td></tr> --> <tr><td colspan="3"> </td></tr> <tr> <td width="13%" align="left"> </td> <td width="26%" align="left" class="fieldnames"><?php echo TEXT_CATEGORY; ?> <span class="required">*</span> </td> <td width="61%" align="left" class="listingmaintext"> <?php echo makeDropDownList("cmbCategory", makeCategoryList(0, 0, $cmbDepartment), $cmbCategory, true, "comm_input input_width1a", "\" style=\"width:250px;\" \"", ""); ?> </td> </tr> <tr><td colspan="3"> <?php //echo 'makeCategoryList(0,0,'.$var_departmentid.')'; ?> </td></tr> <!--Meta tage add--> <tr> <td align="left"> </td> <td align="left" class="fieldnames"><?php echo TEXT_METAKEYWORD;
<div class="content_section_title"><h4><?php echo TEXT_SELECT_DEPARTMENT_AND_CATEGORY; ?> </h4></div> <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="comm_tbl"> <tr> <td align ="left"> <?php echo makeDropDownList("ddlDepartment", makeDepartmentList(0, 0, $_SESSION['sess_usercompid']), $ddlDepartment, "comm_input width1", "\" style=\"width:270px;\" \"", "onChange=\"javascript:changeDepartment();\""); echo " "; echo makeDropDownList("ddlCategory", makeCategoryList(0, 0, $ddlDepartment), $ddlCategory, "comm_input width1", "\" style=\"width:200px;\" \"", "onChange=\"javascript:changeCategory();\""); ?> </td> </tr> </table> <div class="content_search_container"> <div class="left rightmargin topmargin"> <?php echo TEXT_SEARCH; ?> </div>