Hallo,
in einen Script habe ich den Fehler, das wenn die usersprache auf English gestellt ist die werte in einen Dropdown doppelt angezeigt werden. Wenn ich die Sprache des Users auf Deutsch stelle dann ist es wieder ok.
Ich weiss nicht wo ich suchen soll der Code beinhaltet soweit ich das ehe keinen Fehler. ich weiss auch nicht wo ich suchen soll. Könnt ihr mir auf die Sprünge helfen?
ich habe mir mal alle Session variablen ausgeben lassen die dort vorkommen
Hier der Quelltext
ich denke der passende Code im Script ist dieser hier:
in einen Script habe ich den Fehler, das wenn die usersprache auf English gestellt ist die werte in einen Dropdown doppelt angezeigt werden. Wenn ich die Sprache des Users auf Deutsch stelle dann ist es wieder ok.
Ich weiss nicht wo ich suchen soll der Code beinhaltet soweit ich das ehe keinen Fehler. ich weiss auch nicht wo ich suchen soll. Könnt ihr mir auf die Sprünge helfen?
ich habe mir mal alle Session variablen ausgeben lassen die dort vorkommen
Anzeige der SESSION Werte
array(1
{
["sUsername"]=> string(6) "Username"
["iLastAccessTime"]=> int(1404121234)
["sStartLogin"]=> string(9) "login"
["iCountryId"]=> string(1) "1"
["sLang"]=> string(2) "en"
["sSelectOfferState"]=> string(3) "all"
["sSelectOfferPeriod"]=> string(2) "14"
["sSelectOfferCity"]=> string(3) "all"
["bChecked"]=> string(0) ""
["bActive"]=> string(7) "checked"
["bActive1"]=> string(7) "checked"
["sSelectOfferCountry"]=> string(1) "8"
["sLangOffer"]=> string(2) "en"
["s_sFunctionArea"]=> string(1
"ManageOfferRequest"
["sCurrency"]=> string(3) "THB"
["sCountryCode"]=> string(2) "th"
["sSelectOfferWorkState"]=> string(
"newoffer"
["s_sHotelType"]=> string(
"Business"
array(1

["sUsername"]=> string(6) "Username"
["iLastAccessTime"]=> int(1404121234)
["sStartLogin"]=> string(9) "login"
["iCountryId"]=> string(1) "1"
["sLang"]=> string(2) "en"
["sSelectOfferState"]=> string(3) "all"
["sSelectOfferPeriod"]=> string(2) "14"
["sSelectOfferCity"]=> string(3) "all"
["bChecked"]=> string(0) ""
["bActive"]=> string(7) "checked"
["bActive1"]=> string(7) "checked"
["sSelectOfferCountry"]=> string(1) "8"
["sLangOffer"]=> string(2) "en"
["s_sFunctionArea"]=> string(1

["sCurrency"]=> string(3) "THB"
["sCountryCode"]=> string(2) "th"
["sSelectOfferWorkState"]=> string(

["s_sHotelType"]=> string(

Hier der Quelltext
PHP-Code:
<div id=functionarea><h1>Manage offer requests</h1><form action="/offer_action.php5" name="hotellist" method=post accept-charset=""><table id=contenthotelreport><caption>Send E-Mail to selected hotels</caption><tr> <th> Action</th> <th></th></tr><tr> <td> <select name=u_sAction style="width:200px;"> <option value='request'>Request an offer</option> <option value='reminder'>Send a reminder</option> </select> </td> <td><input name="oActionButton" type="submit" value="Prepare E-Mail "></td></tr></table><div class=errorstyle2 style="visibility:hidden"></div><table id=contenthotelreport style="margin-bottom:0px;"><caption > Hotel selection<br></caption><tr> <th style="width:15px;"></th> <th>Country</th> <th>City</th> <th>Period</th> <th>State</th> <th>Only displayed items</th></tr><tr> <td><input type="checkbox" id='bChecked' name='u_bChecked' value="checked" onclick="submit()" ></td> <td> <select name=u_sSelectOfferCountry onchange="submit()" style="width:150px;">
<option value='11' >Belgium</option>
<option value='11' >Belgium</option>
<option value='2' >Brazil</option>
<option value='2' >Brazil</option>
<option value='4' >China</option>
<option value='4' >China</option>
<option value='1' >Germany</option>
<option value='1' >Germany</option>
<option value='7' >Great Britain</option>
<option value='7' >Great Britain</option>
<option value='22' >India</option>
<option value='22' >India</option>
<option value='9' >Indonesia</option>
<option value='9' >Indonesia</option>
<option value='6' >Japan</option>
<option value='6' >Japan</option>
<option value='24' >Malaysia</option>
<option value='24' >Malaysia</option>
<option value='21' >Netherland</option>
<option value='21' >Netherland</option>
<option value='19' >Singapore</option>
<option value='19' >Singapore</option>
<option value='26' >South-Korea</option>
<option value='13' >Spain</option>
<option value='13' >Spain</option>
<option value='10' >Switzerland</option>
<option value='10' >Switzerland</option>
<option value='23' >Taiwan</option>
<option value='23' >Taiwan</option>
<option value='8' selected>Thailand</option>
<option value='8' selected>Thailand</option>
<option value='5' >USA</option>
<option value='5' >USA</option>
<option value='25' >Vietnam</option>
<option value='25' >Vietnam</option>
</select> </td> <td>
PHP-Code:
// Select countries
$sSql = "SELECT iId, sCountryCode, sName, sCurrency ";
$sSql.= " FROM ".C_COUNTRY_TABLE." a, ".C_USER_COUNTRY_TABLE." b ";
$sSql.= " WHERE a.iId = b.iCountryId AND b.sUserId='".$_SESSION["sUsername"]."'";
$sSql.= " ORDER BY sName ";
$aCountries = $oDatabase->getArrayFromSql($sSql);
$aTplVar["aSelectCountry"][0]["sText"]="";
$i = 1;
foreach ($aCountries as $iKey => $oCountry)
{
$aTplVar["aSelectCountry"][$i]["sName"]= $oCountry->sName;
$aTplVar["aSelectCountry"][$i]["sValue"]= $oCountry->iId;
if ($_SESSION["sSelectOfferCountry"]==$oCountry->iId)
{
$aTplVar["aSelectCountry"][$i]["sSelected"]='selected';
$sCurrency=$oCountry->sCurrency;
$_SESSION["sCurrency"]=$oCountry->sCurrency;
$_SESSION["sCountryCode"]=$oCountry->sCountryCode;
$aTplVar["sCurrency"] = getCurrencyString($oCountry->sCurrency);
}
$i++;
}
Kommentar