| Line 651... |
Line 651... |
| 651 |
$users[$user['User']['id']] = $user['User']['first_name'];
|
651 |
$users[$user['User']['id']] = $user['User']['first_name'];
|
| 652 |
}
|
652 |
}
|
| 653 |
$this->layout = 'admin';
|
653 |
$this->layout = 'admin';
|
| 654 |
$this->set(compact('ignoredFields','page','totalPages','userId','activestores','storemapping','amazonorderurl','users', 'orderFilters', 'type'));
|
654 |
$this->set(compact('ignoredFields','page','totalPages','userId','activestores','storemapping','amazonorderurl','users', 'orderFilters', 'type'));
|
| 655 |
}
|
655 |
}
|
| - |
|
656 |
|
| - |
|
657 |
public function monitor() {
|
| - |
|
658 |
$orderFilters = $this->getOrderFilters("monitor");
|
| - |
|
659 |
$page = $this->request->query('page');
|
| - |
|
660 |
$filter = $this->request->query('filter');
|
| - |
|
661 |
$page = isset($page)?$page:1;
|
| - |
|
662 |
// $userId = $this->request->query('user_id');
|
| - |
|
663 |
// if(isset($userId) && !empty($userId)){
|
| - |
|
664 |
// $this->loadModel('User');
|
| - |
|
665 |
// $dbuser = $this->User->findById($userId);
|
| - |
|
666 |
// $this->Auth->login($dbuser['User']);
|
| - |
|
667 |
// }
|
| - |
|
668 |
$this->layout = "innerpages";
|
| - |
|
669 |
$url = $this->apihost."orders/?page=$page&window=20";
|
| - |
|
670 |
if (!empty($filter)) $url .= "&filter=".$filter."&filtertype=monitor";
|
| - |
|
671 |
$response = $this->make_request($url,null);
|
| - |
|
672 |
$totalPages = $response['totalPages'];
|
| - |
|
673 |
if(!empty($response['data'])){
|
| - |
|
674 |
$this->set('orders',$response['data']);
|
| - |
|
675 |
}
|
| - |
|
676 |
$ignoredFields = array('imgUrl','status','productTitle','estimatedDeliveryDate','productCode','merchantSubOrderId','productUrl','closed','tracingkUrl','detailedStatus');
|
| - |
|
677 |
$storemapping = Configure::read('storemapping');
|
| - |
|
678 |
$activestores = Configure::read('activestores');
|
| - |
|
679 |
$amazonorderurl = Configure::read('amazonorderurl');
|
| - |
|
680 |
$allusers = $this->Order->User->find('all',array('fields'=>array('first_name','id'),'recursive'=>-1));
|
| - |
|
681 |
foreach($allusers AS $user){
|
| - |
|
682 |
$users[$user['User']['id']] = $user['User']['first_name'];
|
| - |
|
683 |
}
|
| - |
|
684 |
$this->layout = 'admin';
|
| - |
|
685 |
$this->set(compact('ignoredFields','page','totalPages','userId','activestores','storemapping','amazonorderurl','users', 'orderFilters', 'type'));
|
| - |
|
686 |
}
|
| 656 |
}
|
687 |
}
|