PageRenderTime 37ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/user/views/user/generate_data.php

https://github.com/yii-simon/yii-user-management
PHP | 34 lines | 30 code | 4 blank | 0 comment | 2 complexity | b03e5260e54f515d80de877a9062b0da MD5 | raw file
  1. <?
  2. $this->breadcrumbs = array(Yum::t('Data Generation'));
  3. if(isset($_POST['user_amount'])) {
  4. echo '<h2> Success </h2>';
  5. printf('<p> <strong> %d </strong> %s been generated. The associated password is <em>%s</em> </p>',
  6. $_POST['user_amount'],
  7. $_POST['user_amount'] == 1 ? 'User has' : 'Users have',
  8. $_POST['password']
  9. );
  10. echo '<br />';
  11. }
  12. echo CHtml::beginForm();
  13. echo '<h2> Random user Generator </h2>';
  14. printf('Generate %s %s users <br />
  15. belonging to role %s <br />
  16. with associated password %s',
  17. CHtml::textField('user_amount', '1', array('size' => 2)),
  18. CHtml::dropDownList('status', 1, array(
  19. '-1' => Yum::t('banned'),
  20. '0' => Yum::t('inactive'),
  21. '1' => Yum::t('active'))),
  22. Yum::hasModule('role') ?
  23. CHtml::dropDownList('role', '', CHtml::listData(
  24. YumRole::model()->findAll(), 'id', 'title')) : ' - ',
  25. CHtml::textField('password', 'Demopassword123')
  26. );
  27. echo '<br />';
  28. echo CHtml::submitButton(Yum::t('Generate'));
  29. echo CHtml::endForm();
  30. ?>