Example #1
0
					<?php 
echo $form->dropDownList($model, "calendarID", Branch::listData(), ['class' => 'input-small']);
?>
				</div>
				<?php 
echo $form->endControlGroup();
?>
				<?php 
echo $form->beginControlGroup($model, 'app_user');
?>
				<?php 
echo $form->controlLabel($model, 'app_user');
?>
				<div class="controls">
					<?php 
echo $form->dropDownList($model, "app_user", User::listData(), ['class' => 'input-small']);
?>
				</div>
				<?php 
echo $form->endControlGroup();
?>
				<div class="control-group">
					<label class="control-label">All day event</label>

					<div class="controls">
						<?php 
echo $form->checkBox($model, 'app_allday', ['value' => Appointment::ALLDAY_YES, 'uncheckValue' => Appointment::ALLDAY_NO, 'id' => 'allday-check']);
?>
					</div>
				</div>
				<div id="start-time-container">
Example #2
0
 public static function getUserFromCache($id)
 {
     if (!self::$listData) {
         self::$listData = self::listData();
     }
     if (isset(self::$listData[$id])) {
         return self::$listData[$id];
     }
     return '';
 }
     handle('0000');
     break;
 case 'show':
     $currentUser = new User();
     $currentUser->uid = getRequest('uid');
     if (!preg_match('/^[0-9]+$/', $currentUser->uid)) {
         handle(ERROR_INPUT . '01');
     }
     $response = $currentUser->getData();
     if ($response === false) {
         handle(ERROR_SYSTEM . '00' . '不存在!');
     }
     handle('0000' . $response);
     break;
 case 'list':
     handle('0000' . User::listData(getRequest('username')));
     break;
 case 'signup':
     $currentUser = new User();
     $username = getRequest('username');
     if (!preg_match('/^[a-zA-Z][a-zA-Z0-9]{4,29}$/', $username)) {
         handle(ERROR_INPUT . '01');
     }
     $existUid = User::getUidByUsername($username);
     if ($existUid != 0) {
         handle(ERROR_PERMISSION . '02' . '用户名已存在!');
     }
     $password = password_hash(md5($username . getRequest('password') . '.cc'), PASSWORD_BCRYPT);
     $currentUser->init(getRequest('username'), $password, getRequest('email'));
     if (!$currentUser->checkVariables()) {
         handle(ERROR_INPUT . '02');