Biographies

[insert_php]
/*Languages link*/
$language= $_GET[language];
$firstLetter = $_GET[fl];
$idType=$_GET[idT];

$language=substr($language,0,2);
$firstLetter =substr($firstLetter,0,1);
$idType=substr($idType,0,15);

$connect = mysql_connect(“localhost”, “elianyjma”, “72*pI$52”);
mysql_select_db(“elianyjma”, $connect);

//Languages Header
$currentUrl= “/list/?fl=”.$firstLetter.”&idT=”.$idType.”&language=”;

$query=”select * from tblLanguage where active=1;”;
$result = mysql_query($query);

Print “

“;
if (mysql_num_rows($result)) {
while($qry = mysql_fetch_array($result)){
$urlWithNewLanguage=$currentUrl.$qry[‘idLanguage’];

if(strcmp($qry[‘idLanguage’],$language) == 0 ){
Print “[“.$qry[‘languageDescription’].”] “;
}else{
Print ““.$qry[‘languageDescription’].” “;
}
}
}
Print “

“;
/* Next/Prev letters*/

$letters = range(‘a’, ‘z’);
foreach ($letters as &$letter){
$currentUrl= “/list/?fl=”.$letter.”&idT=”.$idType.”&language=”.$language;
if(strcmp($letter,$firstLetter) == 0 ){
Print “ [“.strtoupper($letter).”] “;
}else{
Print “ “.strtoupper($letter).” “;
}
}

/*main content*/
$query=”select * from vwBiography where idLanguage=’$language’ and idType=’$idType’ and surname like ‘$firstLetter%’;”;

$result = mysql_query($query);
$page=”/biography-detail/”;

$direction=”ltr”;
if($language==”HE”){
$direction=”rtl”;
}
$cssStyle=”text-align:justify;direction:”.$direction;

Print “

“;
if (mysql_num_rows($result)) {
while ($qry = mysql_fetch_array($result)) {
$link=$page.”?id=”.$qry[‘idPeople’].”&language=”.$language;
Print ““;
Print ““;
Print $qry[‘surname’];
Print “
“;
Print $qry[‘name’]. ” “;

if($qry[‘dateofbirth’]!=null) {
Print “(” .$qry[‘dateofbirth’]. “-“;
if($qry[‘dateofdeath’]!=null) {
Print $qry[‘dateofdeath’];
}
Print “) “;
}
if($qry[‘period’]!=null){
Print “(” . $qry[‘period’] . “) “;
}
Print $qry[‘description’];
Print “
“;
}
}

Print “

“;
mysql_close($connect);
[/insert_php]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.