Cadeiao
29/08/2019, 10:14 PM
Olá Perfect .
Meu Leilão está para dar o lance em Pontos, como faço para por para o lance ser em Cash ?
Obrigado.
OBS: Caso estiver no tópico errado peco desculpas .
Cadeiao
29/08/2019, 11:30 PM
Qual website ta usando?
MuSite v2.5.x
Leandro Daldegam
Reenan
30/08/2019, 06:02 PM
Vamos lá, to meio enferrujado, mas creio que para altera isso é diretamente no modulo.
Em ldpaneluser.class.php loadOptionsAuctions procure por columnPoints e troque para columnAmount ou columnAmount2 dependendo de onde está a sua moeda cash.
Com esse exemplo que irei postar abaixo estará para columnAmount
private function loadOptionsAuctions()
{
global $ldTpl, $TABLES_CONFIGS;
$RespostWrite = NULL;
if($_GET['action'] == "showDetailsAuction")
{
$getAuctions = $this->query("SELECT [id],[name],[premium],[startDate],[endDate],[active],[minimumBid],[closed],[winner],[winnerText] FROM [dbo].[webAuctions] WHERE [active] = 1 AND [id] = ".(int) $_GET['id']." ORDER BY [id] DESC");
if(mssql_num_rows($getAuctions) == 0)
{
$RespostWrite = "<table style='width: 100%;'>".
"<tr><td style='text-align: center;' colspan='4'>".LDPU_AUCTIONS_NOT_FOUND."</td></tr>".
"</table>";
}
else
{
$getAuctions = mssql_fetch_object($getAuctions);
if($getAuctions->closed == 1) $status = LDPU_AUCTIONS_STATUS_END;
elseif($getAuctions->startDate > time()) $status = LDPU_AUCTIONS_STATUS_WAIT_BEGIN;
elseif($getAuctions->startDate < time() && $getAuctions->endDate > time()) $status = LDPU_AUCTIONS_STATUS_IN_PROGRESS;
elseif($getAuctions->endDate < time()) $status = LDPU_AUCTIONS_STATUS_WAIT_PREMIUM;
else $status = "Status desconhecido.";
$searchLastBid = $this->query("SELECT TOP 1 [username],[amount],CONVERT(varchar, [lastBid], 103) [lastBidDay],CONVERT(varchar, [lastBid], 108) [lastBidHour] FROM [dbo].[webAuctionsBids] WHERE [auction] = ". (int) $getAuctions->id ." ORDER BY [amount] DESC");
if(mssql_num_rows($searchLastBid) == 0)
{
$lastUserBid = LDPU_AUCTIONS_TAKE_FRIST_BID;
$lastValueBid = $getAuctions->minimumBid;
}
else
{
$searchLastBid = mssql_fetch_object($searchLastBid);
$lastUserBid = $searchLastBid->username.", ".$searchLastBid->lastBidDay." ".$searchLastBid->lastBidHour;
$lastValueBid = $searchLastBid->amount;
}
$findAccountPointsQ = $this->query("SELECT ".$TABLES_CONFIGS['WEBCASH']['columnAmount']." as amount FROM ".$TABLES_CONFIGS['WEBCASH']['database'].".dbo.".$TABLES_CONFIGS['WEBCASH']['table']." WHERE ".$TABLES_CONFIGS['WEBCASH']['columnUsername']."='". $_SESSION['LOGIN'] ."'");
$findAccountPoints = mssql_fetch_object($findAccountPointsQ);
$searchIfHaveBid = $this->query("SELECT [amount] FROM [dbo].[webAuctionsBids] WHERE [auction] = ". (int) $getAuctions->id ." AND [username] = '".$_SESSION['LOGIN']."'");
$RespostWrite = "<table style='width: 100%;'>".
"<tr><td style='width: 150px;'>".LDPU_AUCTIONS_ID.":</td><td><strong>{$getAuctions->id}</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_NAME.":</td><td><strong>{$getAuctions->name}</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_STATUS.":</td><td><strong>{$status}</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_DATE_BEGIN.":</td><td><strong>".date("d/m/Y G:i:s", $getAuctions->startDate)."</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_DATE_END.":</td><td><strong>".date("d/m/Y G:i:s", $getAuctions->endDate)."</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_MIN_BID.":</td><td><strong>{$getAuctions->minimumBid} ".constant("CASH_NAME")."</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_PREMIUM.":</td><td><strong>{$getAuctions->premium}</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_PHOTO.":</td><td><a href="modules/uploads/auctions/{$getAuctions->id}.large.jpg" id="photoLarge_{$getAuctions->id}">
<img src='modules/uploads/auctions/{$getAuctions->id}.small.jpg' /></a>
<script> jQuery("a#photoLarge_{$getAuctions->id}").fancybox();</script></td></tr>".
"</table>".
"<br/>".
"<table style='width: 100%;'>".
"<tr><td style='width: 150px;'>".LDPU_AUCTIONS_LAST_PUT_BID."</td><td><strong>{$lastUserBid}</strong> - <a href='?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id={$getAuctions->id}'>[".LDPU_AUCTIONS_REFRESH."]</a></td></tr>".
"<tr><td>".LDPU_AUCTIONS_AUCTION_VALUE.":</td><td><strong>{$lastValueBid} ".constant("CASH_NAME")."</strong></td></tr>".
"<tr><td>".LDPU_AUCTIONS_YOUR_LAST_BID.":</td><td><strong>".(int) mssql_fetch_object($searchIfHaveBid)->amount." ".constant("CASH_NAME")."</strong></td></tr>".
"<tr>
<td>".LDPU_AUCTIONS_PUT_TOUR_BID.":</td>
<td>
<input type='text' class='inputbox' value='".($lastValueBid+1)."' style='width: 50px;' id='valueToBid'>
<input type='button' class='button' value='".LDPU_AUCTIONS_INTPUT_PUT_BID."' onclick="window.location = '?page=paneluser&option=AUCTIONS&action=bid&id={$getAuctions->id}&points='+jQuery('#valueToBid').val()" />
(".LDPU_AUCTIONS_YOU_HAVE.": {$findAccountPoints->amount} ".constant("CASH_NAME").")</td></tr>".
"</table>";
if($getAuctions->winner == $_SESSION['LOGIN'])
{
$RespostWrite .= "<table style='width: 100%; text-align: center;'>".
"<tr><td style='padding: 20px;'><strong>".LDPU_AUCTIONS_YOU_WINNER."<br /><br />{$getAuctions->winnerText}</strong></td></tr>".
"</table>";
}
}
}
elseif($_GET['action'] == "bid")
{
try
{
if(is_numeric($_GET['points']) == false || $_GET['points'] <= 0)
throw new Exception(sprintf(LDPU_AUCTIONS_FILL_NUMBER_POSITI VE, constant("CASH_NAME")), 1);
if(is_numeric($_GET['id']) == false)
throw new Exception(LDPU_AUCTIONS_INVALID_AUCTION, 1);
$getAuctions = $this->query("SELECT [id],[startDate],[endDate],[active],[minimumBid],[closed] FROM [dbo].[webAuctions] WHERE [active] = 1 AND [id] = ".(int) $_GET['id']." ORDER BY [id] DESC");
if(mssql_num_rows($getAuctions) == 0)
throw new Exception(LDPU_AUCTIONS_INVALID_AUCTION_OR_NOT_ACT IVE, 1);
$getAuctions = mssql_fetch_object($getAuctions);
if($getAuctions->closed == 1) throw new Exception(LDPU_AUCTIONS_STATUS_END, 1);
elseif($getAuctions->startDate > time()) throw new Exception(LDPU_AUCTIONS_STATUS_WAIT_BEGIN, 1);
elseif($getAuctions->endDate < time()) throw new Exception(LDPU_AUCTIONS_STATUS_WAIT_PREMIUM, 1);
if($getAuctions->minimumBid > $_GET['points'])
throw new Exception(LDPU_AUCTIONS_YOU_NEED_BID_MORE." ".$getAuctions->minimumBid.".", 1);
$searchLastBid = $this->query("SELECT TOP 1 [amount] FROM [dbo].[webAuctionsBids] WHERE [auction] = ". (int) $getAuctions->id ." ORDER BY [amount] DESC");
if(mssql_num_rows($searchLastBid) > 0)
{
$searchLastBid = mssql_fetch_object($searchLastBid);
if($searchLastBid->amount >= $_GET['points'])
throw new Exception(LDPU_AUCTIONS_YOU_NEED_BID_MORE." ".$_GET['points'].".", 1);
}
$findAccountPointsQ = $this->query("SELECT ".$TABLES_CONFIGS['WEBCASH']['columnAmount']." as amount FROM ".$TABLES_CONFIGS['WEBCASH']['database'].".dbo.".$TABLES_CONFIGS['WEBCASH']['table']." WHERE ".$TABLES_CONFIGS['WEBCASH']['columnUsername']."='". $_SESSION['LOGIN'] ."'");
$findAccountPoints = mssql_fetch_object($findAccountPointsQ);
if($findAccountPoints->amount < $_GET['points'])
throw new Exception(LDPU_AUCTIONS_YOU_NOT_HAVE_POINTS." ".constant("CASH_NAME").".", 1);
/*
$remove = $this->query("UPDATE ".$TABLES_CONFIGS['WEBCASH']['database'].".dbo.".$TABLES_CONFIGS['WEBCASH']['table']."
SET ".$TABLES_CONFIGS['WEBCASH']['columnAmount']."=".$TABLES_CONFIGS['WEBCASH']['columnAmount']."-".(int)$_GET['points']."
WHERE ".$TABLES_CONFIGS['WEBCASH']['columnUsername']."='".$_SESSION['LOGIN']."' AND ".$TABLES_CONFIGS['WEBCASH']['columnAmount']." > ".(int)$_GET['points'].";
[Only registered and activated users can see links]
if(mssql_fetch_object($remove)->count == 0)
throw new Exception("Você não possui essa quantidade de ".constant("CASH_NAME").".", 1);
*/
$searchIfHaveBid = $this->query("SELECT 1 FROM [dbo].[webAuctionsBids] WHERE [auction] = ". (int) $getAuctions->id ." AND [username] = '".$_SESSION['LOGIN']."'");
if(mssql_num_rows($searchIfHaveBid) > 0)
{
$this->query("UPDATE [dbo].[webAuctionsBids] SET [amount] = ".(int)$_GET['points']." WHERE [auction] = ". (int) $getAuctions->id ." AND [username] = '".$_SESSION['LOGIN']."'");
throw new Exception(LDPU_AUCTIONS_BID_SUCCESS_REGISTER, 0);
}
else
{
$this->query("INSERT INTO [dbo].[webAuctionsBids] ([auction],[amount],[username],[lastBid]) VALUES (".(int) $getAuctions->id.", ".(int) $_GET['points'].", '".$_SESSION['LOGIN']."', getDate());");
throw new Exception(LDPU_AUCTIONS_BID_SUCCESS_REGISTER, 0);
}
}
catch( Exception $e )
{
switch($e->getCode())
{
case 0:
echo "<script>alert('".$e->getMessage()."'); window.location = '?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id=".(int) $getAuctions->id."';</script>";
break;
case 1:
echo "<script>alert('".$e->getMessage()."'); history.go(-1);</script>";
break;
}
}
exit();
}
else
{
$getAuctions = $this->query("SELECT [id],[name],[premium],[startDate],[endDate],[closed] FROM [dbo].[webAuctions] WHERE [active] = 1 ORDER BY [id] DESC");
if(mssql_num_rows($getAuctions) == 0)
{
$RespostWrite = "<table style='width: 100%;'>".
"<tr><td style='width: 27px;'>#</td><td>".LDPU_AUCTIONS_NAME."</td><td>".LDPU_AUCTIONS_PREMIUM."</td><td style='width: 100px;'>".LDPU_AUCTIONS_STATUS."</td></tr>".
"<tr><td style='text-align: center;' colspan='4'>".LDPU_AUCTIONS_NOT_HAVE_AUCTIONS."</td></tr>".
"</table>";
}
else
{
while($auction = mssql_fetch_object($getAuctions))
{
if($auction->closed == 1) $status = LDPU_AUCTIONS_STATUS_END;
elseif($auction->startDate > time()) $status = LDPU_AUCTIONS_STATUS_WAIT_BEGIN;
elseif($auction->startDate < time() && $auction->endDate > time()) $status = LDPU_AUCTIONS_STATUS_IN_PROGRESS;
elseif($auction->endDate < time()) $status = LDPU_AUCTIONS_STATUS_WAIT_PREMIUM;
else $status = LDPU_AUCTIONS_STATUS_ERROR;
$tmpList .= "<tr>
<td><a href='?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id={$auction->id}'>{$auction->id}</a></td>
<td><a href='?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id={$auction->id}'>{$auction->name}</a></td>
<td><a href='?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id={$auction->id}'>".substr($auction->premium, 0, 40).(strlen($auction->premium) > 40 ? "..." : NULL)."</a></td>
<td><a href='?page=paneluser&option=AUCTIONS&action=showDetailsAuction&id={$auction->id}'>{$status}</a></td>
</tr>";
}
$RespostWrite = "<table style='width: 100%;'>".
"<tr><td style='width: 27px;'>#</td><td>".LDPU_AUCTIONS_NAME."</td><td>".LDPU_AUCTIONS_PREMIUM."</td><td style='width: 150px;'>".LDPU_AUCTIONS_STATUS."</td></tr>".
$tmpList.
"</table>";
}
}
$ldTpl->set("RespostWrite", $RespostWrite);
}
Não cheguei a testar, então faça um backup antes de realizar alguma alteração em sua ldpaneluser.class.php
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.