function OFC_Charts_Bar_Sketch($colour, $outline_colour, $fun_factor)
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_sketch';
     $this->set_colour($colour);
     $this->set_outline_colour($outline_colour);
     $this->offset = $fun_factor;
 }
Exemplo n.º 2
0
	public function body() {
		$f = $this->init_module('Libs/OpenFlashChart');

		$title = new OFC_Elements_Title( date("D M d Y") );
		$f->set_title( $title );

		$bar = new OFC_Charts_Bar();
		$bar->set_values( array(9,8,7,6,5,4,3,2,1) );
		$f->add_element( $bar );

		$this->display_module($f);

		$f2 = $this->init_module('Libs/OpenFlashChart');

		$title = new OFC_Elements_Title( date("D M d Y") );
		$f2->set_title( $title );

		$bar = new OFC_Charts_Bar_Glass();
		$data = array();
		for($i=1; $i<10; $i++)
			$data[] = rand()%10;
		$bar->set_values( $data );
		$f2->add_element( $bar );

		$bar = new OFC_Charts_Line();
		$data = array();
		for($i=1; $i<10; $i++)
			$data[] = rand()%10;
		$bar->set_values( $data );
		$bar->set_colour('#FF0000');
		$f2->add_element( $bar );

		$this->display_module($f2);

		//------------------------------ print out src
		print('<hr><b>Install</b><br>');
		$this->pack_module('Utils/CatFile','modules/Tests/OpenFlashChart/OpenFlashChartInstall.php');
		print('<hr><b>Main</b><br>');
		$this->pack_module('Utils/CatFile','modules/Tests/OpenFlashChart/OpenFlashChart_0.php');
		print('<hr><b>Common</b><br>');
		$this->pack_module('Utils/CatFile','modules/Tests/OpenFlashChart/OpenFlashChartCommon_0.php');
	
	}
 function OFC_Charts_Bar_Filled($colour = null, $outline_colour = null)
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_filled';
     if (isset($colour)) {
         $this->set_colour($colour);
     }
     if (isset($outline_colour)) {
         $this->set_outline_colour($outline_colour);
     }
 }
Exemplo n.º 4
0
 /**
  * 构造函数
  *
  * @param string $colour 柱体颜色
  * @param string $outlineColour 边框颜色
  */
 public function __construct($colour = null, $outlineColour = null)
 {
     parent::__construct();
     $this->type = 'bar_filled';
     if (!empty($colour)) {
         $this->setColour($colour);
     }
     if (!empty($outlineColour)) {
         $this->setOutlineColour($outlineColour);
     }
 }
 function OFC_Charts_Bar_Stack()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_stack';
 }
Exemplo n.º 6
0
 /**
  * 构造函数
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = 'bar_glass';
 }
Exemplo n.º 7
0
 function OFC_Charts_Bar_Plastic()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_plastic';
 }
Exemplo n.º 8
0
    function pn_handle_options_page()
    {
        session_cache_limiter(FALSE);
        global $wpdb, $pn_plugin_url, $pn_plugin_dir;
        $action_url = $_SERVER['REQUEST_URI'];
        $unsent_mails = array();
        if (isset($_REQUEST['pnd'])) {
            $plimus_pn = $wpdb->prefix . "plimus_pn";
            $id = $_REQUEST['pnd'];
            $query_db = "DELETE FROM {$plimus_pn} WHERE pn_orn = {$id}";
            $delete = $wpdb->query($query_db);
        }
        $search_term = isset($_POST['search_item']) ? trim($_POST['search_item']) : '';
        $global_days = null;
        if (isset($_REQUEST['filter_all']) && !empty($_REQUEST['filter_all']) && !empty($search_term) && $search_term != 'Filter By Keyword') {
            $filter = isset($_SESSION['filter_by_type']) ? $_SESSION['filter_by_type'] : 'date';
            $global_days = isset($_REQUEST['filter_by_dates']) ? $_REQUEST['filter_by_dates'] : $_SESSION['filter_by_dates'];
            $terms = explode(" ", $search_term);
            $search_where = ' WHERE pn_meta_value LIKE ';
            foreach ($terms as $term) {
                $search_where .= "('%{$term}%') OR pn_meta_value LIKE ";
            }
            $search_where = substr_replace($search_where, '', -22);
            $search_data = $wpdb->get_results("SELECT pn.pn_orn FROM {$wpdb->prefix}plimus_pn as pn {$search_where}", OBJECT_K);
            if (!empty($search_data)) {
                $search_query = " WHERE pn.pn_orn IN ('" . implode("','", array_keys($search_data)) . "');";
            } else {
                $search_query = '';
            }
        } else {
            $filter = 'date';
            if (isset($_REQUEST['show']) && $_REQUEST['show'] == 'all') {
                $global_days = 0;
            }
            unset($_SESSION['filter_by_type']);
            unset($_SESSION['filter_by_dates']);
            $search_query = '';
        }
        if ($search_query != '') {
            $amount_data = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}plimus_pn as pn");
            $total_amount = array();
            if (!empty($amount_data)) {
                foreach ($amount_data as $key => $data) {
                    if ($data->pn_meta_key == 'invoiceAmountUSD' || $data->pn_meta_key == 'transactionDate') {
                        $total_amount[$data->pn_orn][$data->pn_meta_key] = $data->pn_meta_value;
                    }
                }
            }
            $this_month = 0;
            $last_month = 0;
            $total_sum = 0;
            foreach ($total_amount as $key => $data) {
                $total_sum += (double) $data['invoiceAmountUSD'];
                if (date('mY') == date('mY', strtotime($data['transactionDate']))) {
                    $this_month += (double) $data['invoiceAmountUSD'];
                }
                $lmonth = date('m') - 1;
                if (date('' . $lmonth . 'Y') == date('mY', strtotime($data['transactionDate']))) {
                    $last_month += (double) $data['invoiceAmountUSD'];
                }
            }
        }
        if (isset($_REQUEST['filter_all'])) {
            $filter = isset($_POST['filter_by_type']) ? $_POST['filter_by_type'] : $_SESSION['filter_by_type'];
            $_SESSION['filter_by_type'] = $filter;
        }
        $selected[$filter] = 'selected';
        if (isset($_REQUEST['filter_all']) && isset($_REQUEST['filter_by_dates']) && $_REQUEST['filter_by_dates'] != '0') {
            $global_days = isset($_REQUEST['filter_by_dates']) ? $_REQUEST['filter_by_dates'] : $_SESSION['filter_by_dates'];
            $_SESSION['filter_by_dates'] = $global_days;
        }
        $transaction_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}plimus_pn as pn {$search_query}"));
        $this_month = 0;
        $last_month = 0;
        $total_sum = 0;
        if (!empty($transaction_data)) {
            $default_footer = '</div>';
            $table_rows = array();
            $products = array();
            $products_date = array();
            $remove_row = array();
            $transactions = array();
            foreach ($transaction_data as $key => $data) {
                $transactions[$data->pn_orn][$data->pn_meta_key] = $data->pn_meta_value;
            }
            $firt_entry = 0;
            $j = 0;
            if (!empty($transactions)) {
                foreach ($transactions as $key => $data_array) {
                    $item = '';
                    $promotions_array = array();
                    $days_past = (int) (strtotime('today') / 86400 - strtotime($data_array['transactionDate']) / 86400);
                    $firt_entry = $days_past > $firt_entry ? $days_past : $firt_entry;
                    if (!empty($data_array)) {
                        //$key++;
                        $invoice_url = preg_match('/http\\:\\/\\//i', $data_array['invoiceInfoURL']) ? $data_array['invoiceInfoURL'] : 'http://' . $data_array['invoiceInfoURL'];
                        $company = $data_array['company'] != '' ? "<font style='font-weight: bold;' >Coustomer company: </font>{$data_array['company']} <br />" : '';
                        $address1 = $data_array['address1'] != '' ? "<font style='font-weight: bold;' >Coustomer address one: </font>{$data_array['address1']} {$data_array['zipCode']},{$data_array['city']}, {$data_array['state']}, {$data_array['country']} <br />" : '';
                        $address2 = $data_array['address2'] != '' ? "<font style='font-weight: bold;' >Coustomer address two: </font>{$data_array['address2']} <br />" : '';
                        $contact = $data_array['email'] != '' ? "<font style='font-weight: bold;' >Coustomer contact: </font> {$data_array['workPhone']} / {$data_array['extension']} " : '';
                        $mobile_phone = $data_array['mobilePhone'] != '' ? "<font style='font-weight: bold;' > mobile: </font> {$data_array['mobilePhone']}" : '';
                        $home_phone = $data_array['homePhone'] != '' ? "<font style='font-weight: bold;' > home: </font>{$data_array['homePhone']}" : '';
                        $fax = $data_array['faxNumber'] != '' ? "<font style='font-weight: bold;' > fax: </font>{$data_array['faxNumber']} <br />" : '';
                        $coustomer_cc = $data_array['creditCardType'] != '' ? "<font style='font-weight: bold;' > Credit card: </font>{$data_array['creditCardType']} <br />" : '';
                        $ship_to = $data_array['shippingFirstName'] != '' || $data_array['shippingLastName'] != '' ? " <font style='font-weight: bold;' >Shiping To: </font>{$data_array['shippingFirstName']} {$data_array['shippingLastName']} {$data_array['shippingZipCode']} {$data_array['shippingCity']} {$data_array['shippingState']} {$data_array['shippingCountry']}" : '';
                        $shippingMethod = $data_array['shippingMethod'] != '' ? " <font style='font-weight: bold;' > shiping method: </font> {$data_array['shippingMethod']}<br />" : '';
                        $invoiceChargeAmount = $data_array['invoiceChargeAmount'] != '' ? " <font style='font-weight: bold;' >Invoice Amount: </font> {$data_array['invoiceChargeAmount']} {$data_array['invoiceChargeCurrency']} (\$ {$data_array['invoiceAmountUSD']}) <a href='{$invoice_url}' target='_blank'>{$data_array['invoiceInfoURL']}</a><br />" : '';
                        $coupon = $data_array['coupon'] != '' ? "<font style='font-weight: bold;' >Used a coupon: </font> {$data_array['coupon']} " : '';
                        $couponCode = $data_array['couponCode'] != '' ? " <font style='font-weight: bold;' > code: </font>  {$data_array['couponCode']} " : '';
                        $couponValue = $data_array['couponValue'] != '' ? "  <font style='font-weight: bold;' >amount: </font>  {$data_array['couponValue']} {$data_array['invoiceChargeCurrency']} " : '';
                        $referrer = $data_array['referrer'] != '' ? " <font style='font-weight: bold;' > referer: </font>  {$data_array['referrer']} <br />" : '';
                        $table_coupon = $data_array['coupon'] != '' ? "{$data_array['coupon']} ({$data_array['couponCode']})" : '';
                        $coupon = (double) str_replace(',', '', $data_array['couponValue']);
                        $promotions_html = '';
                        $currency = $data_array['currency'];
                        $tr_date = str_replace(' ', '/', substr_replace((string) $data_array['transactionDate'], '', -9));
                        $charge = 0;
                        if ($tr_date != '') {
                            $product_name = $data_array['productName'];
                            if ($filter == 'contract') {
                                $product_name = $data_array['contractName'];
                            }
                            $charge = str_replace(',', '.', $data_array['invoiceAmountUSD']);
                            $products[$tr_date][$key] = array('amount' => isset($products[$tr_date][$product_name]) && in_array($transactiontype, array('CHARGE', 'RECURRING')) ? (double) $products[$tr_date][$product_name] + (double) $charge : 0, 'name' => $product_name);
                        }
                        if ($data_array['promoteContractsNum'] > 0) {
                            for ($i = 0; $i < $data_array['promoteContractsNum']; $i++) {
                                $promotions_html .= '<font style="font-weight: bold;" > Promotion: </font> ' . $data_array["promoteContractName{$i}"] . '
								<font style="font-weight: bold;" > owner: </font> ' . $data_array["promoteContractOwner{$i}"] . '
								<font style="font-weight: bold;" > price: </font> ' . $data_array["promoteContractPrice{$i}"] . '
								<font style="font-weight: bold;" > qty: </font> ' . $data_array["promoteContractQuantity{$i}"] . '
								<font style="font-weight: bold;" > licence: </font> ' . $data_array["promoteContractLicenseKey{$i}"] . '<br />';
                            }
                        }
                        $remove_row[$tr_date][] = $key;
                        $productname = isset($data_array['productName']) ? $data_array['productName'] : '';
                        $contractname = isset($data_array['contractName']) ? $data_array['contractName'] : '';
                        $quantity = isset($data_array['quantity']) ? $data_array['quantity'] : '';
                        $invoiceamountusd = isset($data_array['invoiceAmountUSD']) ? $data_array['invoiceAmountUSD'] : '';
                        $paymentmethod = isset($data_array['paymentMethod']) ? $data_array['paymentMethod'] : '';
                        $transactiontype = isset($data_array['transactionType']) ? $data_array['transactionType'] : '';
                        $prtitle = isset($data_array['title']) ? $data_array['title'] : '';
                        $firstname = isset($data_array['firstName']) ? $data_array['firstName'] : '';
                        $lastname = isset($data_array['lastName']) ? $data_array['lastName'] : '';
                        $premail = isset($data_array['email']) ? $data_array['email'] : '';
                        $transactiondate = isset($data_array['transactionDate']) ? $data_array['transactionDate'] : '';
                        $table_rows[$key] = "<tr><td>{$productname}</td><td>{$contractname}</td><td>{$quantity}</td>\n\t\t\t\t\t\t\t<td>{$invoiceamountusd}</td><td> {$table_coupon}</td><td>{$paymentmethod}</td>\n\t\t\t\t\t\t\t<td>{$transactiontype}</td><td>{$prtitle} {$firstname} {$lastname}</td><td>{$premail}</td>\n\t\t\t\t\t\t\t<td>{$transactiondate}</td><td id='more-info-{$key}'><a href='javascript: void(0)' title='More Info' onclick='showMoreInfo({$key})'>More</a> </td>\n\t\t\t\t\t\t\t<td style='background: #f9f9f9;'>\n\t\t\t\t\t\t\t\t<div class='more-info-panel' id='mi-{$key}' style='display: none;'>\n\t\t\t\t\t\t\t\t\t{$company}{$address1}{$address2}{$contact}{$mobile_phone}{$home_phone}{$fax}{$coustomer_cc}{$ship_to}{$shippingMethod}{$invoiceChargeAmount}\n\t\t\t\t\t\t\t\t\t{$coupon}{$couponCode}{$couponValue}{$referrer}\n\t\t\t\t\t\t\t\t\t" . $promotions_html . "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td></tr>";
                        $un_date = str_replace(' ', '/', substr_replace($transactiondate, '', -9));
                        $unsent_mails[] = array($un_date, $premail);
                    }
                    $j++;
                }
            }
            if ($search_query == '') {
                foreach ($products as $date => $data) {
                    foreach ($data as $key => $value) {
                        $total_sum += (double) $value['amount'];
                        if (date('mY') == date('mY', strtotime($date))) {
                            $this_month += $value['amount'];
                        }
                        $lmonth = $current_month = date('m') - 1;
                        if (date('' . $lmonth . 'Y') == date('mY', strtotime($date))) {
                            $last_month += $value['amount'];
                        }
                    }
                }
            }
            // sort by days
            $selected_date = array(0 => '', 7 => '', 15 => '', 30 => '', 60 => '', 120 => '');
            //if($filter == 'date'){
            $has_results = false;
            $global_days = $global_days == 0 ? $firt_entry : $global_days;
            $selected_date[$global_days] = 'selected="selected"';
            while (!$has_results) {
                $results = array();
                $data_dates = array();
                for ($i = 0; $i < (int) $global_days; $i++) {
                    $date = date('m/d/Y', time() - $i * 86400);
                    $data_dates[$i] = $date;
                }
                $keys = array_keys($products);
                foreach ($data_dates as $date) {
                    if (!array_key_exists($date, $products)) {
                        $products[$date][] = array();
                        $results[$date] = false;
                        continue;
                    }
                    $results[$date] = true;
                }
                foreach ($results as $res) {
                    if ($res) {
                        $has_results = true;
                        break;
                    }
                }
                if (!$has_results) {
                    if ($global_days = 0) {
                        $global_days = 7;
                    } else {
                        if ($global_days = 7) {
                            $global_days = 15;
                        } else {
                            $global_days = 2 * $global_days;
                        }
                    }
                }
                if ($global_days > 120) {
                    break;
                }
            }
            if ($global_days != 0 && false) {
                foreach ($keys as $key) {
                    if (!in_array($key, $data_dates) && isset($remove_row[$key])) {
                        foreach ($remove_row[$key] as $row_id) {
                            unset($table_rows[$row_id]);
                        }
                        unset($products[$key]);
                    }
                }
            }
            foreach ((array) $products as $date => $data) {
                $date_key = strtotime($date);
                foreach ($data as $key => $value) {
                    $products[$date_key][$key] = $value;
                }
                unset($products[$date]);
            }
            ksort($products);
            foreach ($products as $date => $data) {
                $date_key = date('m/d/Y', $date);
                foreach ($data as $key => $value) {
                    $products[$date_key][$key] = $value;
                }
                unset($products[$date]);
            }
            //}
            // end sort by days
            /* json */
            require_once 'pn-chart/OFC/OFC_Chart.php';
            $title_is = '';
            $values = array();
            $tips = array();
            $bar = new OFC_Charts_Bar();
            $max_price = 0;
            $amount = array();
            $array_keys = array_keys($products);
            foreach ($products as $date => $data) {
                if ($filter == 'date') {
                    $price = array();
                    foreach ($data as $key => $value) {
                        if (!isset($price[$date])) {
                            $price[$date] = 0;
                        }
                        $price[$date] += isset($value['amount']) ? $value['amount'] : 0;
                    }
                    $price = (double) $price[$date] < 0 ? 0 : (double) $price[$date];
                    $x_label[] = new OFC_Elements_Axis_X_Label('$' . $price, '#999999', 10, -50);
                    $tip_price = number_format($price, 2, '.', ',');
                    $tip = "\${$tip_price} ({$date})";
                    $val = new OFC_Charts_Bar_Value($price);
                    $val->set_tooltip($tip);
                    $values[] = $val;
                    $max_price = $max_price < $price ? $price + $price / 4 : $max_price;
                } else {
                    if ($date != $array_keys[count($array_keys) - 1]) {
                        foreach ($data as $key => $value) {
                            if (!empty($value) && isset($value['amount'])) {
                                if (!isset($amount[$value['name']])) {
                                    $amount[$value['name']] = 0;
                                }
                                $amount[$value['name']] += $value['amount'];
                            }
                        }
                        continue;
                    }
                    foreach ($data as $key => $value) {
                        if (!empty($value)) {
                            $amount[$value['name']] += $value['amount'];
                        }
                    }
                    foreach ($amount as $product_name => $product_val) {
                        $x_label[] = new OFC_Elements_Axis_X_Label(str_replace('|', ' ', $product_name), '#999999', 10, -50);
                        $tip_price = number_format($product_val, 2, '.', ',');
                        $tip = ucwords($product_name) . " (\$ {$tip_price})";
                        $val = new OFC_Charts_Bar_Value($product_val);
                        $val->set_tooltip($tip);
                        $values[] = $val;
                        $max_price = $max_price < $product_val ? $product_val + $product_val / 4 : $max_price;
                    }
                }
            }
            $bar->set_colour('#119CD3');
            $bar->set_values($values);
            $title = new OFC_Elements_Title($title_is);
            $x_l_set = new OFC_Elements_Axis_X_Label_Set();
            $x_l_set->set_steps(1);
            $x_l_set->set_labels($x_label);
            $x_axis = new OFC_Elements_Axis_X();
            $x_axis->set_3d(0);
            $x_axis->set_colours('#DDDDDD', '#DDDDDD');
            $x_axis->set_stroke(1);
            $x_axis->set_labels($x_l_set);
            $step = $max_price > 500 ? $max_price > 5000 ? $max_price > 50000 ? $max_price > 500000 ? $max_price > 5000000 ? 5000000 : 500000 : 50000 : 5000 : 500 : 50;
            $y_axis = new OFC_Elements_Axis_Y();
            $y_axis->set_colours('#DDDDDD', '#DDDDDD');
            $y_axis->set_range(0, $max_price, $step);
            $chart = new OFC_Chart();
            $chart->set_title($title);
            $chart->set_bg_colour('#F9F9F9');
            $chart->set_x_axis($x_axis);
            $chart->set_y_axis($y_axis);
            $chart->add_element($bar);
            $path = $pn_plugin_dir . "/pn-chart/data.json";
            $file = @fopen($path, "w");
            @fwrite($file, $chart->toString());
            @fclose($file);
            /* end json */
            $result = '';
            if (isset($_REQUEST['filter_all']) && $search_term != 'Filter By Keyword' && $search_term != '' && count($table_rows)) {
                $result = '<i style="color: #777">Showing results for "<strong>' . $search_term . '</strong>"</i>';
            } else {
                if (isset($_REQUEST['filter_all']) && $search_term != 'Filter By Keyword' && $search_term != '' && !count($table_rows)) {
                    $result = '<i style="color: #777">There is no transactions in this time period, that contain <strong>"' . $search_term . '"</strong>. Select your timespan in filter section.</i>';
                }
            }
            $master_table = $result . "<br /><br /><table id='pn-table-main' class='tablesorter'>";
            $master_table .= "<thead><tr><th> Product name </th><th> Contract name </th><th> Qty </th>\n\t\t\t\t<th> Invoice amount (USD)</th><th> Coupon code</th><th> Method </th><th> Transaction type</th><th> Customer name </th><th> Customer email </th><th> Transaction Date </th><td></td></tr></thead><tbody>";
            $master_table .= implode('', $table_rows) . "</tbody></table>";
            $master_table .= <<<END
\t\t\t\t\t\t\t<div id="pager" class="pager">
\t\t\t\t\t\t\t\t<form>
\t\t\t\t\t\t\t\t\t\t<img src="{$pn_plugin_url}/images/first.png" class="first"/>
\t\t\t\t\t\t\t\t\t\t<img src="{$pn_plugin_url}/images/prev.png" class="prev"/>
\t\t\t\t\t\t\t\t\t\t<input type="text" style="width:50px; height:18px; padding: 0px 0px 3px 0px;" class="pagedisplay" />
\t\t\t\t\t\t\t\t\t\t<img src="{$pn_plugin_url}/images/next.png" class="next"/>
\t\t\t\t\t\t\t\t\t\t<img src="{$pn_plugin_url}/images/last.png" class="last"/>
\t\t\t\t\t\t\t\t\t\t<select class="pagesize">
\t\t\t\t\t\t\t  <option value="5">5 per page</option>
\t\t\t\t\t\t\t\t\t\t\t\t<option value="10">10 per page</option>
\t\t\t\t\t\t\t\t\t\t\t\t<option value="20">20 per page</option>
\t\t\t\t\t\t\t\t\t\t\t\t<option value="50" selected="selected">50 per page</option>

\t\t\t\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t\t</form>
\t\t\t\t\t\t</div>
END;
        }
        ?>
		<script type="text/javascript">
			swfobject.embedSWF("<?php 
        echo $pn_plugin_url . "/pn-chart/open-flash-chart.swf";
        ?>
", "pn_chart", "900px", "220px", "9.0.0", "expressInstall.swf", {"data-file":"<?php 
        echo $pn_plugin_url;
        ?>
/pn-chart/data.json"});
		</script>
		<div class="wrap">
		<h2><a href="http://www.bluesnap.com" title="Bluesnap - Take charge" target="_blank"><img src="<?php 
        echo $pn_plugin_url;
        ?>
/images/plimus_logo.png" alt="Plimu IPN" id="plimus-logo" /></a>for WordPress</h2>
		
		<h5><font color="#999999">This Month:</font> <font color="#555555"> $<?php 
        echo number_format($this_month, 2, '.', ',');
        ?>
</font> &nbsp;&nbsp;|&nbsp;&nbsp; <font color="#999999"> Last Month:</font> <font color="#555555"> $<?php 
        echo number_format($last_month, 2, '.', ',');
        ?>
</font> &nbsp;&nbsp;|&nbsp;&nbsp;  <font color="#999999"> Total Amount:</font> <font color="#555555"> $<?php 
        echo number_format($total_sum, 2, '.', ',');
        ?>
</font> </h5>
			<!--<i id="small_size">* Send registration notifications (again), dates in mm/dd/yyyy format please</i>
			 <form action="<?php 
        //echo $action_url;
        ?>
" method="post" id="new_email_form" >
				From <input type="text" name="new_from_date" value="12/1/2010" /> to <input type="text" name="new_to_date" value="12/16/2010" />
				<input type="submit" name="new_mails_submit" id="new_mails_submit" value="Send Registration Emails" class="button"/><br />
					<br /><i id="note">&nbsp;&nbsp;&nbsp;&nbsp;** in your <b>HTML new password email</b> template use <code>{USER_FULL_NAME}</code> <code>{NEW_PASSWORD}</code> <code>{LOGIN_URL}</code> shortcodes, to replace it with user</i>
				<textarea cols="90" rows="10" name="pn_email_tmp" id="pn_email_tmp" ><?php 
        //echo $pn_tpl_reg_email_text
        ?>
</textarea><div id="legend"></div>
				<textarea cols="80" rows="10" name="pn_email_res" id="pn_email_res" ><?php 
        //echo $email_message
        ?>
</textarea><div id="legend"></div>
			</form><br /><br /> -->
		<form action="<?php 
        echo $action_url;
        ?>
" id="search_form" method="POST">
			<select name="filter_by_type" id="filter_by_type" >
				<option value="date" <?php 
        echo isset($selected['date']) ? $selected['date'] : '';
        ?>
 >Show by date</option>
				<option value="product" <?php 
        echo isset($selected['product']) ? $selected['product'] : '';
        ?>
 >Show by product</option>
				<option value="contract" <?php 
        echo isset($selected['contract']) ? $selected['contract'] : '';
        ?>
 >Show by contract</option>
			</select>
			<select name="filter_by_dates" id="filter_by_dates" >
				<option value="0" <?php 
        echo $selected_date[0];
        ?>
>All transactions</option>
				<option value="7" <?php 
        echo $selected_date[7];
        ?>
>Last 7 days</option>
				<option value="15" <?php 
        echo $selected_date[15];
        ?>
>Last 15 days</option>
				<option value="30" <?php 
        echo $selected_date[30];
        ?>
>Last 30 days</option>
				<option value="60" <?php 
        echo $selected_date[60];
        ?>
>Last 60 days</option>
				<option value="120" <?php 
        echo $selected_date[120];
        ?>
>Last 120 days</option>
			</select>
			<input type="text" name="search_item" id="search_item" size="40" value="<?php 
        $search_term = strlen(trim($search_term)) ? $search_term : 'Filter By Keyword';
        echo $search_term;
        ?>
" />
			
			<input type="submit" value=" Submit  " name="filter_all" class="button" />
			<a href="<?php 
        echo $action_url;
        ?>
&show=all" title="Show All" class="button"> Show All </a>
		</form>
	<br />
		<?php 
        if (!empty($transaction_data)) {
            ?>
			<br />
			<div id="resize" style="width:1000px; height:250px; padding: 10px;">
				<div id="pn_chart"></div>
			</div>
			<?php 
            echo $master_table . $default_footer;
        } else {
            if (isset($_REQUEST['filter_all']) && ($search_term != '' || $search_term != 'Filter By Keyword') && empty($transaction_data)) {
                echo "<h5></i>There are no results for '{$_POST['search_item']}'.</i></h5>";
            } else {
                echo "<h5></i>There are no registered sales yet, but hopefully things are about to change.</i></h5>";
            }
        }
        ?>
		<h5><a href="http://www.prelovac.com" title="Plugin by Prelovac Media"><img src="<?php 
        echo $pn_plugin_url;
        ?>
/images/logo.png"  style="margin-top: 30px;"/></a> </h5>
		
		</div><br />
		
		<?php 
    }
Exemplo n.º 9
0
 function OFC_Charts_Bar_Candle()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'candle';
 }
Exemplo n.º 10
0
 function OFC_Charts_Bar_Dome()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_dome';
 }
Exemplo n.º 11
0
 function OFC_Charts_Bar_Round()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_round';
 }
Exemplo n.º 12
0
$result = \Kofradia\DB::get()->query("SELECT WEEKDAY(FROM_UNIXTIME(uhi_secs_hour)) AS date, SUM(uhi_hits) sum_hits, SUM(uhi_hits_redirect) sum_hits_redirect FROM users_hits, users_players WHERE up_u_id = {$u_id} AND up_id = uhi_up_id GROUP BY WEEKDAY(FROM_UNIXTIME(uhi_secs_hour)) ORDER BY date");
while ($row = $result->fetch()) {
    $stats[$row['date'] + 1] = (int) $row['sum_hits'];
    $stats_redir[$row['date'] + 1] = (int) $row['sum_hits_redirect'];
}
$x = array();
global $_lang;
foreach ($stats as $date => $dummy) {
    if ($date == 7) {
        $date = 0;
    }
    $x[] = $_lang['weekdays'][$date];
}
$ofc = new OFC();
$ofc->title(new OFC_Title("Sidevisninger for {$up_name}"));
$bar = new OFC_Charts_Bar();
$bar->text("Antall visninger");
$bar->dot_style()->type("solid-dot")->dot_size(3)->halo_size(2)->tip("#x_label#<br>#val# visninger");
$bar->values(array_values($stats));
$bar->colour(OFC_Colours::$colours[0]);
$ofc->add_element($bar);
$bar = new OFC_Charts_Bar();
$bar->text("Antall videresendinger");
$bar->dot_style()->type("solid-dot")->dot_size(3)->halo_size(2)->tip("#x_label#<br>#val# videresendinger");
$bar->values(array_values($stats_redir));
$bar->colour(OFC_Colours::$colours[1]);
$ofc->add_element($bar);
$ofc->axis_x()->label()->steps(ceil(count($x) / 20))->rotate(330)->labels($x);
$ofc->axis_y()->set_numbers(0, max(max($stats), max($stats_redir)));
$ofc->dark_colors();
echo $ofc;
Exemplo n.º 13
0
<?php

/**
 * PHP Integration of Open Flash Chart
 * Copyright (C) 2008 John Glazebrook <*****@*****.**>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once 'OFC/OFC_Chart.php';
$title = new OFC_Elements_Title(date("D M d Y"));
$bar = new OFC_Charts_Bar();
$bar->set_values(array(9, 8, 7, 6, 5, 4, 3, 2, 1));
$chart = new OFC_Chart();
$chart->set_title($title);
$chart->add_element($bar);
echo $chart->toPrettyString();
Exemplo n.º 14
0
 private function createGraph(Gpf_Chart_DataRecordSet $data)
 {
     if ($this->chartType == Gpf_Rpc_Chart::CHART_TYPE_LINE_DOT && $this->data1->getSize() > 150) {
         $this->chartType = Gpf_Rpc_Chart::CHART_TYPE_LINE;
     }
     switch ($this->chartType) {
         case Gpf_Rpc_Chart::CHART_TYPE_AREA:
             if ($data->getSize() > 40) {
                 $areaGraph = new OFC_Charts_Area_Line();
             } else {
                 $areaGraph = new OFC_Charts_Area_Hollow();
             }
             $areaGraph->set_width(3);
             $areaGraph->set_dot_size(3);
             $areaGraph->set_colour($data->getColor());
             $areaGraph->set_key($data->getName(), 10);
             $areaGraph->set_values($data->getValues());
             $areaGraph->set_tooltip($data->getTooltip());
             return $areaGraph;
         case Gpf_Rpc_Chart::CHART_TYPE_BAR_OUTLINE:
             $barGraph = new OFC_Charts_Bar();
             $barGraph->set_alpha(50);
             $barGraph->set_colour($data->getColor());
             $barGraph->set_key($data->getName(), 10);
             $barGraph->set_values($data->getValues());
             $barGraph->set_tooltip($data->getTooltip());
             return $barGraph;
         case Gpf_Rpc_Chart::CHART_TYPE_LINE_DOT:
             $lineDotGraph = new OFC_Charts_Line_Dot();
             $lineDotGraph->set_width(3);
             $lineDotGraph->set_dot_size(3);
             $lineDotGraph->set_colour($data->getColor());
             $lineDotGraph->set_key($data->getName(), 10);
             $lineDotGraph->set_values($data->getValues());
             $lineDotGraph->set_tooltip($data->getTooltip());
             return $lineDotGraph;
         default:
             $lineGraph = new OFC_Charts_Line();
             $lineGraph->set_width(3);
             $lineGraph->set_dot_size(3);
             $lineGraph->set_colour($data->getColor());
             $lineGraph->set_key($data->getName(), 10);
             $lineGraph->set_values($data->getValues());
             $lineGraph->set_tooltip($data->getTooltip());
             return $lineGraph;
     }
 }
Exemplo n.º 15
0
 /**
  * 构造函数
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = 'bar_stack';
 }
Exemplo n.º 16
0
 function OFC_Charts_Bar_Cylinder()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_cylinder';
 }
Exemplo n.º 17
0
 function OFC_Charts_Bar_Glass()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_glass';
 }
Exemplo n.º 18
0
 /**
  * 构造函数
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = "hbar";
 }
 function OFC_Charts_Bar_3d()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_3d';
 }
Exemplo n.º 20
0
 function OFC_Charts_Bar_Fade()
 {
     parent::OFC_Charts_Bar();
     $this->type = 'bar_fade';
 }