Esempio n. 1
0
function exportAsExcel($query, $HederName)
{
    header("Content-Type: application/vnd.ms-excel; charset=utf-8");
    header("Content-Disposition: attachment; filename=filename.xls");
    header("Pragma: no-cache");
    header("Expires: 0");
    //$HederName=  Array("id","Name");
    //$query = "SELECT id,name FROM  jos_users" ;
    $res = FetchSqltoArray($query);
    foreach ($HederName as $Name) {
        echo $Name . "\t";
    }
    echo "\n\r";
    foreach ($res as $row) {
        foreach ($row as $clom) {
            print_r($clom . "\t");
        }
        echo "\n\r";
    }
}
Esempio n. 2
0
 $qr = "select * from `buyProsses` where `bid`='{$BID}' and `pid`='{$PID}' ";
 $res = FetchSqltoArray($qr);
 if ($res) {
     $bid_server = $res[0]['bid'];
     $pid_server = $res[0]['pid'];
     $rnd_server = $res[0]['rnd'];
     $UNIC = $devID + $rnd_server;
     $UNIC = $UNIC + $pid_server;
     $crcDevpayload = md5($UNIC);
     if (trim($developerPayload) == $crcDevpayload) {
         // all thing is ok
         // buy prosses should end
         // make dl link and send password
         if (trim($purchaseState) == BILLING_RESPONSE_RESULT_OK) {
             $qr = "SELECT `path`,`password` FROM  `product` where `pid`='{$pid_server}' and `productID`='{$productId}'";
             $res = FetchSqltoArray($qr);
             if ($res) {
                 $qr = "DELETE FROM `buyProsses` WHERE `buyProsses`.`bid` = '{$bid_server}' AND `buyProsses`.`pid` = '{$pid_server}'  LIMIT 1";
                 insert($qr);
                 $qr = "INSERT INTO `buyed` (`bid` ,`pid`,`orderID`)VALUES ('" . $bid_server . "',  '" . $pid_server . "',  '" . $orderID . "');";
                 insert($qr);
                 $returnVal = $res[0]['path'] . "aminOmid" . $res[0]['password'];
                 $returnVal = fnEncrypt($returnVal, "1234567890abcdef", $devID);
                 echo $returnVal;
             }
         } else {
             die("PAYMENT NOT ACCEPTED");
         }
     } else {
         die("PayLoad ID not accepted");
     }