本文整理汇总了PHP中Substr函数的典型用法代码示例。如果您正苦于以下问题:PHP Substr函数的具体用法?PHP Substr怎么用?PHP Substr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Substr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Decrypt
function Decrypt($S)
{
$chars = "KECTDPOSWNMFGQHL";
$S = Substr($S, 1);
$s1 = "";
for ($F = 0; $F < StrLen($S) / 2; $F++) {
$f1 = StrPos($chars, substr($S, $F, 1));
$f2 = StrPos($chars, substr($S, StrLen($S) / 2 + $F, 1));
$f2 = $f2 << 4;
$ff = $f1 | $f2;
$s1 = $s1 . Chr($ff);
}
return $s1;
}
示例2: substr
$order = $orderxml->xpath("/BUILD/BuildTroops[Terrno/text()='" . substr($key, 2) . "']");
$order[0]->Major = $val;
} else {
if (substr($key, 0, 2) == 'S-') {
$key = Substr($key, 2);
$orderxml->Strategic->{$key} = $val;
} else {
if (substr($key, 0, 4) == 'max_') {
$orderxml->Storage->{$key} = $val;
} else {
if (substr($key, 0, 3) == 'RA_') {
$key = Substr($key, 3);
$orderxml->Research->{$key}->Amt = $val;
} else {
if (substr($key, 0, 3) == 'RV_') {
$key = Substr($key, 3);
$orderxml->Research->{$key}->Val = $val;
}
}
}
}
}
}
}
}
// Put XML back into the table
$row[0] = $orderxml->asXML();
$mysqli->query("Update sp_orders set order_code='{$row[0]}' where gameno={$gameno} and userno={$userno} and ordername='SR_ORDERXML'") or die($mysqli->error);
// Set orders to submitted
$mysqli->query("Update sp_orders Set order_code='Orders received' Where gameno={$gameno} and turnno={$turnno} and phaseno={$phaseno} and userno={$userno} and ordername='ORDSTAT'") or die($mysqli->error);
// Send message back to the user
示例3: afficherTel
function afficherTel($num)
{
if ($num) {
$num = str_replace(" ", "", $num);
$num = Substr($num, 0, 2) . " " . Substr($num, 2, 2) . " " . Substr($num, 4, 2) . " " . Substr($num, 6, 2) . " " . Substr($num, 8, 2);
}
return $num;
}
示例4: errorMessage
echo errorMessage() . "Error: The database username is blank.</p>";
exit;
}
if ($_POST["dbpass"] == "") {
echo errorMessage() . "Error: The database password is blank.</p>";
exit;
}
if ($_POST["database"] == "") {
echo errorMessage() . "Error: The database name is blank.</p>";
exit;
}
if ($_POST["rss_link"] != "" && Substr($_POST["rss_link"], 0, 7) != "http://") {
echo errorMessage() . "Error: The RSS website URL does not start with http://</p>";
exit;
}
if ($_POST["website_url"] == "" || Substr($_POST["website_url"], 0, 7) != "http://") {
echo errorMessage() . "Error: The website URL does not start with http:// or is blank.</p>";
exit;
}
if (!is_numeric($_POST["max_upload_rate"]) || $_POST["max_upload_rate"] == "" || $_POST["max_upload_rate"] <= 0) {
echo errorMessage() . "Error: The maximum upload rate is not an integer, a negative number, or is blank.</p>";
exit;
}
if (!is_numeric($_POST["max_uploads"]) || $_POST["max_uploads"] == "" || $_POST["max_uploads"] <= 0) {
echo errorMessage() . "Error: The maximum uploads is not an integer, a negative number, or is blank.</p>";
exit;
}
if ($_POST["timezone"] == "") {
echo errorMessage() . "Error: The timezone is blank.</p>";
exit;
}
示例5: baht
function baht($nArabic)
{
$nArabic = number_format($nArabic, 2, '.', '');
$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') {
//.........这里部分代码省略.........
示例6: sqlQuery
* @link http://www.open-emr.org
*
* this is from the barcode-coder and FPDF website I used the examples and code snippets listed on the sites
* to create this program
*
*/
$fake_register_globals = false;
$sanitize_all_escapes = true;
require_once "../globals.php";
require_once "{$srcdir}/classes/PDF_Label.php";
require_once "{$srcdir}/formatting.inc.php";
require_once "{$srcdir}/classes/php-barcode.php";
//Get the data to place on labels
$patdata = sqlQuery("SELECT " . "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " . "p.street, p.city, p.state, p.postal_code, p.pid " . "FROM patient_data AS p " . "WHERE p.pid = ? LIMIT 1", array($pid));
$today = date('m/d/Y');
$dob = substr($patdata['DOB'], 5, 2) . "/" . Substr($patdata['DOB'], 8, 2) . "/" . Substr($patdata['DOB'], 0, 4);
// -------------------------------------------------- //
// BARCODE DATA AND TYPE
// -------------------------------------------------- //
$code = $patdata['pubpid'];
// what is wanted as the barcode
$bartype = $GLOBALS['barcode_label_type'];
// Get barcode type
switch ($bartype) {
case '1':
$type = 'std25';
break;
case '2':
$type = 'int25';
break;
case '3':
示例7: checkFormulaCache
/**
* Checks if a formula is available from cache
*
* @param string formula in LaTeX format
* @returns the file's path if successful, null otherwise
*/
function checkFormulaCache($latex_formula,$folder) {
// circumvent certain security functions of web-software which
// is pretty pointless right here
$latex_formula = preg_replace("/>/i", ">", $latex_formula);
$latex_formula = preg_replace("/</i", "<", $latex_formula);
$formula_hash = md5($latex_formula).$this->_extraname;
$filename = $formula_hash.".".$this->_image_format;
$full_path_filename = $folder.$filename;
// check if there's a file with the same md5 hash (first 32 characters)
// either delete it or use it
$handler = opendir($folder);
// keep going until all files in directory have been read
while ($file = readdir($handler)) {
if (Substr($file, 0, 32).Substr($file, strlen($file)-4, 4) == Substr($filename, 0, 32).Substr($filename, strlen($filename)-4, 4)) {
$filename = $file;
$full_path_filename = $folder.$filename;
break;
}
}
// tidy up: close the handler
closedir($handler);
if (is_file($full_path_filename)) {
return $filename;
}
else {
return null;
}
}
示例8: mp3_id
//.........这里部分代码省略.........
// now convert those four bytes to BIN. maybe it can be faster and easier. dunno how yet. help?
for ($y = 0; $y < 4; $y++) {
$x = decbin(ord($tmp[$y]));
for ($i = 0; $i < 8 - StrLen($x); $i++) {
$x .= "0";
}
$bajt .= $x;
}
// every mp3 framesynch begins with eleven ones, lets look for it. if not found continue looking for some 1024 bytes (you can search multiple for it or you can disable this, it will speed up and not many mp3 are like this. anyways its not standart)
// if(substr($bajt,1,11)!="11111111111") {
// return -1;
// break;
// }
if (substr($bajt, 1, 11) != "11111111111") {
fseek($f, 4);
$tmp = fread($f, 2048);
for ($i = 0; $i < 2048; $i++) {
if (ord($tmp[$i]) == 255 && substr(decbin(ord($tmp[$i + 1])), 0, 3) == "111") {
$tmp = substr($tmp, $i, 4);
$bajt = "";
for ($y = 0; $y < 4; $y++) {
$x = decbin(ord($tmp[$y]));
for ($i = 0; $i < 8 - StrLen($x); $i++) {
$x .= "0";
}
$bajt .= $x;
}
break;
}
}
}
if ($bajt == "") {
return -1;
break;
}
// now parse all the info from frame header
$len = filesize($file);
$idtag["version"] = $version[substr($bajt, 11, 2)];
$idtag["layer"] = $layer[substr($bajt, 13, 2)];
$idtag["crc"] = $crc[$bajt[15]];
$idtag["bitrate"] = $bitrate[substr($bajt, 16, 4)][$bitindex[substr($bajt, 11, 4)]];
$idtag["frequency"] = $freq[substr($bajt, 20, 2)][substr($bajt, 11, 2)];
$idtag["padding"] = $copy[$bajt[22]];
$idtag["mode"] = $mode[substr($bajt, 24, 2)];
$idtag["copyright"] = $copy[$bajt[28]];
$idtag["original"] = $copy[$bajt[29]];
// lets count lenght of the song
if ($idtag["layer"] == 1) {
$fsize = (12 * ($idtag["bitrate"] * 1000) / $idtag["frequency"] + $idtag["padding"]) * 4;
} else {
$fsize = 144 * ($idtag["bitrate"] * 1000 / $idtag["frequency"] + $idtag["padding"]);
}
// Modified by Luca (18/02/01): devel@lluca.com
$idtag["lenght_sec"] = round($len / Round($fsize) / 38.37);
// end
$idtag["lenght"] = date("i:s", round($len / Round($fsize) / 38.37));
// now lets see at the end of the file for id3 tag. if exists then parse it. if file doesnt have an id 3 tag if will return -1 in field 'tag' and if title is empty it returns file name.
if (!$len) {
$len = filesize($file);
}
fseek($f, $len - 128);
$tag = fread($f, 128);
if (Substr($tag, 0, 3) == "TAG") {
$idtag["file"] = $file;
$idtag["tag"] = -1;
// Modified by Luca (18/02/01): devel@lluca.com
$idtag["title"] = Mp3Parser::strip_nulls(Substr($tag, 3, 30));
$idtag["artist"] = Mp3Parser::strip_nulls(Substr($tag, 33, 30));
$idtag["album"] = Mp3Parser::strip_nulls(Substr($tag, 63, 30));
$idtag["year"] = Mp3Parser::strip_nulls(Substr($tag, 93, 4));
$idtag["comment"] = Mp3Parser::strip_nulls(Substr($tag, 97, 30));
// If the comment is less than 29 chars, we look for the presence of a track #
if (strlen($idtag["comment"]) < 29) {
if (Ord(Substr($tag, 125, 1)) == chr(0)) {
// If char 125 is null then track (maybe) is present
$idtag["track"] = Ord(Substr($tag, 126, 1));
} else {
// If not, we are sure is not present.
$idtag["track"] = 0;
}
} else {
// If the comment is 29 or 30 chars long, there's no way to put track #
$idtag["track"] = 0;
}
// end
$idtag["genreid"] = Ord(Substr($tag, 127, 1));
$idtag["genre"] = $genres[$idtag["genreid"]];
$idtag["filesize"] = $len;
} else {
$idtag["tag"] = 0;
}
// close opened file and return results.
if (!$idtag["title"]) {
$idtag["title"] = Str_replace("\\", "/", $file);
$idtag["title"] = substr($idtag["title"], strrpos($idtag["title"], "/") + 1, 255);
}
fclose($f);
return $idtag;
}
}
示例9: addTorrent
function addTorrent()
{
require "config.php";
$tracker_url = $website_url . substr($_SERVER['REQUEST_URI'], 0, -15) . "announce.php";
$hash = strtolower($_POST["hash"]);
$db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Couldn't connect to the database, contact the administrator</p>");
mysql_select_db($database) or die(errorMessage() . "Can't open the database.</p>");
require_once "funcsv2.php";
require_once "BDecode.php";
require_once "BEncode.php";
if ($_FILES["torrent"]["error"] != 4) {
$fd = fopen($_FILES["torrent"]["tmp_name"], "rb") or die(errorMessage() . "File upload error 1</p>\n");
is_uploaded_file($_FILES["torrent"]["tmp_name"]) or die(errorMessage() . "File upload error 2</p>\n");
$alltorrent = fread($fd, filesize($_FILES["torrent"]["tmp_name"]));
$array = BDecode($alltorrent);
if (!$array) {
echo errorMessage() . "Error: The parser was unable to load your torrent. Please re-create and re-upload the torrent.</p>\n";
endOutput();
exit;
}
if (strtolower($array["announce"]) != $tracker_url) {
echo errorMessage() . "Error: The tracker announce URL does not match this:<br>{$tracker_url}<br>Please re-create and re-upload the torrent.</p>\n";
endOutput();
exit;
}
if ($_POST["httpseed"] == "enabled" && $_POST["relative_path"] == "") {
echo errorMessage() . "Error: HTTP seeding was checked however no relative path was given.</p>\n";
endOutput();
exit;
}
if ($_POST["httpseed"] == "enabled" && $_POST["relative_path"] != "") {
if (Substr($_POST["relative_path"], -1) == "/") {
if (!is_dir($_POST["relative_path"])) {
echo errorMessage() . "Error: HTTP seeding relative path ends in / but is not a valid directory.</p>\n";
endOutput();
exit;
}
} else {
if (!is_file($_POST["relative_path"])) {
echo errorMessage() . "Error: HTTP seeding relative path is not a valid file.</p>\n";
endOutput();
exit;
}
}
}
if ($_POST["getrightseed"] == "enabled" && $_POST["httpftplocation"] == "") {
echo errorMessage() . "Error: GetRight HTTP seeding was checked however no URL was given.</p>\n";
endOutput();
exit;
}
if ($_POST["getrightseed"] == "enabled" && (Substr($_POST["httpftplocation"], 0, 7) != "http://" && Substr($_POST["httpftplocation"], 0, 6) != "ftp://")) {
echo errorMessage() . "Error: GetRight HTTP seeding URL must start with http:// or ftp://</p>\n";
endOutput();
exit;
}
$hash = @sha1(BEncode($array["info"]));
fclose($fd);
$target_path = "torrents/";
$target_path = $target_path . basename(clean($_FILES['torrent']['name']));
$move_torrent = move_uploaded_file($_FILES["torrent"]["tmp_name"], $target_path);
if ($move_torrent == false) {
echo errorMessage() . "Unable to move " . $_FILES["torrent"]["tmp_name"] . " to torrents/</p>\n";
}
}
if (isset($_POST["filename"])) {
$filename = clean($_POST["filename"]);
} else {
$filename = "";
}
if (isset($_POST["url"])) {
$url = clean($_POST["url"]);
} else {
$url = "";
}
if (isset($_POST["autoset"])) {
if (strcmp($_POST["autoset"], "enabled") == 0) {
if (strlen($filename) == 0 && isset($array["info"]["name"])) {
$filename = $array["info"]["name"];
}
}
}
//figure out total size of all files in torrent
$info = $array["info"];
$total_size = 0;
if (isset($info["files"])) {
foreach ($info["files"] as $file) {
$total_size = $total_size + $file["length"];
}
} else {
$total_size = $info["length"];
}
//Validate torrent file, make sure everything is correct
$filename = mysql_escape_string($filename);
$filename = htmlspecialchars(clean($filename));
$url = htmlspecialchars(mysql_escape_string($url));
if (strlen($hash) != 40 || !verifyHash($hash)) {
echo errorMessage() . "Error: Info hash must be exactly 40 hex bytes.</p>\n";
endOutput();
}
if (Substr($url, 0, 7) != "http://" && $url != "") {
//.........这里部分代码省略.........
示例10: selectCountrySelect
public static function selectCountrySelect($i5f59c27d67973597e0e9b68674fc5cd69ab7f2b3, $ic675072ffc96928cacbe347efbd8e16c9ed75fd4 = false)
{
$i77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$i77cc319b5c0bea76103c0ad59ef40f87a2cd8424 = StrToLower(Substr(chop($i77cc319b5c0bea76103c0ad59ef40f87a2cd8424[0]), 0, 2));
if (strlen($i5f59c27d67973597e0e9b68674fc5cd69ab7f2b3) > 0) {
$i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = $i5f59c27d67973597e0e9b68674fc5cd69ab7f2b3;
} elseif (strlen($i77cc319b5c0bea76103c0ad59ef40f87a2cd8424) > 0) {
$i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 = SmsVariables::$countryNames[$i77cc319b5c0bea76103c0ad59ef40f87a2cd8424];
}
$i253d5c16c51c17c6504dfee113bc4cb27188a3fd = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Cote DIvoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Monte Negro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Spain - Canary Islands", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City State", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis And Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zaire", "Zambia", "Zimbabwe", "OTHER");
if ($ic675072ffc96928cacbe347efbd8e16c9ed75fd4) {
$i639328b20a73e24c031e47977c13c785edf8c025 = 'onchange ="isVAT(document.forms[\'editAccount\'][\'companyvat\'].value,document.forms[\'editAccount\'][\'country0\'].value);"';
} else {
$i639328b20a73e24c031e47977c13c785edf8c025 = "";
}
$i02fcabda2448d40bdb76bd10f9e95950039649ee = "<select style=\"width:180px;\" name=\"country0\" {$i639328b20a73e24c031e47977c13c785edf8c025}>";
foreach ($i253d5c16c51c17c6504dfee113bc4cb27188a3fd as $i8fbb986cf6c5f44a93f1d73bee36e57fedc47e28) {
if ($i5a4616ba4ac4a7f21e69ba2afe5e994ae9927078 == $i8fbb986cf6c5f44a93f1d73bee36e57fedc47e28) {
$i638555cbe7ed2af60dac0c7d163508bf34c13283 = " selected=\"selected\"";
} else {
$i638555cbe7ed2af60dac0c7d163508bf34c13283 = "";
}
$i02fcabda2448d40bdb76bd10f9e95950039649ee .= "<option value=\"" . htmlspecialchars($i8fbb986cf6c5f44a93f1d73bee36e57fedc47e28) . "\"" . $i638555cbe7ed2af60dac0c7d163508bf34c13283 . ">" . htmlspecialchars($i8fbb986cf6c5f44a93f1d73bee36e57fedc47e28) . "</option>";
}
$i02fcabda2448d40bdb76bd10f9e95950039649ee .= "</select>";
return $i02fcabda2448d40bdb76bd10f9e95950039649ee;
}
示例11: select_country
public static function select_country()
{
$i05355412b857f5174e9a2f71b1e936a86ad60cd208b6ab1432322a285a2017d3ca0f4ef057519922 = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$i05355412b857f5174e9a2f71b1e936a86ad60cd208b6ab1432322a285a2017d3ca0f4ef057519922 = StrToLower(Substr(chop($i05355412b857f5174e9a2f71b1e936a86ad60cd208b6ab1432322a285a2017d3ca0f4ef057519922[0]), 0, 2));
$iab6a314decb74f5c532ecb082cfeb1655b9e98bb = "44";
if (strlen($i05355412b857f5174e9a2f71b1e936a86ad60cd208b6ab1432322a285a2017d3ca0f4ef057519922) > 0) {
$iab6a314decb74f5c532ecb082cfeb1655b9e98bb = SmsVariables::$countryPrefix[$i05355412b857f5174e9a2f71b1e936a86ad60cd208b6ab1432322a285a2017d3ca0f4ef057519922];
}
return $iab6a314decb74f5c532ecb082cfeb1655b9e98bb;
}
示例12: baht
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 = "˹Öè§";
//.........这里部分代码省略.........
示例13: returnsystemlang
function returnsystemlang($tablename = 'department', $addtablename = '')
{
global $systemlang, $newtablename;
global $_SESSION, $SUNSHINE_USER_LANG_VAR;
global $db, $SYSTEM_MODE;
$databaseType = $db->databaseType;
//$db_mysql = $db;
//强制使用MYSQL数据库得到界面语言信息--结束
//print_R($db);
if ($newtablename != '') {
$addtablename != "" ? $tablename = $newtablename : '';
} else {
$addtablename != "" ? $tablename = Substr($addtablename, 0, strlen($addtablename) - 4) : '';
}
$addtablename != "" ? $tablename = $addtablename : '';
//当附加参数存在时使用附加参数
if ($tablename == "") {
return array();
}
//参数不存时返回一个数组
//处理系统语言表没有包含的数据表,也用于不愿意初使化时所直接访问数据表-开始
//global $MetaTables;
//$MetaTablesArray = array();
//for($i=0;$i<sizeof($MetaTables);$i++) {
// $MetaTablesArray[] = $MetaTables[$i];
//}
global $SYSTEM_TABLE_VISION_MODE;
//print $SYSTEM_TABLE_VISION_MODE;
if ($SYSTEM_TABLE_VISION_MODE == "1" && $tablename != "common_html") {
$MetaColumns = $db->MetaColumnNames($tablename);
$MetaColumns = @array_values($MetaColumns);
for ($i = 0; $i < sizeof($MetaColumns); $i++) {
$fieldname = $MetaColumns[$i];
$html_temp[$tablename][$fieldname] = $fieldname;
}
$html_temp[$tablename]["list" . $tablename] = "List " . $tablename;
$html_temp[$tablename]["view" . $tablename] = "View " . $tablename;
$html_temp[$tablename]["edit" . $tablename] = "Edit " . $tablename;
$html_temp[$tablename]["add" . $tablename] = "New " . $tablename;
$html_temp[$tablename]["search" . $tablename] = "Search " . $tablename;
//print_R($html_temp);
return $html_temp;
//exit;
} else {
if ($SYSTEM_TABLE_VISION_MODE == "1" && $tablename == "common_html") {
$html_temp['common_html']['choose'] = "Choose";
$html_temp['common_html']['chooseall'] = "Choose All";
$html_temp['common_html']['add'] = "New";
$html_temp['common_html']['edit'] = "Edit";
$html_temp['common_html']['view'] = "View";
$html_temp['common_html']['delete'] = "Delete";
$html_temp['common_html']['operation'] = "Operation";
$html_temp['common_html']['already_exist'] = "Your input information already exists";
$html_temp['common_html']['return'] = "Return";
$html_temp['common_html']['submit'] = "Submit";
$html_temp['common_html']['addsuccess'] = "Add Success";
$html_temp['common_html']['editsuccess'] = "Edit Success";
$html_temp['common_html']['deletesuccess'] = "Delete Success";
$html_temp['common_html']['warning'] = "Warning";
$html_temp['common_html']['trip'] = "Trip";
$html_temp['common_html']['totalrecords'] = "Total Records";
$html_temp['common_html']['indexto'] = "Jump to";
$html_temp['common_html']['search'] = "Search";
$html_temp['common_html']['editnull'] = "Edit information cann‘t null";
$html_temp['common_html']['newnull'] = "New record can‘t null";
$html_temp['common_html']['browser'] = "Browser";
$html_temp['common_html']['import'] = "Import";
$html_temp['common_html']['export'] = "Export";
$html_temp['common_html']['tableexport'] = "Table Data Export";
$html_temp['common_html']['contentexport'] = "Content Data Export";
$html_temp['common_html']['goback'] = "Goback";
$html_temp['common_html']['yes'] = "Yes";
$html_temp['common_html']['no'] = "No";
$html_temp['common_html']['clear'] = "Clear";
$html_temp['common_html']['close'] = "Close";
$html_temp['common_html']['shutdown'] = "Shutdown";
$html_temp['common_html']['female'] = "Female";
$html_temp['common_html']['male'] = "Female";
$html_temp['common_html']['print'] = "Print";
$html_temp['common_html']['selectall'] = "Select ALL";
$html_temp['common_html']['totalrecords'] = "Total Records";
$html_temp['common_html']['allrecords'] = "All Records";
$html_temp['common_html']['cancel'] = "Cancel";
$html_temp['common_html']['submit'] = "Submit";
$html_temp['common_html']['save'] = "Save";
$html_temp['common_html']['new'] = "New";
//print_R($html_temp);
return $html_temp;
//exit;
}
}
//处理系统语言表没有包含的数据表,也用于不愿意初使化时所直接访问数据表-结束
$sql = "select * from systemlang where tablename='{$tablename}'";
if ($SYSTEM_MODE == "1") {
//等于1时,表示系统处于调试阶段,使用间断较小的缓存
$rs = $db->Execute($sql);
} else {
//不等于1时,表示系统处于正常运行阶段,使用间断较大的缓存
$rs = $db->CacheExecute(150, $sql);
}
//.........这里部分代码省略.........
示例14: DataInsert
function DataInsert($tableName, $flagNoEscape = false, $flagErrorToGo = false)
{
$fields = array();
//接続文読み込み
require 'SQLConnect.php';
$sql1 = "";
$sql2 = "";
$idName = "";
$idValue = "";
$rs = mysql_list_fields("_seotool", $tableName, $GLOBALS[dbHandle]);
for ($i = 0; $i < mysql_num_fields($rs); $i++) {
//print mysql_fieldname($rs, $i);
$fldname = mysql_fieldname($rs, $i);
if ($i == 0) {
$idName = $fldname;
}
$sql1 .= "`" . $fldname . "`,";
//予めエスケープ処理されたものを扱うか否かで処理分け(DEFAULTは"$flagNoEscape = false")
if ($flagNoEscape) {
$sql2 .= "'" . $_POST[$fldname] . "',";
} else {
$sql2 .= "'" . mysql_real_escape_string($_POST[$fldname]) . "',";
}
//print mysql_fieldname($rs, $i) . " ";
}
//切断文読み込み
require 'SQLClose.php';
$sql1 = Substr($sql1, 0, -1);
$sql2 = Substr($sql2, 0, -1);
$sql = "insert into `" . $tableName . "` (" . $sql1 . ")" . " VALUES (" . $sql2 . ")";
//print $sql . "<BR><BR>";
require 'SQLConnect.php';
//sql文を実行する
if ($flagErrorToGo) {
$c_hit = @mysql_db_query("_seotool", $sql);
} else {
$c_hit = mysql_db_query("_seotool", $sql) or die('error: ' . mysql_errno() . ', ' . mysql_error());
}
if (!$c_hit) {
print "DB Error, could not query the database<br />";
print 'MySQL Error: ' . mysql_error();
}
//End if
# $sql_bk = $sql;
# mysql_close($GLOBALS[dbHandle]);
# require('SQLConnect.php');
//データバックアップ
# $sql = "insert into `jas_sql_backup` (`jsb_id`,`jsb_datetime`,`jsb_name`,`jsb_kind`,`jsb_sql`)" .
# " VALUES ('','" . DateNow(0) . "','" . $_SESSION[jm_name] . "','Insert','".
# " VALUES ('','" . DateNow(0) . "','大熊','Insert','".
# mysql_real_escape_string($sql_bk)."')";
//print $sql . "<BR><BR>";
// $c_hit = mysql_db_query("_seotool",$sql)
// or die('error: '.mysql_errno().', '.mysql_error());
# mysql_close($GLOBALS[dbHandle]);
//idを取る
require 'SQLConnect.php';
$sql = "SELECT * FROM `" . $tableName . "` Order By " . $idName . " DESC Limit 0,1;";
//print $sql . "<br><br>";
//SQL文を実行する
$rs = mysql_db_query($dbName, $sql);
$rsCount = mysql_num_rows($rs);
//レコード数
$row = @mysql_fetch_array($rs);
$idValue = $row[$idName];
//まあ要らないか
//require('SQLClose.php');
return $idValue;
}
示例15: selectCountrySelect
public static function selectCountrySelect($i358dc5a1e604ce179c02a507117b6f891d13fe96, $ia34435986e3261ac61175019c2e7cd9aa4aaa7c3 = false)
{
$i08b6ab1432322a285a2017d3ca0f4ef057519922 = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$i08b6ab1432322a285a2017d3ca0f4ef057519922 = StrToLower(Substr(chop($i08b6ab1432322a285a2017d3ca0f4ef057519922[0]), 0, 2));
if (strlen($i358dc5a1e604ce179c02a507117b6f891d13fe96) > 0) {
$iab6a314decb74f5c532ecb082cfeb1655b9e98bb = $i358dc5a1e604ce179c02a507117b6f891d13fe96;
} elseif (strlen($i08b6ab1432322a285a2017d3ca0f4ef057519922) > 0) {
$iab6a314decb74f5c532ecb082cfeb1655b9e98bb = SmsVariables::$countryNames[$i08b6ab1432322a285a2017d3ca0f4ef057519922];
}
$iad164d85afb79026dea640e85e23d5a17f1227b3 = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Cote DIvoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Monte Negro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Spain - Canary Islands", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City State", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis And Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zaire", "Zambia", "Zimbabwe", "OTHER");
if ($ia34435986e3261ac61175019c2e7cd9aa4aaa7c3) {
$i9dbfdeff206b76f15d07ab66514ecd55f8a049fc = 'onchange ="isVAT(document.forms[\'editAccount\'][\'companyvat\'].value,document.forms[\'editAccount\'][\'country0\'].value);"';
} else {
$i9dbfdeff206b76f15d07ab66514ecd55f8a049fc = "";
}
$iae8c74e5273dec25096dbae362493a9f609ecfc8 = "<select style=\"width:180px;\" name=\"country0\" {$i9dbfdeff206b76f15d07ab66514ecd55f8a049fc}>";
foreach ($iad164d85afb79026dea640e85e23d5a17f1227b3 as $if752f824e46416c66bba9ad132e341bac8dd3b80) {
if ($iab6a314decb74f5c532ecb082cfeb1655b9e98bb == $if752f824e46416c66bba9ad132e341bac8dd3b80) {
$i0b528d1be9ee802a3400dc2dc8e66f5f242b1790 = " selected=\"selected\"";
} else {
$i0b528d1be9ee802a3400dc2dc8e66f5f242b1790 = "";
}
$iae8c74e5273dec25096dbae362493a9f609ecfc8 .= "<option value=\"" . htmlspecialchars($if752f824e46416c66bba9ad132e341bac8dd3b80) . "\"" . $i0b528d1be9ee802a3400dc2dc8e66f5f242b1790 . ">" . htmlspecialchars($if752f824e46416c66bba9ad132e341bac8dd3b80) . "</option>";
}
$iae8c74e5273dec25096dbae362493a9f609ecfc8 .= "</select>";
return $iae8c74e5273dec25096dbae362493a9f609ecfc8;
}