Пример #1
0
 public function actionWords($seoUrl)
 {
     $temp = explode('t', $seoUrl);
     if (is_numeric($temp[0])) {
         $learned = 2;
         if ($temp[1] == "learned") {
             $learned = 1;
         } else {
             $learned = 0;
         }
         if ($learned == 2) {
             $group_words = DictModel::model()->where("`group_id`='" . $temp[0] . "' AND `user_id` = '" . Auth::getUser()['id'] . "' ")->findAll();
         } else {
             $group_words = DictModel::model()->where("`group_id`='" . $temp[0] . "' AND `learned`='" . $learned . "' AND `user_id` = '" . Auth::getUser()['id'] . "' ")->findAll();
         }
         $group_id = $seoUrl;
         //var_dump($group_words);
         //echo '11';
     } else {
         if ($seoUrl == "learned") {
             $learned = 1;
         } else {
             $learned = 0;
         }
         $group_words = DictModel::model()->where("`learned`='" . $learned . "' AND `user_id` = '" . Auth::getUser()['id'] . "' ")->findAll();
         //var_dump($group_words);
         //echo '2';
     }
     $groups = DictGroupsModel::model()->where("`user_id`='" . Auth::getUser()['id'] . "'")->findAll();
     $this->view("profile/words", array("words" => $group_words, "groups" => $groups, "learned" => $learned, "group_id" => $group_id), false);
 }
Пример #2
0
    function udate_group_list()
    {
        $dict_groups = DictGroupsModel::model()->where("`user_id`='" . Auth::getUser()['id'] . "'")->findAll();
        ?>
			<ul style="list-style: none; padding-left: 0px;">
			<?php 
        foreach ($dict_groups as $group) {
            ?>
					<li>
						<input type="radio" name="groups" id="<?php 
            echo $group->id;
            ?>
" value="<?php 
            echo $group->id;
            ?>
"><?php 
            echo $group->title;
            ?>
(<?php 
            echo $group->word_count;
            ?>
)
					</li>
					<?php 
        }
        ?>
			</ul><?php 
    }