function vat($nVArabic){ $nVArabic = number_format($nVArabic, 2, '.', ''); $cTarget = Ltrim($nVArabic); $cLtnum=""; $x=0; while (substr($cTarget,$x,1) <> "."){ $cLtnum=$cLtnum.substr($cTarget,$x,1); $x++; } $cRtnum=substr($cTarget,$x+1); $cRtnum=$cRtnum/100; $cRtnum=intval($cRtnum); $vat=$nVArabic+$cRtnum; return $vat; }
function baht($nArabic){ $cTarget = Ltrim($nArabic); $cLtnum=""; $x=0; while (substr($cTarget,$x,1) <> "."){ $cLtnum=$cLtnum.substr($cTarget,$x,1); $x++; } $cRtnum=substr($cTarget,$x+1,2); $nUnit=$x; $nNum=$nUnit; $cRead = "**"; include("connect.inc"); IF ($cLtnum <> "0"){ $count=0; For ($i = 0;$i<=$nNum;$i++){ $cNo = Substr($cLtnum,$count,1); $count++; //��ҹ��ѡ IF ($cNo <>0 and $cNo != "-"){ If ($nUnit <> 1){ $query = "SELECT * FROM thaibaht WHERE fld1 = '$nUnit' "; $result = mysql_query($query) or die("Query 1 failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row $i\n"; continue; } if(!($row = mysql_fetch_object($result))) continue; } $cVarU = $row->fld4; //��ҹ��ѡ } Else { $cVarU = ""; } //��ҹ�Ţ $query = "SELECT * FROM thaibaht WHERE fld1 = '$cNo' "; $result = mysql_query($query) or die("Query 2 failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row $i\n"; continue; } if(!($row = mysql_fetch_object($result))) continue; } $cVar1 = $row->fld2; //��ҹ����Ţ /// if ($nUnit =='2' && $cNo =='2'): $cVar1 = "���"; elseif ($nUnit == '2' && $cNo=='1'): $cVar1 = ""; elseif ($nUnit =='1' && $cNo =='1' && $nNum <> 1 ): $cVar1 = "���"; else: echo ""; endif; $cRead = $cRead.$cVar1.$cVarU; } $nUnit--; } $cRead = $cRead."�ҷ"; } ////Stang//// IF ($cRtnum <> "00"){ $nUnit = 2; $count=0; For ($i = 0;$i<=2;$i++){ $cNo = Substr($cRtnum,$count,1); $count++; If ($cNo != "0"){ $query = "SELECT * FROM thaibaht WHERE fld1 = '$cNo' "; $result = mysql_query($query) or die("Query failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row $i\n"; continue; } if(!($row = mysql_fetch_object($result))) continue; } $cVar1 = $row->fld2 ; ///// If ($nUnit == '2' && $cNo == '2'){ $cVar1 = "���"; } if ($nUnit == '2' && $cNo == '1'){ $cVar1 = "" ; } if ($nUnit == '1' && $cNo =='1'){ $cVar1 = "���"; } If (Substr($cRtnum,0,1) == '0' && $cNo == '1'){ $cVar1 = "˹��"; } /////// If ($nUnit != '1'){ $cRead = $cRead.$cVar1."�Ժ"; } Else{ $cRead = $cRead.$cVar1; } } $nUnit--; } $cRead = $cRead."ʵҧ��**" ; } else{ $cRead = $cRead."��ǹ**" ; } include("connect.inc"); return $cRead; }
</table> <br> <input type="submit" value="Edit Entry"> </form> <?php } //write data to database if (isset($_POST["editdatabase"])) { $temp_counter = (count($_POST) - 1) / 5; array_shift($_POST); for ($i = 0; $i < $temp_counter; $i++) { $temp_hash = htmlspecialchars(array_shift($_POST)); $old_filename = htmlspecialchars(array_shift($_POST)); $temp_filename = array_shift($_POST); $temp_filename = Ltrim($temp_filename); $temp_filename = htmlspecialchars(rtrim($temp_filename)); $temp_url = htmlspecialchars(array_shift($_POST)); $temp_pubDate = htmlspecialchars(array_shift($_POST)); $query = "UPDATE " . $prefix . "namemap SET filename=\"{$temp_filename}\", url=\"{$temp_url}\", pubDate=\"{$temp_pubDate}\" WHERE info_hash=\"{$temp_hash}\""; mysql_query($query) or die(errorMessage() . "Can't do SQL query - " . mysql_error() . "</p>"); //if filename changes, rename .torrent if ($old_filename != $temp_filename) { rename("torrents/" . $old_filename . ".torrent", "torrents/" . $temp_filename . ".torrent"); } } //run RSS generator require_once "rss_generator.php"; echo "<br><p class=\"success\">The database was edited successfully!</p>\n"; } ?>
function baht($nArabic) { $cTarget = Ltrim($nArabic); $cLtnum = ""; $x = 0; while (substr($cTarget, $x, 1) != ".") { $cLtnum = $cLtnum . substr($cTarget, $x, 1); $x++; } $cRtnum = substr($cTarget, $x + 1, 2); $nUnit = $x; $nNum = $nUnit; $cRead = "**"; include "connect.inc"; if ($cLtnum != "0") { $count = 0; for ($i = 0; $i <= $nNum; $i++) { $cNo = Substr($cLtnum, $count, 1); $count++; //ÍèÒ¹ËÅÑ¡ if ($cNo != 0 and $cNo != "-") { if ($nUnit != 1) { $query = "SELECT * FROM thaibaht WHERE fld1 = '{$nUnit}' "; $result = mysql_query($query) or die("Query 1 failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row {$i}\n"; continue; } if (!($row = mysql_fetch_object($result))) { continue; } } $cVarU = $row->fld4; //ÍèÒ¹ËÅÑ¡ } else { $cVarU = ""; } //ÍèÒ¹àÅ¢ $query = "SELECT * FROM thaibaht WHERE fld1 = '{$cNo}' "; $result = mysql_query($query) or die("Query 2 failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row {$i}\n"; continue; } if (!($row = mysql_fetch_object($result))) { continue; } } $cVar1 = $row->fld2; //ÍèÒ¹µÑÇàÅ¢ /// if ($nUnit == '2' && $cNo == '2') { $cVar1 = "ÂÕè"; } elseif ($nUnit == '2' && $cNo == '1') { $cVar1 = ""; } elseif ($nUnit == '1' && $cNo == '1' && $nNum != 1) { $cVar1 = "àÍç´"; } else { echo ""; } $cRead = $cRead . $cVar1 . $cVarU; } $nUnit--; } $cRead = $cRead . "ºÒ·"; } ////Stang//// if ($cRtnum != "00") { $nUnit = 2; $count = 0; for ($i = 0; $i <= 2; $i++) { $cNo = Substr($cRtnum, $count, 1); $count++; if ($cNo != "0") { $query = "SELECT * FROM thaibaht WHERE fld1 = '{$cNo}' "; $result = mysql_query($query) or die("Query failed"); for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row {$i}\n"; continue; } if (!($row = mysql_fetch_object($result))) { continue; } } $cVar1 = $row->fld2; ///// if ($nUnit == '2' && $cNo == '2') { $cVar1 = "ÂÕè"; } if ($nUnit == '2' && $cNo == '1') { $cVar1 = ""; } if ($nUnit == '1' && $cNo == '1') { $cVar1 = "àÍç´"; } if (Substr($cRtnum, 0, 1) == '0' && $cNo == '1') { $cVar1 = "˹Öè§"; } /////// if ($nUnit != '1') { $cRead = $cRead . $cVar1 . "ÊÔº"; } else { $cRead = $cRead . $cVar1; } } $nUnit--; } $cRead = $cRead . "ʵҧ¤ì**"; } else { $cRead = $cRead . "¶éǹ**"; } include "connect.inc"; return $cRead; }
<div class="cv_entry_row"> <div class="index"><?php echo ++$index; ?> </div> <div class="citation"> <?php $authors = explode("|", $row['authors']); $authorPosition = $row['authorPosition']; $name_array = array(); foreach ($authors as $ind => $author_name) { $this_name = ""; $split_fullname = explode(",", $author_name); $lastname = $split_fullname[0]; $this_name .= $lastname . ","; $firstname = Ltrim($split_fullname[1]); $split_firstname = explode(" ", $firstname); foreach ($split_firstname as $name_part) { if (strpos(".", $name_part) >= 0) { $this_name .= " " . substr($name_part, 0, 1) . "."; } else { $this_name .= " " . $name_part; } } if ($ind + 1 == $authorPosition) { $this_name = "<b>" . $this_name . "</b>"; } $name_array[] = $this_name; } $authors_list = implode(", ", $name_array); $title = $row['pubTitle'];