Example #1
0
 public static function PopulateReviewViewModel($review)
 {
     $model = new ReviewViewModel();
     $model->id = $review->review_id;
     $model->product = ProductHelper::PopulateProductViewModel(ProductService::GetById($review->product_id));
     $model->account = AccountHelper::PopulateAccountViewModel(AccountService::GetById($review->account_id));
     $model->value = $review->value;
     return $model;
 }
Example #2
0
 public static function PopulateOrderDetailViewModel($order)
 {
     $model = new OrderDetailViewModel();
     $model->id = $order->order_id;
     $model->branch_name = BranchService::GetById($order->branch_id)->name;
     $model->date_order = $order->date_order->format('Y-m-d H:i:s');
     $model->status_name = Statusorder::find(['statusorder_id' => $order->statusorder_id])->name;
     $model->account_name = AccountService::GetById($order->account_id)->account_name;
     $model->products = OrderListService::GetProductsByOrderId($order->order_id);
     return $model;
 }
 function action_VerifyNewAccount()
 {
     $account_id = $_GET['id'];
     $account = AccountService::GetById($account_id);
     if (isset($account)) {
         $account->isapproved = true;
         AccountService::Save($account);
         $user = new User();
         $user->user_id = $account->account_id;
         $user->user_name = $account->account_name;
         UserService::Save($user);
         header("Location: /main");
     }
 }