"; if ($i == $c_page) { echo " " . ($i+1) . ""; } else { $tmpstr = $f_name . "?cur_page=$i&$strOther"; echo " " . ($i+1) . ""; } } echo "
"; $page_num = $c_page + 1; // Page number is number which we r displaying // current page start with 0 // Page no is for displaying page number if ($page_num>1) { $prev_page = $c_page - 1; $tmpstr = $f_name . "?cur_page=$prev_page&$strOther"; echo " "; // $tmpstr = "abcd"; // echo $tmpstr; } // echo "$page_num : $total_num_page"; if($page_num < $t_pages) { $next_page = $c_page + 1; $last_page = $t_pages - 1; //Next Link $tmpstr = $f_name . "?cur_page=$next_page&$strOther"; echo " "; } } function sql_error() { global $MYSQL_ERRNO, $MYSQL_ERROR; if (empty($MYSQL_ERRNO)) { $MYSQL_ERRNO = mysql_errno(); $MYSQL_ERROR = mysql_error(); } return "$MYSQL_ERRNO : $MYSQL_ERROR"; } function html_header() { global $new_win_width,$new_win_hight; ?> WINDOWS alert($str);"; // echo ""; echo $str; html_footer(); exit; } function msg($str) { echo ""; } function records_x_found($t_rec) { echo ""; echo ""; echo ""; echo "
$t_rec Record(s) Found

Abbreviations  

"; // echo "

$total_rec records found. Displaying the page $page_num of $last_page_num

"; } function drawtoolbar() { echo ""; echo ""; } function desc_of_rec($str) { echo "

$str

"; } function PrintCurrentRecord ($pid, $family, $bname, $sspecies, $variety, $author, $strPM,$cCol) { $intI; echo ""; // echo "$pid"; echo "$family"; echo "$bname"; echo "$author"; echo "$sspecies"; echo "$variety"; echo "$strPM"; /* For intI = 0 to UBound(arrMPCP) - 1 strTmp = MakeHTMLStringForMPCPPlant(arrMPCP(intI), pid, objRSPMlocal) echo "" & strTmp & "" Next */ echo ""; } /* PrintAllRecords function print all records in the RecordSet. Shortlisting is not done in this recordlist. The recordset objRSPlantList is assumed as shortlisted depending upon the condition The table code is supposed to be provided in calling code with border specified So this function will only add record in that table.--> */ function listPlantRecords($strQ, $arrMPCP) { @mysql_select_db('MPCPDB'); //For Plant list $link_id_Plant = db_connect($default_dname); if (!$link_id_Plant) error_message(sql_error()); makepagelinks($PHP_SELF,$cur_page,$total_num_page,""); $resultPlant = mysql_query($strQ); if (!$resultPlant) error_message(sql_error()); mysql_close($link_id_Plant); ?> $arrMPCP[$intI]"; } echo ""; $cCol = "#E1E8FF"; while($query_data = mysql_fetch_array($resultPlant)) { // if ($intii==10) break; if ($cCol == "#E1E8FF") $cCol = "white"; else $cCol = "#E1E8FF"; $strPM = MakeHTMLString4PM($query_data["plant_id"],$arrMPCP); // PrintCurrentRecord($query_data["Plant_id"], $query_data["Family"], $query_data["Botanical_name"],$query_data["S_species"],$query_data["Variety"],$query_data["Author"]); PrintCurrentRecord($query_data["plant_id"],$query_data["family"], $query_data["Botanical_name"],$query_data["s_species"],$query_data["variety"],$query_data["author"], $strPM, $cCol); } mysql_free_result($resultPlant); } //Print all records // This function will return the query string after accepting the paremeters function SearchQueryStringForCommon($strC, $chkKA, $chkKE, $chkTN) { $strTmp=$strTmp; $strCC=$strC; $strReturn = "Select Distinct(pm.plant_id), b.family, concat_ws(\" \",b.genus, b.species) AS Botanical_name, b.s_species, b.variety, b.author"; $strReturn .= " FROM bot_mast AS b, plantmpcp AS pm, mpcp_m m"; $strReturn .= " WHERE ((pm.Plant_ID=b.plant_id) and (pm.mpcp=m.mpcp) and (b.syn_lnk=0)) "; $tok = strtok ($strC," "); while ($tok) { $strReturn .= MakeQueryFor($tok); $tok = strtok (" "); } if ($chkKA == "ON") $strReturn = "$strReturn and (m.State='KA'"; if($chkKE="ON") { if ($chkKA == "ON") $strReturn = "$strReturn or m.State='KE'"; else $strReturn = "$strReturn and (m.State='KE'"; } if ($chkTN == "ON") { if (($chkKA== "ON") OR ($chkKE == "ON")) $strReturn = "$strReturn or m.State='TN'"; Else $strReturn = "$strReturn and (m.State='TN'"; } if (($chkKA=="ON") OR ($chkKE=="ON") OR ($chkTN=="ON")) $strReturn = "$strReturn)"; // $strReturn = "$strReturn ORDER BY b.genus+' '+b.species"; return $strReturn; } // This function will return the query string after accepting the paremeters function CountQueryStringForCommon($strC, $chkKA, $chkKE, $chkTN) { $strCC=$strC; $strReturn = "Select count(Distinct(pm.plant_id))"; $strReturn .= " FROM bot_mast AS b, plantmpcp AS pm, mpcp_m m"; $strReturn .= " WHERE ((pm.Plant_ID=b.plant_id) and (pm.mpcp=m.mpcp) and (b.syn_lnk=0)) "; $tok = strtok ($strC," "); while ($tok) { $strReturn .= MakeQueryFor($tok); $tok = strtok (" "); } if ($chkKA == "ON") $strReturn = "$strReturn and (m.State='KA'"; if($chkKE="ON") { if ($chkKA == "ON") $strReturn = "$strReturn or m.State='KE'"; else $strReturn = "$strReturn and (m.State='KE'"; } if ($chkTN == "ON") { if (($chkKA== "ON") OR ($chkKE == "ON")) $strReturn = "$strReturn or m.State='TN'"; Else $strReturn = "$strReturn and (m.State='TN'"; } if (($chkKA=="ON") OR ($chkKE=="ON") OR ($chkTN=="ON")) $strReturn = "$strReturn)"; // $strReturn = "$strReturn ORDER BY b.genus+' '+b.species"; return $strReturn; } function MakeQueryFor($strC) { $strTmp; $link_id_tmp; $strReturn=""; if (strlen($strC)>0) { $strReturn = "$strReturn AND ( b.family like \"%$strC%\" "; $strReturn = "$strReturn or b.genus like \"%$strC%\" "; $strReturn = "$strReturn or b.species like \"%$strC%\" "; $strReturn = "$strReturn or b.variety like \"%$strC%\" "; } if (strlen($strC)>0) { //This is for medicinal system. $strTmp="select CODE from med_syst where MED_SYS like \"%$strC%\";"; $link_id_tmp = db_connect($default_dname); @mysql_select_db('MPCPDB'); if (!$link_id_tmp) error_message(sql_error()); $result = mysql_query($strTmp); if(!$result) { error_message(sql_error()); } if (mysql_num_rows($result)==0) { // if objrs is not contain any record the resultent should contain no record. // Thats why putting condition like this. $strReturn = "$strReturn or b.DPT_REF like \"%xxxx%\""; } else { $strTmp = $result["Code"]; $strReturn = "$strReturn or b.DPT_REF like \"%$strTmp%\""; } mysql_free_result($result); } if (strlen($strC)>0) { // This is For red listed status // the database is already open so not opening it again (Not opening link_id_tmp)' $strTmp="select Code from redstatus where Desc1 like \"%$strC%\";"; $result = mysql_query($strTmp); if(!$result) { error_message(sql_error()); } if (mysql_num_rows($result)== 0) { // if objrs is not contain any record the resultent should contain no record. // Thats why putting condition like this. $strReturn = "$strReturn or b.red_status like \"%xxxx%\""; } else { $strTmp = $result["Code"]; $strReturn = "$strReturn or b.red_status like \"%$strTmp%\""; } mysql_close($link_id_tmp); mysql_free_result($result); } if (strlen($strC)>0) $strReturn = "$strReturn) "; return $strReturn; } function GiveToken($strC) { $n = strpos($strC," "); if ($n>0) { $strReturn = strstr($strC,0,$n); } else $strReturn = $strC; return $strReturn; } function GiveNextPart($strC) { $n = strpos($strC," "); if ($n==0) { $strReturn = ""; } else { $strReturn = str_replace($strC, GiveToken($strC), " "); $strReturn = trim($strReturn); } return $strReturn; } /*function MakeHTMLString4PM($pid, $arrMPCP, $resultPM) { global $arrPM; $strReturn=""; msg(count($arrPM)); for($intI=0;$intI$arrPM[$intJ][\"MPCP\"]"; // msg ("matching coming here"); break; } } // msg ("coming here"); if ($intJ >= count($arrPM)) { // No record found for this Plant_id and MPCP $strReturn .=""; } } return $strReturn; } */ function MakeHTMLString4PM($pid, $arrMPCP) { $strReturn=""; $strTmp = ""; $strQPM = "select *,concat(MPCP, Plant_id) as MPCP_Pid from plantmpcp where Plant_id = $pid"; $link_id_PM = db_connect($default_dname); if (!$link_id_PM) error_message(sql_error()); $resultPM = mysql_query($strQPM); if (!$resultPM) error_message(sql_error()); for($intI=0;$intI"; break; } } if ($strTmp=="") // No record found $strReturn .= ""; else $strReturn .= $strTmp; } mysql_free_result($resultPM); mysql_close($link_id_PM); return $strReturn; } function MakeEHSRD($E, $H, $S , $R, $D) { $strReturn=""; $strReturn = ""; else $strReturn .= " alt=\"Plant absent in EMF\" src=\"images\EAbsent.gif\">"; $strReturn .= ""; else $strReturn .= " alt=\"Plant absent in Herbarium\" src=\"images\HAbsent.gif\">"; $strReturn .= ""; else $strReturn .= " alt=\"Seeds absent\" src=\"images\SAbsent.gif\">"; $strReturn .= ""; else $strReturn .= " alt=\"Plant absent in Rawdrug\" src=\"images\RAbsent.gif\">"; $strReturn .= ""; else $strReturn .= " alt=\"Plant absent in EMF\" src=\"images\DAbsent.gif\">"; return $strReturn; } ?>
Family Botanical Name Author Sub species Variety
No" . MakeEHSRD(0,0,0,0,0) . "