예제 #1
0
 /**
  * 修改联系人分组顺序
  */
 public function order()
 {
     if ($this->get_method() != 'POST') {
         $this->send_response(405, NULL, Kohana::lang('contact.method_not_exist'));
     }
     $data = $this->get_data();
     $ids = !empty($data['ids']) ? $data['ids'] : array();
     if (empty($ids)) {
         $this->send_response(400, NULL, Kohana::lang('contact.group_ids_empty'));
     } else {
         $ids = explode(',', $ids);
         $list = $this->model->get($this->user_id);
         $old_ids = array();
         foreach ($list as $value) {
             $old_ids[] = $value['id'];
         }
         if (array_intersect($old_ids, $ids) != $old_ids) {
             $this->send_response(400, NULL, Kohana::lang('contact.group_ids_not_complete'));
         } else {
             if ($this->model->change_order($this->user_id, $ids)) {
                 $this->send_response(200);
             } else {
                 $this->send_response(500, NULL, Kohana::lang('contact.operation_fail'));
             }
         }
     }
 }
예제 #2
0
파일: test.php 프로젝트: vobinh/PHP
        ?>
"/>
 <?php 
        for ($i = 0; isset($mlist[$k]['questionnaires']) && $i < count($mlist[$k]['questionnaires']); $i++) {
            ?>
 	 
     <div style="width:100%; float:left;min-height:180px;" class="questionnaires">
   
    <?php 
            if (isset($mlist[$k]['category']) && $mlist[$k]['category'] != $category) {
                ?>
    
    <?php 
                $category_model = new Category_Model();
                $this->db->where('category.uid', $mlist[$k]['parent_id']);
                $mr_parent = $category_model->get();
                echo isset($mr_parent[0]['category']) && $parent_category != $mr_parent[0]['category'] ? '<div style="font-size:36px">' . $mr_parent[0]['category'] . ' </div>' : "";
                if (isset($mr_parent[0]['category'])) {
                    $parent_category = $mr_parent[0]['category'];
                }
                ?>
    <div><h1>
   
   
	<?php 
                echo $mlist[$k]['category'];
                $category = $mlist[$k]['category'];
                ?>
</h1></div>
    <?php 
            }