예제 #1
0
    array_push($allFiles, $imgTypes[$i]);
}
for ($i = 0; $i < count($embedTypes); $i++) {
    array_push($allFiles, $embedTypes[$i]);
}
for ($i = 0; $i < count($htmlTypes); $i++) {
    array_push($allFiles, $htmlTypes[$i]);
}
for ($i = 0; $i < count($phpTypes); $i++) {
    array_push($allFiles, $phpTypes[$i]);
}
for ($i = 0; $i < count($miscTypes); $i++) {
    array_push($allFiles, $miscTypes[$i]);
}
function addArray(&$array, $key, $val)
{
    $tempArray = array($key => $val);
    $array = array_merge($array, $tempArray);
}
// add the default file.gif icon for any file type thatr doesn't have an
// icon set in the list above
for ($i = 0; $i < count($allFiles); $i++) {
    if (!isset($icons[$allFiles[$i]])) {
        addArray($icons, $allFiles[$i], "file.gif");
    }
}
foreach ($icons as $key => $value) {
    echo "\nli.file.icon_{$key}{ background:#2d3034 url(\"icons/{$value}\") 2px 2px no-repeat; }\nli.file_open.icon_{$key}{ background:#DDC url(\"icons/{$value}\") 2px 2px no-repeat; }\n";
}
?>
 
예제 #2
0
 function doPayment($invoice_num, $description, $amount, $recurring, &$processor_vars)
 {
     @($this->x_invoice_num = $invoice_num);
     @($this->x_description = $description);
     @($this->x_amount = $amount);
     addArray($this->__payment_data, "x_po_num", $processor_vars, "po_num");
     addArray($this->__payment_data, "x_tax", $processor_vars, "tax");
     addArray($this->__payment_data, "x_tax_exempt", $processor_vars, "tax_exempt");
     addArray($this->__payment_data, "x_freight", $processor_vars, "freight");
     addArray($this->__payment_data, "x_duty", $processor_vars, "duty");
     addArraySimple($this->__payment_data, "x_recurring_billing", $recurring);
     if ($this->x_method == "cc") {
         addArray($this->__payment_data, "x_card_num", $processor_vars, "card_num");
         addArray($this->__payment_data, "x_exp_date", $processor_vars, "exp_date");
         addArray($this->__payment_data, "x_card_code", $processor_vars, "card_code");
         addArray($this->__payment_data, "x_type", $processor_vars, "charge_type");
         addArray($this->__payment_data, "x_trans_id", $processor_vars, "trans_id");
         addArray($this->__payment_data, "x_auth_code", $processor_vars, "auth_code");
     } elseif ($this->x_method == "echeck") {
         addArraySimple($this->__payment_data, "x_echeck_type", "WEB");
         addArray($this->__payment_data, "x_bank_aba_code", $processor_vars, "bank_aba_code");
         addArray($this->__payment_data, "x_bank_acct_num", $processor_vars, "bank_acct_num");
         addArray($this->__payment_data, "x_bank_acct_type", $processor_vars, "bank_acct_type");
         addArray($this->__payment_data, "x_bank_acct_name", $processor_vars, "bank_acct_name");
         addArray($this->__payment_data, "x_bank_name", $processor_vars, "bank_name");
     }
     $object_vars = get_object_vars($this);
     $this->__addPostArray($object_vars);
     $this->__addPostArray($this->__customer_billing_data);
     $this->__addPostArray($this->__customer_shipping_data);
     $this->__addPostArray($this->__payment_data);
     // join the values together into one url encoded string
     $post_string = "";
     foreach ($this->__post_array as $key => $value) {
         $post_string .= "&" . $key . "=" . $value;
     }
     $post_data = substr($post_string, 1);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, "https://secure.authorize.net/gateway/transact.dll");
     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; www.iTechScripts.com; Developer - Jeremy Johnstone)");
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
     $this->__response_data = curl_exec($ch);
     curl_close($ch);
     return $this->receiveResponseData();
 }