name : null; } function Setup ($user, $pass) { $this->user = $user; $this->pass = $pass; } function Create ($db) { if (!$this->user) { $this->user = USER; } if (!$this->pass) { $this->pass = DBPASSWORD; } if (!$this->db) { $this->db = $db; } if (!$this->host) { $this->host = HOSTSERVER; } $this->id = mysqli_connect($this->host, $this->user, $this->pass) or $this->MySQL_ErrorMsg("Unable to connect to MySQL server: $this->host : '$SERVER_NAME'"); $this->selectdb($db); } function Create2 ($db, $user, $password, $host) { if (!$this->user) { $this->user = $user; } if (!$this->pass) { $this->pass = $password; } if (!$this->host) { $this->host = $host; } $this->id = mysqli_connect($this->host, $this->user, $this->pass) or $this->MySQL_ErrorMsg("Unable to connect to MySQL server: $this->host : '$SERVER_NAME'"); $this->selectdb($db); } function SelectDB ($db) { $this->errors = 0; $this->errStr = "Ok"; mysqli_select_db($this->id, $db ) or $this->MySQL_ErrorMsg ("Unable to select database: $db"); } /* Use this function is the query will return multiple rows. Use the Fetch routine to loop through those rows. */ function Query ($query) { mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL"); //echo $query; $this->result = mysqli_query($this->id, $query) or $this->MySQL_ErrorMsg ("Bad query: $query"); //if ($this->result = mysqli_query($this->id, $query)) { $this->rows = mysqli_num_rows($this->result); $this->a_rows = mysqli_affected_rows($this->id); //mysqli_free_result($this->result); //} } function Query2 ($query) { mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL"); $this->result = mysqli_query($this->id, $query) or $this->MySQL_ErrorMsg ("Bad query2: $query"); $this->rows = mysqli_num_rows($this->result); $this->a_rows = mysqli_affected_rows($this->id); } /* Use this function if the query will only return a single data element. */ function QueryItem ($query) { mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL"); $this->result = mysqli_query($this->id, $query) or $this->MySQL_ErrorMsg ("Unable to perform query: $query"); $this->rows = mysqli_num_rows($this->result); $this->a_rows = mysqli_affected_rows($this->id); $this->data = mysqli_fetch_array($this->result); // or $this->MySQL_ErrorMsg ("Unable to fetch data from query: $query"); return($this->data[0]); } /* This function is useful if the query will only return a single row. */ function QueryRow ($query) { mysqli_query($this->id, "SET CHARACTER_SET_RESULTS=NULL"); $this->result = mysqli_query($this->id, $query) or $this->MySQL_ErrorMsg ("Unable to perform query: $query"); $this->rows = mysqli_num_rows($this->result); $this->a_rows = mysqli_affected_rows($this->id); $this->data = mysqli_fetch_array($this->result); // or $this->MySQL_ErrorMsg ("Unable to fetch data from query: $query"); return($this->data); } function Fetch ($row) { mysqli_data_seek($this->result, $row) or $this->MySQL_ErrorMsg ("Unable to seek data row: $row"); $this->data = mysqli_fetch_array($this->result) or $this->MySQL_ErrorMsg ("Unable to fetch row: $row"); } function Insert ($query) { //$query2 = mysqli_real_escape_string($this->id, $query); //echo "\r\n------------------".$query2; $this->result = mysqli_query($this->id, $query) or $this->MySQL_ErrorMsg ("Unable to perform insert: $query2"); $this->a_rows = mysqli_affected_rows($this->id); } function Update ($query) { $this->result = mysqli_query($query, $this->id) or $this->MySQL_ErrorMsg ("Unable to perform update: $query"); $this->a_rows = mysqli_affected_rows($this->id); } function Delete ($query) { $this->result = mysql_query($this->id, $query) or $this->MySQL_ErrorMsg ("Unable to perform Delete: $query"); $this->a_rows = mysql_affected_rows($this->id); } /* ******************************************************************** * MySQL_ErrorMsg * * Print out an MySQL error message * */ function MySQL_ErrorMsg ($msg) { /* Close out a bunch of HTML constructs which might prevent the HTML page from displaying the error text. */ //echo("\n"); //echo("\n"); /* Display the error message */ $this->errors = 1; $this->errStr = mysqli_error(); //$db_err = 1; $text = "$msg
"; $text .= $this->errStr."
"; // print($text); return($text); } } /* check for unwanted characters in user input query */ function verifyData ($query) { if($query){ $query = str_replace ("%", "", $query); //$query = str_replace ("_", "", $query); $query = str_replace (">", "", $query); $query = str_replace ("<", "", $query); $query = str_replace ("|", "", $query); $query = str_replace ("`", "", $query); //$query = str_replace ("\\", "", $query); incompatible with addslashes $query = str_replace ("+", "", $query); $query = str_replace ("?", "", $query); $query = str_replace ("^", "", $query); return $query; }else{ exit; } } function getRegionList($db,$sql, $region) { if (strlen($sql)<5) return(""); $result = mysqli_query($db, $sql); if ($myrow = mysqli_fetch_array($result)) { // display list if there are records to display do { $count++; $area=$myrow["RegionCode"]; $dash=""; if ($area==0 || $area==70 || $area==99) $dash="---"; if ($area==$region) printf("\n",$area,$dash,$myrow["RegionName"]); else printf("\n",$area,$dash,$myrow["RegionName"],$dash); } while ($myrow = mysqli_fetch_array($result)); //printf("%d records selected\n",$count); } return($count); } function findInDB($sql2,$names, $arabic=0, $view=0) { GLOBAL $colors; $fId = trim(strtok($names , ",")); $name = ""; $comma = ""; $comma2 = "
"; while (strlen($fId)>0) { if ((string)$fId === (string)(int)$fId) { if ($arabic==1) $sName = $sql2->QueryItem("select otherName from ".TABLESCHOLARS." where id='$fId'"); else $sName = $sql2->QueryItem("select famousName from ".TABLESCHOLARS." where id='$fId'"); //$sName = $sql2->data[0]; //$oName = $sql2->data[1]; $rk = (int)($fId/10000) + 1; $color = $colors[$rk]; if ($view==1) $name .= $comma."$sName"; else { if ($fId>=9990 && $fId<=9999) $name .= $comma."$sName"; else $name .= $comma."$sName"; //if (strlen($oName)>3) // $name .= $comma2."$oName"; } } else { $name .= $comma.$fId; } $fId = trim(strtok(",")); $comma = ", "; } return($name); } function findInDB3($sql2,$names,$rank=-1,$arabic=0,$gap=", ") { GLOBAL $colors; $fId = trim(strtok($names, ",")); $name = ""; $comma = ""; $comma2 = "
"; $count=0; $size="-1"; if ($arabic==1) $size="+1"; while (strlen($fId)>0) { if ((string)$fId === (string)(int)$fId) { $rk = (int)($fId/10000) + 1; if ($rk==$rank || $rank==-1) { $color = $colors[$rk]; $sName = $sql2->QueryRow("select famousName,otherName,birthDate,deathDate,liveCity,tags,kunya from ".TABLESCHOLARS." where id='$fId'"); $nm = $sName[$arabic]; $fName = $sName[0]; $dob = trim($sName[2]); $dod = trim($sName[3]); $dbd =""; if (strlen($dob)>2 && strlen($dod)>2) $dbd = "[$dob - $dod]"; else if (strlen($dod)>2) $dbd = "[d. $dod]"; $cities = trim($sName[4]); $kunya = trim($sName[6]); $cap = "$fName,$kunya $dbd [$cities]"; $name .= $comma."".$nm.""; $comma = $gap; $count++; if ($count>5) break; } } $fId = trim(strtok(",")); } return($name); } function getIds($names, $rank=-1) { $fId = trim(strtok($names , ",")); if (strlen($fId)==0) $fId = trim($names); $name = ""; $comma = ""; $comma2 = "
"; while (strlen($fId)>0) { if ((string)$fId === (string)(int)$fId) { $rk = (int)($fId/10000) + 1; if ($rk==$rank || $rank==-1) { $name .= $comma.$fId; $comma=","; } } $fId = trim(strtok(",")); } return($name); } function findInDB2($sql2,$names,$mID=0) { GLOBAL $colors; $name = ""; $fId = trim(strtok($names , ",")); if ($fId=="") $name = "Unknown"; $no=1; $comma = ""; $comma2 = "
"; while (strlen($fId)>0) { if ((string)$fId === (string)(int)$fId) { $dd = $sql2->QueryRow("select famousName,otherName,RefId,miscIds from ".TABLESCHOLARS." where id='$fId'"); $sName = $dd[0]; $oName = $dd[1]; $idd = $dd[2]."-".$dd[3]; $rk = (int)($fId/10000) + 1; $color = $colors[$rk]; //$name .= $comma."$sName"; if ($fId>=9990 && $fId<=9999) $name .= $comma."$sName"; else $name .= $comma."$sName"; if (strlen($oName)>3) $name .= $comma2."$oName"; if ($mID>0) $name .= "."; //$name .= "."; } else { $name .= $comma.$fId; } $fId = trim(strtok(",")); $no++; $comma = "
$no)"; //$comma2 = "
"; } return($name); } function linkTags($tags) { $fId = trim(strtok($tags, ",")); $tag = str_replace(' ', '%20', $fId); $name = ""; $comma = ""; while (strlen($fId)>0) { $name .= $comma."$fId"; $fId = trim(strtok(",")); $tag = str_replace(' ', '%20', $fId); $comma = ", "; } return($name); } function drawBox($align,$size,$heading,$body) { print("\n"); print(""); print("
$heading
\n"); print("
$body
\n
\n"); } function processEntry($sql2,$info, $width, $upto=0) { $count=0; $chds=""; $infos = explode(",",$info); foreach ($infos as $chd) { $chd = trim($chd); if (strlen($chd)<1) continue; if ((string)$chd === (string)(int)$chd) { $child = $sql2->QueryItem("select famousName from ".TABLESCHOLARS." where id='$chd'"); $chd1 =$child; if ($upto>0) { $parts = explode(" ",$child); $child=""; for ($j = 0; $j < $upto; $j++) $child .= $parts[$j]." "; } $chd = "".$child.""; } else { $child = $chd; if ($upto>0) { $parts = explode(" ",$child); $child=""; for ($j = 0; $j < $upto; $j++) $child .= $parts[$j]." "; if (count($parts)>$upto) $chd = "".$child.""; } } $chds .= $chd."
"; $count++; $width=max($width,strlen($child)); } $entry['count'] = $count; $entry['width'] = $width; $entry['child'] = $chds; return ($entry); } function findTeachers($sql2,$sId,$field,$arabic=0,$type=0) { GLOBAL $colors; $name = ""; $IDs=""; $comma = ""; $comma2 = "
"; $count=0; $query = "select id, famousName,otherName from ".TABLESCHOLARS." where concat(',',$field,',') like '%,$sId,%' order by Id"; $sql2->Query ("SET NAMES 'utf8'"); $sql2->Query ($query); $rows = $sql2->rows; for ($kk = 0; $kk < $rows; $kk++) { $sql2->Fetch($kk); $sid = $sql2->data[0]; $rk = (int)($sid/10000) + 1; $color = $colors[$rk]; $nm = $sql2->data[$arabic + 1]; $name .= $comma."".$nm.""; $IDs .=$comma.$sid; $comma = ","; $count++; //if ($count>5) break; } if ($type==0) return($name); else return($name."
".$IDs); } function birthDeath($dob, $dod, $rk, $tb) { $fix=""; $fix2=""; //DOB $dobh = trim(strtok($dob, "/")); $dobg = trim(strtok("*")); $dobg = trim(strtok($dobg, " ")); $date[0]['G'] = $dobg; $date[0]['H'] = $dobh; //$tb = $sql->data[5]; //$tb= $sql2->QueryItem("select tabqa from ".TABLETAQRIB." where scholarId=$sid"); //if ($tb<4) $tb=0; else $tb -= 3; $fs = substr($dobh,0,1); if ($fs=="~" || $fs=="<" || $fs==">") $dobh = trim(substr($dobh,1)); if ($fs=="a") $dobh = trim(substr($dobh,5)); if ($fs=="b") $dobh = trim(substr($dobh,6)); $dobh = trim(strtok($dobh, " ")); $cbh = trim(strtok("*")); $sbe=1; $sb=1; $dobhe = 20 + 80 * ($rk-2); if ($tb>1) $dobhe = ($tb-1)*20 - 10; if ($rk==1) {$dobhe = -10; $sbe=1; } $date[0]['est']=0; if ($dobh==0 && $rk>1) { $dobh = $dobhe ; $fix .="«"; $date[0]['est']=1;} if ($dobh==0 && $rk==1) { $dobh = abs($dobhe); $cbh="BH"; $fix .="«"; $date[0]['est']=1;} $signb = ""; $signd = ""; if (substr($cbh,0,2)=="BH") {$signb = "-"; $sb=-1;} else $cbh="AH"; $jdb = (int)(islamicToJd($sb*$dobh, 6, 15)/365.25) - 4713; $jdbe = (int)(islamicToJd($sbe*$dobhe, 6, 15)/365.25) - 4713; if ($dobg==0) $dobg=$jdb; $dobg = sprintf("%04d",$dobg); $dobh = $signb.sprintf("%04d",$dobh); $date[0]['HA'] = $dobh; $date[0]['GA'] = $dobg; $date[0]['GC'] = $jdb; $date[0]['HE'] = $dobhe; $date[0]['GE'] = $jdbe; //DOD $dodh = trim(strtok($dod, "/")); $dodg = trim(strtok("*")); $dodg = trim(strtok($dodg, " ")); $date[1]['G'] = $dobg; $date[1]['H'] = $dobh; $fs = substr($dodh,0,1); if ($fs == "~" || $fs == "<" || $fs == ">") $dodh = trim(substr($dodh,1)); if ($fs == "a") $dodh = trim(substr($dodh,5)); if ($fs == "b") $dodh = trim(substr($dodh,6)); //$fs = $dodh; $dodh = trim(strtok($dodh, " ")); $cdh = trim(strtok("*")); $sd=1; $sde=1; if (substr($cdh,0,2)=="BH") {$signd = "-"; $sd=-1;} else $cdh="AH"; $dodhe = 40 + 80 * ($rk-1); if ($tb>0) $dodhe = 60 + ($tb-1)*20; $date[1]['est']=0; if ($dodh==0 && $rk>0 && $signd=="") { $dodh = $dodhe; $fix2 .="»"; $date[1]['est']=1;} $jdd = (int)(islamicToJd($sd*$dodh, 6, 15)/365.25) - 4713; $jdde = (int)(islamicToJd($sde*$dodhe, 6, 15)/365.25) - 4713; if ($dodg<$dobg) $dodg=$jdd; $dodg = sprintf("%04d",$dodg); $dodh = $signd.sprintf("%04d",$dodh); $date[1]['HA'] = $dodh; $date[1]['GA'] = $dodg; $date[1]['GC'] = $jdd; $date[1]['HE'] = $dodhe; $date[1]['GE'] = $jdde; $dbda = "[".abs($date[0]['HA'])." $cbh/".$date[0]['GA']." CE - ".abs($date[1]['HA'])." $cdh/".$date[1]['GA']." CE] (Cal.)"; $date[0][0] = $dbda; return($date); } function utf8_strrev($str){ preg_match_all('/./us', $str, $ar); return join('',array_reverse($ar[0])); } function islamicToJd($year, $month, $day) { $_ISLAMIC_EPOCH = 1948439.5; return($day + ceil(29.5 * ($month - 1)) + ($year - 1) * 354 + (int)((3 + (11 * $year)) / 30) + $_ISLAMIC_EPOCH) - 1; } class ArDate { protected $mode = 1; protected $xml = null; protected static $islamicEpoch = 1948439.5; /** * "date" method output charset * @var String */ public $dateOutput = 'utf-8'; /** * Convert given Gregorian date into Hijri date * * @param integer $Y Year Gregorian year * @param integer $M Month Gregorian month * @param integer $D Day Gregorian day * * @return array Hijri date [int Year, int Month, int Day](Islamic calendar) * @author Khaled Al-Sham'aa */ public function hjConvert($Y, $M, $D) { // To get these functions to work, you have to compile PHP // with --enable-calendar // http://www.php.net/manual/en/calendar.installation.php // $jd = GregorianToJD($M, $D, $Y); $jd = $this->gregToJd($M, $D, $Y); list($year, $month, $day) = $this->jdToIslamic($jd); return array($year, $month, $day); } /** * Convert given Julian day into Hijri date * * @param integer $jd Julian day * * @return array Hijri date [int Year, int Month, int Day](Islamic calendar) * @author Khaled Al-Sham'aa */ protected function jdToIslamic($jd) { $jd = (int)$jd + 0.5; $year = ((30 * ($jd - self::$islamicEpoch)) + 10646) / 10631; $year = (int)$year; $month = min(12, ceil(($jd - (29 + $this->islamicToJd($year, 1, 1))) / 29.5) + 1); $day = ($jd - $this->islamicToJd($year, $month, 1)) + 1; return array($year, $month, $day); } /** * Convert given Hijri date into Julian day * * @param integer $year Year Hijri year * @param integer $month Month Hijri month * @param integer $day Day Hijri day * * @return integer Julian day * @author Khaled Al-Sham'aa */ public function islamicToJd($year, $month, $day) { return($day + ceil(29.5 * ($month - 1)) + ($year - 1) * 354 + (int)((3 + (11 * $year)) / 30) + self::$islamicEpoch) - 1; } /** * Converts a Gregorian date to Julian Day Count * * @param integer $m The month as a number from 1 (for January) * to 12 (for December) * @param integer $d The day as a number from 1 to 31 * @param integer $y The year as a number between -4714 and 9999 * * @return integer The julian day for the given gregorian date as an integer * @author Khaled Al-Sham'aa */ protected function gregToJd ($m, $d, $y) { if ($m > 2) { $m = $m - 3; } else { $m = $m + 9; $y = $y - 1; } $c = $y / 100; $ya = $y - 100 * $c; $jd = (146097 * $c) / 4 + (1461 * $ya) / 4 + (153 * $m + 2) / 5 + $d + 1721119; return round($jd); } } function isMaster($host) { $hosts = explode(".",$host,5); //50-15-103-13.hou.clearwire-wmx.net //50-8-24-38.hou.clearwire-wmx.net $master=0; //echo $host."
"; if (($hosts[2]=="hstntx" && $hosts[3]=="swbell") || ($hosts[0]=="50-8-24-38")) { $master=1; } return($master); } function adslashes($abc) { return(addslashes($abc)); } ?>Comp.(RA)","Follower(Tabi')","Succ. (Taba' Tabi')","3rd Century AH","4th Century AH","5th Century AH", "6th Century AH","7th Century AH","8th Century AH","9th Century AH","10th Century AH","11th Century AH","12th Century AH", "13th Century AH","14th Century AH","15th Century AH"); $Ranks2 = array("Rasool Allah", "Companion (RA)","Follower (Tabi')","Successor (Taba' Tabi')","3rd Century AH","4th Century AH","5th Century AH", "6th Century AH","7th Century AH","8th Century AH","9th Century AH","10th Century AH","11th Century AH","12th Century AH", "13th Century AH","14th Century AH","15th Century AH"); $Interests = array("Unknown", "Tafsir/Quran","Recitation/Quran","Hadith","Narrator","Fiqh","Aqeedah","History","Seerah","Theology", //0-9 "Medicine","Science","Mathematics","Economics","Art/Poetry","Explorer","Commander","Khalifah","Governor","Qadhi(Judge)",//10-19 "Reformer","Thinker","Linguistic","Traditionalist","Preacher","Politics"); //20-25 $Subjects = array("Unknown", "Tafsir/Quran","Recitation/Quran","Hadith","Akhlaq","Fiqh","Aqeedah","History","Seerah","Theology","Philosphy","Politics", "Medicine","Science","Mathematics","Economics","Art/Peotry","Comparative Religon","Biography"); //$iconFiles = array("saw23X22.gif", "rah3.gif"); $iconFiles = array("saw23X22.gif", "rah27X23.gif"); //$iconFiles = array("saws.gif", "ranhu.gif"); $muthhubs = array("None", "Hanafi","Maliki","Shafi'ee","Hanbali","Other","Unknown","Non-Muslim"); $narratorGrade = array("Unknown", "No Doubt","Thiqah Thiqah","Thiqah","Sadooq","Sadooq/Delusion","Maqbool", //0 - 6 "Not Thiqah","Weak","Unknown-Majhool","Abandoned","Accused Liar","Liar","Undefined"); //7-13 $counts = array("Companions (Sahaba, RA)","Followers (Tab'aeen)","Successors (Taba' Tab'aeen)","3rd Century (Taba' Taba' Tab'aeen)","Later Scholars","Tafsir Scholars","Historians"); $colors = array("black","darkgreen","blue","purple","brown","magenta"); $tribes = array("Banu Hashim","Banu al-Muttalib","Banu Nawfal","Banu 'Abd Shams","...Banu Umayya","Banu Asad","Banu 'Abd al-Dar", "Banu Zuhrah","Banu Makhzum","Banu Taym","Banu Jumah","Banu Sahm","Banu 'Adi","Banu 'Amir b. Lu'ayy","Banu al-Harith b. Fihr"); $tribesAbbr = array("B.Hashim","B.al-Muttalib","B.Nawfal","B.'Abd Shams","B.Umayya,","B.Asad","B.'Abd al-Dar", "B.Zuhrah","B.Makhzum","B.Taym","B.Jumah","B.Sahm","B.'Adi","B.'Amir","B.Fihr"); $ansarsAbbr = array("B.al-Harith B.al-Khazraj","B.'Auf B.al-Khazraj","B.QauQal","B.al-Hubla","B.Sa'ida","B.Salima","B.Zurayq","B.Bayada","B.Habib", "B.Malik B.al-Najjar","B.Mazin B.al-Najjar","B.'Ady B.al-Najjar","B.Dinar B.al-Najjar"); $ansarsAbbrStr = array("B.al-Harith B.al-Khazraj","B.'Auf B.al-Khazraj","...B.QauQal","...B.al-Hubla","B.Sa'ida","B.Salima","B.Zurayq","B.Bayada","B.Habib", "B.Malik B.al-Najjar","B.Mazin B.al-Najjar","B.'Ady B.al-Najjar","B.Dinar B.al-Najjar"); $awsAbbr = array("B.'Abdul Ashhal","B.Haritha","B.Zafar","B.'Amr B.'Auf","B.Dubay'a","B.Umayyah B.Zayd","B.'Ubaid B.Zayd","B.Mu'awiya", "B.Tha'laba","B.Jahjaba B.Kulfa","B.Ghanm B.al-Salm","B.Khutama"); $awsAbbrStr = array("B.'Abdul Ashhal","B.Haritha","B.Zafar","B.'Amr B.'Auf","...B.Dubay'a","...B.Umayya B.Zayd","...B.'Ubaid B.Zayd","...B.Mu'awiya", "...B.Tha'laba","...B.Jahjaba B.Kulfa","B.Ghanm B.al-Salm","B.Khutama"); //$hadithBooks = array("Sahih Bukhari","Sahih Muslim"); $hadithBooks = array("Sahih Bukhari","Sahih Muslim","Sunan Abi Da'ud","Jami' al-Tirmidhi", "Sunan an-Nasa'i","Sunan Ibn Majah","Riyad as-Salihin"); $hadithStatus = array("Unknown","Sahih","Hasan","Da'if","Gharib","Hasan Gharib","Sahih li ghairih","Hasan Sahih Gharib","Hasan Sahih","Fabricated", "Munkar"); $genderType = array("Unknown","","Woman","Kunya,","Kunya, Woman"); $Tags = array("Early Muslim","Late Muslim","Female","Freed Slave","Tortured","Abyssinia","Abyssinia 1","Abyssinia 2","Aqaba 1","Aqaba 2", "Aqaba Chief","Quraish","Emigrant","Ansar","Badr","Uhud","Khandaq","Khaybar","Promised Paradise","Mother of the Believers","Child","Uncle","Aunt","Scribe","Messenger","Servant","Client"); $tabaqatLevel = array("Comp.(RA)","Successor (Level 1)","Successor (Level 2)","Successor (Level 3)","Successor (Level 4)", "Successor (Level 5)","Successor (Level 6)","Successor (Level 7)","Successor (Level 8)","Successor (Level 9)","Fiqh/Hadith Scholar"); $resources = array("al-Isabah Ibn Hajr","Thiqat Ibn Hibban","Tarikhul Kabir al-Bukhari","Tabaqat Ibn Sa'd", "Siyar A'lam al-Dhahbi","Lisan al-Mizan Ibn Hajr","Tahdheeb al-Tahdheeb Ibn Hajr", "Mezan al-A'tadal al-Dhahbi","Taqrib al-Tahdheeb Ibn Hajr", "Tahdheeb al-kamal by al-Mizzi","Thiqat/Tarikh"); $resource_book = array("al-Isabah","Thiqat","Tarikh-ul Kabir","Tabaqat","Siyar A'lam","Lisan al-Mizan","Tahdheeb al-Tahdheeb","Mezan al-A'tadal","Taqrib al-Tahdheeb","Tahdheeb al-kamal"); $tables = array(TABLEASABAH,TABLEALTHKAT,TABLETARIKH,TABLEIBNSAD,TABLESEER,TABLEMIZAN,TABLETAHZEEB,TABLEMEZAN, TABLETAQRIB, TABLEKAMAL); $adjustArabicName = array(3,4,5,8,9,7,10,11,12); $resource_book_color2 = array("black","magenta","orange","blue","darkgreen","black","purple","brown","yellow","darkblue"); $resource_book_color = array("black","black","black","black","black","black","black","black","black", "black"); $Towns="Hijaz Makkah Medina al-Ta'if Yamama Iraq Kufa Basra Baghdad Wasit Bahrain Musal Egypt Alexandria Abyssinia Syria Damascus Hims Jordon Ramla Palestine Antioch Arminia Yemen Hamadan Sana' Khurasan Merv Ray' Raqqa Mada'in Musaysa 'Asqalan Tursus Bulkh Asbahan Nisapur Balsi Nisa' al-Thaghar Bukhara Samarqand Others"; ?> Islam Time Line $head"); $line_color = array("blue","magenta","darkgreen","purple","red"); $line_legend = array("Father","Mother","Children","Siblings","Spouse"); $line_legend2 = array("Teachers","Students","Children","Siblings","Spouse"); ?>
[$label]"); print(""); if ($type==3) for ($j = 0; $j < 5; $j++) echo ""; else if ($type==4) for ($j = 0; $j < 2; $j++) echo ""; print(""); for ($j = 1; $j < 5; $j++) print(""); ?>
« : DOB unknown, » : DOD unknown [$label2]".$line_legend[$j]."".$line_legend2[$j]."Color Scheme: ".$counts[$j-1]."    
"; $sql = new MySQL_class; $sql->Create(DBNAME); // create an instance of the class object $sql2 = new MySQL_class; $sql2->Create(DBNAME); // create an instance of the class object $box = "style='display:none; border: 1px dotted black; padding: 0.2em;  box-shadow: 5px 5px 5px #888;border-radius: 5px;-moz-border-radius: 5px;'"; $cond1 = str_replace(";",",",$cond); $cond1 = str_replace(",,",",",$cond1); $cond1 = str_replace(",,",",",$cond1); $cond1 = str_replace("(,","(",$cond1); $cond1 = str_replace(",)",")",$cond1); if ($id="") $id=0; $query = "select id, famousName,otherName,birthDate,deathDate,liveCity,tags,kunya,status from ".TABLESCHOLARS." where id='$id' or $cond1"; $sql->Query ("SET NAMES 'utf8'"); $sql->Query($query); $rows = $sql->rows; $cap=""; $list=""; $rk = (int)($Id/10000) + 1; $cyear=20 + ($manage-35)*40; if ($rk>1) $cyear = ($manage==36 ? 80 + 80 * ($rk-2) : 20 + 80 * ($rk-2)); for ($kk = 0; $kk < $rows; $kk++) { $sql->Fetch($kk); $sid = $sql->data[0]; $fName = $sql->data[1]; $oName = $sql->data[2]; $rk = (int)($sid/10000) + 1; $color = $colors[$rk]; $dob = trim($sql->data[3]); $dod = trim($sql->data[4]); $tb= $sql2->QueryItem("select tabqa from ".TABLETAQRIB." where scholarId=$sid"); if ($tb<4) $tb=0; else $tb -= 3; $dates = birthDeath($dob, $dod, $rk, $tb); $dbda = ""; $dbde = ""; //$dbda = "Cal. : [".$dates[0]['HA']."/".$dates[0]['GA']." - ".$dates[1]['HA']."/".$dates[1]['GA']."]"; if ($master==1) { $dbda = $dates[0][0]."
"; $dbde = "Est. : [".$dates[0]['HE']."/".$dates[0]['GE']." - ".$dates[1]['HE']."/".$dates[1]['GE']."]
"; } $dbd =""; if (strlen($dob)>2 && strlen($dod)>2) $dbd = "[$dob - $dod]"; else if (strlen($dod)>2) $dbd = "[d. $dod]"; $cities = trim($sql->data[5]); $tags = trim($sql->data[6]); $kunya = trim($sql->data[7]); $status = $sql->data[8]; $narrator = "[".$narratorGrade[$status]."]"; if ($rk<2) $narrator = ""; $cap = "$fName,$kunya $dbd [$cities]"; $desc= "$oName
$sid-$fName ($tb)
$kunya $narrator
$dbd
$dbde$dbda$cities
$tags"; if ($sid==$id) {$sch = $desc;continue;} //for ($j = 0; $j < count($towns); $j++) if (strpos($cities,$towns[$j]) !== false) $places[$j] .= $sid.","; $nm = $sql->data[$arabic + 1]; $descs[$sid] = $desc; $list .= "$sid,"; //$names[$count] = "".$nm."     
"; $names[$sid] = "".$nm.""; $count++; } //$rows--; if ($master==1) $eedit = "."; print("$sch $eedit

Total Scholars: $rows

\n"); print("\n"); $kk=0; $eedit=""; $npl = explode(",",$list); foreach ($npl as $sid) { if ($sid=="") continue; $add = ""; if ($master==1) $eedit = "."; print($names[$sid]." $add $eedit    
"); print("
".$descs[$sid]."
\n"); if (($kk+1)%4==0) print(""); $kk++; } print("

"); ?>
<< Back <<