예제 #1
0
 /**
  *@deprecated - use JB_does_field_exist() instead
  *
  */
 function does_field_exist($table, $field)
 {
     if (function_exists('JB_does_field_exist')) {
         return JB_does_field_exist($table, $field);
     }
     $result = jb_mysql_query("show columns from `" . jb_escape_sql($table) . "`");
     while ($row = @JB_mysql_fetch_row($result)) {
         if ($row[0] == $field) {
             return true;
         }
     }
     return false;
 }
예제 #2
0
function showSubcat($c)
{
    //global $connection;
    global $SimplyHiredXML_default_l;
    global $SimplyHiredXML_default_k;
    $query = " SELECT *, categories.category_id as CID, seo_keys FROM categories LEFT JOIN SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE parent_category_id = '" . jb_escape_sql($c) . "' and form_id=1 ORDER BY list_order, category_name ASC ";
    $result = jb_mysql_query($query);
    //echo "<b>cateid:".$row2[1]."  $query </b>";
    if (JB_mysql_num_rows($result) == 0) {
        $query = " SELECT kw, loc, categories.category_id as CID, seo_keys FROM categories LEFT JOIN SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE categories.category_id = '" . jb_escape_sql($c) . "' and form_id=1 ";
        $result = jb_mysql_query($query);
        $row = JB_mysql_fetch_array($result);
        if (trim($row['loc']) == '') {
            $row['loc'] = $SimplyHiredXML_default_l;
        }
        if (trim($row['kw']) == '') {
            $row['kw'] = $row['seo_keys'];
        }
        if (trim($row['kw']) == '') {
            // still empty?
            $row['kw'] = JB_getCatName($row['CID']);
            //$SimplyHiredXML_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 = JB_mysql_fetch_array($result)) {
            $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'] = $SimplyHiredXML_default_l;
            }
            if (trim($row['kw']) == '') {
                $row['kw'] = $row['seo_keys'];
            }
            if (trim($row['kw']) == '') {
                // still empty?
                //$row['kw'] = $SimplyHiredXML_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 SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE parent_category_id = '" . $row['CID'] . "' ORDER BY list_order, category_name ASC ";
            $result2 = jb_mysql_query($query);
            if (JB_mysql_num_rows($result2) > 0) {
                echo "<br>";
                $row2 = JB_mysql_fetch_row($result2);
                ?>
		  <table style="margin-left: 15px;" cellspacing="1" border="0" width="100%">

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

		</table>
		<?php 
            }
        }
    }
    echo "</div>";
}