Version Notes
You can Now Track you all the Magento Backend Activity Using our Emizentech Magento Mobile Apps . IT has very great feature API to display All the Sales Activity with Graph . You can now easily see all the Magento Orders Listing , Product Listing, Customer Listing .
Features :
* Wonderful View of your Sales with Days Filter Graph
* Sales Listing View with Details.
* Customer Listing View with Details
* Product Listing View With Details
* Store view Selection For Dashboard,
* Multistore Support
Download this release
Release Info
Developer | Emizen Tech Private Limited |
Extension | emizenmobileadmin |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/local/EmizenTech/MobileAdmin/Helper/Data.php +109 -100
- app/code/local/EmizenTech/MobileAdmin/Model/Observer.php +48 -9
- app/code/local/EmizenTech/MobileAdmin/controllers/IndexController.php +368 -26
- app/code/local/EmizenTech/MobileAdmin/controllers/ReportController.php +308 -0
- lib/EmizenMobileAdmin/PushNotificationAppCertificateKey.pem +66 -0
- package.xml +4 -4
app/code/local/EmizenTech/MobileAdmin/Helper/Data.php
CHANGED
@@ -1,113 +1,122 @@
|
|
1 |
<?php
|
2 |
class EmizenTech_MobileAdmin_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
{
|
|
|
|
|
|
|
|
|
4 |
public function getPrice($price)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
{
|
6 |
-
$
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
{
|
12 |
-
$price = sprintf("%01.2f", $price);
|
13 |
-
return $price;
|
14 |
}
|
15 |
-
|
16 |
-
public function getActualDate($updated_date)
|
17 |
{
|
18 |
-
$
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
}
|
24 |
|
25 |
-
|
26 |
{
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
|
51 |
-
$flags = STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT;
|
52 |
-
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err,$errstr, 60, $flags, $ctx);
|
53 |
-
|
54 |
-
foreach($collections as $collection){
|
55 |
-
$deviceType = $collection->getDeviceType();
|
56 |
-
|
57 |
-
if($deviceType == 'ios'){
|
58 |
-
|
59 |
-
if ($fp){
|
60 |
-
|
61 |
-
$deviceToken = $collection->getDeviceToken();
|
62 |
-
$body['aps'] = array(
|
63 |
-
'alert' => $message,
|
64 |
-
'sound' => 'default',
|
65 |
-
'entity_id' => $entity_id,
|
66 |
-
'type' => $notification_type
|
67 |
-
);
|
68 |
-
$payload = json_encode($body);
|
69 |
-
$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;
|
70 |
-
$result = fwrite($fp, $msg, strlen($msg));
|
71 |
-
|
72 |
-
}
|
73 |
-
|
74 |
-
}elseif($deviceType == 'android')
|
75 |
-
{
|
76 |
-
$deviceToken = $collection->getDeviceToken();
|
77 |
-
$registrationIds = array($deviceToken);
|
78 |
-
|
79 |
-
$msg_a = array(
|
80 |
-
'message' => $message,
|
81 |
-
'entity_id' => $entity_id,
|
82 |
-
'type' => $notification_type
|
83 |
-
);
|
84 |
-
|
85 |
-
$fields = array(
|
86 |
-
'registration_ids' => $registrationIds,
|
87 |
-
'data' => $msg_a
|
88 |
-
);
|
89 |
-
|
90 |
-
$headers = array(
|
91 |
-
'Authorization: key=' . $google_api_key,
|
92 |
-
'Content-Type: application/json'
|
93 |
-
);
|
94 |
-
|
95 |
-
$ch = curl_init();
|
96 |
-
curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
|
97 |
-
curl_setopt( $ch,CURLOPT_POST, true );
|
98 |
-
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
|
99 |
-
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
|
100 |
-
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
|
101 |
-
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
|
102 |
-
$result = curl_exec($ch );
|
103 |
-
curl_close( $ch );
|
104 |
-
|
105 |
-
|
106 |
-
}
|
107 |
-
}
|
108 |
-
fclose($fp);
|
109 |
-
|
110 |
-
return true;
|
111 |
-
}
|
112 |
}
|
113 |
-
?>
|
1 |
<?php
|
2 |
class EmizenTech_MobileAdmin_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
{
|
4 |
+
/*
|
5 |
+
* @ Get formetted price
|
6 |
+
* @param: $price
|
7 |
+
*/
|
8 |
public function getPrice($price)
|
9 |
+
{
|
10 |
+
$price = strip_tags(Mage::helper('core')->currency($this->getPriceFormat($price)));
|
11 |
+
return $price;
|
12 |
+
}
|
13 |
+
|
14 |
+
/*
|
15 |
+
* @ Get price format
|
16 |
+
* @param: $price
|
17 |
+
*/
|
18 |
+
public function getPriceFormat($price)
|
19 |
+
{
|
20 |
+
$price = sprintf("%01.2f", $price);
|
21 |
+
return $price;
|
22 |
+
}
|
23 |
+
|
24 |
+
/*
|
25 |
+
* @ Get Actual Date
|
26 |
+
* @param: $updateddate
|
27 |
+
*/
|
28 |
+
public function getActualDate($updated_date)
|
29 |
+
{
|
30 |
+
$date = Mage::app()->getLocale()->date(strtotime($updated_date));
|
31 |
+
$timestamp = $date->get(Zend_Date::TIMESTAMP) - $date->get(Zend_Date::TIMEZONE_SECS);
|
32 |
+
$updated_date = date("Y-m-d H:i:s", $timestamp);
|
33 |
+
return $updated_date;
|
34 |
+
}
|
35 |
+
|
36 |
+
/*
|
37 |
+
* @ Using this function, check if extension is enabled or not !
|
38 |
+
* @param: NULL
|
39 |
+
*/
|
40 |
+
public function isEnable()
|
41 |
+
{
|
42 |
+
return Mage::getStoreConfig('emizen_mob/emizen_general/enabled');
|
43 |
+
}
|
44 |
+
|
45 |
+
/*
|
46 |
+
* @Description: if any customer register and products add and new order come, will process of three type methods and then notification will come on your ios and android device.
|
47 |
+
* @ Notification of both device type like iphone & android
|
48 |
+
* @param: $notification_type and $entityId
|
49 |
+
*/
|
50 |
+
public function pushNotification($notification_type)
|
51 |
+
{
|
52 |
+
//$google_api_key = 'AIzaSyAZPkT165oPcjfhUmgJnt5Lcs2OInBFJmE';
|
53 |
+
$passphrase = '123456789';
|
54 |
+
|
55 |
+
$collections = Mage::getModel("mobileadmin/emizenmob")->getCollection()
|
56 |
+
->addFieldToFilter('notification_flag',1)
|
57 |
+
->addFieldToFilter('is_logout',0);
|
58 |
+
|
59 |
+
//return $collections->getFirstItem();
|
60 |
+
|
61 |
+
$collection_items = $collections->getFirstItem();
|
62 |
+
|
63 |
+
if($notification_type=='customer')
|
64 |
{
|
65 |
+
$messageText = Mage::getStoreConfig('emizen_mob/emizen_general/emizen_register');
|
66 |
+
if($messageText == null)
|
67 |
+
{
|
68 |
+
$messageText = Mage::helper('mobileadmin')->__('A New customer has been registered on the Store.');
|
69 |
+
}
|
|
|
|
|
|
|
70 |
}
|
71 |
+
else
|
|
|
72 |
{
|
73 |
+
$messageText = Mage::getStoreConfig('emizen_mob/emizen_general/emizen_noti');
|
74 |
+
if($messageText == null)
|
75 |
+
{
|
76 |
+
$messageText = Mage::helper('mobileadmin')->__('A New order has been received on the Store.');
|
77 |
+
}
|
78 |
}
|
79 |
|
80 |
+
foreach($collections->getData() as $collection)
|
81 |
{
|
82 |
+
$deviceType = $collection['device_type'];
|
83 |
+
if($deviceType == 'ios')
|
84 |
+
{
|
85 |
+
$message = new Zend_Mobile_Push_Message_Apns();
|
86 |
+
$message->setAlert($messageText);
|
87 |
+
$message->setBadge(1);
|
88 |
+
$message->setSound('default');
|
89 |
+
$message->setId(time());
|
90 |
+
$message->setToken($collection['device_token']);
|
91 |
+
|
92 |
+
$apns = new Zend_Mobile_Push_Apns();
|
93 |
+
//$apns->setCertificate('/path/to/provisioning-certificate.pem');
|
94 |
+
$apns->setCertificate(Mage::getBaseDir('lib'). DS. "EmizenMobileAdmin".DS."PushNotificationAppCertificateKey.pem");
|
95 |
+
// if you have a passphrase on your certificate:
|
96 |
+
$apns->setCertificatePassphrase($passphrase);
|
97 |
+
|
98 |
+
try {
|
99 |
+
$apns->connect(Zend_Mobile_Push_Apns::SERVER_SANDBOX_URI);
|
100 |
+
} catch (Zend_Mobile_Push_Exception_ServerUnavailable $e) {
|
101 |
+
// you can either attempt to reconnect here or try again later
|
102 |
+
Mage::log("1_". $e->getMessage() , null , 'push_notification1345.log');
|
103 |
+
} catch (Zend_Mobile_Push_Exception $e) {
|
104 |
+
Mage::log("2_". $e->getMessage() , null , 'push_notification1345.log');
|
105 |
}
|
106 |
+
|
107 |
+
try {
|
108 |
+
$apns->send($message);
|
109 |
+
} catch (Zend_Mobile_Push_Exception_InvalidToken $e) {
|
110 |
+
// you would likely want to remove the token from being sent to again
|
111 |
+
Mage::log("3_". $e->getMessage() , null , 'push_notification1345.log');
|
112 |
+
} catch (Zend_Mobile_Push_Exception $e) {
|
113 |
+
// all other exceptions only require action to be sent
|
114 |
+
Mage::log("4_". $e->getMessage() , null , 'push_notification1345.log');
|
115 |
}
|
116 |
+
$apns->close();
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
+
?>
|
app/code/local/EmizenTech/MobileAdmin/Model/Observer.php
CHANGED
@@ -1,24 +1,63 @@
|
|
1 |
<?php
|
2 |
class EmizenTech_MobileAdmin_Model_Observer
|
3 |
{
|
|
|
|
|
|
|
|
|
4 |
public function salesOrderSaveAfter(Varien_Event_Observer $observer)
|
5 |
{
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
|
|
11 |
public function customerRegisterNotification(Varien_Event_Observer $observer)
|
12 |
{
|
13 |
-
//
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
|
|
18 |
public function customerRegisterNotificationCheckout(Varien_Event_Observer $observer)
|
19 |
{
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
}
|
24 |
}
|
1 |
<?php
|
2 |
class EmizenTech_MobileAdmin_Model_Observer
|
3 |
{
|
4 |
+
private static $_handleCustomerFirstOrderCounter = 1;
|
5 |
+
private static $_handleCustomerFirstRegisterNotificationCounter = 1;
|
6 |
+
|
7 |
+
// when order palaced then will be notificate
|
8 |
public function salesOrderSaveAfter(Varien_Event_Observer $observer)
|
9 |
{
|
10 |
+
if(Mage::getStoreConfig('emizen_mob/emizen_general/enabled'))
|
11 |
+
{
|
12 |
+
if(self::$_handleCustomerFirstOrderCounter > 1)
|
13 |
+
{
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
self::$_handleCustomerFirstOrderCounter++;
|
17 |
+
$result = Mage::helper('mobileadmin')->pushNotification('order');
|
18 |
+
|
19 |
+
$quoteId = $observer->getEvent()->getOrder()->getData('quote_id');
|
20 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId);
|
21 |
+
$method = $quote->getCheckoutMethod(true);
|
22 |
+
|
23 |
+
if ($method=='register')
|
24 |
+
{
|
25 |
+
Mage::dispatchEvent('customer_register_checkout',
|
26 |
+
array(
|
27 |
+
'customer' => $observer->getEvent()->getOrder()->getCustomer()
|
28 |
+
)
|
29 |
+
);
|
30 |
+
}
|
31 |
+
}
|
32 |
}
|
33 |
|
34 |
+
// when customer registerd then will be notificate
|
35 |
public function customerRegisterNotification(Varien_Event_Observer $observer)
|
36 |
{
|
37 |
+
//return true;
|
38 |
+
if(Mage::getStoreConfig('emizen_mob/emizen_general/enabled'))
|
39 |
+
{
|
40 |
+
$customer = $observer->getEvent()->getCustomer();
|
41 |
+
if($customer)
|
42 |
+
{
|
43 |
+
$customer_id = $customer->getId();
|
44 |
+
}
|
45 |
+
if($customer_id)
|
46 |
+
{
|
47 |
+
$result = Mage::helper('mobileadmin')->pushNotification('customer');
|
48 |
+
//echo "<pre>"; print_r($result); die;
|
49 |
+
}
|
50 |
+
}
|
51 |
}
|
52 |
|
53 |
+
// when customer registerd using checkout process then will be notificate
|
54 |
public function customerRegisterNotificationCheckout(Varien_Event_Observer $observer)
|
55 |
{
|
56 |
+
$customer = $observer->getEvent()->getCustomer();
|
57 |
+
if ($customer)
|
58 |
+
{
|
59 |
+
$customer_id = $customer->getId();
|
60 |
+
$result = Mage::helper('mobileadmin')->pushNotification('customer');
|
61 |
+
}
|
62 |
}
|
63 |
}
|
app/code/local/EmizenTech/MobileAdmin/controllers/IndexController.php
CHANGED
@@ -308,11 +308,15 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
308 |
}
|
309 |
|
310 |
$limit = $post_data['limit'];
|
|
|
311 |
$storeId = $post_data['storeid']; // Make varibles to get post data one by one
|
312 |
$offset = $post_data['offset'];
|
313 |
$is_refresh = $post_data['is_refresh'];
|
314 |
|
315 |
$orderCollection = Mage::getResourceModel('sales/order_grid_collection')->addFieldToFilter('store_id',Array('eq'=>$storeId))->setOrder('entity_id', 'desc'); // get order collection filter by storeId and desc order by entityId
|
|
|
|
|
|
|
316 |
if($offset != null)
|
317 |
{
|
318 |
$orderCollection->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
@@ -326,10 +330,23 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
326 |
|
327 |
$orderCollection->getSelect()->where("(entity_id BETWEEN '".$min_fetch_order."'AND '".$last_fetch_order ."' AND updated_at > '".$last_updated."') OR entity_id >'".$last_fetch_order."'"); // collection filter by updated date
|
328 |
}
|
329 |
-
|
|
|
330 |
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
$orderListData[] = array(
|
334 |
'entity_id' => $order->getEntityId(),
|
335 |
'increment_id' => $order->getIncrementId(),
|
@@ -340,10 +357,12 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
340 |
'grand_total' => Mage::helper('mobileadmin')->getPrice($order->getGrandTotal()),
|
341 |
'toal_qty' => Mage::getModel('sales/order')->load($order->getEntityId())->getTotalQtyOrdered()
|
342 |
);
|
|
|
|
|
343 |
}
|
344 |
|
345 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // get updated time
|
346 |
-
$orderListResultArr = array('orderlistdata' => $orderListData,'updated_time' =>$updated_time);
|
347 |
//echo "<pre>"; print_r($orderListResultArr); die;
|
348 |
$orderListResult = Mage::helper('core')->jsonEncode($orderListResultArr); // comvert data array to json
|
349 |
return Mage::app()->getResponse()->setBody($orderListResult);
|
@@ -563,11 +582,15 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
563 |
}
|
564 |
$storeId = $post_data['storeid'];
|
565 |
$limit = $post_data['limit']; // Pass parameter according to post method pass
|
|
|
566 |
$offset = $post_data['offset'];
|
567 |
$new_products = $post_data['last_fetch_product'];
|
568 |
$is_refresh = $post_data['is_refresh'];
|
569 |
|
570 |
$products = Mage::getModel('catalog/product')->getCollection()->addStoreFilter($storeId)->setOrder('entity_id', 'desc');
|
|
|
|
|
|
|
571 |
if($offset != null)
|
572 |
{
|
573 |
$products->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
@@ -581,10 +604,22 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
581 |
$products->getSelect()->where("(entity_id BETWEEN '".$min_fetch_product."'AND '".$last_fetch_product ."' AND updated_at > '".$last_updated."') OR entity_id >'".$last_fetch_product."'");
|
582 |
}
|
583 |
|
584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
585 |
|
|
|
586 |
foreach($products as $product) // make array of products detail
|
587 |
{
|
|
|
|
|
588 |
$product_data = Mage::getModel('catalog/product')->load($product->getId()); // load product according to product id
|
589 |
$status = $product_data->getStatus(); // get product status
|
590 |
$qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_data)->getQty(); // get Quantity
|
@@ -606,9 +641,11 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
606 |
'image' => ($product_data->getImage())?Mage::helper('catalog/image')->init($product, 'image',$product_data->getImage())->resize(300,330)->keepAspectRatio(true)->constrainOnly(true)->__toString():'N/A',
|
607 |
'type' => $product->getTypeId()
|
608 |
);
|
|
|
|
|
609 |
}
|
610 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // last item updated time
|
611 |
-
$productResultArr = array('productlistdata' => $product_list,'updated_time' =>$updated_time);
|
612 |
//echo "<pre>"; print_r($productResultArr); die;
|
613 |
$productListResult = Mage::helper('core')->jsonEncode($productResultArr);
|
614 |
return Mage::app()->getResponse()->setBody($productListResult);
|
@@ -750,11 +787,14 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
750 |
}
|
751 |
|
752 |
$limit = $post_data['limit']; // define limit
|
|
|
753 |
$offset = $post_data['offset']; // define offset
|
754 |
$new_customers = $post_data['last_fetch_customer']; // define last fetch customer time
|
755 |
$is_refresh = $post_data['is_refresh']; // pass is_refresh int 1 or 0
|
756 |
$customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->setOrder('entity_id', 'desc');
|
757 |
|
|
|
|
|
758 |
if($offset != null)
|
759 |
{
|
760 |
$customers->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
@@ -768,8 +808,22 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
768 |
$customers->getSelect()->where("(e.entity_id BETWEEN '".$min_fetch_customer."'AND '".$last_fetch_customer ."' AND updated_at > '".$last_updated."') OR e.entity_id >'".$last_fetch_customer."'");
|
769 |
}
|
770 |
|
771 |
-
|
772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
{
|
774 |
$billing_address = Mage::getModel('customer/address')->load($customer->getDefaultBilling()); // get billing address
|
775 |
$shipping_address = Mage::getModel('customer/address')->load($customer->getDefaultShipping()); // get shipping address
|
@@ -783,9 +837,11 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
783 |
'billing_address_id' => $billing_address->getId(),
|
784 |
'shipping_address_id' => $shipping_address->getId()
|
785 |
);
|
|
|
786 |
}
|
|
|
787 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // updated time
|
788 |
-
$customerListResultArr = array('customerlistdata' => $customer_list,'updated_time' =>$updated_time);
|
789 |
$customerListResult = Mage::helper('core')->jsonEncode($customerListResultArr);
|
790 |
return Mage::app()->getResponse()->setBody($customerListResult); // return customer list in default json format
|
791 |
}
|
@@ -1007,7 +1063,7 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1007 |
$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
|
1008 |
|
1009 |
list ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')
|
1010 |
-
->getDateRange('
|
1011 |
|
1012 |
$dateStart->setTimezone($timezoneLocal);
|
1013 |
$dateEnd->setTimezone($timezoneLocal);
|
@@ -1045,7 +1101,8 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1045 |
$count = 0;
|
1046 |
foreach($dates as $date)
|
1047 |
{
|
1048 |
-
|
|
|
1049 |
|
1050 |
if($type_id==24)
|
1051 |
{
|
@@ -1058,9 +1115,11 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1058 |
$dateEnd = date('Y-m-d 23:59:59',strtotime($date));
|
1059 |
}
|
1060 |
$orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from'=>$dateStart, 'to'=>$dateEnd));
|
1061 |
-
$orderByDate->
|
1062 |
-
|
1063 |
-
|
|
|
|
|
1064 |
if(count($orderByDate) == 0)
|
1065 |
{
|
1066 |
if ($type_id==24)
|
@@ -1078,20 +1137,86 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1078 |
}
|
1079 |
else
|
1080 |
{
|
|
|
1081 |
if($type_id==24)
|
1082 |
{
|
1083 |
-
|
1084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1085 |
}
|
1086 |
else if ($type_id=='month')
|
1087 |
{
|
1088 |
-
|
1089 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1090 |
}
|
1091 |
else
|
1092 |
{
|
1093 |
-
|
1094 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1095 |
}
|
1096 |
}
|
1097 |
|
@@ -1120,17 +1245,37 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1120 |
|
1121 |
foreach($dates as $date)
|
1122 |
{
|
1123 |
-
|
|
|
|
|
1124 |
$dateStart = date('Y-m-d 00:00:00',strtotime($date));
|
1125 |
$dateEnd = date('Y-m-d 23:59:59',strtotime($date));
|
1126 |
$orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from'=>$dateStart, 'to'=>$dateEnd));
|
1127 |
-
|
1128 |
-
$orderByDate->getSelect()->group(array('store_id'));
|
1129 |
-
$orderdata= $orderByDate->getData();
|
1130 |
-
$ordersByDate[] = $orderdata[0]['grand_total_sum'];
|
1131 |
}
|
1132 |
|
1133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1134 |
}
|
1135 |
}
|
1136 |
|
@@ -1140,7 +1285,44 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1140 |
//$averageOrder = strip_tags(Mage::helper('core')->currency(round(Mage::getResourceModel('reports/order_collection')->addFieldToFilter('store_id', $storeId)->calculateSales()->load()->getFirstItem()->getAverage(),2)));
|
1141 |
//$orderTotalResultArr = array('dashboard_result' =>array('ordertotalbydate' => $orderTotalByDate,'ordergrandtotal' => $orderGrandTotal,'totalordercount' => $total_count,'lifetimesales' => $lifeTimeSales,'averageorder' => $averageOrder));
|
1142 |
|
1143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1144 |
//echo "<pre>"; print_r($orderTotalResultArr); die;
|
1145 |
$orderDashboardResult = Mage::helper('core')->jsonEncode($orderTotalResultArr);
|
1146 |
return Mage::app()->getResponse()->setBody($orderDashboardResult);
|
@@ -1233,4 +1415,164 @@ class EmizenTech_MobileAdmin_IndexController extends Mage_Core_Controller_Front_
|
|
1233 |
$result = strtotime("{$year}-{$month}-01");
|
1234 |
return date('Y-m-d', $result);
|
1235 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1236 |
}
|
308 |
}
|
309 |
|
310 |
$limit = $post_data['limit'];
|
311 |
+
$page = $post_data['page_num'];
|
312 |
$storeId = $post_data['storeid']; // Make varibles to get post data one by one
|
313 |
$offset = $post_data['offset'];
|
314 |
$is_refresh = $post_data['is_refresh'];
|
315 |
|
316 |
$orderCollection = Mage::getResourceModel('sales/order_grid_collection')->addFieldToFilter('store_id',Array('eq'=>$storeId))->setOrder('entity_id', 'desc'); // get order collection filter by storeId and desc order by entityId
|
317 |
+
|
318 |
+
$before_coll = count(Mage::getResourceModel('sales/order_grid_collection')->addFieldToFilter('store_id',Array('eq'=>$storeId))->setOrder('entity_id', 'desc')); //echo $before_coll; die;
|
319 |
+
|
320 |
if($offset != null)
|
321 |
{
|
322 |
$orderCollection->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
330 |
|
331 |
$orderCollection->getSelect()->where("(entity_id BETWEEN '".$min_fetch_order."'AND '".$last_fetch_order ."' AND updated_at > '".$last_updated."') OR entity_id >'".$last_fetch_order."'"); // collection filter by updated date
|
332 |
}
|
333 |
+
//$orderCollection->getSelect()->limit($limit); // define limit
|
334 |
+
//echo "<pre>"; print_r(get_class_methods($orderCollection)); die;
|
335 |
|
336 |
+
if(isset($page) && $limit)
|
337 |
+
{
|
338 |
+
//echo $page."**".$limit; die;
|
339 |
+
$orderCollection->setPage($page,$limit);
|
340 |
+
$orderCollection->setPageSize($limit);
|
341 |
+
}
|
342 |
|
343 |
+
$totl_rocrd = round($before_coll/$limit); //echo $totl_rocrd; die;
|
344 |
+
|
345 |
+
$i = ($page - 1)*$limit;
|
346 |
+
|
347 |
+
foreach($orderCollection as $order){
|
348 |
+
if($i < $before_coll)
|
349 |
+
{
|
350 |
$orderListData[] = array(
|
351 |
'entity_id' => $order->getEntityId(),
|
352 |
'increment_id' => $order->getIncrementId(),
|
357 |
'grand_total' => Mage::helper('mobileadmin')->getPrice($order->getGrandTotal()),
|
358 |
'toal_qty' => Mage::getModel('sales/order')->load($order->getEntityId())->getTotalQtyOrdered()
|
359 |
);
|
360 |
+
$i++;
|
361 |
+
}
|
362 |
}
|
363 |
|
364 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // get updated time
|
365 |
+
$orderListResultArr = array('orderlistdata' => $orderListData,'updated_time' =>$updated_time, 'total_record'=>$totl_rocrd);
|
366 |
//echo "<pre>"; print_r($orderListResultArr); die;
|
367 |
$orderListResult = Mage::helper('core')->jsonEncode($orderListResultArr); // comvert data array to json
|
368 |
return Mage::app()->getResponse()->setBody($orderListResult);
|
582 |
}
|
583 |
$storeId = $post_data['storeid'];
|
584 |
$limit = $post_data['limit']; // Pass parameter according to post method pass
|
585 |
+
$page = $post_data['page_num'];
|
586 |
$offset = $post_data['offset'];
|
587 |
$new_products = $post_data['last_fetch_product'];
|
588 |
$is_refresh = $post_data['is_refresh'];
|
589 |
|
590 |
$products = Mage::getModel('catalog/product')->getCollection()->addStoreFilter($storeId)->setOrder('entity_id', 'desc');
|
591 |
+
|
592 |
+
$before_coll = count(Mage::getModel('catalog/product')->getCollection()->addStoreFilter($storeId)->setOrder('entity_id', 'desc')); //echo $before_coll; die;
|
593 |
+
|
594 |
if($offset != null)
|
595 |
{
|
596 |
$products->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
604 |
$products->getSelect()->where("(entity_id BETWEEN '".$min_fetch_product."'AND '".$last_fetch_product ."' AND updated_at > '".$last_updated."') OR entity_id >'".$last_fetch_product."'");
|
605 |
}
|
606 |
|
607 |
+
//$products->getSelect()->limit($limit); // define limit how many show items in your page
|
608 |
+
|
609 |
+
if(isset($page) && $limit)
|
610 |
+
{
|
611 |
+
//echo $page."**".$limit; die;
|
612 |
+
$products->setPage($page,$limit);
|
613 |
+
$products->setPageSize($limit);
|
614 |
+
}
|
615 |
+
|
616 |
+
$totl_rocrd = round($before_coll/$limit); //echo $totl_rocrd; die;
|
617 |
|
618 |
+
$i = ($page - 1)*$limit;
|
619 |
foreach($products as $product) // make array of products detail
|
620 |
{
|
621 |
+
if($i < $before_coll)
|
622 |
+
{
|
623 |
$product_data = Mage::getModel('catalog/product')->load($product->getId()); // load product according to product id
|
624 |
$status = $product_data->getStatus(); // get product status
|
625 |
$qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_data)->getQty(); // get Quantity
|
641 |
'image' => ($product_data->getImage())?Mage::helper('catalog/image')->init($product, 'image',$product_data->getImage())->resize(300,330)->keepAspectRatio(true)->constrainOnly(true)->__toString():'N/A',
|
642 |
'type' => $product->getTypeId()
|
643 |
);
|
644 |
+
$i++;
|
645 |
+
}
|
646 |
}
|
647 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // last item updated time
|
648 |
+
$productResultArr = array('productlistdata' => $product_list,'updated_time' =>$updated_time,'total_record'=>$totl_rocrd);
|
649 |
//echo "<pre>"; print_r($productResultArr); die;
|
650 |
$productListResult = Mage::helper('core')->jsonEncode($productResultArr);
|
651 |
return Mage::app()->getResponse()->setBody($productListResult);
|
787 |
}
|
788 |
|
789 |
$limit = $post_data['limit']; // define limit
|
790 |
+
$page = $post_data['page_num'];
|
791 |
$offset = $post_data['offset']; // define offset
|
792 |
$new_customers = $post_data['last_fetch_customer']; // define last fetch customer time
|
793 |
$is_refresh = $post_data['is_refresh']; // pass is_refresh int 1 or 0
|
794 |
$customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->setOrder('entity_id', 'desc');
|
795 |
|
796 |
+
$before_coll = count(Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->setOrder('entity_id', 'desc')); //echo $before_coll; die;
|
797 |
+
|
798 |
if($offset != null)
|
799 |
{
|
800 |
$customers->addAttributeToFilter('entity_id', array('lt' => $offset)); // lt means less then
|
808 |
$customers->getSelect()->where("(e.entity_id BETWEEN '".$min_fetch_customer."'AND '".$last_fetch_customer ."' AND updated_at > '".$last_updated."') OR e.entity_id >'".$last_fetch_customer."'");
|
809 |
}
|
810 |
|
811 |
+
//$customers->getSelect()->limit($limit); // define limit
|
812 |
+
|
813 |
+
if(isset($page) && $limit)
|
814 |
+
{
|
815 |
+
//echo $page."**".$limit; die;
|
816 |
+
$customers->setPage($page,$limit);
|
817 |
+
$customers->setPageSize($limit);
|
818 |
+
}
|
819 |
+
|
820 |
+
$totl_rocrd = round($before_coll/$limit); //echo $totl_rocrd; die;
|
821 |
+
|
822 |
+
$i = ($page - 1)*$limit;
|
823 |
+
|
824 |
+
foreach($customers as $customer)
|
825 |
+
{
|
826 |
+
if($i < $before_coll)
|
827 |
{
|
828 |
$billing_address = Mage::getModel('customer/address')->load($customer->getDefaultBilling()); // get billing address
|
829 |
$shipping_address = Mage::getModel('customer/address')->load($customer->getDefaultShipping()); // get shipping address
|
837 |
'billing_address_id' => $billing_address->getId(),
|
838 |
'shipping_address_id' => $shipping_address->getId()
|
839 |
);
|
840 |
+
$i++;
|
841 |
}
|
842 |
+
}
|
843 |
$updated_time = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); // updated time
|
844 |
+
$customerListResultArr = array('customerlistdata' => $customer_list,'updated_time' =>$updated_time,'total_record'=>$totl_rocrd);
|
845 |
$customerListResult = Mage::helper('core')->jsonEncode($customerListResultArr);
|
846 |
return Mage::app()->getResponse()->setBody($customerListResult); // return customer list in default json format
|
847 |
}
|
1063 |
$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
|
1064 |
|
1065 |
list ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')
|
1066 |
+
->getDateRange('12h', '', '', true);
|
1067 |
|
1068 |
$dateStart->setTimezone($timezoneLocal);
|
1069 |
$dateEnd->setTimezone($timezoneLocal);
|
1101 |
$count = 0;
|
1102 |
foreach($dates as $date)
|
1103 |
{
|
1104 |
+
//$orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id',Array('eq'=>$storeId))->addFieldToFilter('status',Array('eq'=>'complete'))->setOrder('entity_id', 'desc');
|
1105 |
+
$orderCollectionByDate = Mage::getModel('sales/order')->getCollection();
|
1106 |
|
1107 |
if($type_id==24)
|
1108 |
{
|
1115 |
$dateEnd = date('Y-m-d 23:59:59',strtotime($date));
|
1116 |
}
|
1117 |
$orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from'=>$dateStart, 'to'=>$dateEnd));
|
1118 |
+
//echo "<pre>"; print_r($orderByDate->getData());
|
1119 |
+
//$orderByDate->getSelect()->columns('SUM(grand_total) AS grand_total_sum');
|
1120 |
+
// $orderByDate->getSelect()->group(array('store_id'));
|
1121 |
+
// $orderdata= $orderByDate->getData();
|
1122 |
+
//echo count($orderByDate); die;
|
1123 |
if(count($orderByDate) == 0)
|
1124 |
{
|
1125 |
if ($type_id==24)
|
1137 |
}
|
1138 |
else
|
1139 |
{
|
1140 |
+
//echo $type_id; die;
|
1141 |
if($type_id==24)
|
1142 |
{
|
1143 |
+
//$ordersByDate[date("Y-m-d H:i",strtotime($date))][] = $orderdata[0]['grand_total_sum'];
|
1144 |
+
//$orderTotalByDate[date("Y-m-d H:i",strtotime($date))] = array_sum($ordersByDate[date("Y-m-d H:i",strtotime($date))]);
|
1145 |
+
$orderTotalByDate[date("Y-m-d H:i",strtotime($date))] = count($orderByDate);
|
1146 |
+
|
1147 |
+
$orderByDate->getSelect()->columns('SUM(grand_total) AS grand_total_sum');
|
1148 |
+
$orderByDate->getSelect()->columns('SUM(tax_amount) AS tax_total_sum');
|
1149 |
+
$orderByDate->getSelect()->columns('SUM(shipping_amount) AS shipping_total_sum');
|
1150 |
+
$orderByDate->getSelect()->columns('SUM(total_qty_ordered) AS qty_total_sum');
|
1151 |
+
|
1152 |
+
$orderByDateData = $orderByDate->getData();
|
1153 |
+
|
1154 |
+
$ordersByDate[$date][] = $orderByDateData[0]['grand_total_sum'];
|
1155 |
+
$orderTotalByDateTotoal[] = array_sum($ordersByDate[$date]);
|
1156 |
+
|
1157 |
+
$ordersByDateTax[$date][] = $orderByDateData[0]['tax_total_sum'];
|
1158 |
+
$orderTotalByDateTax[] = array_sum($ordersByDateTax[$date]);
|
1159 |
+
|
1160 |
+
$ordersByDateShipping[$date][] = $orderByDateData[0]['shipping_total_sum'];
|
1161 |
+
$orderTotalByDateShipping[] = array_sum($ordersByDateShipping[$date]);
|
1162 |
+
|
1163 |
+
$ordersByDateQty[$date][] = $orderByDateData[0]['qty_total_sum'];
|
1164 |
+
$orderTotalByDateQty[] = array_sum($ordersByDateQty[$date]);
|
1165 |
+
|
1166 |
}
|
1167 |
else if ($type_id=='month')
|
1168 |
{
|
1169 |
+
//$ordersByDate[date('d',strtotime($date))][] = $orderdata[0]['grand_total_sum'];
|
1170 |
+
//$orderTotalByDate[date('d',strtotime($date))] = array_sum($ordersByDate[date('d',strtotime($date))]);
|
1171 |
+
$orderTotalByDate[date('d',strtotime($date))] = count($orderByDate);
|
1172 |
+
|
1173 |
+
$orderByDate->getSelect()->columns('SUM(grand_total) AS grand_total_sum');
|
1174 |
+
$orderByDate->getSelect()->columns('SUM(tax_amount) AS tax_total_sum');
|
1175 |
+
$orderByDate->getSelect()->columns('SUM(shipping_amount) AS shipping_total_sum');
|
1176 |
+
$orderByDate->getSelect()->columns('SUM(total_qty_ordered) AS qty_total_sum');
|
1177 |
+
|
1178 |
+
$orderByDateData = $orderByDate->getData();
|
1179 |
+
|
1180 |
+
$ordersByDate[$date][] = $orderByDateData[0]['grand_total_sum'];
|
1181 |
+
$orderTotalByDateTotoal[] = array_sum($ordersByDate[$date]);
|
1182 |
+
|
1183 |
+
$ordersByDateTax[$date][] = $orderByDateData[0]['tax_total_sum'];
|
1184 |
+
$orderTotalByDateTax[] = array_sum($ordersByDateTax[$date]);
|
1185 |
+
|
1186 |
+
$ordersByDateShipping[$date][] = $orderByDateData[0]['shipping_total_sum'];
|
1187 |
+
$orderTotalByDateShipping[] = array_sum($ordersByDateShipping[$date]);
|
1188 |
+
|
1189 |
+
$ordersByDateQty[$date][] = $orderByDateData[0]['qty_total_sum'];
|
1190 |
+
$orderTotalByDateQty[] = array_sum($ordersByDateQty[$date]);
|
1191 |
+
|
1192 |
}
|
1193 |
else
|
1194 |
{
|
1195 |
+
//$ordersByDate[$date][] = $orderdata[0]['grand_total_sum'];
|
1196 |
+
//$orderTotalByDate[$date] = array_sum($ordersByDate[$date]);
|
1197 |
+
$orderTotalByDate[$date] = count($orderByDate);
|
1198 |
+
|
1199 |
+
|
1200 |
+
$orderByDate->getSelect()->columns('SUM(grand_total) AS grand_total_sum');
|
1201 |
+
$orderByDate->getSelect()->columns('SUM(tax_amount) AS tax_total_sum');
|
1202 |
+
$orderByDate->getSelect()->columns('SUM(shipping_amount) AS shipping_total_sum');
|
1203 |
+
$orderByDate->getSelect()->columns('SUM(total_qty_ordered) AS qty_total_sum');
|
1204 |
+
|
1205 |
+
$orderByDateData = $orderByDate->getData();
|
1206 |
+
|
1207 |
+
$ordersByDate[$date][] = $orderByDateData[0]['grand_total_sum'];
|
1208 |
+
$orderTotalByDateTotoal[] = array_sum($ordersByDate[$date]);
|
1209 |
+
|
1210 |
+
$ordersByDateTax[$date][] = $orderByDateData[0]['tax_total_sum'];
|
1211 |
+
$orderTotalByDateTax[] = array_sum($ordersByDateTax[$date]);
|
1212 |
+
|
1213 |
+
$ordersByDateShipping[$date][] = $orderByDateData[0]['shipping_total_sum'];
|
1214 |
+
$orderTotalByDateShipping[] = array_sum($ordersByDateShipping[$date]);
|
1215 |
+
|
1216 |
+
$ordersByDateQty[$date][] = $orderByDateData[0]['qty_total_sum'];
|
1217 |
+
$orderTotalByDateQty[] = array_sum($ordersByDateQty[$date]);
|
1218 |
+
|
1219 |
+
|
1220 |
}
|
1221 |
}
|
1222 |
|
1245 |
|
1246 |
foreach($dates as $date)
|
1247 |
{
|
1248 |
+
|
1249 |
+
$orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id',Array('eq'=>$storeId));
|
1250 |
+
|
1251 |
$dateStart = date('Y-m-d 00:00:00',strtotime($date));
|
1252 |
$dateEnd = date('Y-m-d 23:59:59',strtotime($date));
|
1253 |
$orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from'=>$dateStart, 'to'=>$dateEnd));
|
1254 |
+
|
|
|
|
|
|
|
1255 |
}
|
1256 |
|
1257 |
+
//$orderTotalByDate[$month] = array_sum($ordersByDate);
|
1258 |
+
$orderTotalByDate[$month] = count($orderByDate);
|
1259 |
+
|
1260 |
+
$orderByDate->getSelect()->columns('SUM(grand_total) AS grand_total_sum');
|
1261 |
+
$orderByDate->getSelect()->columns('SUM(tax_amount) AS tax_total_sum');
|
1262 |
+
$orderByDate->getSelect()->columns('SUM(shipping_amount) AS shipping_total_sum');
|
1263 |
+
$orderByDate->getSelect()->columns('SUM(total_qty_ordered) AS qty_total_sum');
|
1264 |
+
|
1265 |
+
$orderByDateData = $orderByDate->getData();
|
1266 |
+
|
1267 |
+
$ordersByDate[$date][] = $orderByDateData[0]['grand_total_sum'];
|
1268 |
+
$orderTotalByDateTotoal[] = array_sum($ordersByDate[$date]);
|
1269 |
+
|
1270 |
+
$ordersByDateTax[$date][] = $orderByDateData[0]['tax_total_sum'];
|
1271 |
+
$orderTotalByDateTax[] = array_sum($ordersByDateTax[$date]);
|
1272 |
+
|
1273 |
+
$ordersByDateShipping[$date][] = $orderByDateData[0]['shipping_total_sum'];
|
1274 |
+
$orderTotalByDateShipping[] = array_sum($ordersByDateShipping[$date]);
|
1275 |
+
|
1276 |
+
$ordersByDateQty[$date][] = $orderByDateData[0]['qty_total_sum'];
|
1277 |
+
$orderTotalByDateQty[] = array_sum($ordersByDateQty[$date]);
|
1278 |
+
|
1279 |
}
|
1280 |
}
|
1281 |
|
1285 |
//$averageOrder = strip_tags(Mage::helper('core')->currency(round(Mage::getResourceModel('reports/order_collection')->addFieldToFilter('store_id', $storeId)->calculateSales()->load()->getFirstItem()->getAverage(),2)));
|
1286 |
//$orderTotalResultArr = array('dashboard_result' =>array('ordertotalbydate' => $orderTotalByDate,'ordergrandtotal' => $orderGrandTotal,'totalordercount' => $total_count,'lifetimesales' => $lifeTimeSales,'averageorder' => $averageOrder));
|
1287 |
|
1288 |
+
|
1289 |
+
$tot = 0;
|
1290 |
+
$totTax = 0;
|
1291 |
+
$$totShipping = 0;
|
1292 |
+
$totQty = 0;
|
1293 |
+
for($i=0; $i<=count($orderTotalByDateTotoal); $i++)
|
1294 |
+
{
|
1295 |
+
$tot = $tot + $orderTotalByDateTotoal[$i];
|
1296 |
+
}
|
1297 |
+
|
1298 |
+
for($j = 0; $j <= count($orderTotalByDateTax); $j++)
|
1299 |
+
{
|
1300 |
+
$totTax = $totTax + $orderTotalByDateTax[$j];
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
for($k = 0; $k <= count($orderTotalByDateShipping); $k++)
|
1304 |
+
{
|
1305 |
+
$totShipping = $totShipping + $orderTotalByDateShipping[$k];
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
for($l = 0; $l <= count($orderTotalByDateQty); $l++)
|
1309 |
+
{
|
1310 |
+
$totQty = $totQty + $orderTotalByDateQty[$l];
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
//$orderTotalResultArr = array('dashboard_result' =>array('ordertotalbydate' => $orderTotalByDate));
|
1314 |
+
$orderTotalResultArr = array(
|
1315 |
+
'dashboard_result' => array(
|
1316 |
+
'ordertotalbydate' => $orderTotalByDate,
|
1317 |
+
'orderTotalAmount' => array(
|
1318 |
+
'Revenue' => Mage::helper('core')->currency($tot, true, false),
|
1319 |
+
'Tax' => Mage::helper('core')->currency($totTax, true, false),
|
1320 |
+
'Shipping' => Mage::helper('core')->currency($totShipping, true, false),
|
1321 |
+
'Quantity' => $totQty
|
1322 |
+
)
|
1323 |
+
),
|
1324 |
+
);
|
1325 |
+
|
1326 |
//echo "<pre>"; print_r($orderTotalResultArr); die;
|
1327 |
$orderDashboardResult = Mage::helper('core')->jsonEncode($orderTotalResultArr);
|
1328 |
return Mage::app()->getResponse()->setBody($orderDashboardResult);
|
1415 |
$result = strtotime("{$year}-{$month}-01");
|
1416 |
return date('Y-m-d', $result);
|
1417 |
}
|
1418 |
+
|
1419 |
+
/*public function reIndexAction()
|
1420 |
+
{
|
1421 |
+
$collection = Mage::getResourceModel('index/process_collection');
|
1422 |
+
$re = Mage::getModel('index/process');
|
1423 |
+
echo "<pre>"; print_r($re->getCollection()->getData()); die;
|
1424 |
+
|
1425 |
+
|
1426 |
+
$data = Mage::app()->getRequest()->getParams();
|
1427 |
+
|
1428 |
+
$processId = $data['process'];
|
1429 |
+
//echo $processId['process']; die;
|
1430 |
+
$result = array();
|
1431 |
+
|
1432 |
+
$process = $this->_initProcess($processId);
|
1433 |
+
|
1434 |
+
echo $process->getIndexer()->getName();
|
1435 |
+
|
1436 |
+
echo "<pre>"; print_r($process->getData()); die;
|
1437 |
+
if ($process)
|
1438 |
+
{
|
1439 |
+
try {
|
1440 |
+
Varien_Profiler::start('__INDEX_PROCESS_REINDEX_ALL__');
|
1441 |
+
|
1442 |
+
$process->reindexEverything();
|
1443 |
+
Varien_Profiler::stop('__INDEX_PROCESS_REINDEX_ALL__');
|
1444 |
+
|
1445 |
+
$result['status'] = "index was rebuilt.".$process->getIndexer()->getName();
|
1446 |
+
} catch (Mage_Core_Exception $e) {
|
1447 |
+
|
1448 |
+
$result['error'] = $e->getMessage();
|
1449 |
+
} catch (Exception $e) {
|
1450 |
+
|
1451 |
+
$result['error'] = "There was a problem with reindexing process.";
|
1452 |
+
}
|
1453 |
+
} else {
|
1454 |
+
|
1455 |
+
$result['error'] = "Cannot initialize the indexer process.";
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
echo "<pre>"; print_r($result);
|
1459 |
+
}
|
1460 |
+
|
1461 |
+
protected function _initProcess($processId)
|
1462 |
+
{
|
1463 |
+
//$processId = Mage::app()->getRequest()->getParams('process');
|
1464 |
+
if($processId)
|
1465 |
+
{
|
1466 |
+
$process = Mage::getModel('index/process')->load($processId);
|
1467 |
+
if($process->getId() && $process->getIndexer()->isVisible())
|
1468 |
+
{
|
1469 |
+
return $process;
|
1470 |
+
}
|
1471 |
+
}
|
1472 |
+
return false;
|
1473 |
+
}*/
|
1474 |
+
|
1475 |
+
/**
|
1476 |
+
* Reindex all using command
|
1477 |
+
*/
|
1478 |
+
public function reindexAllAction()
|
1479 |
+
{
|
1480 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
|
1481 |
+
{
|
1482 |
+
$post_data = Mage::app()->getRequest()->getParams(); // get data from post method
|
1483 |
+
$sessionId = $post_data['session']; // session id
|
1484 |
+
if(!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // if logged in return true otherwise access denied
|
1485 |
+
{
|
1486 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
1487 |
+
return false;
|
1488 |
+
}
|
1489 |
+
try
|
1490 |
+
{
|
1491 |
+
$result = array();
|
1492 |
+
$mage_base = Mage::getBaseDir();
|
1493 |
+
//echo $mage_base; die;
|
1494 |
+
system("php ". $mage_base ."/shell/indexer.php reindexall > ".$mage_base."/var/log/reindexall.log &");
|
1495 |
+
$result['success'] = "reindexall via SHELL processing !";
|
1496 |
+
}
|
1497 |
+
catch(Exception $e)
|
1498 |
+
{
|
1499 |
+
$result['error'] = $e->getMessage();
|
1500 |
+
}
|
1501 |
+
$jsonData = Mage::helper('core')->jsonEncode($result);
|
1502 |
+
return Mage::app()->getResponse()->setBody($jsonData);
|
1503 |
+
}
|
1504 |
+
else
|
1505 |
+
{
|
1506 |
+
$isEnable = Mage::helper('core')->jsonEncode(array('enable' => false));
|
1507 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
1508 |
+
}
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
/**
|
1512 |
+
* Flush cache storage
|
1513 |
+
*/
|
1514 |
+
public function flushAllAction()
|
1515 |
+
{
|
1516 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
|
1517 |
+
{
|
1518 |
+
$post_data = Mage::app()->getRequest()->getParams(); // get data from post method
|
1519 |
+
$sessionId = $post_data['session']; // session id
|
1520 |
+
if(!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // if logged in return true otherwise access denied
|
1521 |
+
{
|
1522 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
1523 |
+
return false;
|
1524 |
+
}
|
1525 |
+
try
|
1526 |
+
{
|
1527 |
+
$result = array();
|
1528 |
+
Mage::app()->getCacheInstance()->flush();
|
1529 |
+
$result['success'] = "The cache storage has been flushed.";
|
1530 |
+
}
|
1531 |
+
catch (Exception $e)
|
1532 |
+
{
|
1533 |
+
$result['error'] = $e->getMessage();
|
1534 |
+
}
|
1535 |
+
$jsonData = Mage::helper('core')->jsonEncode($result);
|
1536 |
+
return Mage::app()->getResponse()->setBody($jsonData);
|
1537 |
+
}
|
1538 |
+
else
|
1539 |
+
{
|
1540 |
+
$isEnable = Mage::helper('core')->jsonEncode(array('enable' => false));
|
1541 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
1542 |
+
}
|
1543 |
+
}
|
1544 |
+
|
1545 |
+
/**
|
1546 |
+
* Flush all magento cache
|
1547 |
+
*/
|
1548 |
+
public function flushSystemAction()
|
1549 |
+
{
|
1550 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check extension if enabled or not
|
1551 |
+
{
|
1552 |
+
$post_data = Mage::app()->getRequest()->getParams(); // get data from post method
|
1553 |
+
$sessionId = $post_data['session']; // session id
|
1554 |
+
if(!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // if logged in return true otherwise access denied
|
1555 |
+
{
|
1556 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
1557 |
+
return false;
|
1558 |
+
}
|
1559 |
+
try
|
1560 |
+
{
|
1561 |
+
$result = array();
|
1562 |
+
Mage::app()->cleanCache();
|
1563 |
+
$result['success'] = "The Magento cache storage has been flushed.";
|
1564 |
+
}
|
1565 |
+
catch(Exception $e)
|
1566 |
+
{
|
1567 |
+
$result['error'] = $e->getMessage();
|
1568 |
+
}
|
1569 |
+
$jsonData = Mage::helper('core')->jsonEncode($result);
|
1570 |
+
return Mage::app()->getResponse()->setBody($jsonData);
|
1571 |
+
}
|
1572 |
+
else
|
1573 |
+
{
|
1574 |
+
$isEnable = Mage::helper('core')->jsonEncode(array('enable' => false));
|
1575 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
1576 |
+
}
|
1577 |
+
}
|
1578 |
}
|
app/code/local/EmizenTech/MobileAdmin/controllers/ReportController.php
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class EmizenTech_MobileAdmin_ReportController extends Mage_Core_Controller_Front_Action{
|
3 |
+
|
4 |
+
/*
|
5 |
+
*@ get admin report sales order using start and end date and more specific variables
|
6 |
+
*Parameter: startDate, endDate, sessionId, period(ex. day,month), status(ex. canceled,completed etc.)
|
7 |
+
*/
|
8 |
+
public function AdminReportOrderAction()
|
9 |
+
{
|
10 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check if extension is enabled or not ?
|
11 |
+
{
|
12 |
+
$post_data = Mage::app()->getRequest()->getParams();
|
13 |
+
$sessionId = $post_data['session'];
|
14 |
+
if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check if customer is not logged in then return Access denied
|
15 |
+
{
|
16 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
17 |
+
return false; // return logged out
|
18 |
+
}
|
19 |
+
|
20 |
+
$start_date = $post_data['date_start'];
|
21 |
+
$end_date = $post_data['date_end'];
|
22 |
+
$storeId = $post_data['store_id'];
|
23 |
+
$dateStart = date('Y-m-d', strtotime($start_date));
|
24 |
+
$dateEnd = date('Y-m-d',strtotime($end_date));
|
25 |
+
$period = $post_data['period'];
|
26 |
+
|
27 |
+
$store = $post_data['store_id'];
|
28 |
+
|
29 |
+
$orderStatuses = array($post_data['status']);
|
30 |
+
|
31 |
+
$dat = array(
|
32 |
+
'orders_count' => 'sum(orders_count)',
|
33 |
+
'total_qty_ordered' => 'sum(total_qty_ordered)',
|
34 |
+
'total_income_amount' => 'sum(total_income_amount)', // Queries in mysql
|
35 |
+
'total_invoiced_amount' => 'sum(total_invoiced_amount)',
|
36 |
+
'total_refunded_amount' => 'sum(total_refunded_amount)',
|
37 |
+
'total_tax_amount' => 'sum(total_tax_amount)',
|
38 |
+
'total_shipping_amount' => 'sum(total_shipping_amount)',
|
39 |
+
'total_discount_amount' => 'sum(total_discount_amount)',
|
40 |
+
'total_canceled_amount' => 'sum(total_canceled_amount)'
|
41 |
+
);
|
42 |
+
|
43 |
+
if(is_array($orderStatuses))
|
44 |
+
{
|
45 |
+
if(count($orderStatuses) == 1 && strpos($orderStatuses[0],',')!== false)
|
46 |
+
{
|
47 |
+
$post_data['status'] = explode(',',$orderStatuses[0]);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
$Rcolection = Mage::getResourceModel('sales/report_order_collection') // report sales order model
|
52 |
+
->setPeriod($period)
|
53 |
+
->setDateRange($dateStart,$dateEnd)
|
54 |
+
->addStoreFilter($store) //filtering report order sing these parameters
|
55 |
+
->addOrderStatusFilter($post_data['status'])
|
56 |
+
->setAggregatedColumns($dat);
|
57 |
+
|
58 |
+
$result = array();
|
59 |
+
foreach($Rcolection as $_data)
|
60 |
+
{
|
61 |
+
$result['report_sales_order'][] = $_data->getData();
|
62 |
+
}
|
63 |
+
|
64 |
+
$totalOrder = 0;
|
65 |
+
$totalOrderQty = 0;
|
66 |
+
$totalOrderQtyInvoice = 0;
|
67 |
+
$totalIncomeAmount = 0;
|
68 |
+
$totalRevenueAmount = 0;
|
69 |
+
$totalProfitAmount = 0;
|
70 |
+
$totalInvoicedAmount = 0;
|
71 |
+
$totalCanceledAmount = 0;
|
72 |
+
$totalPaidAmount = 0;
|
73 |
+
$totalRefundedAmount = 0;
|
74 |
+
$totalTaxAmount = 0;
|
75 |
+
$totalTaxAmountActual = 0;
|
76 |
+
$totalShippingAmount = 0;
|
77 |
+
$totalShippingAmountActual = 0;
|
78 |
+
$totalDiscountAmount = 0;
|
79 |
+
$totalDiscountAmountActual = 0;
|
80 |
+
|
81 |
+
foreach ($result['report_sales_order'] as $key => $value) // caculated price
|
82 |
+
{
|
83 |
+
$totalOrder = $totalOrder + $value['orders_count'];
|
84 |
+
$totalOrderQty = $totalOrderQty + $value['total_qty_ordered'];
|
85 |
+
$totalOrderQtyInvoice = $totalOrderQtyInvoice + $value['total_qty_invoiced'];
|
86 |
+
$totalIncomeAmount = $totalIncomeAmount + $value['total_income_amount'];
|
87 |
+
$totalRevenueAmount = $totalRevenueAmount + $value['total_revenue_amount'];
|
88 |
+
$totalProfitAmount = $totalProfitAmount + $value['total_profit_amount'];
|
89 |
+
$totalInvoicedAmount = $totalInvoicedAmount + $value['total_invoiced_amount'];
|
90 |
+
$totalCanceledAmount = $totalCanceledAmount + $value['total_canceled_amount'];
|
91 |
+
$totalPaidAmount = $totalPaidAmount + $value['total_paid_amount'];
|
92 |
+
$totalRefundedAmount = $totalRefundedAmount + $value['total_refunded_amount'];
|
93 |
+
$totalTaxAmount = $totalTaxAmount + $value['total_tax_amount'];
|
94 |
+
$totalTaxAmountActual = $totalTaxAmountActual + $value['total_tax_amount_actual'];
|
95 |
+
$totalShippingAmount = $totalShippingAmount + $value['total_shipping_amount'];
|
96 |
+
$totalShippingAmountActual = $totalShippingAmountActual + $value['total_shipping_amount_actual'];
|
97 |
+
$totalDiscountAmount = $totalDiscountAmount + $value['total_discount_amount'];
|
98 |
+
$totalDiscountAmountActual = $totalDiscountAmountActual + $value['total_discount_amount_actual'];
|
99 |
+
}
|
100 |
+
|
101 |
+
$result['Total']['totalOrder'] = $totalOrder;
|
102 |
+
$result['Total']['totalOrderQty'] = $totalOrderQty;
|
103 |
+
$result['Total']['totalOrderQtyInvoice'] = $totalOrderQtyInvoice;
|
104 |
+
$result['Total']['totalIncomeAmount'] = $totalIncomeAmount;
|
105 |
+
$result['Total']['totalRevenueAmount'] = $totalRevenueAmount;
|
106 |
+
$result['Total']['totalProfitAmount'] = $totalProfitAmount;
|
107 |
+
$result['Total']['totalInvoicedAmount'] = $totalInvoicedAmount;
|
108 |
+
$result['Total']['totalCanceledAmount'] = $totalCanceledAmount;
|
109 |
+
$result['Total']['totalPaidAmount'] = $totalPaidAmount;
|
110 |
+
$result['Total']['totalRefundedAmount'] = $totalRefundedAmount;
|
111 |
+
$result['Total']['totalTaxAmount'] = $totalTaxAmount;
|
112 |
+
$result['Total']['totalTaxAmountActual'] = $totalTaxAmountActual;
|
113 |
+
$result['Total']['totalShippingAmount'] = $totalShippingAmount;
|
114 |
+
$result['Total']['totalShippingAmountActual'] = $totalShippingAmountActual;
|
115 |
+
$result['Total']['totalDiscountAmount'] = $totalDiscountAmount;
|
116 |
+
$result['Total']['totalDiscountAmountActual'] = $totalDiscountAmountActual;
|
117 |
+
//echo json_encode($result);
|
118 |
+
//echo "<pre>"; print_r($result);
|
119 |
+
}
|
120 |
+
else
|
121 |
+
{
|
122 |
+
$result['error'] = $this->__('Please activate the Mobile Emizentech Extension on the Magento Store.');
|
123 |
+
}
|
124 |
+
$isEnable = Mage::helper('core')->jsonEncode($result);
|
125 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
126 |
+
}
|
127 |
+
|
128 |
+
/*
|
129 |
+
*@ get admin report sales invoice using start and end date and more specific variables
|
130 |
+
*Parameter: startDate, endDate, sessionId, period(ex. day,month), status(ex. canceled,completed etc.)
|
131 |
+
*/
|
132 |
+
public function AdminReportInvoiceAction()
|
133 |
+
{
|
134 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check if extension is enabled or not ?
|
135 |
+
{
|
136 |
+
$post_data = Mage::app()->getRequest()->getParams();
|
137 |
+
$sessionId = $post_data['session'];
|
138 |
+
if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check if customer is not logged in then return Access denied
|
139 |
+
{
|
140 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
141 |
+
return false; // return logged out
|
142 |
+
}
|
143 |
+
|
144 |
+
$start_date = $post_data['date_start'];
|
145 |
+
$end_date = $post_data['date_end'];
|
146 |
+
$storeId = $post_data['store_id'];
|
147 |
+
$dateStart = date('Y-m-d', strtotime($start_date));
|
148 |
+
$dateEnd = date('Y-m-d',strtotime($end_date));
|
149 |
+
$period = $post_data['period'];
|
150 |
+
|
151 |
+
$store = $post_data['store_id'];
|
152 |
+
|
153 |
+
$orderStatuses = array($post_data['status']);
|
154 |
+
|
155 |
+
|
156 |
+
$dat = array(
|
157 |
+
'orders_count' => 'sum(orders_count)', // sql queries for calculated price
|
158 |
+
'orders_invoiced' => 'sum(orders_invoiced)',
|
159 |
+
'total_income_amount' => 'sum(total_income_amount)',
|
160 |
+
'invoiced' => 'sum(invoiced)',
|
161 |
+
'invoiced_captured' => 'sum(invoiced_captured)',
|
162 |
+
'invoiced_not_captured' => 'sum(invoiced_not_captured)'
|
163 |
+
);
|
164 |
+
|
165 |
+
if(is_array($orderStatuses))
|
166 |
+
{
|
167 |
+
if(count($orderStatuses) == 1 && strpos($orderStatuses[0],',')!== false)
|
168 |
+
{
|
169 |
+
$post_data['status'] = explode(',',$orderStatuses[0]);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
//echo "<pre>"; print_r($post_data['status']);
|
173 |
+
$Rcolection = Mage::getResourceModel('sales/report_invoiced_collection_order') // report sales invoice model
|
174 |
+
->setPeriod($period)
|
175 |
+
->setDateRange($dateStart,$dateEnd)
|
176 |
+
->addStoreFilter($store)
|
177 |
+
->addOrderStatusFilter($post_data['status'])
|
178 |
+
->setAggregatedColumns($dat);
|
179 |
+
|
180 |
+
$result = array();
|
181 |
+
foreach($Rcolection as $_data)
|
182 |
+
{
|
183 |
+
$result['report_invoice_order'][] = $_data->getData();
|
184 |
+
}
|
185 |
+
|
186 |
+
$orders_count = 0;
|
187 |
+
$orders_invoiced = 0;
|
188 |
+
$total_income_amount = 0;
|
189 |
+
$invoiced = 0;
|
190 |
+
$invoiced_captured = 0;
|
191 |
+
$invoiced_not_captured = 0;
|
192 |
+
|
193 |
+
foreach ($result['report_invoice_order'] as $key => $value)
|
194 |
+
{
|
195 |
+
$orders_count = $orders_count + $value['orders_count'];
|
196 |
+
$orders_invoiced = $orders_invoiced + $value['orders_invoiced'];
|
197 |
+
$total_income_amount = $total_income_amount + $value['total_income_amount'];
|
198 |
+
$invoiced = $invoiced + $value['invoiced'];
|
199 |
+
$invoiced_captured = $invoiced_captured + $value['invoiced_captured'];
|
200 |
+
$invoiced_not_captured = $invoiced_not_captured + $value['invoiced_not_captured'];
|
201 |
+
}
|
202 |
+
|
203 |
+
$result['Total']['orders_count'] = $orders_count;
|
204 |
+
$result['Total']['orders_invoiced'] = $orders_invoiced;
|
205 |
+
$result['Total']['total_income_amount'] = $total_income_amount;
|
206 |
+
$result['Total']['invoiced'] = $invoiced;
|
207 |
+
$result['Total']['invoiced_captured'] = $invoiced_captured;
|
208 |
+
$result['Total']['invoiced_not_captured'] = $invoiced_not_captured;
|
209 |
+
|
210 |
+
//echo json_encode($result);
|
211 |
+
//echo "<pre>"; print_r($result);
|
212 |
+
}
|
213 |
+
else
|
214 |
+
{
|
215 |
+
$result['error'] = $this->__('Please activate the Mobile Emizentech Extension on the Magento Store.');
|
216 |
+
}
|
217 |
+
$isEnable = Mage::helper('core')->jsonEncode($result);
|
218 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
219 |
+
}
|
220 |
+
|
221 |
+
/*
|
222 |
+
*@ get admin report sales shipping using start and end date and more specific variables
|
223 |
+
*Parameter: startDate, endDate, sessionId, period(ex. day,month), status(ex. canceled,completed etc.)
|
224 |
+
*/
|
225 |
+
public function AdminReportShippingAction()
|
226 |
+
{
|
227 |
+
if(Mage::helper('mobileadmin')->isEnable()) // check if extension is enabled or not ?
|
228 |
+
{
|
229 |
+
$post_data = Mage::app()->getRequest()->getParams();
|
230 |
+
$sessionId = $post_data['session'];
|
231 |
+
if (!Mage::getSingleton('api/session')->isLoggedIn($sessionId)) // check if customer is not logged in then return Access denied
|
232 |
+
{
|
233 |
+
echo $this->__("The Login has expired. Please try log in again.");
|
234 |
+
return false; // return logged out
|
235 |
+
}
|
236 |
+
|
237 |
+
$start_date = $post_data['date_start'];
|
238 |
+
$end_date = $post_data['date_end'];
|
239 |
+
$storeId = $post_data['store_id'];
|
240 |
+
$dateStart = date('Y-m-d', strtotime($start_date));
|
241 |
+
$dateEnd = date('Y-m-d',strtotime($end_date));
|
242 |
+
$period = $post_data['period'];
|
243 |
+
|
244 |
+
$store = $post_data['store_id'];
|
245 |
+
|
246 |
+
$orderStatuses = array($post_data['status']);
|
247 |
+
|
248 |
+
|
249 |
+
$dat = array(
|
250 |
+
'orders_count' => 'sum(orders_count)', // calculating order and price using database queries
|
251 |
+
'total_shipping' => 'sum(total_shipping)',
|
252 |
+
'total_shipping_actual' => 'sum(total_shipping_actual)'
|
253 |
+
);
|
254 |
+
|
255 |
+
if(is_array($orderStatuses))
|
256 |
+
{
|
257 |
+
if(count($orderStatuses) == 1 && strpos($orderStatuses[0],',')!== false)
|
258 |
+
{
|
259 |
+
$post_data['status'] = explode(',',$orderStatuses[0]);
|
260 |
+
}
|
261 |
+
}
|
262 |
+
//echo "<pre>"; print_r($post_data['status']);
|
263 |
+
$Rcolection = Mage::getResourceModel('sales/report_shipping_collection_order') // report sales shipping model
|
264 |
+
->setPeriod($period)
|
265 |
+
->setDateRange($dateStart,$dateEnd)
|
266 |
+
->addStoreFilter($store)
|
267 |
+
->addOrderStatusFilter($post_data['status'])
|
268 |
+
->setAggregatedColumns($dat);
|
269 |
+
|
270 |
+
$result = array();
|
271 |
+
|
272 |
+
$array_sum_array = array();
|
273 |
+
|
274 |
+
$orders_count = 0;
|
275 |
+
$total_shipping = 0;
|
276 |
+
$total_shipping_actual = 0;
|
277 |
+
|
278 |
+
foreach($Rcolection as $_key => $_data)
|
279 |
+
{
|
280 |
+
//$result['report_invoice_order'][] = $_data->getData();
|
281 |
+
//echo "<pre>"; print_r($_data->getData());
|
282 |
+
$result[$_data->getData('period')][] = $_data->getData();
|
283 |
+
|
284 |
+
|
285 |
+
$array_sum_array[$_data->getData('period')]['orders_count'][] = $_data->getData('orders_count');
|
286 |
+
$array_sum_array[$_data->getData('period')]['total_shipping'][] = $_data->getData('total_shipping');
|
287 |
+
$array_sum_array[$_data->getData('period')]['total_shipping_actual'][] = $_data->getData('total_shipping_actual');
|
288 |
+
|
289 |
+
// $orders_count += $_data->getData('orders_count');
|
290 |
+
// $total_shipping = $total_shipping + $_data->getData('total_shipping');
|
291 |
+
// $total_shipping_actual = $total_shipping_actual + $_data->getData('total_shipping_actual');
|
292 |
+
|
293 |
+
$result[$_data->getData('period')]['Total']['orders_count'] = array_sum($array_sum_array[$_data->getData('period')]['orders_count']);
|
294 |
+
$result[$_data->getData('period')]['Total']['total_shipping'] = array_sum($array_sum_array[$_data->getData('period')]['total_shipping']);
|
295 |
+
$result[$_data->getData('period')]['Total']['total_shipping_actual'] = array_sum($array_sum_array[$_data->getData('period')]['total_shipping_actual']);
|
296 |
+
|
297 |
+
}
|
298 |
+
//echo "<pre>"; print_r($result); die;
|
299 |
+
}
|
300 |
+
else
|
301 |
+
{
|
302 |
+
$result['error'] = $this->__('Please activate the Mobile Emizentech Extension on the Magento Store.');
|
303 |
+
}
|
304 |
+
$isEnable = Mage::helper('core')->jsonEncode($result);
|
305 |
+
return Mage::app()->getResponse()->setBody($isEnable);
|
306 |
+
}
|
307 |
+
}
|
308 |
+
?>
|
lib/EmizenMobileAdmin/PushNotificationAppCertificateKey.pem
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-----BEGIN CERTIFICATE-----
|
2 |
+
MIIFjDCCBHSgAwIBAgIIBMCclD3pImgwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV
|
3 |
+
BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js
|
4 |
+
ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3
|
5 |
+
aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
|
6 |
+
HhcNMTUwMjE4MDcyNjMwWhcNMTYwMjE4MDcyNjMwWjCBizEkMCIGCgmSJomT8ixk
|
7 |
+
AQEMFGNvbS5lbWl6ZW50ZWNoLmFkbWluMUEwPwYDVQQDDDhBcHBsZSBQcm9kdWN0
|
8 |
+
aW9uIElPUyBQdXNoIFNlcnZpY2VzOiBjb20uZW1pemVudGVjaC5hZG1pbjETMBEG
|
9 |
+
A1UECwwKNTVESlFQRzZNOTELMAkGA1UEBhMCSU4wggEiMA0GCSqGSIb3DQEBAQUA
|
10 |
+
A4IBDwAwggEKAoIBAQDeDN5sOOsEQL6VHTXTYR4UuG0sMksaNcQbcW4uBBA/Bt/0
|
11 |
+
DwgFtoa7dalrOm5eVh1104rPW4DCr+tePH3UDZWYcdPYgTh3y7uB/o5nkA1B981+
|
12 |
+
Rf3fHU6L2xBLRrfoyI7kGfeZGLaqCmlCG214qnSL7pLReJj6KLizpP0lHIXnFtxN
|
13 |
+
4rEVryox4ATzufgFaNqU3cXWajKU3Durovbq9AgncsTiVguBPRcED5OVD92R7uxR
|
14 |
+
/ZXyuu7kAqVzu76qn5IrLYLeO3fRLZZ5fCFyGkqKZd5yUAxYLhIcL9CS9SPOyxci
|
15 |
+
iVylZDH1AxMjWj5XoaLaccRNY2rQm1o5V0R+yPs3AgMBAAGjggHlMIIB4TAdBgNV
|
16 |
+
HQ4EFgQUUimCepskFXG2ZSU63beYDiLQC7gwCQYDVR0TBAIwADAfBgNVHSMEGDAW
|
17 |
+
gBSIJxcJqbYYYIvs67r2R1nFUlSjtzCCAQ8GA1UdIASCAQYwggECMIH/BgkqhkiG
|
18 |
+
92NkBQEwgfEwgcMGCCsGAQUFBwICMIG2DIGzUmVsaWFuY2Ugb24gdGhpcyBjZXJ0
|
19 |
+
aWZpY2F0ZSBieSBhbnkgcGFydHkgYXNzdW1lcyBhY2NlcHRhbmNlIG9mIHRoZSB0
|
20 |
+
aGVuIGFwcGxpY2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2Yg
|
21 |
+
dXNlLCBjZXJ0aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRpZmljYXRpb24gcHJhY3Rp
|
22 |
+
Y2Ugc3RhdGVtZW50cy4wKQYIKwYBBQUHAgEWHWh0dHA6Ly93d3cuYXBwbGUuY29t
|
23 |
+
L2FwcGxlY2EvME0GA1UdHwRGMEQwQqBAoD6GPGh0dHA6Ly9kZXZlbG9wZXIuYXBw
|
24 |
+
bGUuY29tL2NlcnRpZmljYXRpb25hdXRob3JpdHkvd3dkcmNhLmNybDALBgNVHQ8E
|
25 |
+
BAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwIwEAYKKoZIhvdjZAYDAgQCBQAwDQYJ
|
26 |
+
KoZIhvcNAQEFBQADggEBAGWccKr7f6eSPlOlbcsawOgr/3ChvPfZZgFJR0jwONap
|
27 |
+
To1Ffyyz/c0vgaH7lKYiZN4/z5jSvqAqqz3MS/R9/qaPXeZ6QbPYkmiNXFJ+xdLI
|
28 |
+
uSqeiTB0j7Lq9JklE7ub4dzvUGur2V8fxC8cAKjamFokV6m43JUEB1m9/HK+UY/Y
|
29 |
+
3URjEh4yvROogvBaK/Q2HlF/DYfB+d3gxPk3vWNP7FzDGPbvWr6TLtOoyFpLgxhb
|
30 |
+
od7Sgl+zS4xshXlVYQ7Weq5fxGFeJ29oGQit38FabEkNQdPUwRJtwUv40Xnt9yp1
|
31 |
+
izn/RWZnijd/aaTxyCpM7j7QbjTRKnGN4kONXJ7IHD8=
|
32 |
+
-----END CERTIFICATE-----
|
33 |
+
Bag Attributes
|
34 |
+
friendlyName: Virendra Sharma
|
35 |
+
localKeyID: 52 29 82 7A 9B 24 15 71 B6 65 25 3A DD B7 98 0E 22 D0 0B B8
|
36 |
+
Key Attributes: <No Attributes>
|
37 |
+
-----BEGIN RSA PRIVATE KEY-----
|
38 |
+
Proc-Type: 4,ENCRYPTED
|
39 |
+
DEK-Info: DES-EDE3-CBC,491CAC965ED99D8D
|
40 |
+
|
41 |
+
qzTFqm7eO+EP5wTpth8kXS7m63OhlMrzZOHOB7osvMcXzI0kYAFRj5spuXqHSJ33
|
42 |
+
OSGW/XNL6NgAPkMTm79Z69seD+4ZeujEIeKTIIviAKwzdjE7wowh95GCy1PA5VEd
|
43 |
+
DqfHcMYabjT3HByg7D7QKKljxp7bQe90lL0wUhLZX42O0RxYqV/HqVFbrBJRPAVH
|
44 |
+
I+NdRKXUcbNtDZ27KNobM8hbiPYsQrlfwLr9wAImJhVycEhPQm7QpAWg3HFNJFVf
|
45 |
+
rg5C7Z++moSMi3K1CFfT8ytFKSGjTWybTBqdu8Ee/a/04bSmAMy+AMXdVNepv823
|
46 |
+
PV1TuKsfNEJKBVVGzqjy00dzfNiKFVvMe3Z9N/JeI4sUedV92SP1ZsGepqdqUbVi
|
47 |
+
SQx+6HdyLB+/UzuPDLB95QPD2v9bVSKVnIMpXKbkBYCuPlJCLgwghFTSVealioEy
|
48 |
+
Q51E4d6I+1TpUUT17TMpYWc+9X2/bO1S2WAo+1jhf1vjUm3gNY76HFAR747NsRgE
|
49 |
+
NQL3f/BcZ9TZs88kwT7787tDUtc4Woqh8cHERE/NIaXFz9Jz3dobl35Lp6+s/Y1Z
|
50 |
+
bsnA5lBWxrAn2i7ndlkU02i1ledwyhUsSsW8mRlsXbx6NXLPxMQ5dE3EOdVStJLe
|
51 |
+
iHd5qkfWY92bna6XHmqbE4lEvNPhyiEXaLROD9fVQkA2z3S7dBqg0fuS/e5AWyNg
|
52 |
+
l08fjamzPn5pCDrsn++8YAarACfM0mLA/3vUaHiIfi4IldIu+9b02T9ZRBct//jO
|
53 |
+
TOd0N2hlmv3MzGFBtgoiB821uyy1xnok8p8xA/TIzD1NNhq3yL2IoasUJedq5HTS
|
54 |
+
O42rHFiOECXfnJ1gaq1TvNbkcrGtxnchU6Ux4tBpElVFhGPO00z50/IO8iy1nnbM
|
55 |
+
bE32wyfHjrnDh53YNN9lJOrw/TDf1gMk3IUoKUSb7EIyrUd+wXht0e6EWihvGDXc
|
56 |
+
73xagVSKU4jgEJHGMIz8LnJ+0pKchwuaUCyfYr4zuWQf35UuHpHTxMHhVJtbT13d
|
57 |
+
QKQiBth8pdfsHraPQVTgRWO3UFzMiLUsLOAou8O5OTNejFJCafnQdd/6mXeT8ajz
|
58 |
+
Dzzu75VUYZEUdGozUsSaGrndp4aT/8SRNddWlnLKXigs96q8mWnTG+mUnHM8dVoF
|
59 |
+
HQ3ufCSvPB0SVhgSfWK4PeuZ7mHQVzHcs7m3xkPw50mOpkTnGZcwgJ0NSmebdQud
|
60 |
+
mblBI/tefCQL2BqLJUVFxoZWyADvuaIc9L0PeGzA1qP9SaFC8RYYIQLKnOLW2SK4
|
61 |
+
p8pJF6w6qQkY6iXj759VcE6FiyzZ1wg39NY+G/sQSFsMoakB98hYzWs+dZPgl7zn
|
62 |
+
lLSAcmHexT0tcoWUaSpDKj6c1ZIHiV8MMbEIa2URrA9HDV2e4Xua2gmrjzGUYYHp
|
63 |
+
DZbyQIVWqq34ojW05OH42AUIbnlF9QYsSGiHHSp4bAU+HeRzonVh6P51zsomkhGh
|
64 |
+
vfF3vzNviqyhs8CX6K2nj2vei3TZsHWEpVkFWaA7E9hvexL8nFBYLuLsbfcl5a74
|
65 |
+
Sm4SHHKFQ8dHVfsXxRDr7eI9N1n9oMY/+fZfca2+UebwoCWKlFb6lqD2tJpdpBi+
|
66 |
+
-----END RSA PRIVATE KEY-----
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>emizenmobileadmin</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -28,9 +28,9 @@ Features :
|
|
28 |
* Store view Selection For Dashboard,
|
29 |
* Multistore Support</notes>
|
30 |
<authors><author><name>Emizen Tech Private Limited</name><user>emizen</user><email>info@emizentech.com</email></author></authors>
|
31 |
-
<date>2015-
|
32 |
-
<time>
|
33 |
-
<contents><target name="mageetc"><dir name="modules"><file name="EmizenTech_MobileAdmin.xml" hash="3d9904aebe449343c74004cd160e0b89"/></dir></target><target name="magelocal"><dir name="EmizenTech"><dir name="MobileAdmin"><dir><dir name="Block"><file name="Index.php" hash="76f331d88fb83bbe3135c494d084e4b7"/></dir><dir name="Helper"><file name="Data.php" hash="
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>emizenmobileadmin</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
28 |
* Store view Selection For Dashboard,
|
29 |
* Multistore Support</notes>
|
30 |
<authors><author><name>Emizen Tech Private Limited</name><user>emizen</user><email>info@emizentech.com</email></author></authors>
|
31 |
+
<date>2015-03-11</date>
|
32 |
+
<time>05:37:57</time>
|
33 |
+
<contents><target name="mageetc"><dir name="modules"><file name="EmizenTech_MobileAdmin.xml" hash="3d9904aebe449343c74004cd160e0b89"/></dir></target><target name="magelocal"><dir name="EmizenTech"><dir name="MobileAdmin"><dir><dir name="Block"><file name="Index.php" hash="76f331d88fb83bbe3135c494d084e4b7"/></dir><dir name="Helper"><file name="Data.php" hash="717d18ec9e49c69e4ba19eaffb88397e"/></dir><dir name="Model"><file name="Api.php" hash="1139274252b522c02ad26655ca1fc641"/><file name="Emizenmob.php" hash="0b2018dfc93072b5712d20ed676c8a30"/><dir name="Mysql4"><dir name="Emizenmob"><file name="Collection.php" hash="6b958aa1ddc5d96955dbdf4bdd7f6976"/></dir><file name="Emizenmob.php" hash="1285e93887bc67933f0bac32bed8b762"/></dir><file name="Observer.php" hash="c819a71c2130d56d760f06a674b8c7b9"/></dir><dir name="controllers"><file name="IndexController.php" hash="88cd549de1f06887c82a49ada020cb2e"/><file name="ReportController.php" hash="f42a6f20ee66fbeb5f07c4e4170675d4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="53c7b1eb3b23e2cf8b899309517a1c14"/><file name="api.xml" hash="c81e576c36f189af6dffefca1a746622"/><file name="config.xml" hash="fc55154f0afa4f68e7c501cdf6145b27"/><file name="system.xml" hash="6f7e1b090d771a29e5d2d4777d7e4304"/></dir><dir name="sql"><dir name="mobileadmin_setup"><file name="mysql4-install-0.1.0.php" hash="3faa6e0c9146571ac842f5aeeedf961c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mobileadmin"><file name="index.phtml" hash="395b5512423d31a9526f94e3d7dcc13a"/></dir></dir><dir name="layout"><file name="mobileadmin.xml" hash="bf0ff6a1d30dfeb5b159c72eff4311ae"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="EmizenMobileAdmin"><file name="PushNotificationAppCertificateKey.pem" hash="546f3a014aab15d6765f80a1133cbedd"/></dir></dir></target></contents>
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|