# 📄 Bank Receipt Heading Customization Feature

This feature allows administrators to customize the heading information displayed on bank deposit receipts printed from the fees section.

## 🚀 New Features Added

### 1. Admin Settings Page
- **Location**: `http://localhost/bidda/admin/bank_receipt_settings.php`
- **Purpose**: Customize all aspects of bank receipt headings
- **Features**: 
  - School/Institution name
  - Address information
  - Receipt title
  - Subtitle (optional)
  - Watermark text
  - Live preview functionality

### 2. Sidebar Menu Integration
- **Location**: Security → Admin Panel → ব্যাংক রসিদ সেটিংস
- **Badge**: "নতুন" indicator for easy identification

### 3. Dashboard Access
- **Location**: Admin Dashboard → "ব্যাংক রসিদ সেটিংস" card
- **Quick access** to customization settings

## 🎯 How It Works

### Customizable Elements:
1. **School/Institution Name** - Main heading text
2. **Address** - Institution address (optional)
3. **Receipt Title** - Main receipt type designation
4. **Subtitle** - Additional descriptive text (optional)
5. **Watermark** - Background watermark text

### Implementation:
- Settings are stored in the database `settings` table
- Uses keys prefixed with `bank_receipt_`
- Default values are provided if no custom settings exist
- Changes take effect immediately on all new receipts

## 📋 Files Created/Modified

### New Files:
1. `admin/bank_receipt_settings.php` - Main settings interface
2. `BANK_RECEIPT_CUSTOMIZATION.md` - This documentation

### Modified Files:
1. `fees/my_fees.php` - Updated receipt generation to use custom settings
2. `includes/sidebar_layout.php` - Added menu item
3. `admin/index.php` - Added dashboard card

## 🔧 Usage Instructions

### For Administrators:
1. **Via Dashboard**: Go to Admin Dashboard → Click "ব্যাংক রসিদ সেটিংস" card
2. **Via Sidebar**: Navigate to Security → Admin Panel → ব্যাংক রসিদ সেটিংস
3. **Direct URL**: Visit `http://localhost/bidda/admin/bank_receipt_settings.php`

### Setting Up:
1. Fill in the institution details
2. Use the live preview to see changes
3. Click "সেটিংস সংরক্ষণ করুন" to save
4. Test by generating a bank receipt from fees section

## 📊 Settings Structure

The system uses the following database settings:
- `bank_receipt_school_name` - Institution name
- `bank_receipt_address` - Full address
- `bank_receipt_title` - Receipt title
- `bank_receipt_subtitle` - Additional subtitle
- `bank_receipt_watermark` - Background watermark text

## 🔄 Default Values

If no custom settings are configured, the system uses:
- **School Name**: কার্পাসডাঙ্গা মাধ্যমিক বালিকা বিদ্যালয়
- **Address**: কার্পাসডাঙ্গা ভুমিহীন পাড়া, দামুড়হুদা, চুয়াডাঙ্গা
- **Receipt Title**: ব্যাংক ডিপোজিট রসিদ
- **Watermark**: DEPOSIT

## 💡 Benefits

- **Branding Consistency**: Maintain institutional identity across all receipts
- **Flexibility**: Easy customization without code changes
- **Professional Appearance**: Clean, consistent receipt formatting
- **Multi-language Support**: Works with Bengali text properly
- **Immediate Effect**: Changes apply to all new receipts instantly

## 🛡️ Security Features

- Admin authentication required
- Input sanitization and validation
- XSS protection through proper escaping
- Database transaction safety

## 📝 Example Output

**Before Customization:**
```
কার্পাসডাঙ্গা মাধ্যমিক বালিকা বিদ্যালয়
কার্পাসডাঙ্গা ভুমিহীন পাড়া, দামুড়হুদা, চুয়াডাঙ্গা
ব্যাংক ডিপোজিট রসিদ
```

**After Customization (Example):**
```
ঢাকা মডেল স্কুল এন্ড কলেজ
১২৩ গ্রিন রোড, ঢাকা-১২০৫
ব্যাংক জমা রসিদ
শিক্ষা বর্ষ: ২০২৪
```

## 📞 Support

If issues occur:
1. Check that all required fields are filled
2. Verify database connectivity
3. Ensure proper permissions for admin users
4. Contact system administrator with error details

---
**Note**: This feature enhances the professional appearance of bank receipts and allows institutions to maintain their branding consistently across all financial documents.