plugin wip
This commit is contained in:
@ -57,15 +57,15 @@ class Products extends AdminController {
|
||||
|
||||
public function edit( $id = null ) {
|
||||
if ( !Input::exists( 'submit' ) ) {
|
||||
return Views::view( 'members.admin.products.edit', self::$posts->findById( $id ) );
|
||||
return Views::view( 'members.admin.products.edit', self::$products->findById( $id ) );
|
||||
}
|
||||
if ( !Forms::check( 'editMembershipProduct' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
||||
return $this->index();
|
||||
}
|
||||
|
||||
if ( self::$posts->updatePost( $id, Input::post( 'title' ), Input::post( 'blogPost' ), Input::post( 'submit' ) ) === true ) {
|
||||
Issues::add( 'success', 'Post Updated.' );
|
||||
if ( self::$products->updatePost( $id, Input::post( 'name' ), Input::post( 'description' ), Input::post( 'monthly_price' ), Input::post( 'yearly_price' ) ) === true ) {
|
||||
Issues::add( 'success', 'Your product Updated.' );
|
||||
return $this->index();
|
||||
}
|
||||
Issues::add( 'error', 'There was an error with your request.' );
|
||||
@ -75,9 +75,9 @@ class Products extends AdminController {
|
||||
public function view( $id = null ) {
|
||||
$data = self::$products->findById( $id );
|
||||
if ( $data !== false ) {
|
||||
return Views::view( 'blog.admin.view', $data );
|
||||
return Views::view( 'members.admin.products.view', $data );
|
||||
}
|
||||
Issues::add( 'error', 'Post not found.' );
|
||||
Issues::add( 'error', 'Product not found.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,13 @@ class Records extends AdminController {
|
||||
public function edit( $data = null ) {
|
||||
}
|
||||
|
||||
public function view( $data = null ) {
|
||||
public function view( $id = null ) {
|
||||
$data = self::$memberships->findById( $id );
|
||||
if ( $data !== false ) {
|
||||
return Views::view( 'members.admin.memberships.view', $data );
|
||||
}
|
||||
Issues::add( 'error', 'Membership not found.' );
|
||||
$this->index();
|
||||
}
|
||||
|
||||
public function delete( $data = null ) {
|
||||
|
Reference in New Issue
Block a user