Example #1
0
	 /**
	 * Count the number of customers in the database
	 *
	 * Method will process the post data and create text for display. Used by SEOM to determine how many times to run DownloadCustomers()
	 *
	 * @access public
	 * @return string a response to the data to display on the page.
	 */

	public function ProcessCustomerCount()
	{
		$response = '';
		$count = StoneEdgeCount('customers','');
		$response = "SetiResponse: itemcount=$count";
		return $response;
	}
Example #2
0
	 /**
	 * Count the total number of products in the database (no conditions)
	 *
	 * Method will process the post data and create text for display. Used to determine how many times SEOM should request Product Downloads.
	 *
	 * @access public
	 * @return string a response to the data to display on the page. Requires prodcode, so make sure it's there.
	 */

	public function ProcessProductCount()
	{
		$response = '';
		$count = StoneEdgeCount("products",'');
		//it's ok to return zero.
		$response = "SetiResponse: itemcount=$count";
		return $response;
	}
Example #3
0
	 /**
	 * Count the number of orders in the database
	 *
	 * Method will process the post data and create text for display. Used by SEOM to determine how many times to run DownloadOrders().
	 *
	 * @access public
	 * @return string a response to the data to display on the page.
	 */

	public function ProcessOrderCount()
	{
		$response = '';
		if (isset($_REQUEST['lastorder'])) {
			/* either an order number or 'All' */
			if ($_REQUEST['lastorder'] == 'All') {
				/* return a count of all orders in the database */
				$count = StoneEdgeCount('orders',"WHERE ordstatus IN('2', '3', '9', '10', '11') AND deleted = 0");
				$response = "SetiResponse: ordercount=$count";
			} else {
				/* return a count of all orders after the last order passed to SEOM to make sure that this isn't a SQL injection attempt. */
				if (is_numeric($_REQUEST['lastorder'])) {
					$previousend = $_REQUEST['lastorder'];
				} else {
					/* Stone Edge Order Manager will always send lastorder. If we get here, ignore their request and change the last order to 1. */
					$previousend = 1;
				}
				$count = StoneEdgeCount("orders","WHERE ordstatus IN('2', '3', '9', '10', '11') AND deleted = 0 AND orderid > $previousend");
				$response = "SetiResponse: ordercount=$count";
			}
		} else {
			/* either a date in 10/Jun/2003 format or 'All' */
			if ($_REQUEST['lastdate'] == 'All') {
				/* return a count of all orders in the database */
				$count = StoneEdgeCount('orders','');
				$response = "SetiResponse: ordercount=$count";
			} else {
				/* return the orders after the last timestamp. */
				/* convert their date to our date structure */
				list($day,$month,$year) = explode('/',$_REQUEST['lastdate']);
				$date = strtotime("$day $month $year");
				/* make sure that this isn't a SQL injection attempt. */
				if (is_numeric($date)) {
					$count = StoneEdgeCount('orders',"WHERE ordstatus IN('2', '3', '9', '10', '11') AND deleted = 0 AND orddate >= $date");
				} else {
					/* then something went wrong so return all orders. Always return something. */
					$count = StoneEdgeCount('orders','');
				}
				$response = "SetiResponse: ordercount=$count";
			}
		}
		return $response;
	}