Example #1
0
 public function getFarmerName($id)
 {
     $modelFarmers = new Model_Farmers();
     $farmer = $modelFarmers->fetchFarmerById($id);
     return $farmer->names;
 }
Example #2
0
 public function getFarmerNameByPhone($phoneno)
 {
     $modelFarmers = new Model_Farmers();
     $farmer = $modelFarmers->fetchFarmerByPhone($phoneno);
     return $farmer->names;
 }
Example #3
0
 public function farmerMenu($user, $no)
 {
     $menuModel = new Model_Menu();
     $menu = $menuModel->getMenu(5);
     // print_r($menu);
     // exit;
     $menu_id = $menu->id;
     //get the description
     $description = $menu->description;
     // print_r($description);
     // exit;
     //build up the options
     $menuItemsModel = new Model_MenuItems();
     $menuOptions = $menuItemsModel->getMenuOptions($menu_id);
     // print_r($menuOptions);
     // exit;
     $farmerModel = new Model_Farmers();
     $data = array('session' => 1, 'step' => 1, 'menu_item_id' => 5);
     //$userModel = new Model_User();
     $result = $farmerModel->updateUserData($data, $user['id']);
     //print_r($result);
     //exit;
     //$result = $userModel -> updateUserSession($user['id'],1);
     return $description . PHP_EOL . $menuOptions;
     //exit;
 }