示例#1
0
function showSubcat($c)
{
    //global $connection;
    global $JobsFiller_default_l;
    global $JobsFiller_default_k;
    $query = " SELECT *, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id  WHERE parent_category_id = '{$c}' and form_id=1 ORDER BY list_order, category_name ASC ";
    $result = jb_mysql_query($query) or die(mysql_error());
    //echo "<b>cateid:".$row2[1]."  $query </b>";
    if (mysql_num_rows($result) == 0) {
        $query = " SELECT kw, loc, categories.category_id as CID, seo_keys FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id  WHERE categories.category_id = '{$c}' and form_id=1 ";
        $result = jb_mysql_query($query) or die(mysql_error());
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        if (trim($row['loc']) == '') {
            $row['loc'] = $JobsFiller_default_l;
        }
        if (trim($row['kw']) == '') {
            $row['kw'] = $row['seo_keys'];
        }
        if (trim($row['kw']) == '') {
            // still empty?
            $row['kw'] = JB_getCatName($row['CID']);
            //$JobsFiller_default_k;
        }
        ?>
	What: <input size='36' type="text" value="<?php 
        echo jb_escape_html($row['kw']);
        ?>
" name='kw_<?php 
        echo $row['CID'];
        ?>
'>
	Where: <input size='36' type="text" value="<?php 
        echo jb_escape_html($row['loc']);
        ?>
" name='loc_<?php 
        echo $row['CID'];
        ?>
'><br>
	<?php 
    } else {
        $x = 0;
        echo "<br><div style='margin-left: 20px;'>";
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $x++;
            if ($x > SHOW_SUBCATS) {
                break;
            }
            //if  ($row['allow_records']=='N') echo "<b>&#8224;</b>";
            echo "<A HREF=" . $_SERVER['PHP_SELF'] . "?cat=" . $row['CID'] . "><font color=#0000FF>" . jb_escape_html($row['category_name']) . "</font></A> ";
            //;echo "<small>(ID: ". ($row[0]).")</small>";
            if (trim($row['loc']) == '') {
                $row['loc'] = $JobsFiller_default_l;
            }
            if (trim($row['kw']) == '') {
                $row['kw'] = $row['seo_keys'];
            }
            if (trim($row['kw']) == '') {
                // still empty?
                //$row['kw'] = $JobsFiller_default_k;
                $row['kw'] = JB_getCatName($row['CID']);
            }
            ?>
		What: <input size='35' type="text" value="<?php 
            echo jb_escape_html($row['kw']);
            ?>
" name='kw_<?php 
            echo $row['CID'];
            ?>
'>
		Where: <input size='35' type="text" value="<?php 
            echo jb_escape_html($row['loc']);
            ?>
" name='loc_<?php 
            echo $row['CID'];
            ?>
'>
		<br>

		<?php 
            // does this category have sub-categories?
            $query = " SELECT * FROM categories LEFT JOIN JobsFiller_keywords ON categories.category_id = JobsFiller_keywords.category_id  WHERE parent_category_id = '" . $row['CID'] . "' ORDER BY list_order, category_name ASC ";
            $result2 = jb_mysql_query($query);
            if (mysql_num_rows($result2) > 0) {
                echo "<br>";
                $row2 = mysql_fetch_row($result2);
                ?>
		  <table style="margin-left: 15px;" cellspacing="1" border="0" width="100%">

		<?php 
                showAllCat($row['CID'], 1);
                ?>

		</table>
		<?php 
            }
        }
    }
    echo "</div>";
}
示例#2
0
">
	
	<input type="hidden" name="action" value="edit">
	<input type="submit" value="Save">
	</td>
	</tr>
	</table>
	</form>
	<hr>
	<p>&nbsp</p>

	<?php 
}
//if ($new_cat == '') {
$MODE = "ADMIN";
showAllCat($_REQUEST['cat'], 1, 3, $_SESSION['MDS_LANG'], $_SESSION[form_id]);
if ($_SESSION[form_id] == 1) {
    require_once '../include/ads.inc.php';
    build_ad_count($_REQUEST['cat']);
    // echo "cats rebuilt.";
}
//}
?>
</table>
<?php 
?>

</div>

</body>
</html>