当前位置: 首页>>代码示例>>PHP>>正文


PHP Purchase::exportcolumns方法代码示例

本文整理汇总了PHP中Purchase::exportcolumns方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::exportcolumns方法的具体用法?PHP Purchase::exportcolumns怎么用?PHP Purchase::exportcolumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Purchase的用法示例。


在下文中一共展示了Purchase::exportcolumns方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: export_purchases

	/**
	 * Delivers order export files to the browser
	 *
	 * @since 1.1
	 *
	 * @return void
	 **/
	function export_purchases () {
		if (!current_user_can('ecart_financials') || !current_user_can('ecart_export_orders')) exit();

		if (!isset($_POST['settings']['purchaselog_columns'])) {
			$Purchase = Purchase::exportcolumns();
			$Purchased = Purchased::exportcolumns();
			$_POST['settings']['purchaselog_columns'] =
			 	array_keys(array_merge($Purchase,$Purchased));
			$_POST['settings']['purchaselog_headers'] = "on";
		}
		$this->Settings->saveform();

		$format = $this->Settings->get('purchaselog_format');
		if (empty($format)) $format = 'tab';

		switch ($format) {
			case "csv": new PurchasesCSVExport(); break;
			case "xls": new PurchasesXLSExport(); break;
			case "iif": new PurchasesIIFExport(); break;
			default: new PurchasesTabExport();
		}
		exit();

	}
开发者ID:robbiespire,项目名称:paQui,代码行数:31,代码来源:Resources.php

示例2: orders_list


//.........这里部分代码省略.........
     $statusLabels = $this->Settings->get('order_status');
     if (empty($statusLabels)) {
         $statusLabels = array('');
     }
     $txnStatusLabels = array('PENDING' => __('Pending', 'Shopp'), 'CHARGED' => __('Charged', 'Shopp'), 'REFUNDED' => __('Refunded', 'Shopp'), 'VOID' => __('Void', 'Shopp'));
     if ($update == "order" && !empty($selected) && is_array($selected)) {
         foreach ($selected as $selection) {
             $Purchase = new Purchase($selection);
             $Purchase->status = $newstatus;
             $Purchase->save();
         }
     }
     $Purchase = new Purchase();
     if (!empty($start)) {
         $startdate = $start;
         list($month, $day, $year) = explode("/", $startdate);
         $starts = mktime(0, 0, 0, $month, $day, $year);
     }
     if (!empty($end)) {
         $enddate = $end;
         list($month, $day, $year) = explode("/", $enddate);
         $ends = mktime(23, 59, 59, $month, $day, $year);
     }
     $pagenum = absint($pagenum);
     if (empty($pagenum)) {
         $pagenum = 1;
     }
     if (!$per_page || $per_page < 0) {
         $per_page = 20;
     }
     $start = $per_page * ($pagenum - 1);
     $where = '';
     if (!empty($status) || $status === '0') {
         $where = "WHERE status='{$status}'";
     }
     if (!empty($s)) {
         $s = stripslashes($s);
         if (preg_match_all('/(\\w+?)\\:(?="(.+?)"|(.+?)\\b)/', $s, $props, PREG_SET_ORDER) > 0) {
             foreach ($props as $search) {
                 $keyword = !empty($search[2]) ? $search[2] : $search[3];
                 switch (strtolower($search[1])) {
                     case "txn":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "transactionid='{$keyword}'";
                         break;
                     case "gateway":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "gateway LIKE '%{$keyword}%'";
                         break;
                     case "cardtype":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "cardtype LIKE '%{$keyword}%'";
                         break;
                     case "address":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "(address LIKE '%{$keyword}%' OR xaddress='%{$keyword}%')";
                         break;
                     case "city":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "city LIKE '%{$keyword}%'";
                         break;
                     case "province":
                     case "state":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "state='{$keyword}'";
                         break;
                     case "zip":
                     case "zipcode":
                     case "postcode":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "postcode='{$keyword}'";
                         break;
                     case "country":
                         $where .= (empty($where) ? "WHERE " : " AND ") . "country='{$keyword}'";
                         break;
                 }
             }
             if (empty($where)) {
                 $where .= (empty($where) ? "WHERE " : " AND ") . " (id='{$s}' OR CONCAT(firstname,' ',lastname) LIKE '%{$s}%')";
             }
         } elseif (strpos($s, '@') !== false) {
             $where .= (empty($where) ? "WHERE " : " AND ") . " email='{$s}'";
         } else {
             $where .= (empty($where) ? "WHERE " : " AND ") . " (id='{$s}' OR CONCAT(firstname,' ',lastname) LIKE '%{$s}%')";
         }
     }
     if (!empty($starts) && !empty($ends)) {
         $where .= (empty($where) ? "WHERE " : " AND ") . ' (UNIX_TIMESTAMP(created) >= ' . $starts . ' AND UNIX_TIMESTAMP(created) <= ' . $ends . ')';
     }
     $ordercount = $db->query("SELECT count(*) as total,SUM(total) AS sales,AVG(total) AS avgsale FROM {$Purchase->_table} {$where} ORDER BY created DESC");
     $query = "SELECT * FROM {$Purchase->_table} {$where} ORDER BY created DESC LIMIT {$start},{$per_page}";
     $Orders = $db->query($query, AS_ARRAY);
     $num_pages = ceil($ordercount->total / $per_page);
     $page_links = paginate_links(array('base' => add_query_arg('pagenum', '%#%'), 'format' => '', 'total' => $num_pages, 'current' => $pagenum));
     $ranges = array('all' => __('Show All Orders', 'Shopp'), 'today' => __('Today', 'Shopp'), 'week' => __('This Week', 'Shopp'), 'month' => __('This Month', 'Shopp'), 'quarter' => __('This Quarter', 'Shopp'), 'year' => __('This Year', 'Shopp'), 'yesterday' => __('Yesterday', 'Shopp'), 'lastweek' => __('Last Week', 'Shopp'), 'last30' => __('Last 30 Days', 'Shopp'), 'last90' => __('Last 3 Months', 'Shopp'), 'lastmonth' => __('Last Month', 'Shopp'), 'lastquarter' => __('Last Quarter', 'Shopp'), 'lastyear' => __('Last Year', 'Shopp'), 'lastexport' => __('Last Export', 'Shopp'), 'custom' => __('Custom Dates', 'Shopp'));
     $exports = array('tab' => __('Tab-separated.txt', 'Shopp'), 'csv' => __('Comma-separated.csv', 'Shopp'), 'xls' => __('Microsoft&reg; Excel.xls', 'Shopp'), 'iif' => __('Intuit&reg; QuickBooks.iif', 'Shopp'));
     $formatPref = $Shopp->Settings->get('purchaselog_format');
     if (!$formatPref) {
         $formatPref = 'tab';
     }
     $columns = array_merge(Purchase::exportcolumns(), Purchased::exportcolumns());
     $selected = $Shopp->Settings->get('purchaselog_columns');
     if (empty($selected)) {
         $selected = array_keys($columns);
     }
     include "{$this->basepath}/core/ui/orders/orders.php";
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:101,代码来源:Flow.php

示例3: PurchasesExport

	function PurchasesExport () {
		global $Ecart;

		$this->purchase_cols = Purchase::exportcolumns();
		$this->purchased_cols = Purchased::exportcolumns();
		$this->defined = array_merge($this->purchase_cols,$this->purchased_cols);

		$this->sitename = get_bloginfo('name');
		$this->headings = ($Ecart->Settings->get('purchaselog_headers') == "on");
		$this->selected = $Ecart->Settings->get('purchaselog_columns');
		$this->date_format = get_option('date_format');
		$this->time_format = get_option('time_format');
		$Ecart->Settings->save('purchaselog_lastexport',mktime());
	}
开发者ID:robbiespire,项目名称:paQui,代码行数:14,代码来源:Purchase.php


注:本文中的Purchase::exportcolumns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。