/**
  * Show generate license form
  */
 public function getGenerateLicense()
 {
     $this->_data['page_title'] = "Generate License";
     $this->_data['affiliates'] = Affiliate::orderBy('name', 'ASC')->get();
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     $this->_data['plans'] = Plan::orderBy('name', 'ASC')->where('product_id', '=', Input::old('product_id'))->get();
     return View::make('admin.utilities.generate-license', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
 /**
  * Get all plans of a product
  */
 public function getGetPlansByProduct($product_id)
 {
     $plansObj = Plan::orderBy('name', 'ASC')->where('product_id', '=', $product_id)->get();
     $plans = array();
     if ($plansObj) {
         foreach ($plansObj as $plan) {
             $plans[$plan->id] = $plan->name;
         }
     }
     return json_encode($plans);
 }