<div class="page-title">
    <h2><i class="bi bi-plus-circle"></i> Create New Campaign</h2>
</div>

<div class="card">
    <div class="card-body">
        <?php if (validation_errors()): ?>
            <div class="alert alert-danger">
                <?= validation_errors() ?>
            </div>
        <?php endif; ?>
        
        <form method="post" action="<?= base_url('admin/campaign_create') ?>">
            <div class="row">
                <div class="col-md-6">
                    <div class="mb-3">
                        <label class="form-label">Campaign Name *</label>
                        <input type="text" class="form-control" name="name" value="<?= set_value('name') ?>" required>
                    </div>
                </div>
                
                <div class="col-md-6">
                    <div class="mb-3">
                        <label class="form-label">Campaign Type *</label>
                        <select class="form-select" name="type" required>
                            <option value="">-- Select Type --</option>
                            <option value="SMS">SMS</option>
                            <option value="WhatsApp">WhatsApp</option>
                            <option value="WhatsApp Image">WhatsApp Image</option>
                            <option value="Status Messaging">Status Messaging</option>
                            <option value="Newsletter">Newsletter</option>
                            <option value="Custom">Custom</option>
                        </select>
                    </div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-6">
                    <div class="mb-3">
                        <label class="form-label">Fail Percentage (%) *</label>
                        <input type="number" class="form-control" name="fail_percentage" value="<?= set_value('fail_percentage', '1.00') ?>" step="0.01" min="0.01" max="100" required>
                        <small class="text-muted">Recommended: 1% - 1.5%</small>
                    </div>
                </div>
            </div>
            
            <div class="alert alert-info">
                <strong><i class="bi bi-info-circle"></i> Note:</strong> 
                The system will automatically add extra records based on the fail percentage when assigning data.
            </div>
            
            <div class="mt-3">
                <button type="submit" class="btn btn-primary">
                    <i class="bi bi-save"></i> Create Campaign
                </button>
                <a href="<?= base_url('admin/campaigns') ?>" class="btn btn-secondary">
                    <i class="bi bi-x-circle"></i> Cancel
                </a>
            </div>
        </form>
    </div>
</div>
