Avatar billede flejn Nybegynder
17. marts 2006 - 19:47 Der er 30 kommentarer og
1 løsning

Værdi højere end 0??

Hej eksperter.

Jeg har et hurtigt spørgsmål.

når jeg bruger "komandoen"
    if ($amount <= 0)

udelukker denne så alt hvad der er under 0, altså også tal og tegn?
Eller er der visse tegn/bogstaver der har en værdi der er større end 0?
Avatar billede kalp Novice
17. marts 2006 - 19:49 #1
if ($amount >= 0)

skal vist være omvendt... hvis du skal udelukke hvad der er mindre.
Avatar billede kdjweb Nybegynder
17. marts 2006 - 19:49 #2
0 betyder intet

if($amount > 0){
  // $amout er større end 0
}
Avatar billede flejn Nybegynder
17. marts 2006 - 19:50 #3
okay tak. Men det besvare ikke mit spørgsmål :)
Udelukker denne komando ALLE tegn og bogstaver pånær 1 2 3 4 5 6 7 8 9 ?
Avatar billede kdjweb Nybegynder
17. marts 2006 - 19:51 #4
den udelukker alt der ikke har nogen værdi :)
Avatar billede flejn Nybegynder
17. marts 2006 - 19:51 #5
Eller er der visse undtagelser? Ålstå nogle tegn der er større end 0?
Avatar billede kdjweb Nybegynder
17. marts 2006 - 19:51 #6
man kan også sige if(empty($abmout))
Avatar billede kalp Novice
17. marts 2006 - 19:52 #7
tænker du på ascii værdierne? så ser det ud til at det vil udelukke alt ja
http://www.lookuptables.com/
Avatar billede flejn Nybegynder
17. marts 2006 - 19:56 #8
Okay jeg forstår ikk helt tabellen :)
Det er fordi jeg har fået en til at teste det og der er "hul" i den komando. Så på en eller anden måde kan han komme uden om den.
Dvs. hvis hans konto har 0 point kan han på en eller anden måde få udbetalt 4 point alligevel.
Avatar billede jakobdo Ekspert
17. marts 2006 - 19:56 #9
du kunne lave:
if(is_numeric($amount) && $amount > 0)

så sikrer du $amount er et tal og over 0.
Avatar billede jakobdo Ekspert
17. marts 2006 - 19:57 #10
Kan det være han har direkte adgang til nogle sider efter der hvor du laver tjekket?
Avatar billede flejn Nybegynder
17. marts 2006 - 19:59 #11
Disse sider er tilgænglige.
Det hele kører på MySQL.
Avatar billede flejn Nybegynder
17. marts 2006 - 19:59 #12
er utilgænglige :)
Avatar billede terrak Nybegynder
17. marts 2006 - 20:01 #13
Har du udregningen til $amount?
Avatar billede jakobdo Ekspert
17. marts 2006 - 20:03 #14
Eller prøv at vis noget kode omkring hvor han slipper igennem.
Avatar billede flejn Nybegynder
17. marts 2006 - 20:03 #15
Hele filen er postet for neden:
Sig hvis i skal bruge anden info



<?
  if ($frm['action'] == 'preview')
  {
    $ab = get_user_balance ($userinfo['id']);
    $amount = sprintf ('%0.2f', $frm['amount']);
    $description = quote ($frm['comment']);
    $ec = sprintf ('%d', $frm['ec']);
    if (0 < $settings['forbid_withdraw_before_deposit'])
    {
      $q = 'select count(*) as cnt from hm2_deposits where user_id = ' . $userinfo['id'];
      $sth = mysql_query ($q);
      $row = mysql_fetch_array ($sth);
      if ($row['cnt'] < 1)
      {
        header ('Location: ?a=withdraw&say=no_deposits');
        db_close ($dbconn);
        exit ();
      }
    }

    if ($amount <= 0)
    {
      header ('Location: ?a=withdraw&say=zero');
      db_close ($dbconn);
      exit ();
    }

    $on_hold = 0;
    if ($settings['allow_withdraw_when_deposit_ends'] == 1)
    {
      $q = '' . 'select id from hm2_deposits where user_id = ' . $userinfo['id'];
      ($sth = mysql_query ($q) OR print mysql_error ());
      $deps = array ();
      $deps[0] = 0;
      while ($row = mysql_fetch_array ($sth))
      {
        array_push ($deps, $row[id]);
      }

      $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec . ' and
    deposit_id in (') . join (',', $deps) . ') and
            (type=\'earning\' or
    (type=\'deposit\' and (description like \'Compou%\' or description like \'<b>Archived transactions</b>:<br>Compound%\')));';
      ($sth = mysql_query ($q) OR print mysql_error ());
      while ($row = mysql_fetch_array ($sth))
      {
        $on_hold = $row[amount];
      }
    }

    if ($settings['hold_only_first_days'] == 1)
    {
      $q = '' . 'select hm2_deposits.id, hm2_types.hold from hm2_deposits, hm2_types where user_id = ' . $userinfo[id] . ' and hm2_types.id = hm2_deposits.type_id and ec=' . $ec . ' and hm2_deposits.deposit_date + interval hm2_types.hold day > now()';
    }
    else
    {
      $q = '' . 'select hm2_deposits.id, hm2_types.hold from hm2_deposits, hm2_types where user_id = ' . $userinfo[id] . ' and hm2_types.id = hm2_deposits.type_id and ec=' . $ec;
    }

    ($sth = mysql_query ($q) OR print mysql_error ());
    $deps = array ();
    $deps[0] = 0;
    while ($row = mysql_fetch_array ($sth))
    {
      $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec . ' and
        deposit_id = ' . $row[id] . ' and date > now() - interval ' . $row[hold] . ' day and
            (type=\'earning\' or
        (type=\'deposit\' and (description like \'Compou%\' or description like \'<b>Archived transactions</b>:<br>Compound%\')));');
      ($sth1 = mysql_query ($q) OR print mysql_error ());
      while ($row1 = mysql_fetch_array ($sth1))
      {
        $on_hold += $row1[amount];
      }
    }

    $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec);
    ($sth = mysql_query ($q) OR print mysql_error ());
    $ab['total'] = 0;
    while ($row = mysql_fetch_array ($sth))
    {
      $ab['total'] = $row['amount'] - $on_hold;
    }

    if ($ab['total'] < $amount)
    {
      if ($amount <= $ab['total'] + $on_hold)
      {
        header ('Location: ?a=withdraw&say=on_hold');
      }
      else
      {
        header ('Location: ?a=withdraw&say=not_enought');
      }

      db_close ($dbconn);
      exit ();
    }

    if ($amount < $settings['min_withdrawal_amount'])
    {
      header ('Location: ?a=withdraw&say=less_min');
      db_close ($dbconn);
      exit ();
    }

    if (0 < $settings[max_daily_withdraw])
    {
      $q = '' . 'select sum(actual_amount) as am from hm2_history where type in (\'withdraw\', \'withdraw_pending\') and user_id = ' . $userinfo[id];
      ($sth = mysql_query ($q) OR print mysql_error ());
      $dw = 0;
      while ($row = mysql_fetch_array ($sth))
      {
        $dw = 0 - $row[am];
      }

      if ($settings[max_daily_withdraw] < $dw + $amount)
      {
        header ('Location: ?a=withdraw&say=daily_limit');
        db_close ($dbconn);
        exit ();
      }
    }

    $fee = floor ($amount * $settings['withdrawal_fee']) / 100;
    if ($fee < $settings['withdrawal_fee_min'])
    {
      $fee = $settings['withdrawal_fee_min'];
    }

    $to_withdraw = $amount - $fee;
    if ($to_withdraw < 0)
    {
      $to_withdraw = 0;
    }

    $to_withdraw = number_format (floor ($to_withdraw * 100) / 100, 2);
    $account = '';
    if (($ec == 0 AND $settings['def_payee_account']))
    {
      $account = $userinfo['egold_account'];
    }

    if (($ec == 1 AND $settings['def_payee_account_evocash']))
    {
      $account = $userinfo['evocash_account'];
    }

    if (($ec == 2 AND $settings['def_payee_account_intgold']))
    {
      $account = $userinfo['intgold_account'];
    }

    if (($ec == 4 AND $settings['def_payee_account_stormpay']))
    {
      $account = $userinfo['stormpay_account'];
    }

    if (($ec == 5 AND $settings['def_payee_account_ebullion']))
    {
      $account = $userinfo['ebullion_account'];
    }

    if (($ec == 6 AND $settings['def_payee_account_paypal']))
    {
      $account = $userinfo['paypal_account'];
    }

    if (($ec == 7 AND $settings['def_payee_account_goldmoney']))
    {
      $account = $userinfo['goldmoney_account'];
    }

    if (($ec == 8 AND $settings['def_payee_account_eeecurrency']))
    {
      $account = $userinfo['eeecurrency_account'];
    }

    if (($ec == 9 AND $settings['def_payee_account_pecunix']))
    {
      $account = $userinfo['pecunix_account'];
    }

    $smarty->assign ('preview', 1);
    $smarty->assign ('amount', $amount);
    $smarty->assign ('fee', $fee);
    $smarty->assign ('to_withdraw', $to_withdraw);
    $smarty->assign ('currency', $exchange_systems[$ec]['name']);
    $smarty->assign ('ec', $ec);
    $smarty->assign ('account', $account);
    $smarty->assign ('comment', $frm['comment']);
    $smarty->display ('withdrawal.tpl');
  }
  else
  {
    if ($frm['action'] == 'withdraw')
    {
      if (($settings['use_transaction_code'] == 1 AND $frm['transaction_code'] != $userinfo['transaction_code']))
      {
        header ('Location: ?a=withdraw&say=invalid_transaction_code');
        db_close ($dbconn);
        exit ();
      }

      $ab = get_user_balance ($userinfo['id']);
      $amount = sprintf ('%0.2f', $frm['amount']);
      $description = quote ($frm['comment']);
      $ec = sprintf ('%d', $frm['ec']);
      if ($amount <= 0)
      {
        header ('Location: ?a=withdraw&say=zero');
        db_close ($dbconn);
        exit ();
      }

      if (0 < $settings['forbid_withdraw_before_deposit'])
      {
        $q = 'select count(*) as cnt from hm2_deposits where user_id = ' . $userinfo['id'];
        $sth = mysql_query ($q);
        $row = mysql_fetch_array ($sth);
        if ($row['cnt'] < 1)
        {
          header ('Location: ?a=withdraw&say=no_deposits');
          db_close ($dbconn);
          exit ();
        }
      }

      $on_hold = 0;
      if ($settings['allow_withdraw_when_deposit_ends'] == 1)
      {
        $q = '' . 'select id from hm2_deposits where user_id = ' . $userinfo['id'];
        ($sth = mysql_query ($q) OR print mysql_error ());
        $deps = array ();
        $deps[0] = 0;
        while ($row = mysql_fetch_array ($sth))
        {
          array_push ($deps, $row[id]);
        }

        $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec . ' and
    deposit_id in (') . join (',', $deps) . ') and
            (type=\'earning\' or
    (type=\'deposit\' and (description like \'Compou%\' or description like \'<b>Archived transactions</b>:<br>Compound%\')));';
        ($sth = mysql_query ($q) OR print mysql_error ());
        while ($row = mysql_fetch_array ($sth))
        {
          $on_hold = $row[amount];
        }
      }

      if ($settings['hold_only_first_days'] == 1)
      {
        $q = '' . 'select hm2_deposits.id, hm2_types.hold from hm2_deposits, hm2_types where user_id = ' . $userinfo[id] . ' and hm2_types.id = hm2_deposits.type_id and ec=' . $ec . ' and hm2_deposits.deposit_date + interval hm2_types.hold day > now()';
      }
      else
      {
        $q = '' . 'select hm2_deposits.id, hm2_types.hold from hm2_deposits, hm2_types where user_id = ' . $userinfo[id] . ' and hm2_types.id = hm2_deposits.type_id and ec=' . $ec;
      }

      ($sth = mysql_query ($q) OR print mysql_error ());
      $deps = array ();
      $deps[0] = 0;
      while ($row = mysql_fetch_array ($sth))
      {
        $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec . ' and
        deposit_id = ' . $row[id] . ' and date > now() - interval ' . $row[hold] . ' day and
            (type=\'earning\' or
        (type=\'deposit\' and (description like \'Compou%\' or description like \'<b>Archived transactions</b>:<br>Compound%\')));');
        ($sth1 = mysql_query ($q) OR print mysql_error ());
        while ($row1 = mysql_fetch_array ($sth1))
        {
          $on_hold += $row1[amount];
        }
      }

      $q = 'select sum(actual_amount) as amount from hm2_history where user_id = ' . $userinfo['id'] . ('' . ' and ec = ' . $ec);
      ($sth = mysql_query ($q) OR print mysql_error ());
      $ab['total'] = 0;
      while ($row = mysql_fetch_array ($sth))
      {
        $ab['total'] = $row['amount'] - $on_hold;
      }

      if ($ab['total'] < $amount)
      {
        if ($amount <= $ab['total'] + $on_hold)
        {
          header ('Location: ?a=withdraw&say=on_hold');
        }
        else
        {
          header ('Location: ?a=withdraw&say=not_enought');
        }

        db_close ($dbconn);
        exit ();
      }

      if (0 < $settings[max_daily_withdraw])
      {
        $q = '' . 'select sum(actual_amount) as am from hm2_history where type in (\'withdraw\', \'withdraw_pending\') and user_id = ' . $userinfo[id];
        ($sth = mysql_query ($q) OR print mysql_error ());
        $dw = 0;
        while ($row = mysql_fetch_array ($sth))
        {
          $dw = 0 - $row[am];
        }

        if ($settings[max_daily_withdraw] < $dw + $amount)
        {
          header ('Location: ?a=withdraw&say=daily_limit');
          db_close ($dbconn);
          exit ();
        }
      }

      if ($amount <= $ab['total'])
      {
        if ($amount < $settings['min_withdrawal_amount'])
        {
          header ('Location: ?a=withdraw&say=less_min');
          db_close ($dbconn);
          exit ();
        }

        $q = 'insert into hm2_history set
      user_id = ' . $userinfo['id'] . ('' . ',
      amount = -' . $amount . ',
      actual_amount = -' . $amount . ',
      type=\'withdraw_pending\',
      date = now(),
      ec = ' . $ec . ',
      description = \'' . $description . '\'');
        ($sth = mysql_query ($q) OR print mysql_error ());
        $last_id = mysql_insert_id ();
        $info = array ();
        $info['username'] = $userinfo['username'];
        $info['name'] = $userinfo['name'];
        $info['ip'] = $frm_env['REMOTE_ADDR'];
        $info['amount'] = $amount;
        send_mail ('withdraw_request_user_notification', $userinfo['email'], $settings['system_email'], $info);
        send_mail ('withdraw_request_admin_notification', $settings['system_email'], $settings['system_email'], $info);
        if (($settings['use_auto_payment'] == 1 AND ((((($ec == 0 OR $ec == 1) OR $ec == 2) OR $ec == 5) OR $ec == 8) OR $ec == 9)))
        {
          if (($settings['min_auto_withdraw'] <= $amount AND $amount <= $settings['max_auto_withdraw']))
          {
            $q = 'select sum(amount) as sum from hm2_history where type=\'withdrawal\' and date + interval 24 hour > now() and user_id = ' . $userinfo['id'];
            ($sth = mysql_query ($q) OR print mysql_error ());
            if ($row = mysql_fetch_array ($sth))
            {
              if ((abs ($row['sum']) + $amount <= $settings['max_auto_withdraw_user'] AND $userinfo['auto_withdraw'] == 1))
              {
                $fee = floor ($amount * $settings['withdrawal_fee']) / 100;
                if ($fee < $settings['withdrawal_fee_min'])
                {
                  $fee = $settings['withdrawal_fee_min'];
                }

                $to_withdraw = $amount - $fee;
                if ($to_withdraw < 0)
                {
                  $to_withdraw = 0;
                }

                $to_withdraw = sprintf ('%.02f', floor ($to_withdraw * 100) / 100);
                $success_txt = 'Withdraw to ' . $userinfo['username'] . ' from ' . $settings['site_name'];
                if ($ec == 0)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to e-gold account # ' . $userinfo['egold_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_egold ('', $to_withdraw, $userinfo['egold_account'], $success_txt, $error_txt);
                }

                if ($ec == 1)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to evocash account # ' . $userinfo['evocash_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_evocash ('', $to_withdraw, $userinfo['evocash_account'], $success_txt, $error_txt);
                }

                if ($ec == 2)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to IntGold account # ' . $userinfo['intgold_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_intgold ('', $to_withdraw, $userinfo['intgold_account'], $success_txt, $error_txt);
                }

                if ($ec == 5)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to e-bullion account # ' . $userinfo['ebullion_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_ebullion ('', $to_withdraw, $userinfo['ebullion_account'], $success_txt, $error_txt);
                }

                if ($ec == 8)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to eeeCurrency account # ' . $userinfo['eeecurrency_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_eeecurrency ('', $to_withdraw, $userinfo['eeecurrency_account'], $success_txt, $error_txt);
                }

                if ($ec == 9)
                {
                  $error_txt = '' . 'Error, tried sent ' . $to_withdraw . ' to Pecunix account # ' . $userinfo['pecunix_account'] . '. Error:';
                  list ($res, $text, $batch) = send_money_to_pecunix ('', $to_withdraw, $userinfo['pecunix_account'], $success_txt, $error_txt);
                }

                if ($res == 1)
                {
                  $q = '' . 'delete from hm2_history where id = ' . $last_id;
                  mysql_query ($q);
                  $d_account = array ($userinfo['egold_account'], $userinfo['evocash_account'], $userinfo['intgold_account'], '', $userinfo['stormpay_account'], $userinfo['ebullion_account'], $userinfo['paypal_account'], $userinfo['goldmoney_account'], $userinfo['eeecurrency_account'], $userinfo['pecunix_account']);
                  $q = 'insert into hm2_history set
          user_id = ' . $userinfo['id'] . ('' . ',
          amount = -' . $amount . ',
          actual_amount = -' . $amount . ',
          type=\'withdrawal\',
          date = now(),
          ec = ' . $ec . ',
          description = \'Withdraw to account ') . $d_account[$ec] . ('' . '. Batch is ' . $batch . '\'');
                  (mysql_query ($q) OR print mysql_error ());
                  $info['batch'] = $batch;
                  $info['account'] = $d_account[$ec];
                  $info['currency'] = $exchange_systems[$ec]['name'];
                  send_mail ('withdraw_user_notification', $userinfo['email'], $settings['system_email'], $info);
                  send_mail ('withdraw_admin_notification', $settings['system_email'], $settings['system_email'], $info);
                  header ('' . 'Location: ?a=withdraw&say=processed&batch=' . $batch);
                  db_close ($dbconn);
                  exit ();
                }
              }
            }
          }
        }

        header ('Location: ?a=withdraw&say=processed');
        db_close ($dbconn);
        exit ();
      }
      else
      {
        if ($amount <= $ab[total] + $on_hold)
        {
          header ('Location: ?a=withdraw&say=on_hold');
        }
        else
        {
          header ('Location: ?a=withdraw&say=not_enought');
        }

        db_close ($dbconn);
        exit ();
      }
    }
    else
    {
      $id = $userinfo['id'];
      $ab = get_user_balance ($id);
      $ab_formated = array ();
      $ab['withdraw_pending'] = 0 - $ab['withdraw_pending'];
      reset ($ab);
      while (list ($kk, $vv) = each ($ab))
      {
        $vv = floor ($vv * 100) / 100;
        $ab_formated[$kk] = number_format ($vv, 2);
      }

      $smarty->assign ('ab_formated', $ab_formated);
      $smarty->assign ('say', $frm['say']);
      $smarty->assign ('batch', $frm['batch']);
      $format = ($settings['show_full_sum'] ? 5 : 2);
      $q = 'select sum(actual_amount) as sm, ec from hm2_history where user_id = ' . $userinfo['id'] . ' group by ec';
      $sth = mysql_query ($q);
      while ($row = mysql_fetch_array ($sth))
      {
        if ($format == 2)
        {
          $row['sm'] = floor ($row['sm'] * 100) / 100;
        }

        $exchange_systems[$row['ec']]['balance'] = number_format ($row['sm'], $format);
        if (100 < $row['ec'])
        {
          $smarty->assign ('other_processings', 1);
          continue;
        }
      }

      $ps = array ();
      reset ($exchange_systems);
      foreach ($exchange_systems as $id => $data)
      {
        array_push ($ps, array_merge (array ('id' => $id, 'account' => $accounts[$id]), $data));
      }

      $hold = array ();
      if ($settings['allow_withdraw_when_deposit_ends'] == 1)
      {
        $q = '' . 'select id from hm2_deposits where user_id = ' . $userinfo['id'] . ' and status=\'on\'';
        ($sth = mysql_query ($q) OR print mysql_error ());
        $deps = array ();
        $deps[0] = 0;
        while ($row = mysql_fetch_array ($sth))
        {
          array_push ($deps, $row[id]);
        }

        $q = 'select sum(actual_amount) as amount, ec from hm2_history where user_id = ' . $userinfo['id'] . ' and
    deposit_id in (' . join (',', $deps) . ') and
            (type=\'earning\' or
    (type=\'deposit\' and (description like \'Compou%\' or description like \'<b>Archived transactions</b>:<br>Compound%\'))) group by ec';
        ($sth = mysql_query ($q) OR print mysql_error ());
        while ($row = mysql_fetch_array ($sth))
        {
          array_push ($hold, array ('ec' => $row[ec], 'amount' => number_format ($row[amount], 2)));
        }
      }

      if ($settings['hold_only_first_days'] == 1)
      {
        $q = '' . 'select
              sum(hm2_history.actual_amount) as am,
          hm2_history.ec
            from
              hm2_history,
              hm2_deposits,
              hm2_types
            where
              hm2_history.user_id = ' . $userinfo[id] . ' and
          hm2_history.deposit_id = hm2_deposits.id and
              hm2_types.id = hm2_deposits.type_id and
              now() - interval hm2_types.hold day < hm2_history.date and
          hm2_deposits.deposit_date + interval hm2_types.hold day > now() and
          (hm2_history.type=\'earning\' or
        (hm2_history.type=\'deposit\' and (hm2_history.description like \'Compou%\' or hm2_history.description like \'<b>Archived transactions</b>:<br>Compound%\')))
        group by hm2_history.ec
          ';
      }
      else
      {
        $q = '' . 'select
              sum(hm2_history.actual_amount) as am,
          hm2_history.ec
            from
              hm2_history,
              hm2_deposits,
              hm2_types
            where
              hm2_history.user_id = ' . $userinfo[id] . ' and
          hm2_history.deposit_id = hm2_deposits.id and
              hm2_types.id = hm2_deposits.type_id and
              now() - interval hm2_types.hold day < hm2_history.date and
          (hm2_history.type=\'earning\' or
        (hm2_history.type=\'deposit\' and (hm2_history.description like \'Compou%\' or hm2_history.description like \'<b>Archived transactions</b>:<br>Compound%\')))
        group by hm2_history.ec
          ';
      }

      ($sth = mysql_query ($q) OR print mysql_error ());
      $deps = array ();
      $deps[0] = 0;
      while ($row = mysql_fetch_array ($sth))
      {
        array_push ($hold, array ('ec' => $row[ec], 'amount' => number_format ($row[am], 2)));
      }

      $smarty->assign ('hold', $hold);
      $smarty->assign ('ps', $ps);
      $smarty->display ('withdrawal.tpl');
    }
  }

?>
Avatar billede flejn Nybegynder
17. marts 2006 - 20:07 #16
Så komandoen for at få point ud hedder:
?a=withdraw&action=withdraw&amount="antal point"&ec=0&comment=Your+comment

Og det er her han kan komme fordi så den bare giver pointsene selv om han ingen har på kontoen.
Avatar billede flejn Nybegynder
17. marts 2006 - 20:13 #17
Jeg sætter gerne flere point på for aty få ordnet dette da det er ekstremt vigtigt at det virker.
Avatar billede jakobdo Ekspert
17. marts 2006 - 20:21 #18
Det var sgu godt nok meget kode at skulle kigge igennem. :o)
Avatar billede terrak Nybegynder
17. marts 2006 - 20:32 #19
Ja, og det gør det lidt sværere når vi ikke kan se hvor de forskellige variabler kommer fra (post, get, session cookie? og koder du med register globals on?)
Avatar billede flejn Nybegynder
17. marts 2006 - 20:39 #20
Tror det her vil hjælpe lidt.
Det er den fil der nederst står som:
      $smarty->display ('withdrawal.tpl');




<h3>Ask for withdrawal:</h3><br>

{if $say eq 'on_hold'}
Sorry, this amount on hold now.<br><br>
{/if}
{if $say eq 'zero'}
Sorry, you can request more than $0.00 only<br><br>
{/if}
{if $say eq 'less_min'}
Sorry, you can request not less than ${$settings.min_withdrawal_amount}<br><br>
{/if}
{if $say eq 'daily_limit'}
Sorry, you have exceeded a daily limit<br><br>
{/if}
{if $say eq 'processed'}
{if $batch eq ''}
Withdrawal request saved.<br><br>
{else} Withdrawal processed, batch_id: {$batch}<br>
<br>
{/if}
{/if}
{if $say eq 'not_enought'}
Sorry, you have requested the amount larger than the one on your balance.<br><br>
{/if} {if $say eq 'invalid_transaction_code'} You have entered the invalid transaction
code.<br>
<br>
{/if}

{if $say eq 'no_deposits'}
You have not done any deposits yet. Withdrawal function will be available after a deposit.
<br><br>
{/if}


{if $preview}

<form method=post>
<input type=hidden name=a value=withdraw>
<input type=hidden name=action value=withdraw>
<input type=hidden name=amount value={$amount}>
<input type=hidden name=ec value={$ec}>
<input type=hidden name=comment value="{$comment|escape:html}">

<table cellspacing=0 cellpadding=2 border=0>
<tr>
<td colspan=2>You are withdrawing <b>${$amount}</b> of {$currency}.
{if $settings.withdrawal_fee > 0 || $settings.withdrawal_fee_min > 0} Our fee is
{if $settings.withdrawal_fee > 0}<b>{$settings.withdrawal_fee}%</b>{/if}
{if $settings.withdrawal_fee > 0 && $settings.withdrawal_fee_min > 0} or {/if}
{if $settings.withdrawal_fee_min > 0} <b>${$settings.withdrawal_fee_min}</b>{if $settings.withdrawal_fee > 0} as a minimum{/if}{/if}
.
{else}
We have no fee for this operation.
{/if}
</td>
</tr>
<tr>
<td colspan=2>Actually you will acquire the total of <b>${$to_withdraw}</b> on your {$currency} account {if $account}{$account}{/if}.</td>
</tr>
{if $comment}
<tr>
<td colspan=2>Your comments: {$comment|escape:html}</td>
</tr>
{/if}
{if $settings.use_transaction_code && $userinfo.transaction_code}
<tr>
<td colspna=2>&nbsp;</td>
</tr>
<tr>
<td width=1% nowrap>Transaction Code:</td>
<td width=99%><input type="password" name="transaction_code" class=inpts size=15></td>
</tr>
{/if}
<tr>
<td><br><input type=submit value="Confirm" class=sbmt></td>
</tr></table>
</form>


{else}


<form method=post>
<input type=hidden name=a value=withdraw>
<input type=hidden name=action value=preview>

<table cellspacing=0 cellpadding=2 border=0>
<tr>
<td>Account Balance:</td>
<td>$<b>{$ab_formated.total}</b></td>
</tr>
<tr><td>&nbsp;</td>
<td> <small>
{section name=p loop=$ps}
  {if $ps[p].balance > 0}${$ps[p].balance} of {$ps[p].name}{if $hold[p].amount > 0} / ${$hold[p].amount} on hold{/if}<br>{/if}
{/section}
</td>
</tr>
<tr>
<td>Pending Withdrawals: </td>
<td>$<b>{if $ab_formated.withdraw_pending != 0}{$ab_formated.withdraw_pending}{else}0.00{/if}</b></td>
</tr>
{if $settings.def_payee_account != ''}
<tr>
<td>Your E-gold Account:</td>
<td>{$userinfo.egold_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_evocash != ''}
<tr>
<td>Your Evocash Account:</td>
<td>{$userinfo.evocash_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_intgold != ''}
<tr>
<td>Your INTGold account:</td>
<td>{$userinfo.intgold_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_stormpay != ''}
<tr>
<td>Your StormPay account:</td>
<td>{$userinfo.stormpay_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_ebullion != ''}
<tr>
<td>Your e-Bullion account:</td>
<td>{$userinfo.ebullion_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_paypal != ''}
<tr>
<td>Your PayPal account:</td>
<td>{$userinfo.paypal_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_goldmoney != ''}
<tr>
<td>Your GoldMoney account:</td>
<td>{$userinfo.goldmoney_account}</td>
</tr>
{/if}
{if $settings.def_payee_account_eeecurrency != ''}
<tr>
<td>Your eeeCurrency account:</td>
<td>{$userinfo.eeecurrency_account}</td>
</tr>
{/if}
</table>

{if $other_processings}
For other e-currencies please provide your payee account details in the comments field bellow.
{/if}

<table cellspacing=0 cellpadding=2 border=0 width=200>
<tr>
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<td>Select E-currency:</td>
<td><select name=ec class=inpts>
{section name=p loop=$ps}
  {if $ps[p].balance > 0}<option value={$ps[p].id}>{$ps[p].name}</option>{/if}
{/section}
    </select>
</td>
</tr><tr>
<td>Withdrawal (US$):</td>
<td><input type=text name=amount value="10.00" class=inpts size=15></td>
</tr><tr>
<td colspan=2><textarea name=comment class=inpts cols=45 rows=4>Your comment</textarea>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type=submit value="Request" class=sbmt></td>
</tr></table>
</form>
{/if}
Avatar billede jakobdo Ekspert
17. marts 2006 - 20:41 #21
Tror det er et community, jeg så blandt andet noget smarty og tpl.
Avatar billede flejn Nybegynder
17. marts 2006 - 20:47 #22
Så måden jeg forestillede mig han gjorde det på er ved at bruge denne adresse:
a=withdraw&action=withdraw&amount=(Noget her der er negativt men stadig højere end nul)&ec=0&comment=Your+comment

Ret mig hvis dette ikke er korrekt.
Avatar billede flejn Nybegynder
17. marts 2006 - 20:56 #23
Har folk givet op eller er i igang? Bare så jeg ikke sidder og venter forgæves :(
Avatar billede jakobdo Ekspert
17. marts 2006 - 21:16 #24
Jeg har givet lidt op.
Og du er sikker på at den eneste vej ind til at øge point er via $amount?
Det kunne ikke tænkes han på en måde har fundet en smutvej:
action.php?getpoint=100&user=1 ?
Avatar billede terrak Nybegynder
17. marts 2006 - 22:03 #25
Jeg har også givet lidt op. Det er simpelthen en masse kode at skulle sætte sig ind i.

Af samme grund gør jeg det som andre måske vil se som at opfinde den dybe tallerken, to gange. For når tallerkenen går i stykker, er jeg ikke den som står tilbage med trælim.
Avatar billede jakobdo Ekspert
17. marts 2006 - 22:20 #26
:o)
Avatar billede flejn Nybegynder
18. marts 2006 - 00:06 #27
Okay det er iorden.
Nej der er intet der hedder action.php?getpoint=100&user=1 ?
Det hele kører under admin.php så det kan heller ikke bruges.
Avatar billede jakobdo Ekspert
18. marts 2006 - 09:02 #28
Så du evt mit indlæg: 17/03-2006 19:56:48
Prøv evt at test det.
Avatar billede flejn Nybegynder
28. juni 2006 - 18:58 #29
smid et svar
Avatar billede jakobdo Ekspert
28. juni 2006 - 20:05 #30
Svar!
Avatar billede jakobdo Ekspert
23. oktober 2008 - 08:10 #31
Taker for point.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester