0

大家好,我有一个网站,我想添加 Cashu 支付网关。给用户可以购买>这是我的付款文件

付款管理.php

include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();
$adminurl = $config['adminurl'];

function insert_get_trans_id($a)
{
    global $conn;
    $query = "select txn_id, memo from paypal_table where id='".mysql_real_escape_string($a[id])."'"; 
    $executequery=$conn->execute($query);
    $results = $conn->execute($query);
    $returnthis = $results->getrows();
    return $returnthis;
}

if($_REQUEST['sortby']=="OID")
{
    $sortby = "OID";
    $sort =" order by A.OID";
    $add1 = "&sortby=OID";
}
elseif($_REQUEST['sortby']=="username")
{
    $sortby = "username";
    $sort =" order by B.username";
    $add1 = "&sortby=username";
}
elseif($_REQUEST['sortby']=="time")
{
    $sortby = "time";
    $sort =" order by A.time";
    $add1 = "&sortby=time";
}
elseif($_REQUEST['sortby']=="PAYPAL")
{
    $sortby = "PAYPAL";
    $sort =" order by A.PAYPAL";
    $add1 = "&sortby=PAYPAL";
}
else
{
    $sortby = "ID";
    $sort =" order by A.ID";
    $add1 = "&sortby=ID";
}

if($_REQUEST['sorthow']=="asc")
{
    $sorthow ="asc";
    $add1 .= "&sorthow=asc";
}
else
{
    $sorthow ="desc";
    $add1 .= "&sorthow=desc";
}

//Search
$fromid = intval($_REQUEST['fromid']);
$toid = intval($_REQUEST['toid']);
$OID = htmlentities(strip_tags($_REQUEST['OID']), ENT_COMPAT, "UTF-8");
$username = htmlentities(strip_tags($_REQUEST['username']), ENT_COMPAT, "UTF-8");
$add1 .= "&fromid=$fromid&toid=$toid&OID=$OID&username=$username";
if($_POST['submitform'] == "1" || ($_REQUEST['fromid']!="" || $toid>0 || $OID!="" || $username!=""))
{
    if($fromid > 0)
    {
        $addtosql = "AND A.ID>='".mysql_real_escape_string($fromid)."'";
        Stemplate::assign('fromid',$fromid);
    }
    else
    {
        $addtosql = "AND A.ID>'".mysql_real_escape_string($fromid)."'";
    }
    if($toid > 0)
    {
        $addtosql .= "AND A.ID<='".mysql_real_escape_string($toid)."'";
        Stemplate::assign('toid',$toid);
    }
    if($OID != "")
    {
        $addtosql .= "AND A.OID='".mysql_real_escape_string($OID)."'";
        Stemplate::assign('OID',$OID);
    }
    if($username != "")
    {
        $addtosql .= "AND B.username like'%".mysql_real_escape_string($username)."%'";
        Stemplate::assign('username',$username);
    }
    Stemplate::assign('search',"1");
}
//Search End

$page = intval($_REQUEST['page']);
if($page=="")
{
    $page = "1";
}
$currentpage = $page;

if ($page >=2)
{
    $pagingstart = ($page-1)*$config['items_per_page'];
}
else
{
    $pagingstart = "0";
}

$queryselected = "select A.ID,B.username from payments A, members B WHERE A.ID>0 AND A.USERID=B.USERID $addtosql $sort $sorthow limit $config[maximum_results]";
$query2 = "select A.*,B.username from payments A, members B WHERE A.ID>0 AND A.USERID=B.USERID $addtosql $sort $sorthow limit $pagingstart, $config[items_per_page]";
$executequeryselected = $conn->Execute($queryselected);
$totalposts = $executequeryselected->rowcount();    
if ($totalposts > 0)
{
    if($totalposts<=$config[maximum_results])
    {
        $total = $totalposts;
    }
    else
    {
        $total = $config[maximum_results];
    }
    $toppage = ceil($total/$config[items_per_page]);
    if($toppage==0)
    {
        $xpage=$toppage+1;
    }
    else
    {
        $xpage = $toppage;
    }
    $executequery2 = $conn->Execute($query2);   
    $results = $executequery2->getrows();
    $beginning=$pagingstart+1;
    $ending=$pagingstart+$executequery2->recordcount();
    $pagelinks="";
    $k=1;
    $theprevpage=$currentpage-1;
    $thenextpage=$currentpage+1;
    if ($currentpage > 0)
    {   
        if($currentpage > 1) 
        {
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=1$add1' title='first page'>First</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=$theprevpage$add1'>Previous</a>&nbsp;";
        };
        $counter=0;
        $lowercount = $currentpage-5;
        if ($lowercount <= 0) $lowercount = 1;
        while ($lowercount < $currentpage)
        {
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=$lowercount$add1'>$lowercount</a>&nbsp;";
            $lowercount++;
            $counter++;
        }
        $pagelinks.=$currentpage."&nbsp;";
        $uppercounter = $currentpage+1;
        while (($uppercounter < $currentpage+10-$counter) && ($uppercounter<=$toppage))
        {
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=$uppercounter$add1'>$uppercounter</a>&nbsp;";
            $uppercounter++;
        }
        if($currentpage < $toppage) 
        {
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=$thenextpage$add1'>Next</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_manage.php?page=$toppage$add1' title='last page'>Last</a>&nbsp;";
        };
    }
}
else
{
    $error = "Sorry, no payments were found.";
}

$mainmenu = "6";
$submenu = "1";
Stemplate::assign('mainmenu',$mainmenu);
Stemplate::assign('submenu',$submenu);
Stemplate::assign('sorthow',$sorthow);
Stemplate::assign('sortby',$sortby);
Stemplate::assign('currentpage',$currentpage);
STemplate::display("administrator/global_header.tpl");
STemplate::assign('beginning',$beginning);
STemplate::assign('ending',$ending);
STemplate::assign('pagelinks',$pagelinks);
STemplate::assign('total',$total+0);
STemplate::assign('results',$results);
Stemplate::assign('error',$error);
STemplate::display("administrator/payments_manage.tpl");
STemplate::display("administrator/global_footer.tpl");
?>

payment_featured.php

<?php

include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();
$adminurl = $config['adminurl'];

function insert_get_trans_id($a)
{
    global $conn;
    $query = "select txn_id, memo from paypal_table2 where id='".mysql_real_escape_string($a[id])."'"; 
    $executequery=$conn->execute($query);
    $results = $conn->execute($query);
    $returnthis = $results->getrows();
    return $returnthis;
}

if($_REQUEST['sortby']=="OID")
{
    $sortby = "OID";
    $sort =" order by A.PID";
    $add1 = "&sortby=OID";
}
elseif($_REQUEST['sortby']=="username")
{
    $sortby = "username";
    $sort =" order by B.username";
    $add1 = "&sortby=username";
}
elseif($_REQUEST['sortby']=="time")
{
    $sortby = "time";
    $sort =" order by A.time";
    $add1 = "&sortby=time";
}
elseif($_REQUEST['sortby']=="PAYPAL")
{
    $sortby = "PAYPAL";
    $sort =" order by A.PAYPAL";
    $add1 = "&sortby=PAYPAL";
}
else
{
    $sortby = "ID";
    $sort =" order by A.ID";
    $add1 = "&sortby=ID";
}

if($_REQUEST['sorthow']=="asc")
{
    $sorthow ="asc";
    $add1 .= "&sorthow=asc";
}
else
{
    $sorthow ="desc";
    $add1 .= "&sorthow=desc";
}

//Search
$fromid = intval($_REQUEST['fromid']);
$toid = intval($_REQUEST['toid']);
$OID = htmlentities(strip_tags($_REQUEST['OID']), ENT_COMPAT, "UTF-8");
$username = htmlentities(strip_tags($_REQUEST['username']), ENT_COMPAT, "UTF-8");
$add1 .= "&fromid=$fromid&toid=$toid&OID=$OID&username=$username";
if($_POST['submitform'] == "1" || ($_REQUEST['fromid']!="" || $toid>0 || $OID!="" || $username!=""))
{
    if($fromid > 0)
    {
        $addtosql = "AND A.ID>='".mysql_real_escape_string($fromid)."'";
        Stemplate::assign('fromid',$fromid);
    }
    else
    {
        $addtosql = "AND A.ID>'".mysql_real_escape_string($fromid)."'";
    }
    if($toid > 0)
    {
        $addtosql .= "AND A.ID<='".mysql_real_escape_string($toid)."'";
        Stemplate::assign('toid',$toid);
    }
    if($OID != "")
    {
        $addtosql .= "AND A.PID='".mysql_real_escape_string($OID)."'";
        Stemplate::assign('OID',$OID);
    }
    if($username != "")
    {
        $addtosql .= "AND B.username like'%".mysql_real_escape_string($username)."%'";
        Stemplate::assign('username',$username);
    }
    Stemplate::assign('search',"1");
}
//Search End

$page = intval($_REQUEST['page']);
if($page=="")
{
    $page = "1";
}
$currentpage = $page;

if ($page >=2)
{
    $pagingstart = ($page-1)*$config['items_per_page'];
}
else
{
    $pagingstart = "0";
}

$queryselected = "select A.ID,B.username, C.gtitle from featured A, members B, posts C WHERE A.ID>0 AND A.PID=C.PID AND C.USERID=B.USERID $addtosql $sort $sorthow limit $config[maximum_results]";
$query2 = "select A.*,B.username, C.gtitle from featured A, members B, posts C WHERE A.ID>0 AND A.PID=C.PID AND C.USERID=B.USERID $addtosql $sort $sorthow limit $pagingstart, $config[items_per_page]";
$executequeryselected = $conn->Execute($queryselected);
$totalposts = $executequeryselected->rowcount();    
if ($totalposts > 0)
{
    if($totalposts<=$config[maximum_results])
    {
        $total = $totalposts;
    }
    else
    {
        $total = $config[maximum_results];
    }
    $toppage = ceil($total/$config[items_per_page]);
    if($toppage==0)
    {
        $xpage=$toppage+1;
    }
    else
    {
        $xpage = $toppage;
    }
    $executequery2 = $conn->Execute($query2);   
    $results = $executequery2->getrows();
    $beginning=$pagingstart+1;
    $ending=$pagingstart+$executequery2->recordcount();
    $pagelinks="";
    $k=1;
    $theprevpage=$currentpage-1;
    $thenextpage=$currentpage+1;
    if ($currentpage > 0)
    {   
        if($currentpage > 1) 
        {
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=1$add1' title='first page'>First</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=$theprevpage$add1'>Previous</a>&nbsp;";
        };
        $counter=0;
        $lowercount = $currentpage-5;
        if ($lowercount <= 0) $lowercount = 1;
        while ($lowercount < $currentpage)
        {
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=$lowercount$add1'>$lowercount</a>&nbsp;";
            $lowercount++;
            $counter++;
        }
        $pagelinks.=$currentpage."&nbsp;";
        $uppercounter = $currentpage+1;
        while (($uppercounter < $currentpage+10-$counter) && ($uppercounter<=$toppage))
        {
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=$uppercounter$add1'>$uppercounter</a>&nbsp;";
            $uppercounter++;
        }
        if($currentpage < $toppage) 
        {
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=$thenextpage$add1'>Next</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_featured.php?page=$toppage$add1' title='last page'>Last</a>&nbsp;";
        };
    }
}
else
{
    $error = "There are no payments yet.";
}

$mainmenu = "6";
$submenu = "1";
Stemplate::assign('mainmenu',$mainmenu);
Stemplate::assign('submenu',$submenu);
Stemplate::assign('sorthow',$sorthow);
Stemplate::assign('sortby',$sortby);
Stemplate::assign('currentpage',$currentpage);
STemplate::display("administrator/global_header.tpl");
STemplate::assign('beginning',$beginning);
STemplate::assign('ending',$ending);
STemplate::assign('pagelinks',$pagelinks);
STemplate::assign('total',$total+0);
STemplate::assign('results',$results);
Stemplate::assign('error',$error);
STemplate::display("administrator/payments_featured.tpl");
STemplate::display("administrator/global_footer.tpl");
?>

payment_clear.php

<?php

include("../include/config.php");
include_once("../include/functions/import.php");
verify_login_admin();
$adminurl = $config['adminurl'];

//CLEAR
if($_POST['asub']=="1")
{
    $AID = intval($_POST['AID']);
    $aseller = intval($_POST['aseller']);
    $apay = number_format($_POST['apay'], 2);
    if($AID > 0 && $aseller > 0 && $apay > 0)
    {
        $sql="UPDATE payments SET wd='1' WHERE ID='".mysql_real_escape_string($AID)."'";
        $conn->Execute($sql);
        $sql="UPDATE members SET afunds=afunds+$apay WHERE USERID='".mysql_real_escape_string($aseller)."'";
        $conn->Execute($sql);
        $message = "Payment successfully cleared.";
        Stemplate::assign('message',$message);
    }
}
//CLEAR

function insert_get_trans_id($a)
{
    global $conn;
    $query = "select txn_id, memo from paypal_table where id='".mysql_real_escape_string($a[id])."'"; 
    $executequery=$conn->execute($query);
    $results = $conn->execute($query);
    $returnthis = $results->getrows();
    return $returnthis;
}

if($_REQUEST['sortby']=="OID")
{
    $sortby = "OID";
    $sort =" order by A.OID";
    $add1 = "&sortby=OID";
}
elseif($_REQUEST['sortby']=="username")
{
    $sortby = "username";
    $sort =" order by B.username";
    $add1 = "&sortby=username";
}
elseif($_REQUEST['sortby']=="time")
{
    $sortby = "time";
    $sort =" order by A.time";
    $add1 = "&sortby=time";
}
elseif($_REQUEST['sortby']=="PAYPAL")
{
    $sortby = "PAYPAL";
    $sort =" order by A.PAYPAL";
    $add1 = "&sortby=PAYPAL";
}
else
{
    $sortby = "ID";
    $sort =" order by A.ID";
    $add1 = "&sortby=ID";
}

if($_REQUEST['sorthow']=="asc")
{
    $sorthow ="asc";
    $add1 .= "&sorthow=asc";
}
else
{
    $sorthow ="desc";
    $add1 .= "&sorthow=desc";
}

//Search
$fromid = intval($_REQUEST['fromid']);
$toid = intval($_REQUEST['toid']);
$OID = htmlentities(strip_tags($_REQUEST['OID']), ENT_COMPAT, "UTF-8");
$username = htmlentities(strip_tags($_REQUEST['username']), ENT_COMPAT, "UTF-8");
$add1 .= "&fromid=$fromid&toid=$toid&OID=$OID&username=$username";
if($_POST['submitform'] == "1" || ($_REQUEST['fromid']!="" || $toid>0 || $OID!="" || $username!=""))
{
    if($fromid > 0)
    {
        $addtosql = "AND A.ID>='".mysql_real_escape_string($fromid)."'";
        Stemplate::assign('fromid',$fromid);
    }
    else
    {
        $addtosql = "AND A.ID>'".mysql_real_escape_string($fromid)."'";
    }
    if($toid > 0)
    {
        $addtosql .= "AND A.ID<='".mysql_real_escape_string($toid)."'";
        Stemplate::assign('toid',$toid);
    }
    if($OID != "")
    {
        $addtosql .= "AND A.OID='".mysql_real_escape_string($OID)."'";
        Stemplate::assign('OID',$OID);
    }
    if($username != "")
    {
        $addtosql .= "AND B.username like'%".mysql_real_escape_string($username)."%'";
        Stemplate::assign('username',$username);
    }
    Stemplate::assign('search',"1");
}
//Search End

$page = intval($_REQUEST['page']);
if($page=="")
{
    $page = "1";
}
$currentpage = $page;

if ($page >=2)
{
    $pagingstart = ($page-1)*$config['items_per_page'];
}
else
{
    $pagingstart = "0";
}

$queryselected = "select D.ctp, A.ID,B.username, C.cltime, D.USERID as seller from payments A, members B, orders C, posts D WHERE D.PID=C.PID AND A.OID=C.OID AND C.status='5' AND A.cancel='0' AND A.wd='0' AND A.ID>0 AND D.USERID=B.USERID $addtosql $sort $sorthow limit $config[maximum_results]";
$query2 = "select D.ctp, A.*,B.username, C.cltime, C.IID, D.USERID as seller from payments A, members B, orders C, posts D WHERE D.PID=C.PID AND A.OID=C.OID AND C.status='5' AND A.cancel='0' AND A.wd='0' AND A.ID>0 AND D.USERID=B.USERID $addtosql $sort $sorthow limit $pagingstart, $config[items_per_page]";
$executequeryselected = $conn->Execute($queryselected);
$totalposts = $executequeryselected->rowcount();    
if ($totalposts > 0)
{
    if($totalposts<=$config[maximum_results])
    {
        $total = $totalposts;
    }
    else
    {
        $total = $config[maximum_results];
    }
    $toppage = ceil($total/$config[items_per_page]);
    if($toppage==0)
    {
        $xpage=$toppage+1;
    }
    else
    {
        $xpage = $toppage;
    }
    $executequery2 = $conn->Execute($query2);   
    $results = $executequery2->getrows();
    $beginning=$pagingstart+1;
    $ending=$pagingstart+$executequery2->recordcount();
    $pagelinks="";
    $k=1;
    $theprevpage=$currentpage-1;
    $thenextpage=$currentpage+1;
    if ($currentpage > 0)
    {   
        if($currentpage > 1) 
        {
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=1$add1' title='first page'>First</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=$theprevpage$add1'>Previous</a>&nbsp;";
        };
        $counter=0;
        $lowercount = $currentpage-5;
        if ($lowercount <= 0) $lowercount = 1;
        while ($lowercount < $currentpage)
        {
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=$lowercount$add1'>$lowercount</a>&nbsp;";
            $lowercount++;
            $counter++;
        }
        $pagelinks.=$currentpage."&nbsp;";
        $uppercounter = $currentpage+1;
        while (($uppercounter < $currentpage+10-$counter) && ($uppercounter<=$toppage))
        {
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=$uppercounter$add1'>$uppercounter</a>&nbsp;";
            $uppercounter++;
        }
        if($currentpage < $toppage) 
        {
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=$thenextpage$add1'>Next</a>&nbsp;";
            $pagelinks.="<a href='$adminurl/payments_clear.php?page=$toppage$add1' title='last page'>Last</a>&nbsp;";
        };
    }
}
else
{
    $error = "No payments are ready to be cleared yet";
}

$mainmenu = "6";
$submenu = "2";
Stemplate::assign('mainmenu',$mainmenu);
Stemplate::assign('submenu',$submenu);
Stemplate::assign('sorthow',$sorthow);
Stemplate::assign('sortby',$sortby);
Stemplate::assign('currentpage',$currentpage);
STemplate::display("administrator/global_header.tpl");
STemplate::assign('beginning',$beginning);
STemplate::assign('ending',$ending);
STemplate::assign('pagelinks',$pagelinks);
STemplate::assign('total',$total+0);
STemplate::assign('results',$results);
Stemplate::assign('error',$error);
STemplate::display("administrator/payments_clear.tpl");
STemplate::display("administrator/global_footer.tpl");
?>

我喜欢那些贝宝>我想成为贝宝和cashU。每个人都可以从他想要的地方购买。

谢谢。

4

1 回答 1

0

您必须为 CashU 创建自己的课程或点击此链接可能会有所帮助

http://www.opencart.com/index.php?route=extension/extension/info&extension_id=447

于 2013-11-01T18:26:41.693 回答