Пример #1
0
 public function index()
 {
     $clang = Yii::app()->lang;
     if (!Permission::model()->hasGlobalPermission('emailTemp', 'create')) {
         Yii::app()->setFlashMessage($clang->gT("You do not have sufficient rights to access this page."), 'error');
         $this->getController()->redirect(array("admin/index"));
     }
     App()->getClientScript()->registerCssFile(Yii::app()->getConfig('styleurl') . "jquery.dataTables.css");
     App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'jquery.dataTables.min.js');
     $userlist = getPagelist();
     $aData['row'] = 0;
     $aData['usr_arr'] = $userlist;
     $aData['imageurl'] = Yii::app()->getConfig("adminimageurl");
     $this->_renderWrappedTemplate('get', 'view_listtmplt', $aData);
 }
Пример #2
0
    echo $row["id"];
    ?>
&redirect=<%=e.getUrl%>"><i class="fa fa-pencil"></i> 修改</a>&nbsp;&nbsp;
    	<a href="news.action.php?action=rec&id=<?php 
    echo $row["id"];
    ?>
&redirect=<%=e.getUrl%>" onclick="return confirm('确定要删除吗')"><i class="fa fa-recycle"></i> 回收站</a>
    </td>
  </tr>
<?php 
}
?>
</table>

<?php 
echo getPagelist($total[0]['count(*)'], $pagesize);
?>

<script>
$(function(){
  $('#sort_jump_box').change(function(){
    document.location.href='news.listview.php?pid='+$('#sort_jump_box').val();
  })
})

<?php 
if (isset($_GET['search_keywords'])) {
    ?>
$('#search_keywords').val('<?php 
    echo $_GET['search_keywords'];
    ?>
Пример #3
0
 public function edit_profile()
 {
     $clang = $this->getController()->lang;
     App()->getClientScript()->registerPackage('jqgrid');
     $userlist = getPagelist();
     $aData['row'] = 0;
     $aData['usr_arr'] = $userlist;
     $aData['imageurl'] = Yii::app()->getConfig("adminimageurl");
     $action = isset($_POST['action']) ? $_POST['action'] : '';
     if ($action == 'edit_profile') {
         $fname = $_POST['fname'];
         $lname = $_POST['lname'];
         $panellist_id = $_POST['panellist_id'];
         $aData['display'] = false;
         $aViewUrls = array();
         $oRecord = PL::model()->findByPk($panellist_id);
         $oRecord->first_name = $fname;
         $oRecord->last_name = $lname;
         $EditPanellist = $oRecord->save();
         if ($EditPanellist) {
             $quelist_reg = Question(get_question_categoryid('Registration'), '', true, false);
             $sql = "UPDATE {{panellist_answer}} SET status = 'E' ";
             foreach ($quelist_reg as $key => $value) {
                 if ($value == 'CheckBox') {
                     $val = implode(',', $_POST[$key]);
                     $sql .= ", question_id_{$key} = '" . $val . "'";
                 } elseif ($value == 'DOB') {
                     $birthdate = date('Y-m-d', strtotime($_POST[$key]));
                     $sql .= ", question_id_{$key} = '" . $birthdate . "'";
                 } else {
                     $sql .= ", question_id_{$key} = '" . $_POST[$key] . "'";
                 }
             }
             $quelist_prof = Question(get_question_categoryid('Profile'), '', true, false);
             foreach ($quelist_prof as $key => $value) {
                 if ($value == 'CheckBox') {
                     $val = implode(',', $_POST[$key]);
                     $sql .= ", question_id_{$key} = '" . $val . "'";
                 } elseif ($value == 'DOB') {
                     $birthdate = date('Y-m-d', strtotime($_POST[$key]));
                     $sql .= ", question_id_{$key} = '" . $birthdate . "'";
                 } else {
                     $sql .= ", question_id_{$key} = '" . $_POST[$key] . "'";
                 }
             }
             $sql .= " where panellist_id = '" . $panellist_id . "' ";
             $result = Yii::app()->db->createCommand($sql)->query();
             $message = $clang->gT('Data submitted Successfully');
             App()->user->setFlash('Error', $message);
             $this->getController()->redirect(array('/pl/home/sa/edit_profile'));
         }
     }
     $this->_renderWrappedTemplate('', 'edit_account', $aData);
 }