예제 #1
0
 public function executePurchaseHistory(sfWebRequest $request)
 {
     $part_no = rawurldecode($request->getParameter('part_no'));
     $agent = new CCSearchAgent($part_no);
     if ($data = $agent->fetchPurchaseHistory()) {
         $json = json_encode($data);
     } else {
         $json = NULL;
     }
     //TODO: ajax helper for this block?
     $response = $this->getResponse();
     $response->setContentType('application/json');
     $response->sendHttpHeaders();
     return $this->renderText($json);
 }