Webhosting in Pakistan
Results 1 to 4 of 4

Thread: plz check this and tell me how i disable categories

  1. #1
    gulfreen is offline Junior Member
    Last Online
    27th March 2011 @ 11:31 PM
    Join Date
    13 Dec 2008
    Age
    31
    Posts
    10
    Threads
    5
    Credits
    490
    Thanked
    0

    Default plz check this and tell me how i disable categories

    Webhosting in Pakistan
    <?php
    require_once('includes/connection.php');
    include_once("Templates/user_header.php");


    //session_start();
    if(isset($_GET['catid'])){
    $sel_cat="SELECT * from tff_categories where cat_parent='".$_GET['catid']."'";
    $sel_items="SELECT * from tff_products where products_category='".$_GET['catid']."'";
    }else{
    $sel_cat="SELECT * from tff_categories where cat_parent=1";
    $sel_items="SELECT * from tff_products where products_category=1";
    }

    $sql=$sel_items;
    $per_page=9;
    $page=$HTTP_GET_VARS['page'];
    if (!$page){
    $page = 1;
    }
    $prev_page = $page - 1;
    $next_page = $page + 1;

    $query = mysql_query($sql);
    $page_start = ($per_page * $page) - $per_page;
    $num_rows = mysql_num_rows($query);
    if ($num_rows <= $per_page){
    $num_pages = 1;
    }else if (($num_rows % $per_page) == 0){
    $num_pages = ($num_rows / $per_page);
    }else{
    $num_pages = ($num_rows / $per_page) + 1;
    }
    $num_pages = (int) $num_pages;
    if (($page > $num_pages) || ($page < 0)){
    $msg=urlencode("You have specified an invalid page number.");
    header("Location: $PHP_SELF?errmsg=$msg");
    exit(0);
    }

    $sql = $sql . " LIMIT $page_start, $per_page";
    $query = mysql_query($sql);


    $rs_sel_cat=mysql_query($sel_cat) or die(mysql_error());
    $numrows_cat=mysql_num_rows($rs_sel_cat);
    ?>

    <?php $cat_exp=explode(" ",$_GET['cat_name']);?>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <?php if($_GET['cat_name']!=0){?>
    <tr>
    <td colspan="2" class="heading18" height="42"><strong>Categories</strong></td>
    </tr>
    <tr>
    <td width="62%" valign="top" class="heading14"><?php echo $cat_exp[0]; ?><?php echo $cat_exp[1]; ?></td>
    <td width="38%" valign="top" class="adminLinkHeading">
    <?php if ($cat_exp[0] <> "" ) { ?>
    <input type="submit" name="btnback" value="- Back -" onClick="javascript:history.back();">
    <?php } ?>
    </td>
    </tr>
    <tr>
    <td colspan="2" valign="top">
    <table width="100%" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td valign="top"> <form action="" method="post" name="form1">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
    <?php if($numrows_cat>0){ ?>
    <tr>
    <td height="20" colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <?php
    $new_row=0;
    while($row_sel_cat=mysql_fetch_array($rs_sel_cat)) {
    if(($new_row % 3)==0)
    echo("<tr align=\"center\">");

    ?>
    <td valign="top"><table width="135" height="133" border="0" cellpadding="2" cellspacing="2">
    <tr>
    <td width="135" height="133" background="../images/white_box.gif" style="background-repeat: no-repeat" align="center">
    <a href="item.php?catid=<?php echo $row_sel_cat['cat_id']; ?>&cat_name=<?php echo urlencode($row_sel_cat['cat_name']); ?>">
    <img height="100" width="100" src="data/shopping_cart/category/<?php echo $row_sel_cat['cat_id']; ?><?php echo $row_sel_cat['cat_image']; ?>" border="0">
    </a>
    </td>
    </tr>
    <tr>
    <td align="center"><a href="item.php?catid=<?php echo $row_sel_cat['cat_id']; ?>&cat_name=<?php echo urlencode($row_sel_cat['cat_name']); ?>" class="categories"><? echo($row_sel_cat['cat_name'])?></a></td>
    </tr>
    </table></td>
    <?
    $new_row++;
    if(($new_row % 3)==0 && $new_row>0)
    echo("</tr>");

    } // end of whiel
    if(($new_row % 3)!=0 && $new_row>0)
    echo("</tr>");

    ?>
    </table>
    <?php } ?> </td>
    </tr>
    <?php
    //$rs_sel_items=mysql_query($sql);
    $numrows=mysql_num_rows($query);
    if($numrows>0){ ?>
    <tr>
    <td height="20" colspan="2" class="heading18">
    <hr>Products
    </td>
    </tr>
    <tr>
    <td height="20" colspan="2">&nbsp;</td>
    </tr>
    <tr>
    <td height="20" colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <?php
    $new_row=0;

    while($row_sel_items=mysql_fetch_array($query)){
    if(($new_row % 3)==0)
    echo("<tr align=\"center\">");

    ?>
    <td valign="bottom"> <table width="150" height="150" border="0" cellpadding="1" cellspacing="1" background="../images/white_box.gif" style="background-repeat: no-repeat">
    <tr>
    <td align="center">
    <a href="item_detail.php?itemid=<?php echo suCrypt($row_sel_items['products_id']); ?>&cat_id=<?php echo $row_sel_items['products_category']; ?>">
    <img width="100" height="100" src="data/shopping_cart/products/prod_resized/<?php echo $row_sel_items['products_id']; ?><?php echo $row_sel_items['products_image']; ?>" border="0">
    </a>
    </td>
    </tr>
    <tr>
    <td height="35" valign="top" align="center">
    <a href="item_detail.php?itemid=<?php echo suCrypt($row_sel_items['products_id']); ?>&cat_id=<?php echo $row_sel_items['products_category']; ?>">
    <img src="_images/view.jpg" alt="View Detail" border="0"> </a> </td>
    </tr>
    </table></td>
    <?
    $new_row++;
    if(($new_row % 3)==0 && $new_row>0)
    echo("</tr>");
    } // end of while
    if(($new_row % 3)!=0 && $new_row>0)
    echo("</tr>");

    ?>
    </table>
    <?php } ?> </td>
    </tr>
    <tr>
    <td width="22%" height="20">&nbsp;</td>
    <td width="78%" height="20">&nbsp;</td>
    </tr>
    </table>
    </form></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="center"><?
    $cat_id=$_GET['catid'];
    $cat_name=urlencode($_GET['cat_name']);
    if ($prev_page){
    echo "<a href=$PHP_SELF?page=$prev_page&catid=$cat_id&cat_n ame=$cat_name>Previous</a>";
    }
    if ($num_pages>1){
    if($page>5)
    $st_page=$page-5;
    else
    $st_page=1;

    if($num_pages>10 && ($num_pages-$page)>5)
    $end_page=$page+5;
    else
    $end_page=$num_pages;

    for($kk=$st_page;$kk<=$end_page;$kk++){
    if($kk==$page)
    echo "&nbsp;$kk&nbsp;";
    else
    echo "&nbsp;<a href=$PHP_SELF?page=$kk&catid=$cat_id&cat_name=$ca t_name>$kk</a>&nbsp;";
    }
    }
    if ($page != $num_pages){
    echo "<a href=$PHP_SELF?page=$next_page&catid=$cat_id&cat_n ame=$cat_name>Next </a>";
    }
    ?></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td colspan="2" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    </table>
    <?php include_once("Templates/user_footer.php");?>

  2. #2
    tasadduqshah's Avatar
    tasadduqshah is offline Senior Member+
    Last Online
    8th February 2018 @ 11:25 AM
    Join Date
    20 Sep 2008
    Location
    Gujranwala Pakistan
    Age
    36
    Posts
    245
    Threads
    40
    Credits
    558
    Thanked
    18

    Default

    What is this Dear???????
    PLZ Explain....

  3. #3
    Dark_Rising is offline Senior Member+
    Last Online
    10th September 2012 @ 10:57 AM
    Join Date
    28 Feb 2009
    Age
    33
    Posts
    310
    Threads
    34
    Credits
    0
    Thanked
    0

    Default

    this is php programing for web

  4. #4
    jamshed_206 is offline Member
    Last Online
    12th July 2009 @ 01:22 PM
    Join Date
    29 Aug 2008
    Location
    Bhakkar
    Age
    30
    Posts
    121
    Threads
    19
    Thanked
    0

    Arrow

    Webhosting in Pakistan
    Quote Dark_Rising said: View Post
    this is php programing for web
    everybody knows that this is php language but what he want to do with this????

Similar Threads

  1. Answered Add some Sub categories in Webmaster Zone
    By Ali Luqman in forum Tajaweez aur Shikayat
    Replies: 1
    Last Post: 16th October 2015, 02:48 PM
  2. how to add categories in blogs
    By alibabar in forum Ask an Expert
    Replies: 4
    Last Post: 14th July 2010, 09:55 AM
  3. How To Make Categories For Blog?
    By Enter in forum Ask an Expert
    Replies: 7
    Last Post: 4th July 2009, 11:16 AM
  4. Heaven of Portable Application... almost all categories
    By oralover2006 in forum General Discussion
    Replies: 0
    Last Post: 17th February 2009, 04:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •