【发布时间】:2018-06-19 06:19:05
【问题描述】:
我有代码 CodeIgniter
我需要帮助解决这个问题,
“我想将帐户设置为默认不活动”它在用户创建新帐户时处于活动状态。
<?php // status ?>
<div class="form-group col-sm-3<?php echo form_error('status') ? ' has-error' : ''; ?>">
<?php echo form_label(lang('users input status'), '', array('class'=>'control-label')); ?>
<span class="required">*</span>
<div>
<label style="font-weight:500">
<?php echo form_radio(array('class'=>'radio', 'type'=>'radio', 'name'=>'status', 'id'=>'radio-status-1', 'value'=>'1', 'checked'=>(( ! isset($user['status']) OR (isset($user['status']) && (int)$user['status'] == 1) OR $user['id'] == 1) ? 'checked' : FALSE))); ?>
<span><?php echo lang('admin input active'); ?></span>
</label>
</div>
<?php if ( ! $user['id'] OR $user['id'] > 1) : ?>
<div>
<label style="font-weight:500">
<?php echo form_radio(array('class'=>'radio', 'type'=>'radio', 'name'=>'status', 'id'=>'radio-status-2', 'value'=>'0', 'checked'=>((isset($user['status']) && (int)$user['status'] == 0) ? 'checked' : FALSE))); ?>
<span><?php echo lang('admin input inactive'); ?></span>
</label>
</div>
<?php endif; ?>
</div>
【问题讨论】:
标签: php codeigniter