當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tool::alert方法代碼示例

本文整理匯總了PHP中Tool::alert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tool::alert方法的具體用法?PHP Tool::alert怎麽用?PHP Tool::alert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tool的用法示例。


在下文中一共展示了Tool::alert方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: config

 public function config()
 {
     $model = new AttributesModel();
     if (isset($_POST['send'])) {
         if ($_POST['schoolType'] == '_placeHolder') {
             Tool::alertBackNoRefresh('請選擇學校類型');
             return;
         }
         $sheetNumArr = explode('-', $_POST['dataSheetNum']);
         foreach ($sheetNumArr as $key => &$sheetNum) {
             if (trim($sheetNum)) {
                 $sheetNum = trim($sheetNum) - 1;
             } else {
                 unset($sheetNumArr[$key]);
             }
         }
         if (!count($sheetNumArr)) {
             Tool::alertBackNoRefresh('請配置 Excel中體測數據工作表序號');
             return;
         }
         foreach ($_POST as $column => $attributeName) {
             $model->{$column} = $attributeName;
         }
         if ($model->save()) {
             Tool::alert('上傳文件格式設置成功成功:)');
         } else {
             Tool::alert('很遺憾文件格式設置失敗:(');
         }
     }
     $this->render('data/config', array('attributes' => $model->getAttributes(), 'config' => $model->getConfig(), 'schoolArr' => array(0 => '大學', 1 => '高中', 2 => '初中', 3 => '小學'), 'beginRowArr' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 'columnAArr_1' => array('A' => 'column1', 'B' => 'column2', 'C' => 'column3', 'D' => 'column4', 'E' => 'column5', 'F' => 'column6', 'G' => 'column7', 'H' => 'column8', 'I' => 'column9', 'J' => 'column10', 'K' => 'column11', 'L' => 'column12', 'M' => 'column13', 'N' => 'column14', 'O' => 'column15', 'P' => 'column16', 'Q' => 'column17', 'R' => 'column18', 'S' => 'column19', 'T' => 'column20', 'U' => 'column21', 'V' => 'column22', 'W' => 'column23', 'X' => 'column24', 'Y' => 'column25', 'Z' => 'column26'), 'columnAArr_2' => array('AA' => 'column27', 'AB' => 'column28', 'AC' => 'column29', 'AD' => 'column30', 'AE' => 'column31', 'AF' => 'column32', 'AG' => 'column33', 'AH' => 'column34', 'AI' => 'column35', 'AJ' => 'column36', 'AK' => 'column37', 'AL' => 'column38', 'AM' => 'column39', 'AN' => 'column40', 'AO' => 'column41', 'AP' => 'column42', 'AQ' => 'column43', 'AR' => 'column44', 'AS' => 'column45', 'AT' => 'column46', 'AU' => 'column47', 'AV' => 'column48', 'AW' => 'column49', 'AX' => 'column50', 'AY' => 'column51', 'AZ' => 'column52'), 'columnBArr' => array('BA' => 'column53', 'BB' => 'column54', 'BC' => 'column55', 'BD' => 'column56', 'BE' => 'column57'), 'collorArr' => array('stuId' => 'style="color: #fb3838"', 'stuName' => 'style="color: #fb3838"', 'sex' => 'style="color: #fb3838"', 'height' => 'style="color: #fb3838"', 'weight' => 'style="color: #fb3838"', 'BMIMark' => 'style="color: #f7883a"', 'BMIScore' => 'style="color: #f7883a"', 'BMIGrade' => 'style="color: #f7883a"', 'FVCMark' => 'style="color: #308430"', 'FVCScore' => 'style="color: #308430"', 'FVCGrade' => 'style="color: #308430"', '_50mMark' => 'style="color: #385ad3"', '_50mScore' => 'style="color: #385ad3"', '_50mGrade' => 'style="color: #385ad3"', 'SLJMark' => 'style="color: #800080"', 'SLJScore' => 'style="color: #800080"', 'SLJGrade' => 'style="color: #800080"', 'SARMark' => 'style="color: #fb3838"', 'SARScore' => 'style="color: #fb3838"', 'SARGrade' => 'style="color: #fb3838"', '_800mMark' => 'style="color: #f7883a"', '_800mScore' => 'style="color: #f7883a"', '_800mAdditionalScore' => 'style="color: #f7883a"', '_800mGrade' => 'style="color: #f7883a"', '_1000mMark' => 'style="color: #308430"', '_1000mScore' => 'style="color: #308430"', '_1000mAdditionalScore' => 'style="color: #308430"', '_1000mGrade' => 'style="color: #308430"', 'SitUpsMark' => 'style="color: #385ad3"', 'SitUpsScore' => 'style="color: #385ad3"', 'SitUpsAdditionalScore' => 'style="color: #385ad3"', 'SitUpsGrade' => 'style="color: #385ad3"', 'ChinUpMark' => 'style="color: #f7883a"', 'ChinUpScore' => 'style="color: #f7883a"', 'ChinUpAdditionalScore' => 'style="color: #f7883a"', 'ChinUpGrade' => 'style="color: #f7883a"', 'ropeSkippingMark' => 'style="color: #fb3838"', 'ropeSkippingScore' => 'style="color: #fb3838"', 'ropeSkippingAdditionalScore' => 'style="color: #fb3838"', 'ropeSkippingGrade' => 'style="color: #fb3838"', '_400mMark' => 'style="color: #800080"', '_400mScore' => 'style="color: #800080"', '_400mAdditionalScore' => 'style="color: #800080"', '_400mGrade' => 'style="color: #800080"', 'standardPoints' => 'style="color: #308430"', 'additionalPoints' => 'style="color: #308430"', 'SumUpScore' => 'style="color: #308430"', 'SumUpGrade' => 'style="color: #308430"')));
 }
開發者ID:denglitong,項目名稱:tice,代碼行數:31,代碼來源:DataController.class.php

示例2: resetPasswd

 public function resetPasswd()
 {
     parent::checkAdmin();
     if (isset($_POST['send'])) {
         $model = new AdminModel();
         $model->oldPassword = sha1(trim($_POST['oldPassword']));
         $model->password = sha1(trim($_POST['password']));
         if ($model->resetPasswd()) {
             Tool::alert('密碼修改成功');
         } else {
             Tool::alertBackNoRefresh('原密碼不正確或密碼修改失敗:(');
         }
     }
     $this->render('default/resetPasswd');
 }
開發者ID:denglitong,項目名稱:tice,代碼行數:15,代碼來源:DefaultController.class.php

示例3: checkType

 private function checkType()
 {
     if (!in_array($this->type, $this->typeArr)) {
         Tool::alert('警告,不合法的上傳類型');
         $this->flag = false;
     }
 }
開發者ID:hanfengtianyasmile,項目名稱:hfphp,代碼行數:7,代碼來源:FileUpload.class.php

示例4: getFromImg

 private function getFromImg($file, $type)
 {
     switch ($type) {
         case 1:
             $img = imagecreatefromgif($file);
             break;
         case 2:
             $img = imagecreatefromjpeg($file);
             break;
         case 3:
             $img = imagecreatefrompng($file);
             break;
         default:
             Tool::alert('警告:此圖片類型本係統不支持!');
             break;
     }
     return $img;
 }
開發者ID:hanfengtianyasmile,項目名稱:hfphp2.0,代碼行數:18,代碼來源:Image.class.php

示例5: resetPasswd

 public function resetPasswd()
 {
     parent::checkLogin();
     if (isset($_POST['send'])) {
         $model = new UserModel();
         $model->stuId = $_SESSION['ticeStuId'];
         $model->oldPassword = sha1(trim($_POST['oldPassword']));
         $model->password = sha1(trim($_POST['password']));
         if ($model->resetPasswd()) {
             Tool::alert('密碼修改成功');
         } else {
             Tool::alertBackNoRefresh('原密碼不正確或密碼修改失敗:(');
         }
     }
     $this->render('site/resetPasswd');
 }
開發者ID:denglitong,項目名稱:tice,代碼行數:16,代碼來源:SiteController.class.php


注:本文中的Tool::alert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。