SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problems with passing values

    Hi, need some help again.
    pls click this link:

    http://www.certifyexpress.com/micros...sentials/1.php

    when i click "yes" or "no" button in that page, it suppose to go back to the above page, not the:
    http://www.certifyexpress.com/review/admin/disimage.php
    . how am i suppose to do that?

    in this 1.php, i included disimage.php. from the 'Reviewed Books' title onwards.
    this is the code:

    <?
    echo "<html>";
    function display_date($date)
    {
    $day=substr($date,6,2);
    $month=substr($date,4,2);
    $year=substr($date,0,4);
    $hour=substr($date,8,2);
    $minute=substr($date,10,2);
    $second=substr($date,12,2);
    $user_date="$day/$month/$year $hour:$minute:$second";

    return $user_date;
    }

    function display_star($star)
    {
    switch ($star)
    {
    case "5":
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    break;

    case "4":
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='4/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='4/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='4/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='4/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='4/5.0' width=13 height=12>");
    break;

    case "3":
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='3/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='3/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='3/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='3/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='3/5.0' width=13 height=12>");
    break;

    case "2":
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='2/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='2/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='2/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='2/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='2/5.0' width=13 height=12>");
    break;

    default:
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='1/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='1/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='1/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='1/5.0' width=13 height=12>");
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='1/5.0' width=13 height=12>");
    break;
    }

    }

    function count_review ($status, $review_ID, $gid)
    {
    global $review_obj, $cat;

    $table = "count_review";
    $field = "count(*) as a, count_flag";
    $criteria = "WHERE review_ID='$review_ID' and cat_ID=$gid and count_sta='$status' group by count_flag";

    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];

    return $data;

    }

    function user_view($gid)
    {
    global $review_obj, $cat, $subcat, $title, $flag, $desc, $image, $uto, $uuntil, $rows, $cate, $subcate, $newrows;

    //**********************Retrieve sum rate from user_review********************

    $table="user_review";
    $field="avg(user_rate) as sumrate";
    $criteria="WHERE flag=2 and cat_ID='$gid' group by cat_ID";

    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];

    $average = $data[0][0];

    //**********************Retrieve data from user_review********************
    $table="user_review";
    $field="user_ID, user_date, user_rate, user_cat, user_subcat, user_title, user_review, user_name, user_world, cat_ID";
    $criteria="WHERE flag=2 and cat_ID='$gid' order by user_date desc";

    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];
    $numrows=$getdata[1];

    //***************************view user_review*******************************

    if ($numrows > 0)
    {
    //echo "<tr><td>";
    $number = explode(".", $average);
    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td><font face=verdana size=1 color=#CCCC00>User Review</font><br></td></tr>";
    echo "<tr><td><font face=verdana size=1><b>Average user rating/b>&nbsp;";

    //display star
    for ($j=0; $j < $number[0] ;$j++)
    echo ("<img src='http://www.certifyexpress.com/review/image/gold-star.gif' alt='5/5.0' width=13 height=12>");
    if (count($number) > 1)
    {
    echo ("<img src='http://www.certifyexpress.com/review/image/half-star.gif' alt='4/5.0' width=13 height=12>");
    $num1 = 5 - ($number[0] + 1);
    }
    else
    $num1 = 5 - $number[0];

    for ($j=0; $j < $num1 ;$j++)
    echo ("<img src='http://www.certifyexpress.com/review/image/hollow-star.gif' alt='4/5.0' width=13 height=12>");
    //end

    echo "&nbsp;&nbsp;Based on $numrows reviews.</font></td></tr>";
    //echo"<tr><td></td></tr>";

    $rows = 1;

    }else
    $rows = 0;
    //$no = 1;


    for($i=0;$i<$rows;$i++)
    { //for

    //start date
    $user_date = display_date($data[$i][1]);

    $date = $user_date;
    //$cat = $data[$i][3];
    //$subcat = $data[$i][4];
    $star = $data[$i][2];
    $title1 = $data[$i][5];
    $review = $data[$i][6];
    $name = $data[$i][7];
    $world = $data[$i][8];
    $user_ID = $data[$i][0];
    $cat_ID = $data[$i][9];

    $temp = count_review('u',$user_ID, $cat_ID);

    if (count($temp) == 1)
    {
    if ($temp[0][1] == "y")
    $yes = $temp[0][0];
    else
    $yes = 0;

    $total = $temp[0][0];
    }else
    {
    $yes = $temp[1][0];
    $total = $temp[1][0] + $temp[0][0];
    }

    if ($total != 0)
    {
    echo "<tr><td><font face=verdana size=1>$yes of $total people found the following review helpful/font></td></tr>";
    }
    //echo "</font></td></tr>";
    echo "<tr><td>";
    display_star($star);
    echo "<font face=verdana size=1>&nbsp;&nbsp;&nbsp;<b>$title1</b></font>,&nbsp;<font face=verdana size=1>$date</font></td></tr>";
    echo "<tr><td><font face=verdana size=1><b>Reviewer/b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#CC0033><b>$name</b></font>&nbsp;from $world</font></td></tr>";
    echo "<tr><td><font face=verdana size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $word = explode(" ", $review);
    $number = 0;
    $row = 0;
    $flat = 0;
    $newrow=0;
    for ($j=0;$j<count($word) ;$j++)
    {
    $number += strlen($word[$j]);

    if ($j == 0 || $newrows == 1)
    echo $word[$j];
    else
    {
    echo " ".$word[$j];
    $newrows = 0;
    }

    if ($number > 58)
    {
    echo "<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $number = 0;
    $row++;
    $newrow = 1;
    }
    if ($row == 5)
    {
    $flat = 1;
    break;
    }

    }
    if ($flat)
    {
    echo "<font face=verdana size=1>...<a href=\"http://www.certifyexpress.com/review/admin/display.php?gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=u\">more details</a></font>";
    }
    /*$num = round(strlen($review) / 58);
    if ($num > 5)
    $num = 5;
    else if ($num == 0)
    $num = 1;
    $start = 0;
    $end = 57;
    for ($j=0;$j<$num;$j++)
    {
    echo substr($review, $start, $end)."<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $start += 58;

    }
    if (round(strlen($review) / 58) > $num)
    {
    echo "<font face=verdana size=1>...<a href=\"../admin/display.php?gid=$user_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=u\">more details</a></font>";
    }*/
    echo "</font></td></tr>";
    echo "<tr><td>&nbsp;</td></tr>";
    echo "<tr><td><font face=verdana size=1>Do you find this review useful:&nbsp;";
    $next = $uto;
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$user_ID&status=u&cflag=y&cat_ID=$cat_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&uuntil=$uuntil\"><img src='http://www.certifyexpress.com/review/image/yes.gif' border=0 align=middle></a>&nbsp;";
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$user_ID&status=u&cflag=n&cat_ID=$cat_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&uuntil=$uuntil\"><img src='http://www.certifyexpress.com/review/image/no.gif' border=0 align=middle></a>";

    /*$test = $uto - $i;
    if ($no&&($test == 1))
    {
    $str = "../admin/display.php?user_ID=$user_ID&gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&uto=$uto&status=u";
    echo "<tr><td><font face=verdana size=1><p align=right><a href=\"$str\">More user review</a></p></font></td></tr>";
    }*/
    echo "</td></tr>";
    if ($numrows > 1)
    {
    $subcat = urlencode($subcat);
    echo "<tr><td><font face=verdana size=1><p align=right><a href=\"http://www.certifyexpress.com/review/admin/display.php?gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=u\">More User Reviews</a></p></font></td></tr>";
    }
    echo"<tr><td colspan=2><hr size=1>></td></tr>";
    } //endfor
    if ($numrows > 0)
    {
    echo "</table>";
    //echo "</td></tr>";
    }

    }

    function mod_view($gid)
    {
    global $review_obj, $cat, $subcat, $title, $flag, $desc, $image, $mto, $rows, $cate, $subcate, $newrows;
    //**********************Retrieve data from mod_review********************

    $table="mod_review";
    $field="*";
    $criteria="where cat_ID='$gid' and flag=2 order by mod_date desc";

    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];
    $numrows=$getdata[1];

    //***************************view mod_review*******************************
    $no = 1;
    $rows = 0;
    if ($numrows > 0)
    {
    //echo "<td>";

    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td><font face=verdana size=1 color=#CCCC00>Moderator Review</font></td></tr>";

    $rows=1;
    }else
    $rows=0;

    for($i=0;$i<$rows;$i++)
    { //for

    //start date

    $admin_date = display_date($data[$i][1]);

    $date = $admin_date;
    //$cat = $data[$i][3];
    //$subcat = $data[$i][4];
    $star = $data[$i][2];
    $title2 = $data[$i][5];
    $review = $data[$i][6];
    $mod_ID = $data[$i][0];
    $cat_ID = $data[$i][7];

    $temp = count_review('m',$mod_ID, $cat_ID);
    if (count($temp) == 1)
    {
    if ($temp[0][1] == "y")
    $yes = $temp[0][0];
    else
    $yes = 0;

    $total = $temp[0][0];
    }else
    {
    $yes = $temp[1][0];
    $total = $temp[1][0] + $temp[0][0];
    }

    if ($total != 0)
    {
    echo "<tr><td><font face=verdana size=1>$yes of $total people found the following review helpful/font></td></tr>";
    }


    echo "<tr><td>";
    display_star($star);
    echo "<font face=verdana size=1><b>&nbsp;&nbsp;&nbsp;$title2, </b></font><font face=verdana size=1>$date</font></td></tr>";
    echo "<tr><td><font face=verdana size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $word = explode(" ", $review);
    $number = 0;
    $row = 0;
    $flat = 0;
    $newrow=0;
    for ($j=0;$j<count($word) ;$j++)
    {
    $number += strlen($word[$j]);

    if ($j == 0 || $newrows == 1)
    echo $word[$j];
    else
    {
    echo " ".$word[$j];
    $newrows = 0;
    }

    if ($number > 58)
    {
    echo "<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $number = 0;
    $row++;
    $newrow = 1;
    }
    if ($row == 7)
    {
    $flat = 1;
    break;
    }

    }
    if ($flat)
    {
    echo "<font face=verdana size=1>...<a href=\"http://www.certifyexpress.com/review/admin/display.php?gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=m\">more details</a></font>";
    }
    /*$num = round(strlen($review) / 58);
    if ($num > 7)
    $num = 7;
    else if ($num == 0)
    $num = 1;
    $start = 0;
    $end = 57;
    ;
    for ($j=0;$j<$num;$j++)
    {
    echo substr($review, $start, $end)."<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $start += 58;
    }
    if (round(strlen($review) / 58) > $num)
    {
    echo "<font face=verdana size=1>...<a href=\"../admin/display.php?gid=$mod_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=m\">more details</a></font>";
    }*/

    echo "</font></td></tr>";
    echo "<tr><td>&nbsp;</td></tr>";
    echo "<tr><td><font face=verdana size=1>Do you find this review useful:&nbsp;";
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$mod_ID&status=m&cflag=y&cat_ID=$cat_ID&image=$image&cat=$cat&subcat=$subcat&title=$title&desc=$desc&flag=$flag\"><img src='http://www.certifyexpress.com/review/image/yes.gif' border=0 align=middle></a>&nbsp;";
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$mod_ID&status=m&cflag=n&cat_ID=$cat_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag\"><img src='http://www.certifyexpress.com/review/image/no.gif' border=0 align=middle></a>";
    /*$test = $mto - $i;
    if ($no && ($test == 1))
    {
    $str = "../admin/display.php?mod_ID=$mod_ID&gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&mto=$mto&status=m";
    echo "<tr><td><p align=right><font face=verdana size=1><a href=\"$str\">More moderator review</a></font></p></td></tr>";
    }*/

    echo "</td>";
    if ($numrows > 1)
    {
    echo "<td><font face=verdana size=1><p align=right><a href=\"http://www.certifyexpress.com/review/admin/display.php?gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=m\">More Moderator Reviews</a></p></font></td></tr>";
    }
    echo"<tr><td colspan=2><hr size=1></hr></td></tr>";

    } //endfor
    if ($numrows > 0)
    {
    echo "</td></tr>";
    echo "</table>";

    }

    }

    function admin_view($gid)
    {
    global $review_obj, $cat, $subcat, $title, $flag, $desc, $image, $cat_ID, $cate, $subcate, $newrows;
    //**********************Retrieve data from admin_review********************
    $table="admin_review";
    $field="*";
    $criteria="where cat_ID='$gid' order by admin_date desc";

    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];
    $numrows=$getdata[1];


    //***************************view admin_review*******************************
    if ($numrows > 0)
    {
    //echo "<tr><td>";


    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td><font face=Verdana size=1 color=#CCCC00>Certifyexpress Review</font></td></tr>";

    }else
    $rows=0;

    for($i=0;$i<$numrows;$i++)
    { //for
    //start date
    $admin_date = display_date($data[$i][1]);

    $date = $admin_date;
    //$cat = $data[$i][3];
    //$subcat = $data[$i][4];
    $star = $data[$i][2];
    $title1 = $data[$i][5];
    $review = $data[$i][6];
    $admin_ID = $data[$i][0];
    $cat_ID = $data[$i][10];

    $temp = count_review('a',$admin_ID, $cat_ID);
    if (count($temp) == 1)
    {
    if ($temp[0][1] == "y")
    $yes = $temp[0][0];
    else
    $yes = 0;

    $total = $temp[0][0];
    }else
    {
    $yes = $temp[1][0];
    $total = $temp[1][0] + $temp[0][0];
    }

    if ($total != 0)
    {
    echo "<tr><td><font face=verdana size=1>$yes of $total people found the following review helpful/font></td></tr>";
    }

    echo "<tr><td>";
    display_star($star);
    echo "<font face=verdana size=1><b>&nbsp;&nbsp;&nbsp;$title1,</b></font><font face=verdana size=1>&nbsp;$date</font></td></tr>";
    echo "<tr><td><font face=verdana size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $word = explode(" ", $review);
    $number = 0;
    $row = 0;
    $flat = 0;
    $newrow=0;
    for ($j=0;$j<count($word) ;$j++)
    {
    $number += strlen($word[$j]);

    if ($j == 0 || $newrows == 1)
    echo $word[$j];
    else
    {
    echo " ".$word[$j];
    $newrows = 0;
    }

    if ($number > 58)
    {
    echo "<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $number = 0;
    $row++;
    $newrow = 1;
    }
    if ($row == 10)
    {
    $flat = 1;
    break;
    }

    }
    if ($flat)
    {
    echo "<font face=verdana size=1>...<a href=\"http://www.certifyexpress.com/review/admin/display.php?gid=$gid&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=a\">more details</a></font>";
    }
    /*$num = round(strlen($review) / 58);
    if ($num > 11)
    $num = 10;
    else if ($num == 0)
    $num = 1;
    $start = 0;
    $end = 57;

    for ($j=0;$j<$num;$j++)
    {
    echo substr($review, $start, $end)."<br>";
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $start += 58;
    }
    if (round(strlen($review) / 58) > $num)
    {
    echo "<font face=verdana size=1>...<a href=\"../admin/display.php?gid=$admin_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag&sta=a\">more details</a></font>";
    }*/
    echo "</font></td></tr>";
    echo "<tr><td>&nbsp;</td></tr>";
    echo "<tr><td><font face=verdana size=1>Do you find this review useful:&nbsp;";
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$admin_ID&status=a&cflag=y&image=$image&cat_ID=$cat_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&flag=$flag\"><img src='http://www.certifyexpress.com/review/image/yes.gif' border=0 align=middle></a>&nbsp;";
    echo "<a href=\"http://www.certifyexpress.com/review/admin/disimage.php?ID=$admin_ID&status=a&cflag=n&cat_ID=$cat_ID&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag\"><img src='http://www.certifyexpress.com/review/image/no.gif' border=0 align=middle></a>";
    echo "</td></tr>";
    echo"<tr><td><hr size=1></hr></td></tr>";

    } //endfor
    if ($numrows > 0)
    {
    echo "</td></tr>";
    echo "</table>";
    //echo "<tr><td></td>";


    }

    }

    function array_cat()
    {
    global $cate, $subcate, $cat, $subcat;

    $cate[0] = "---- Books ----";
    $cate[1] = "Microsoft";
    $cate[2] = "Cisco";
    $cate[3] = "Novell";
    $cate[4] = "CompTIA";
    $cate[5] = "Linux/Unix";
    $cate[6] = "CIW";
    $cate[7] = "Oracle";
    $cate[8] = "Lotus";
    $cate[9] = "CheckPoint";
    $cate[10] = "Sun";
    $cate[11] = "BEA";
    $cate[12] = " ";
    $cate[13] = "--- Hardware ---";


    $subcate[$cate[1]][0] = "Net Essentials";
    $subcate[$cate[1]][1] = "NT Workstation";
    $subcate[$cate[1]][2] = "NT Server";
    $subcate[$cate[1]][3] = "NT Enterprise";
    $subcate[$cate[1]][4] = "Win98";
    $subcate[$cate[1]][5] = "TCP/IP";
    $subcate[$cate[1]][6] = "IIS4";
    $subcate[$cate[1]][7] = "Exchange 5.x";
    $subcate[$cate[1]][8] = "I.E 5.x";
    $subcate[$cate[1]][9] = "Proxy 2.x";
    $subcate[$cate[1]][10] = "Site Server 3.x";
    $subcate[$cate[1]][11] = "SMS 2.x";
    $subcate[$cate[1]][12] = "SQL 7.x Admin";
    $subcate[$cate[1]][13] = "SQL 7.x Imp";
    $subcate[$cate[1]][14] = "SQL 7.x Data";
    $subcate[$cate[1]][15] = "VB 6 Dsk";
    $subcate[$cate[1]][16] = "VB 6 Dist";
    $subcate[$cate[1]][17] = "Visual C++ Dsk";
    $subcate[$cate[1]][18] = "Architectures";
    $subcate[$cate[1]][19] = "FrontPage 98";
    $subcate[$cate[1]][20] = "Win2K Upg";
    $subcate[$cate[1]][21] = "Win2K Pro";
    $subcate[$cate[1]][22] = "Win2K Server";
    $subcate[$cate[1]][23] = "Win2K Accelarated";
    $subcate[$cate[1]][24] = "Win2K Net Infra";
    $subcate[$cate[1]][25] = "Win2K DS Infra";
    $subcate[$cate[1]][26] = "Win2K Migration";
    $subcate[$cate[1]][27] = "Win2K DS Design";
    $subcate[$cate[1]][28] = "Win2K Net Design";
    $subcate[$cate[1]][29] = "Win2KDsg Security";
    $subcate[$cate[1]][30] = "Word 2000";
    $subcate[$cate[1]][31] = "Word 2000 Expert";
    $subcate[$cate[1]][32] = "Excel 2000";
    $subcate[$cate[1]][33] = "Excel 2000 Expert";
    $subcate[$cate[1]][34] = "Powerpoint 2000";
    $subcate[$cate[1]][35] = "SQL 2000 Admin";

    $subcate[$cate[2]][0] = "CCNA 1.0";
    $subcate[$cate[2]][1] = "CCNA 2.0";
    $subcate[$cate[2]][2] = "CCDA";
    $subcate[$cate[2]][3] = "ACRC";
    $subcate[$cate[2]][4] = "BSCN";
    $subcate[$cate[2]][5] = "BCRAN";
    $subcate[$cate[2]][6] = "BCMSN";
    $subcate[$cate[2]][7] = "CIT";

    $subcate[$cate[3]][0] = "Netware 4.11 to 5 Update";
    $subcate[$cate[3]][1] = "Netware 5.0 Admin";
    $subcate[$cate[3]][2] = "Netware 5.0 Adv";
    $subcate[$cate[3]][3] = "Netware 5.1 Admin";
    $subcate[$cate[3]][4] = "TCP/IP";
    $subcate[$cate[3]][5] = "GroupWise 5";
    $subcate[$cate[3]][6] = "GroupWise 5 Adv";
    $subcate[$cate[3]][7] = "Networking Tech";
    $subcate[$cate[3]][8] = "NDS Design";
    $subcate[$cate[3]][9] = "Integrating NT";

    $subcate[$cate[4]][0] = "A+ Core";
    $subcate[$cate[4]][1] = "A+ Dos/Win";
    $subcate[$cate[4]][2] = "A+ Core Hard";
    $subcate[$cate[4]][3] = "A+ OS";
    $subcate[$cate[4]][4] = "Network +";
    $subcate[$cate[4]][5] = "I-NETT";

    $subcate[$cate[5]][0] = "RedHat";
    $subcate[$cate[5]][1] = "LPI";
    $subcate[$cate[5]][2] = "SAIR Int Conf";

    $subcate[$cate[6]][0] = "CIW Site Designer ";

    $subcate[$cate[7]][0] = "Oracle 8 DBA";
    $subcate[$cate[7]][1] = "SQL - PL/SQL";
    $subcate[$cate[7]][2] = "Net Admin";
    $subcate[$cate[7]][3] = "Perf Tuning";
    $subcate[$cate[7]][4] = "7.3 to 8 Upg";
    $subcate[$cate[7]][5] = "8 to 8i Upg";
    $subcate[$cate[7]][6] = "8i Backup & Recov";
    $subcate[$cate[7]][7] = "8i Perf Tuning";

    $subcate[$cate[8]][0] = "Maint Domino";
    $subcate[$cate[8]][1] = "Domino Infra";

    $subcate[$cate[9]][0] = "CCSA";
    $subcate[$cate[9]][1] = "CCSE";
    $subcate[$cate[9]][2] = "CCAE";
    $subcate[$cate[9]][3] = "CCQE";

    $subcate[$cate[10]][0] = "Java2 Programmer";

    $subcate[$cate[11]][0] = "Weblogic Server6 Developer Exam";

    }

    function select_subcat($value,$name,$others,$invalue, $type, $subvalue='')
    {
    global $history1;
    echo "<select name=$name font face=verdana align=left $others>";
    if ($type == 0)
    {
    if ($subvalue=='')
    {
    echo "<option value=''></option>";
    }


    for ($i=0;$i<count($value[$invalue]);$i++)
    {
    echo "<option value='".$value[$invalue][$i]."'";
    if ($value[$invalue][$i] == $subvalue)
    echo " selected";
    echo ">".$value[$invalue][$i]."</option>";
    }
    }else
    {
    for ($i=0;$i<count($value) ;$i++)
    {
    echo "<option value='".$value[$i]."'";
    if ($value[$i] == $invalue)
    echo " selected";
    echo ">".$value[$i]."</option>";
    }
    }

    echo "</select>";

    }

    //script begin here

    include("../includes/dbConnect.php");
    include("../includes/reviewClass.php");
    $review_obj = new review_DB($dbhost,$dbusername,$dbpasswd,$db);

    if (!isset($flag))
    $flag = md5(3);

    if (isset($ID))
    {
    $table="count_review";
    $field="review_ID,count_flag,count_sta,cat_ID";
    $value="'$ID','$cflag','$status','$cat_ID'";
    $insdata=$review_obj -> insert_data($table,$field,$value);
    //exit;
    //$link = "../admin/disimage.php?flag=$flag&cat=$cat&subcat=".urlencode($subcat);
    //header ("Location : $link");
    //header ("Location:\"../admin/disimage.php?flag=$flag&cat=$cat&subcat=\".urlencode($subcat)");
    //***************************************cat & subcat*************************************************************

    switch ($cat)
    {
    case "Microsoft":
    $path = "microsoft";
    break;
    case "Cisco":
    $path = "cisc";
    break;
    default:
    echo "wrong!!";
    break;
    }//switch($cat)

    switch ($subcat)
    {
    case "Net Essentials":
    $location = "netessentials";
    break;
    case "NT Workstation":
    $path = "ntworkstation";
    break;
    default:
    echo "wrong!!";
    break;
    }//switch($subcat)


    header("Location:http://www.certifyexpress.com/".urlencode($path)."/".urlencode($location)."/index.php");

    }

    echo "<table width=100% border=0>";
    echo "<form name=disimage method=post>";
    if ($flag==md5(1))
    {
    echo "<div align=right><font face=verdana size=1><a href=../admin/ad_main.php?flag=$flag>Add Categories</a> | \n";
    echo "<a href=../admin/crt_mod.php>Create Moderator</a> | \n";
    echo "<a href=../admin/user_review.php>User's Review</a> | \n";
    echo "<a href=../admin/mod_review.php>Moderator's Reviews</a> | \n";
    echo "<a href=../admin/ad_login.php>LogOut</a> \n</font></div>";
    }else if ($flag == md5(2))
    {
    echo "<div align=right><font face=verdana size=1><a href=../admin/ad_main.php?flag=$flag>Add Categories</a> | \n";
    echo "<a href=../admin/ad_login.php>LogOut</a> \n</font></div>";
    }


    //echo "<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center'>";
    //<tr bgcolor=#000000><td colspan=2>";
    //echo "<font face='verdana' color=#FFFFFF size='2'><b>&nbsp;Categories</b></font></td></tr>";
    //**************************************Title*************************************************
    echo "<table border=0 width=100% cellspacing=0 cellpadding=0>";
    echo "<tr>";
    echo "<td width=65% valign=top>";
    //echo "<table border=0 width=100% cellspacing=0 cellpadding=0>";
    //echo "<tr>";
    //echo "<td width=100%>";
    //echo "<table border=0 width=100% cellspacing=0 cellpadding=0>";
    //echo "<tr>";
    //echo "<td width=100%>";
    echo "<table border=0 width=100% cellspacing=0 cellpadding=0>";
    echo "<tr>";
    echo "<td width=200 bgcolor=#000000><font color=#FFFFFF size=2 face=verdana, verdana><b>&nbsp;</b></font><b><font size=2 face=Verdana color=#FFFFFF>Reviewed Books</font></b></td>";
    echo "<td>&nbsp;</td>";
    echo "</tr>";
    echo "</table>";
    echo "</td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td width=100% height=1 bgcolor=#000000><img alt src=\"http://www.certifyexpress.com/images/pixel.gif\" height=1></td>";
    //echo "</tr>";
    //echo "</table>";
    //echo "</td>";
    //echo "</tr>";
    //echo "</table>";
    echo "</td>";
    echo "</tr>";
    echo "</table>";

    //************************************************************************************************

    if ($flag == md5(1) || $flag == md5(2))
    {
    array_cat();
    if ($cat == '')
    $cat = "---- Books ----";

    echo "<table border=0 width=100%><tr><td width=30%><font face='verdana' size='1'>Please select a category and a sub category/font></td>";
    echo "<input type=hidden name=history1 value='$cat'>";
    echo "<input type=hidden name=history2 value='$subcat'>";
    }

    echo "<td>";
    if ($flag== md5(1) || $flag==md5(2))
    select_subcat($cate,"cat","onchange='this.form.submit()'",$cat, 1);

    if (($flag == md5(3)) || ($cat != "---- Books ----" && $cat != "--- Hardware ---" && $cat != " "))
    {
    if ($flag== md5(1) || $flag==md5(2))
    {
    if ($history1 != $cat)
    {
    select_subcat($subcate,"subcat","onchange='this.form.submit()'",$cat, 0);
    $subcat = '';
    }
    else
    select_subcat($subcate,"subcat","onchange='this.form.submit()'",$cat, 0, $subcat);
    }

    $table = "cat_review";
    $field = "*";
    $criteria = "where cat_cat='$cat' ";
    if ($subcat != '')
    $criteria .= " and cat_subcat='$subcat' ";
    $criteria .= "order by ID desc";
    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];
    $numrows=$getdata[1];


    }else
    $numrows = 0;

    echo "</td></tr></table>";



    if ($numrows > 0)
    {
    for ($i=0; $i < $numrows; $i++)
    {
    $id = $data[$i][0];
    $cat = $data[$i][1];
    $subcat = $data[$i][2];
    $title = $data[$i][3];
    $desc = $data[$i][4];
    $image = $data[$i][5];


    echo"<table width=100% border=0 cellpadding=0 cellspacing=0>";
    if ($flag == md5(1))
    echo "<tr><td colspan=3 align=right><font face=verdana size=1><a href =\" http://www.certifyexpress.com/review...eview.php?gid=$id&cat=$cat&title=$title&subcat=$subcat\">Write a review</a></font>";
    else if ($flag == md5(2))
    echo "<tr><td colspan=3 align=right><font face=verdana size=1><a href =\" http://www.certifyexpress.com/review...eview.php?gid=$id&cat=$cat&title=$title&subcat=$subcat\">Write a review</a></font>";
    else
    echo "<tr><td colspan=3 align=right><font face=verdana size=1><a href =\" http://www.certifyexpress.com/review..._main.php?gid=$id&cat=$cat&title=$title&subcat=$subcat&desc=$desc&image=$image\">Write a review</a></font>";
    echo "</td></tr></table>";
    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td width=13%>";
    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    $image = "/review/img/".$data[$i][5];
    echo "<tr><td width=100% rowspan=2><img src=\"$image\" width=80 height=120 border=0></a>\n</td></tr>";
    echo "</table>";
    echo "<td width=87% valign=top>";
    echo "<table width=100% border=0>";
    echo "<tr><td width=100%>";
    echo "<font face=verdana size=1><b><u>$title</u></b></font>&nbsp;<font face=verdana size=1>($subcat-$cat)</font></td></tr>";
    echo "<tr><td width=100%><font face=verdana size=1><b><i>$title</i></b></font></td></tr>";
    echo "<tr><td><font face=verdana size=1>$desc</font></td></tr>";

    echo "</table>";
    echo "</td></td></tr>";
    echo "</table>";
    echo "<hr>";
    admin_view($id);
    mod_view($id);
    user_view($id);



    //echo "</table>";
    //echo "</table>";
    //echo "<hr>";

    }

    }
    else if (($numrows==0) && ($cat != "---- Books ----" && $cat != "--- Hardware ---" && $cat != " "))
    {
    echo "<br><table border=0 width=100%><tr><td align=center><font face=verdana size=1>No records are found!</font></td></tr></table>";
    }

    echo "</form>";
    echo "</table>";
    echo "</html>";
    ?>

    pls help.

  2. #2
    Digital Warrior Renegade's Avatar
    Join Date
    Nov 2000
    Location
    Portland, OR
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that is a lot of code. Do you think you could try to narrow it down a little, the post only the relevant code? Its too much to wade through, sorry

  3. #3
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey for me it worked fine. Just bumped up the stats for

    "Certifyexpress Review" from 41 people finding it useful to 46.


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
  •