-5
如何將此PHP函數轉換爲使用相同算法或更好的JavaScript?paypal javascript drop drop down menu複選框
error_reporting(E_ALL^E_NOTICE);
if($_GET['text008']=="1br")
{ $typeservice=119;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
if($_GET['text008']=="2br")
{
$typeservice=139;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
if($_GET['text008']=="3br")
{
$typeservice=159;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
if($_GET['text008']=="4br")
{
$typeservice=189;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
if($_GET['text008']=="5br")
{
$typeservice=219;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
if($_GET['text008']=="6br")
{
$typeservice=249;
if(isset($_GET['extras']))
foreach ($_GET['extras'] as $k){
$total +=$k;
}
echo "Service: $" . $typeservice . "<br/>" . "Extra Fees: $" .$total . "<br/>";
echo "Service w/ Extra Fee: $" . $balyo=$typeservice + $total;
if(isset($_GET['freq']))
{
if($_GET['freq']=="O")
{
echo "<br/>Once";
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="M")
{
echo "<br/>Monthly";
$lahat = $balyo - ($balyo * .10);
echo "<br/>Discount:$ " . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="BW")
{
echo "<br/>Bi-Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
if($_GET['freq']=="W")
{
echo "<br/>Weekly";
$lahat = $balyo - ($balyo * .15);
echo "<br/>Discount: $" . ($balyo * .15);
echo "<br/> Total: $" . $lahat;
}
}
}
你知道任何的JavaScript嗎?你有什麼嘗試? – Scott
嗨斯科特,即時通訊不是真正熟悉的JavaScript我需要做一個JavaScript代碼,功能相同,因爲該代碼 –
歡迎來到SO,戴夫。我認爲可能是這樣,不幸的是,這個網站並不是要求其他人爲你編碼。如果你不懂JavaScript,那麼你需要學習它,或者在其他地方尋求你的解決方案。本網站只能在您對問題有所瞭解的情況下提供幫助,並嘗試自行解決。請參閱[幫助部分](http://stackoverflow.com/help)。 – Scott