function draw_packing_slip_order($order, &$pdf)
{
    global $db;
    require_once DIR_WS_CLASSES . 'currencies.php';
    $currencies = new currencies();
    // prepare order-status pulldown list
    $orders_statuses = array();
    $orders_status_array = array();
    $orders_status = $db->Execute("select orders_status_id, orders_status_name\n                from " . TABLE_ORDERS_STATUS . "\n                where language_id = '" . (int) $_SESSION['languages_id'] . "'");
    while (!$orders_status->EOF) {
        $orders_statuses[] = array('id' => $orders_status->fields['orders_status_id'], 'text' => $orders_status->fields['orders_status_name'] . ' [' . $orders_status->fields['orders_status_id'] . ']');
        $orders_status_array[$orders_status->fields['orders_status_id']] = $orders_status->fields['orders_status_name'];
        $orders_status->MoveNext();
    }
    /* display order information header */
    $pdf->SetFont('Arial', 'B', 6);
    /* order object doesn't include orderid.  added id to info so we can retrieve it here */
    $pdf->Cell(120, 14, ENTRY_ORDER_ID . $order->info['id']);
    $pdf->Cell(236, 14, ENTRY_DATE_PURCHASED . ' ' . zen_date_long($order->info['date_purchased']));
    $pdf->MultiCell(220, 14, ENTRY_PAYMENT_METHOD . ' ' . $order->info['payment_method']);
    $pdf->SetFont('Arial', '', 10);
    if (TAX_ID_NUMBER != '') {
        $pdf->SetFillColor(180, 180, 180);
        $pdf->Cell(30, 14, TABLE_HEADING_QTY, 1, 0, '', 1);
        $pdf->Cell(160, 14, TABLE_HEADING_PRODUCTS, 1, 0, '', 1);
        $pdf->Cell(160, 14, TABLE_HEADING_PRODUCTS_MODEL, 1, 0, '', 1);
        $pdf->Cell(60, 14, TABLE_HEADING_TAX, 1, 0, '', 1);
        $pdf->Cell(78, 14, TABLE_HEADING_PRICE_NO_TAX, 1, 0, 'R', 1);
        $pdf->MultiCell(78, 14, TABLE_HEADING_TOTAL_NO_TAX, 1, 'R', 1);
    } else {
        $pdf->SetFillColor(180, 180, 180);
        $pdf->Cell(25, 14, TABLE_HEADING_QTY, 1, 0, '', 1);
        $pdf->Cell(120, 14, TABLE_HEADING_PRODUCTS, 1, 0, '', 1);
        $pdf->Cell(120, 14, TABLE_HEADING_PRODUCTS_MODEL, 1, 0, '', 1);
        $pdf->Cell(40, 14, TABLE_HEADING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_PRICE_EXCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_PRICE_INCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->Cell(68, 14, TABLE_HEADING_TOTAL_EXCLUDING_TAX, 1, 0, 'R', 1);
        $pdf->MultiCell(68, 14, TABLE_HEADING_TOTAL_INCLUDING_TAX, 1, 'R', 1);
    }
    $pdf->SetFillColor(256, 256, 256);
    if (TAX_ID_NUMBER != '') {
        /* draw order items in table when tax ID number is NOT null*/
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-03-2011) */
            /* break attributes onto new lines */
            $prod_name = $order->products[$i]['name'];
            $prod_attrs = array();
            if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
                for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                    $prod_attrs[] = $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']);
                }
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* Find height of model and Product names */
            $h_model = $pdf->MultiCellHeight(160, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $h = $h_model;
            $h_product_name = $pdf->MultiCellHeight(160, 14, $prod_name, 'LRT', 'L', 1);
            $h = $h_product_name > $h ? $h_product_name : $h;
            /* If cells would be too tall, force a page break */
            if ($pdf->y + $h > $pdf->PageBreakTrigger) {
                $pdf->AddPage();
            }
            /* Get current y, to use with $h_product_name later when placing attributes */
            $y_top = $pdf->getY();
            /* END add (Loose Chicken Software Development 01-07-2011) */
            $pdf->Cell(30, 14, $order->products[$i]['qty'], 'LRT', 0, '', 1);
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Changed Cell to MultiCell for the test wrapping. 
             * Because MultiCell doesn't leave the cursor in the right place:
             * Retrived cursor before drawing cell, and placed it afterward base on origal location and cell width 
             */
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(160, 14, $prod_name, 'LRT', 'L', 1);
            $max_y = $pdf->getY();
            $pdf->setXY($x + 160, $y);
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(160, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $max_y = $pdf->getY() > $max_y ? $pdf->getY() : $max_y;
            $pdf->setXY($x + 160, $y);
            /* END update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Cell(60, 14, ENTRY_NO_TAX, 'LRT', 0, '', 1);
            $pdf->Cell(78, 14, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);
            $pdf->MultiCell(78, 14, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 'R', 1);
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Draw cell borders in case model or product name wrapped and thus would leave blank
             * spaces on the other cells. (This must be transparent so the cells are not overritten)
             */
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            if ($max_y > $y) {
                $h = $max_y - $y;
                $pdf->Cell(30, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(160, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(160, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(60, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(78, $h, '', 'LR', 0, '', 0);
                $pdf->MultiCell(78, $h, '', 'LR', 'J', 0);
                $pdf->setXY($x, $y);
            }
            $max_y_page = $pdf->PageNo();
            /* Place attributes below product_name */
            $pdf->setXY($x, $y_top + $h_product_name);
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetTextColor(40, 40, 40);
            foreach ($prod_attrs as $prod_attr) {
                $pdf->Cell(30, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(160, 10, '  - ' . $prod_attr, 'LR', 0, '', 1);
                $pdf->Cell(160, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(60, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(78, 10, '', 'LR', 0, '', 1);
                $pdf->MultiCell(78, 10, '', 'LR', 'J', 1);
            }
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * If after drawing the attributes the cursor is not as low as after drawing 
             * the model and product name lower the cursor for the drawing of the bottom line 
             */
            if ($max_y > $y && $max_y_page == $pdf->PageNo()) {
                $y = $max_y;
            }
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Line($x, $y, $x + 30 + 160 + 160 + 60 + 78 + 78, $y);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->SetFont('Arial', '', 10);
            /* END modification (Loose Chicken Software Development 01-03-2011) */
        }
    } else {
        /* draw order items in table  when tax ID number IS null*/
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-03-2011) */
            /* break attributes onto new lines */
            $prod_name = $order->products[$i]['name'];
            $prod_attrs = array();
            if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
                for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                    $prod_attrs[] = $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']);
                }
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* Find height of model and Product names */
            $h_model = $pdf->MultiCellHeight(120, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $h = $h_model;
            $h_product_name = $pdf->MultiCellHeight(120, 14, $prod_name, 'LRT', 'L', 1);
            $h = $h_product_name > $h ? $h_product_name : $h;
            /* If cells would be too tall, force a page break */
            if ($pdf->y + $h > $pdf->PageBreakTrigger) {
                $pdf->AddPage();
            }
            /* Get current y, to use with $h_product_name later when placing attributes */
            $y_top = $pdf->getY();
            /* END add (Loose Chicken Software Development 01-07-2011) */
            $pdf->Cell(25, 14, $order->products[$i]['qty'], 'LRT', 0, '', 1);
            /* BEGIN update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Changed Cell to MultiCell for the test wrapping. 
             * Because MultiCell doesn't leave the cursor in the right place:
             * Retrived cursor before drawing cell, and placed it afterward base on origal location and cell width 
             */
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(120, 14, $prod_name, 'LRT', 'L', 1);
            $max_y = $pdf->getY();
            $pdf->setXY($x + 120, $y);
            $y = $pdf->getY();
            $x = $pdf->getX();
            $pdf->MultiCell(120, 14, $order->products[$i]['model'], 'LRT', 'L', 1);
            $max_y = $pdf->getY() > $max_y ? $pdf->getY() : $max_y;
            $pdf->setXY($x + 120, $y);
            /* END update (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /*$pdf->Cell(40, 14, zen_display_tax_value($order->products[$i]['tax']) . '%', 'LRT', 0, 'R', 1);     
                      
            	     $pdf->Cell(68, 14, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);     
                      
            	   
            	    $pdf->Cell(68, 14, $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1);
            		
            		
            		
                       $pdf->Cell(68, 14, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 0, 'R', 1); 
            		
            		
            		    
                       $pdf->MultiCell(68, 14, $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), 'LRT', 'R', 1);
                                */
            $pdf->Cell(40, 14, html_entity_decode(zen_display_tax_value($order->products[$i]['tax']) . '%', ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            if ($order->info['currency'] == 'EUR') {
                $f1 = str_replace('&euro;', '€', $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f1), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f2 = str_replace('&euro;', '€', $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f2), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f3 = str_replace('&euro;', '€', $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->Cell(68, 14, html_entity_decode($f3), 'LRT', 'R', 1);
            } else {
                $pdf->Cell(68, 14, html_entity_decode($currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 0, 'R', 1);
            }
            if ($order->info['currency'] == 'EUR') {
                $f = str_replace('&euro;', '€', $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
                $pdf->MultiCell(68, 14, html_entity_decode($f), 'LRT', 'R', 1);
            } else {
                $pdf->MultiCell(68, 14, html_entity_decode($currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), ENT_QUOTES, "ISO-8859-15"), 'LRT', 'R', 1);
            }
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * Draw cell borders in case model or product name wrapped and thus would leave blank
             * spaces on the other cells. (This must be transparent so the cells are not overritten)
             */
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            if ($max_y > $y) {
                $h = $max_y - $y;
                $pdf->Cell(25, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(120, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(120, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(40, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->Cell(68, $h, '', 'LR', 0, '', 0);
                $pdf->MultiCell(68, $h, '', 'LR', 'J', 0);
                $pdf->setXY($x, $y);
            }
            $max_y_page = $pdf->PageNo();
            /* Place attributes below product_name */
            $pdf->setXY($x, $y_top + $h_product_name);
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->SetFont('Arial', '', 8);
            $pdf->SetTextColor(40, 40, 40);
            foreach ($prod_attrs as $prod_attr) {
                $pdf->Cell(25, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(120, 10, '  - ' . $prod_attr, 'LR', 0, '', 1);
                $pdf->Cell(120, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(40, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->Cell(68, 10, '', 'LR', 0, '', 1);
                $pdf->MultiCell(68, 10, '', 'LR', 'J', 1);
            }
            $x = $pdf->GetX();
            $y = $pdf->GetY();
            /* BEGIN add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            /* 
             * If after drawing the attributes the cursor is not as low as after drawing 
             * the model and product name lower the cursor for the drawing of the bottom line 
             */
            if ($max_y > $y && $max_y_page == $pdf->PageNo()) {
                $y = $max_y;
            }
            /* END add (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
            $pdf->Line($x, $y, $x + 25 + 120 + 120 + 40 + 68 + 68 + 68 + 68, $y);
            $pdf->SetTextColor(0, 0, 0);
            $pdf->SetFont('Arial', '', 10);
            /* END modification (Loose Chicken Software Development 01-03-2011) */
        }
    }
    /* order cost summary */
    $pdf->Ln();
    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
        $title = strip_tags($order->totals[$i]['title']);
        $text = strip_tags($order->totals[$i]['text']);
        /* $pdf->Cell(516, 14, $title, 0, 0, 'R');             
           $pdf->MultiCell(50, 14, $text, 0, 'R'); */
        $pdf->Cell(516, 14, html_entity_decode($title, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        //echo substr($text,0,5);
        if (substr($text, 0, 5) == '&euro') {
            $a = str_replace('&euro;', '€', $text);
            $pdf->MultiCell(50, 14, html_entity_decode($a, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        } else {
            $pdf->MultiCell(50, 14, html_entity_decode($text, ENT_QUOTES, "ISO-8859-15"), 0, 0, 'R');
        }
    }
    /* order balance */
    /*$orders_balance = $db->Execute("select orders_id , balance_due
    				from " . TABLE_ORDERS . "
    					where orders_id = '" . zen_db_input($order->info['id']) . "'
    					order by orders_id");
    		$balance_due = $orders_balance->fields['balance_due'];*/
    $pdf->SetFont('Arial', 'B', '');
    require_once DIR_WS_CLASSES . 'super_order.php';
    $so = new super_order($order->info['id']);
    $pdf->Cell(516, 14, 'Amount Paid: ', 0, 0, 'R');
    // $pdf->MultiCell(50, 14, $currencies->format($so->amount_applied), 0, 'R');
    //  $pdf->MultiCell(50, 14, $currencies->format($balance_due), 0, 'R');
    // $pdf->MultiCell(50, 14, $currencies->format($so->balance_due), 0, 'R');
    $var1 = substr($currencies->format($so->amount_applied), 0, 5);
    if ($var1 == '&euro') {
        $pdf->MultiCell(50, 14, '€' . $so->amount_applied, 0, 'R');
    } else {
        $pdf->MultiCell(50, 14, html_entity_decode($currencies->format($so->amount_applied), ENT_QUOTES, "ISO-8859-15"), 0, 'R');
    }
    $pdf->Cell(516, 14, 'Balance Due:', 0, 0, 'R');
    $var = substr($currencies->format($so->balance_due), 0, 5);
    if ($var == '&euro') {
        $pdf->MultiCell(50, 14, '€' . $so->balance_due, 0, 'R');
    } else {
        $pdf->MultiCell(50, 14, html_entity_decode($currencies->format($so->balance_due), ENT_QUOTES, "ISO-8859-15"), 0, 'R');
    }
    //$pdf->SetFont('Arial','', 7);
    if (ORDER_COMMENTS_PACKING_SLIP > 0) {
        $pdf->Ln();
        $pdf->SetFillColor(180, 180, 180);
        $pdf->SetFont('Arial', 'B', 10);
        $pdf->MultiCell(576, 14, 'Order Comments & Status', 'B');
        $pdf->SetFont('Arial', '', 7);
        $pdf->SetFillColor(256, 256, 256);
        $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments\n                    from " . TABLE_ORDERS_STATUS_HISTORY . "\n                    where orders_id = '" . zen_db_input($order->info['id']) . "' and customer_notified >= 0\n                    order by date_added");
        $count_comments = 0;
        if ($orders_history->RecordCount() >= 1 && ORDER_COMMENTS_PACKING_SLIP == 1) {
            while (!$orders_history->EOF) {
                if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false) {
                    $count_comments++;
                    $pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
                    $pdf->MultiCell(456, 14, $orders_status_array[$orders_history->fields['orders_status_id']]);
                    $pdf->Cell(27, 14, '', 0, 0, '', 1);
                    /* BEGIN modify (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
                    /* removed function zen_db_output, which was converting output into html code */
                    //$pdf->MultiCell(549, 14, (zen_db_output($orders_history->fields['comments'])), 'B');
                    $pdf->MultiCell(549, 14, $orders_history->fields['comments'], 'B');
                    /* END modify (Loose Chicken Software Development, david@loosechicken.com 01-07-2011) */
                    $pdf->SetLineWidth(0.5);
                    $pdf->Line(18, $pdf->GetY(), 594, $pdf->GetY());
                }
                $orders_history->MoveNext();
                /*if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
                     break;
                  } */
            }
        }
        if ($count_comments == 0) {
            $pdf->MultiCell(576, 14, TEXT_NO_ORDER_HISTORY, 'B');
        }
    }
}
Esempio n. 2
0
     break;
 case 'p2d':
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_PENDING_TO_DEPOSIT_POINT . '</strong>');
     $contents = array('form' => zen_draw_form('points', FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=p2dconfirm', 'post', '', true));
     $contents[] = array('text' => TEXT_INFO_PENDING_TO_DEPOSIT_INTRO . '<br /><br /><strong>' . ENTRY_POINT_ID . $pInfo->id . '<br />' . $pInfo->firstname . '&nbsp;' . $pInfo->lastname . ($pInfo->company != '' ? '<br />' . $pInfo->company : '') . '<br />' . $pInfo->description . '</strong>');
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id, 'NONSSL') . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>');
     break;
 case 'd2p':
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_DEPOSIT_TO_PENDING_POINT . '</strong>');
     $contents = array('form' => zen_draw_form('points', FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=d2pconfirm', 'post', '', true));
     $contents[] = array('text' => TEXT_INFO_DEPOSIT_TO_PENDING_INTRO . '<br /><br /><strong>' . ENTRY_POINT_ID . $pInfo->id . '<br />' . $pInfo->firstname . '&nbsp;' . $pInfo->lastname . ($pInfo->company != '' ? '<br />' . $pInfo->company : '') . '<br />' . $pInfo->description . '</strong>');
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id, 'NONSSL') . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>');
     break;
 default:
     if (isset($pInfo) && is_object($pInfo)) {
         $heading[] = array('text' => '<strong>[' . $pInfo->id . ']&nbsp;&nbsp;' . zen_datetime_short($pInfo->created_at) . '</strong>');
         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=delete', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
         if ($pInfo->status == 1) {
             $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=statusoff', 'NONSSL') . '">' . TEXT_STATUS_OFF . '</a>');
             if ($pInfo->pending > 0) {
                 $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=p2d') . '">' . TEXT_PENDING_TO_DEPOSIT . '</a>');
             } elseif ($pInfo->deposit > 0) {
                 $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=d2p') . '">' . TEXT_DEPOSIT_TO_PENDING . '</a>');
             }
         } else {
             $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ADDON_MODULES_ADMIN, zen_get_all_get_params(array('module', 'pID', 'action')) . 'module=point_base&pID=' . $pInfo->id . '&action=statuson', 'NONSSL') . '">' . TEXT_STATUS_ON . '</a>');
         }
         $contents[] = array('text' => '<br />' . TEXT_DATE_POINT_CREATED . ' ' . zen_date_short($pInfo->created_at));
         if (zen_not_null($pInfo->updated_at)) {
             $contents[] = array('text' => TEXT_DATE_POINT_UPDATED . ' ' . zen_date_short($pInfo->updated_at));
         }
Esempio n. 3
0
function zen_get_system_information()
{
    global $db;
    // determine database size stats
    $indsize = 0;
    $datsize = 0;
    $result = $db->Execute("SHOW TABLE STATUS" . (DB_PREFIX == '' ? '' : " LIKE '" . str_replace('_', '\\_', DB_PREFIX) . "%'"));
    while (!$result->EOF) {
        $datsize += $result->fields['Data_length'];
        $indsize += $result->fields['Index_length'];
        $result->MoveNext();
    }
    $mysql_in_strict_mode = false;
    $result = $db->Execute("SHOW VARIABLES LIKE 'sql\\_mode'");
    while (!$result->EOF) {
        if (strstr($result->fields['Value'], 'strict_')) {
            $mysql_in_strict_mode = true;
        }
        $result->MoveNext();
    }
    $db_query = $db->Execute("select now() as datetime");
    $errnum = 0;
    $system = $host = $kernel = $output = '';
    list($system, $host, $kernel) = array('', $_SERVER['SERVER_NAME'], php_uname());
    $uptime = DISPLAY_SERVER_UPTIME == 'true' ? 'Unsupported' : 'Disabled/Unavailable';
    // check to see if "exec()" is disabled in PHP -- if not, get additional info via command line
    $php_disabled_functions = '';
    $exec_disabled = false;
    $php_disabled_functions = @ini_get("disable_functions");
    if ($php_disabled_functions != '') {
        if (in_array('exec', preg_split('/,/', str_replace(' ', '', $php_disabled_functions)))) {
            $exec_disabled = true;
        }
    }
    if (!$exec_disabled) {
        @exec('uname -a 2>&1', $output, $errnum);
        if ($errnum == 0 && sizeof($output)) {
            list($system, $host, $kernel) = preg_split('/[\\s,]+/', $output[0], 5);
        }
        $output = '';
        if (DISPLAY_SERVER_UPTIME == 'true') {
            @exec('uptime 2>&1', $output, $errnum);
            if ($errnum == 0) {
                $uptime = $output[0];
            }
        }
    }
    return array('date' => zen_datetime_short(date('Y-m-d H:i:s')), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => $uptime, 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : '', 'db_server' => DB_SERVER, 'db_ip' => gethostbyname(DB_SERVER), 'db_version' => 'MySQL ' . $db->get_server_info(), 'db_date' => zen_datetime_short($db_query->fields['datetime']), 'php_memlimit' => @ini_get('memory_limit'), 'php_safemode' => version_compare(PHP_VERSION, 5.4, '<') ? strtolower(@ini_get('safe_mode')) : '', 'php_file_uploads' => strtolower(@ini_get('file_uploads')), 'php_uploadmaxsize' => @ini_get('upload_max_filesize'), 'php_postmaxsize' => @ini_get('post_max_size'), 'database_size' => $datsize, 'index_size' => $indsize, 'mysql_strict_mode' => $mysql_in_strict_mode);
}
Esempio n. 4
0
function zen_get_system_information()
{
    global $db;
    // determine database size stats
    $indsize = 0;
    $datsize = 0;
    $result = $db->Execute("SHOW TABLE STATUS" . (DB_PREFIX == '' ? '' : " LIKE '" . str_replace('_', '\\_', DB_PREFIX) . "%'"));
    while (!$result->EOF) {
        $datsize += $result->fields['Data_length'];
        $indsize += $result->fields['Index_length'];
        $result->MoveNext();
    }
    $mysql_in_strict_mode = false;
    $result = $db->Execute("SHOW VARIABLES LIKE 'sql\\_mode'");
    while (!$result->EOF) {
        if (strstr($result->fields['Value'], 'strict_')) {
            $mysql_in_strict_mode = true;
        }
        $result->MoveNext();
    }
    $db_query = $db->Execute("select now() as datetime");
    list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);
    if ($host == '') {
        list($system, $host, $kernel) = array('', $_SERVER['SERVER_NAME'], php_uname());
    }
    return array('date' => zen_datetime_short(date('Y-m-d H:i:s')), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => DISPLAY_SERVER_UPTIME == 'true' ? @exec('uptime 2>&1') : 'Unchecked', 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : '', 'db_server' => DB_SERVER, 'db_ip' => gethostbyname(DB_SERVER), 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''), 'db_date' => zen_datetime_short($db_query->fields['datetime']), 'php_memlimit' => @ini_get('memory_limit'), 'php_safemode' => strtolower(@ini_get('safe_mode')), 'php_file_uploads' => strtolower(@ini_get('file_uploads')), 'php_uploadmaxsize' => @ini_get('upload_max_filesize'), 'php_postmaxsize' => @ini_get('post_max_size'), 'database_size' => $datsize, 'index_size' => $indsize, 'mysql_strict_mode' => $mysql_in_strict_mode);
}
Esempio n. 5
0
</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php 
$heading = array();
$contents = array();
switch ($_GET['action']) {
    case 'release':
        $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . zen_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));
        $contents[] = array('align' => 'center', 'text' => zen_draw_form('gv_release', FILENAME_GV_QUEUE, 'action=confirmrelease&page=' . $_GET['page']) . zen_image_submit('button_confirm_red.gif', IMAGE_CONFIRM) . '<input type="hidden" name="gid" value="' . $gInfo->unique_id . '" /></form>' . '<a href="' . zen_href_link('gv_queue.php', 'action=cancel&gid=' . $gInfo->unique_id . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        //      $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link('gv_queue.php', 'action=confirmrelease&gid=' . $gInfo->unique_id . '&page=' . $_GET['page'],'NONSSL') . '">' . zen_image_button('button_confirm_red.gif', IMAGE_CONFIRM) . '</a> <a href="' . zen_href_link('gv_queue.php', 'action=cancel&gid=' . $gInfo->unique_id . '&page=' . $_GET['page'],'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
    default:
        $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . zen_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));
        if ($gv_list->RecordCount() == 0) {
            $contents[] = array('align' => 'center', 'text' => TEXT_GV_NONE);
        } else {
            $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link('gv_queue.php', 'action=release&gid=' . $gInfo->unique_id . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image_button('button_release_gift.gif', IMAGE_RELEASE) . '</a>');
            // quick link to order
            $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '90%', '3'));
            $contents[] = array('align' => 'center', 'text' => TEXT_EDIT_ORDER . $gInfo->order_id);
            $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $gInfo->order_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_order.gif', IMAGE_ORDER) . '</a>');
        }
        break;
}
if (zen_not_null($heading) && zen_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
Esempio n. 6
0
            <td class="smallText" align="center"><strong><?php 
    echo TABLE_HEADING_STATUS;
    ?>
</strong></td>
            <td class="smallText" align="center"><strong><?php 
    echo TABLE_HEADING_COMMENTS;
    ?>
</strong></td>
          </tr>
<?php 
    $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments\n                                    from " . TABLE_ORDERS_STATUS_HISTORY . "\n                                    where orders_id = '" . zen_db_input($oID) . "' and customer_notified >= 0\n                                    order by date_added");
    if ($orders_history->RecordCount() > 0) {
        $count_comments = 0;
        while (!$orders_history->EOF) {
            $count_comments++;
            echo '          <tr>' . "\n" . '            <td class="smallText" align="center" valign="top">' . zen_datetime_short($orders_history->fields['date_added']) . '</td>' . "\n";
            echo '            <td class="smallText" valign="top">' . $orders_status_array[$orders_history->fields['orders_status_id']] . '</td>' . "\n";
            echo '            <td class="smallText" valign="top">' . ($orders_history->fields['comments'] == '' ? TEXT_NONE : nl2br(zen_db_output($orders_history->fields['comments']))) . '&nbsp;</td>' . "\n" . '          </tr>' . "\n";
            $orders_history->MoveNext();
            if (ORDER_COMMENTS_INVOICE == 1 && $count_comments >= 1) {
                break;
            }
        }
    } else {
        echo '          <tr>' . "\n" . '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . '          </tr>' . "\n";
    }
    ?>
        </table></td>
      </tr>
<?php 
}
Esempio n. 7
0
                        <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
                        <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></td>
                	<td class="dataTableHeadingContent" align="left" colspan="2"><?php echo TABLE_HEADING_ORDER_STATUS; ?></td>
                      </tr>
<?php
    while (!$orders->EOF) {
?> 
		<tr class="dataTableRow" onMouseOver="rowOverEffect(this);this.style.cursor='default'" onMouseOut="rowOutEffect(this)">
                        <td class="dataTableContent" align="left"><?php 
			echo zen_draw_checkbox_field('batch_order_numbers[' . $orders->fields['orders_id'] . ']', 'yes', $checked);
                  echo $orders->fields['orders_id'];
                ?></td>
                        <td class="dataTableContent" align="right"><?php echo '[' . $orders->fields['customers_id'] . ']'; ?></td>
                        <td class="dataTableContent" align="left"><?php echo $orders->fields['customers_name']; ?></td>
                        <td class="dataTableContent" align="right"><?php echo $currencies->format($orders->fields['order_total']); ?></td>
                        <td class="dataTableContent" align="center"><?php echo zen_datetime_short($orders->fields['date_purchased']); ?></td>
                        <td class="dataTableContent" align="left"><?php echo $orders->fields['payment_method']; ?></td>
                        <td class="dataTableContent" align="left"><?php echo $orders->fields['orders_status_name']; ?></td>
						
                        <td class="dataTableContent" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $orders->fields['orders_id'] . '&action=edit', 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_details.gif', ICON_ORDER_DETAILS) . '</a>&nbsp'; ?></td>
                      </tr>
					  
					  
<?php
      $orders->MoveNext();
    }
  }  // END if ($orders->RecordCount() > 0)
?>
                </form>
                  </table></td>
                </tr>
Esempio n. 8
0
            <td class="smallText" align="left"><strong><?php echo TABLE_HEADING_DATE_ADDED; ?></strong></td>
            <td class="smallText" align="left"><strong><?php echo TABLE_HEADING_STATUS; ?></strong></td>
            <td class="smallText" align="left"><strong><?php echo TABLE_HEADING_COMMENTS; ?></strong></td>
          </tr>

<?php
    $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
                                    from " . TABLE_ORDERS_STATUS_HISTORY . "
                                    where orders_id = '" . zen_db_input($oID) . "' and customer_notified >= 0
                                    order by date_added");
    if ($orders_history->RecordCount() > 0) {
      $count_comments=0;
      while (!$orders_history->EOF) {
        $count_comments++;
        echo '          <tr>' . "\n" .
             '            <td class="smallText" valign="top" align="left">' . zen_datetime_short($orders_history->fields['date_added']) . '</td>' . "\n";
        echo '            <td class="smallText" valign="top" align="left">' . $orders_status_array[$orders_history->fields['orders_status_id']] . '</td>' . "\n";
        echo '            <td class="smallText" valign="top" align="left">' . ($orders_history->fields['comments'] == '' ? TEXT_NONE : nl2br(zen_db_output($orders_history->fields['comments']))) . '&nbsp;</td>' . "\n" .
             '          </tr>' . "\n";
        $orders_history->MoveNext();

        if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
     //    break;
        }
      }
    } else {
        echo '          <tr>' . "\n" .
             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
             '          </tr>' . "\n";
    }
?>
<?php 
    }
    // END if (sizeof($sr->timeframe) > 1)
    ?>
    </table></td>
  </tr>
<?php 
    if ($output_format == 'print') {
        ?>
  <tr>
    <td><?php 
        echo zen_draw_separator('pixel_trans.gif', 30, 20);
        ?>
</td>
    <td align="right" valign="bottom" class="smallText"><?php 
        echo TEXT_REPORT_TIMESTAMP . zen_datetime_short(date("Y-m-d H:i:s"));
        ?>
</td>
  </tr>
<?php 
    } elseif ($output_format == 'display') {
        $parse_end = get_microtime();
        $parse_time = $parse_end - $parse_start;
        ?>
  <tr>
    <td colspan="2" align="right"><?php 
        echo '<a href="' . zen_href_link(FILENAME_STATS_SALES_REPORT, zen_get_all_get_params(array('output_format', 'auto_print')) . 'output_format=print&auto_print=1', 'NONSSL') . '" title="' . TEXT_PRINT_FORMAT_TITLE . '"><span class="smallText">' . zen_image(DIR_WS_IMAGES . 'icons/icon_print.gif') . '&nbsp;' . TEXT_PRINT_FORMAT . '</span></a>';
        ?>
</td>
  </tr>
  <tr>
Esempio n. 10
0
</td>
          </tr>
        </table></td>
<?php 
        // create sidebox
        $heading = array();
        $contents = array();
        if (isset($archive) && is_object($archive)) {
            // get the customer ID
            $customer = $db->Execute("select customers_id from " . TABLE_CUSTOMERS . "\n                              where customers_email_address like '" . $archive->email_to_address . "'");
            if ($customer->RecordCount() == 1) {
                $mail_button = '<a href="' . zen_href_link(FILENAME_MAIL, 'origin=' . FILENAME_EMAIL_HISTORY . '&mode=NONSSL&selected_box=tools&customer=' . $archive->email_to_address . '&cID=' . $customer->fields['customers_id'], 'NONSSL') . '">' . zen_image_button('button_email.gif', IMAGE_EMAIL) . '</a>';
            } else {
                $mail_button = '<a href="mailto:' . $archive->email_to_address . '">' . zen_image_button('button_email.gif', IMAGE_EMAIL) . '</a>';
            }
            $heading[] = array('text' => '<b>' . TEXT_ARCHIVE_ID . $archive->archive_id . '&nbsp; - &nbsp;' . zen_datetime_short($archive->date_sent) . '</b>');
            $contents[] = array('align' => 'center', 'text' => $mail_button . '&nbsp;<a href="' . zen_href_link(FILENAME_EMAIL_HISTORY, 'archive_id=' . $archive->archive_id . '&action=resend_confirm') . '">' . zen_image_button('button_resend.gif', IMAGE_ICON_RESEND) . '</a>');
            // Delete button
            $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_EMAIL_HISTORY, 'archive_id=' . $archive->archive_id . '&action=delete_confirm') . '">' . zen_image_button('button_delete.gif', IMAGE_ICON_DELETE) . '</a>' . $html_button);
            $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_EMAIL_HISTORY, 'archive_id=' . $archive->archive_id . '&action=prev_text') . '" TARGET="_blank">' . zen_image_button('button_prev_text.gif', IMAGE_ICON_TEXT) . '</a>' . $html_button);
            if ($archive->email_html != '') {
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_EMAIL_HISTORY, 'archive_id=' . $archive->archive_id . '&action=prev_html') . '" TARGET="_blank">' . zen_image_button('button_prev_html.gif', IMAGE_ICON_HTML) . '</a>');
            }
            $contents[] = array('text' => '<br>' . zen_draw_separator());
            $contents[] = array('text' => '<br><b>' . TEXT_EMAIL_MODULE . '</b>' . $archive->module);
            $contents[] = array('text' => '<br><b>' . TEXT_EMAIL_TO . '</b>' . $archive->email_to_name . ' [' . $archive->email_to_address . ']');
            $contents[] = array('text' => '<b>' . TEXT_EMAIL_FROM . '</b>' . $archive->email_from_name . ' [' . $archive->email_from_address . ']');
            $contents[] = array('text' => '<b>' . TEXT_EMAIL_DATE_SENT . '</b>' . $archive->date_sent);
            $contents[] = array('text' => '<b>' . TEXT_EMAIL_SUBJECT . '</b>' . $archive->email_subject);
            $contents[] = array('text' => '<br><b>' . TEXT_EMAIL_EXCERPT . '</b>');
            $contents[] = array('text' => '<br>' . nl2br(substr($archive->email_text, 0, MESSAGE_SIZE_LIMIT)) . MESSAGE_LIMIT_BREAK);
                        ?>
</td>
                        <td class="dataTableContent" align="right"><?php 
                        echo '[' . $orders->fields['customers_id'] . ']';
                        ?>
</td>
                        <td class="dataTableContent" align="left"><?php 
                        echo $orders->fields['customers_name'];
                        ?>
</td>
                        <td class="dataTableContent" align="right"><?php 
                        echo $currencies->format($orders->fields['order_total']);
                        ?>
</td>
                        <td class="dataTableContent" align="center"><?php 
                        echo zen_datetime_short($orders->fields['date_purchased']);
                        ?>
</td>
                        <td class="dataTableContent" align="left"><?php 
                        echo $orders->fields['payment_method'];
                        ?>
</td>
                        <td class="dataTableContent" align="left"><?php 
                        echo $orders->fields['orders_status_name'];
                        ?>
</td>
						
                        <td class="dataTableContent" align="right"><?php 
                        echo '<a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $orders->fields['orders_id'] . '&action=edit', 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_details.gif', ICON_ORDER_DETAILS) . '</a>&nbsp';
                        ?>
</td>
Esempio n. 12
0
        break;
    case 'edit':
        break;
    case 'delete':
        break;
    default:
        if (is_object($ipnInfo)) {
            $heading[] = array('text' => '<strong>' . TEXT_INFO_PAYPAL_IPN_HEADING . ' #' . $ipnInfo->paypal_ipn_id . '</strong>');
            $ipn = $db->Execute("select * from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . $ipnInfo->paypal_ipn_id . "'");
            $ipn_count = $ipn->RecordCount();
            $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('ipnID', 'action')) . 'oID=' . $ipnInfo->order_id . '&' . 'ipnID=' . $ipnInfo->paypal_ipn_id . '&action=edit' . '&referer=ipn') . '">' . zen_image_button('button_orders.gif', IMAGE_ORDERS) . '</a>');
            $contents[] = array('text' => '<br>' . TABLE_HEADING_NUM_HISTORY_ENTRIES . ': ' . $ipn_count);
            $count = 1;
            while (!$ipn->EOF) {
                $contents[] = array('text' => '<br>' . TABLE_HEADING_ENTRY_NUM . ': ' . $count);
                $contents[] = array('text' => TABLE_HEADING_DATE_ADDED . ': ' . zen_datetime_short($ipn->fields['date_added']));
                $contents[] = array('text' => TABLE_HEADING_TRANS_ID . ': ' . $ipn->fields['txn_id']);
                $contents[] = array('text' => TABLE_HEADING_PAYMENT_STATUS . ': ' . $ipn->fields['payment_status']);
                $contents[] = array('text' => TABLE_HEADING_PENDING_REASON . ': ' . $ipn->fields['pending_reason']);
                $count++;
                $ipn->MoveNext();
            }
        }
        break;
}
if (zen_not_null($heading) && zen_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
Esempio n. 13
0
                ?>
</td>
        <td class="refundContent" align="right"><strong><?php 
                echo '-' . $currencies->format($so->refund[$f]['amount']);
                ?>
</strong></td>
        <td class="refundContent" align="center"><?php 
                echo $so->full_type($so->refund[$f]['type']);
                ?>
</td>
        <td class="refundContent" align="center"><?php 
                echo zen_datetime_short($so->refund[$f]['posted']);
                ?>
</td>
        <td class="refundContent" align="center"><?php 
                echo zen_datetime_short($so->refund[$f]['modified']);
                ?>
</td>
      </tr>
<?php 
            }
        }
    }
    // END if ($so->refund)
    ?>
    </table></td>
  </tr>
<?php 
}
// END else
?>
Esempio n. 14
0
              }
              else {
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
      </tr>
<?php
              }
?>
      <tr class="refundRow">
        <td class="refundContent" align="left"><?php echo $so->refund[$f]['number']; ?></td>
        <td class="refundContent" align="left"><?php echo $so->refund[$f]['name']; ?></td>
        <td class="refundContent" align="right"><strong><?php echo '-' . $currencies->format($so->refund[$f]['amount']); ?></strong></td>
        <td class="refundContent" align="center"><?php echo $so->full_type($so->refund[$f]['type']); ?></td>
        <td class="refundContent" align="left"><?php echo zen_datetime_short($so->refund[$f]['posted']); ?></td>
        <td class="refundContent" align="left"><?php echo zen_datetime_short($so->refund[$f]['modified']); ?></td>
      </tr>
<?php
            }
          }
        }  // END if ($so->refund)
?>
    </table></td>
  </tr>
<?php
      }  // END else
?>
</table>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
            ?>
</strong></td>
      </tr>
<?php 
            while (!$refund->EOF) {
                ?>
      <tr class="refundRow" width="100%" cellspacing="0" cellpadding="0" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php 
                echo zen_href_link(FILENAME_SUPER_ORDERS, 'oID=' . $refund->fields['orders_id'] . '&action=edit');
                ?>
'">
        <td class="dataTableContent" align="left"><?php 
                echo $refund->fields['orders_id'];
                ?>
</td>
        <td class="dataTableContent" align="center"><?php 
                echo zen_datetime_short($refund->fields['date_posted']);
                ?>
</td>
        <td class="dataTableContent" align="left"><?php 
                echo $refund->fields['refund_number'];
                ?>
</td>
        <td class="dataTableContent" align="left"><?php 
                echo $refund->fields['refund_name'];
                ?>
</td>
        <td class="dataTableContent" align="center"><?php 
                echo $refund->fields['refund_type'];
                ?>
</td>
        <td class="dataTableContent" align="left">&nbsp;</td>
$output .= $ipn->fields['payment_status'] . "\n";
$output .= '</td></tr>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_PENDING_REASON . "\n";
$output .= '</td><td class="main">' . "\n";
$output .= $ipn->fields['pending_reason'] . "\n";
$output .= '</td></tr>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_INVOICE . "\n";
$output .= '</td><td class="main">' . "\n";
$output .= $ipn->fields['invoice'] . "\n";
$output .= '</td></tr>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_DATE . "\n";
$output .= '</td><td class="main">' . "\n";
$output .= zen_datetime_short($ipn->fields['payment_date']) . "\n";
$output .= '</td></tr>' . "\n";
$output .= '</table></td>' . "\n";
$output .= '<td valign="top"><table>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_CURRENCY . "\n";
$output .= '</td><td class="main">' . "\n";
$output .= $ipn->fields['mc_currency'] . "\n";
$output .= '</td></tr>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_GROSS_AMOUNT . "\n";
$output .= '</td><td class="main">' . "\n";
$output .= $ipn->fields['mc_gross'] . "\n";
$output .= '</td></tr>' . "\n";
$output .= '<tr><td class="main">' . "\n";
$output .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_FEE . "\n";
              </tr>
            </table></td>
<?php 
    $heading = array();
    $contents = array();
    switch ($action) {
        case 'delete':
            $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_DELETE_ORDER . $oInfo->orders_id . '</strong>');
            $contents = array('form' => zen_draw_form('orders', FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm', 'post', '', true));
            $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br /><br /><strong>' . ENTRY_ORDER_ID . $oInfo->orders_id . '<br />' . $oInfo->order_total . '<br />' . $oInfo->customers_name . '</strong>');
            $contents[] = array('text' => '<br />' . zen_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
            $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id, $request_type) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        default:
            if (isset($oInfo) && is_object($oInfo)) {
                $heading[] = array('text' => '<strong>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . zen_datetime_short($oInfo->date_purchased) . '</strong>');
                //        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', $request_type) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', $request_type) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                //        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . zen_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . zen_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . zen_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
                //Begin - Add Edit Order button to order order list page
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDER_EDIT, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>
                                                      &nbsp;<a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>
                                                      &nbsp;<a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SUPER_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . zen_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a>
                                                      &nbsp;<a href="' . zen_href_link(FILENAME_SUPER_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . zen_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
                //End - Add Edit Order button to order order list page
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_SUPER_DATA_SHEET, 'oID=' . $oInfo->orders_id) . '" target="_blank">' . zen_image_button('btn_print.gif', ICON_ORDER_PRINT) . '</a>&nbsp;<a href="' . zen_href_link(FILENAME_SUPER_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', $request_type) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                $contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . zen_date_short($oInfo->date_purchased));
                if (zen_not_null($oInfo->last_modified)) {
                    $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . zen_date_short($oInfo->last_modified));
                }
                $contents[] = array('text' => '<br />' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);
Esempio n. 18
0
function zen_get_system_information()
{
    global $db, $_SERVER;
    $db_query = $db->Execute("select now() as datetime");
    list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);
    return array('date' => zen_datetime_short(date('Y-m-d H:i:s')), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => DISPLAY_SERVER_UPTIME == 'true' ? @exec('uptime') : '', 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : '', 'db_server' => DB_SERVER, 'db_ip' => gethostbyname(DB_SERVER), 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''), 'db_date' => zen_datetime_short($db_query->fields['datetime']));
}
Esempio n. 19
0
 function mark_cancelled()
 {
     global $db;
     if ($this->status == false || $this->status == "completed") {
         $db->Execute("UPDATE " . TABLE_ORDERS . " SET date_cancelled = now() WHERE orders_id = '" . $this->oID . "'");
         if ($this->status == "completed") {
             $db->Execute("UPDATE " . TABLE_ORDERS . " SET date_completed = NULL WHERE orders_id = '" . $this->oID . "'");
         }
         if (STATUS_ORDER_CANCELLED != 0) {
             update_status($this->oID, STATUS_ORDER_CANCELLED);
         }
         $this->status = "cancelled";
         $this->status_date = zen_datetime_short(date('Y-m-d H:i:s'));
     }
 }
     $customer_name = "Guest";
 }
 if ($lt_row->fields['referrer'] == '') {
     $referrer = 'Direct Access / Bookmark';
 } else {
     $referrer = '<a href="' . $lt_row->fields['referrer'] . '?' . $lt_row->fields['referrer_query_string'] . '" target="_blank">' . urldecode($lt_row->fields['referrer'] . '?' . $lt_row->fields['referrer_query_string']) . '</a>';
 }
 echo '<table width="100%" border=0 cellspacing=0 cellpadding=1 style="border:1px solid #000;">';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_IP . '</b> <a href="http://whatismyipaddress.com/ip/' . $lt_row->fields['ip_address'] . '" target="_blank">' . $lt_row->fields['ip_address'] . '</a>' . ' (' . gethostbyaddr($lt_row->fields['ip_address']) . ') ' . zen_image(DIR_WS_IMAGES . 'flags/' . $lt_row->fields['country_code'] . '.gif') . ' ' . $lt_row->fields['countries_name'] . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_CUSTOMER_BROWSER_IDENT . '</b> ' . $lt_row->fields['browser_string'] . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_NAME . '</b> ' . $customer_name . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_REFFERED_BY . '</b> ' . $referrer . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_LANDING_PAGE . '</b> ' . '<a href="' . $lt_row->fields['landing_page'] . '" target="_blank" title="' . $lt_row->fields['landing_page_name'] . '">' . $lt_row->fields['landing_page_name'] . '</a>' . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_LAST_PAGE_VIEWED . '</b> ' . '<a href="' . $lt_row->fields['exit_page'] . '" target="_blank" title="' . $lt_row->fields['exit_page_name'] . '">' . $lt_row->fields['exit_page_name'] . '</a>' . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_TIME_ARRIVED . '</b> ' . zen_datetime_short($lt_row->fields['time_arrived']) . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_LAST_CLICK . '</b> ' . zen_datetime_short($lt_row->fields['last_click']) . '</td></tr>';
 $time_on_site = strtotime($lt_row->fields['last_click']) - strtotime($lt_row->fields['time_arrived']);
 $hours_on_site = floor($time_on_site / 3600);
 $minutes_on_site = floor(($time_on_site - $hours_on_site * 3600) / 60);
 $seconds_on_site = $time_on_site - $hours_on_site * 3600 - $minutes_on_site * 60;
 $time_on_site = $hours_on_site . 'hrs ' . $minutes_on_site . 'mins ' . $seconds_on_site . ' seconds';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_TIME_ON_SITE . '</b> ' . $time_on_site . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_NUMBER_OF_CLICKS . '</b> ' . $lt_row->fields['num_clicks'] . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_ADDED_CART . '</b> ' . $lt_row->fields['added_cart'] . '</td></tr>';
 echo '<tr><td class="dataTableContent"><b>' . TABLE_TEXT_COMPLETED_PURCHASE . '</b> ' . $lt_row->fields['completed_purchase'] . '</td></tr>';
 if ($lt_row->fields['completed_purchase'] == 'true') {
     $order_result = $db->Execute("SELECT ot.text AS order_total FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot WHERE o.orders_id=ot.orders_id AND o.orders_id = '" . $lt_row->fields['order_id'] . "' AND ot.class='ot_total'");
     if ($order_result->RecordCount() > 0) {
         echo '<tr><td class="dataTableContent">' . TABLE_TEXT_ORDER_VALUE . $order_result->fields['order_total'] . '</td></tr>';
     }
 }