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


PHP Tool::alertBack方法代碼示例

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


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

示例1: upload

 public function upload()
 {
     if (isset($_FILES['userfile']['tmp_name'])) {
         switch ($_POST['type']) {
             case 'face':
                 $width = 99;
                 $height = 100;
                 $info = '頭像上傳成功';
                 break;
             case 'ok':
                 $width = 300;
                 $height = 300;
                 $info = '圖片上傳成功';
                 break;
             case 'rotator':
                 $width = 1200;
                 $height = 530;
                 $info = '輪播器圖片上傳成功';
                 break;
             default:
                 exit('非法操作');
         }
         $upload = new UploadFile('userfile', $_POST['MAX_FILE_SIZE']);
         $path = $upload->getPath();
         $thumb = new Image($path);
         $thumb->thumb($width, $height);
         $thumb->outImage();
         $upload->alertThumbClose($info, $path);
     } else {
         Tool::alertBack('警告:未知錯誤');
     }
 }
開發者ID:zhendeguoke1008,項目名稱:shop-1,代碼行數:32,代碼來源:CallAction.class.php

示例2: Action

 public function Action()
 {
     switch ($_GET['action']) {
         case 'login':
             if (isset($_POST['send'])) {
                 if (!Validate::Check_Length($_POST['code'], 4, 'equals')) {
                     Tool::alertBack('驗證碼必須為四位');
                 }
                 if (!Validate::Check_Equals($_POST['code'], strtolower($_SESSION['code']))) {
                     Tool::alertBack('驗證碼不正確');
                 }
                 $object = $this->model->Manage_Login();
                 if (!Validate::Check_Null($object)) {
                     $_SESSION['admin']['username'] = $object->username;
                     //生成session
                     $_SESSION['admin']['level_position'] = $object->level_position;
                     $this->model->Login_Count();
                     Tool::alertLocation(null, 'admin.php');
                 } else {
                     Tool::alertBack('用戶名或者密碼錯誤,請重新輸入');
                 }
             }
             break;
         case 'logout':
             if (session_start()) {
                 session_destroy();
             }
             Tool::alertLocation(null, 'admin_login.php');
             break;
     }
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:31,代碼來源:LoginAction.class.php

示例3: delete

 private function delete()
 {
     if (isset($_GET['id'])) {
         $this->_model->id = $_GET['id'];
         $this->_model->deleteComment() ? Tool::alertLocation('Succeed', PREV_URL) : Tool::alertBack('Fail');
     } else {
         Tool::alertBack("illegal operation");
     }
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:9,代碼來源:CommentAction.class.php

示例4: add

 private function add()
 {
     if (isset($_POST['send'])) {
         $this->_model->userInfo = $_POST['user_info'];
         echo $this->_model->addModule();
         exit;
     } else {
         Tool::alertBack('非法操作!');
     }
 }
開發者ID:Cyc429170296,項目名稱:webName,代碼行數:10,代碼來源:ModuleAction.class.php

示例5: Delete_Level

 public function Delete_Level()
 {
     $this->id = $_GET['id'];
     $sql_delete = "delete from manage_level where id='{$this->id}' limit 1";
     $affected_rows = parent::add_up_de($sql_delete);
     if ($affected_rows == 1) {
         Tool::alertLocation('刪除成功', 'level.php?action=show');
     } else {
         Tool::alertBack('刪除失敗');
     }
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:11,代碼來源:LevelModel.class.php

示例6: add

 private function add()
 {
     if (@$_POST['send'] == '新增管理員') {
         $this->_model->admin_user = $_POST['admin_user'];
         $this->_model->admin_pass = sha1($_POST['admin_pass']);
         $this->_model->level = $_POST['level'];
         $this->_model->addManage() ? Tool::alertLocation('添加成功', 'manage.php?action=list') : Tool::alertBack('添加失敗');
     }
     $this->_tpl->assign('add', true);
     $this->_tpl->assign('title', '新增管理員');
 }
開發者ID:Under-soil,項目名稱:gitcms,代碼行數:11,代碼來源:ManageAction.class.php

示例7: Agree

 private function Agree()
 {
     if (isset($_GET['id'])) {
         $this->model->id = $_GET['id'];
         if ($this->model->Agree()) {
             Tool::alertLocation(null, PREV_URL);
         }
     } else {
         Tool::alertBack('非法操作');
     }
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:11,代碼來源:CommentAction.class.php

示例8: _action

 public function _action()
 {
     if ($_GET['action'] == 'delcache') {
         if (strstr($_SESSION['admin']['premission'], '2')) {
             $this->delCache();
         } else {
             Tool::alertBack('警告:權限不足,您不能清理緩存!');
         }
     }
     $this->cacheNum();
 }
開發者ID:denson7,項目名稱:phpstudy,代碼行數:11,代碼來源:MainAction.class.php

示例9: delete

 private function delete()
 {
     if (isset($_GET['id'])) {
         $this->_model->id = $_GET['id'];
         $_manage = new ManageModel();
         $_manage->level = $this->_model->id;
         if ($_manage->getOneManage()) {
             Tool::alertBack('this level could not be deleted. please delete user first');
         }
         $this->_model->deleteLevel() ? Tool::alertLocation('Succeed', PREV_URL) : Tool::alertBack('Fail');
     } else {
         Tool::alertBack("illegal operation");
     }
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:14,代碼來源:LevelAction.class.php

示例10: Action

 public function Action()
 {
     global $templates;
     switch ($_GET['action']) {
         case 'show':
             $templates->assgin('title', '等級列表');
             $templates->assgin('show', true);
             $all_level = $this->model->Get_ALL_Level();
             $templates->assgin('ALL_Level', $all_level);
             break;
         case 'update':
             if (isset($_GET['id'])) {
                 $templates->assgin('title', '修改等級');
                 $templates->assgin('update', true);
                 $object = $this->model->Get_One_Level();
                 $templates->assgin('level_position', $object->level_position);
                 $templates->assgin('id', $object->id);
                 $templates->assgin('level_info', $object->level_info);
                 if ($_POST['send'] == '修改等級') {
                     $this->model->Update_Level();
                 }
             }
             break;
         case 'add':
             $templates->assgin('title', '新增等級');
             $templates->assgin('add', true);
             if ($_POST['send'] == '新增等級') {
                 if ($this->model->Get_One_Level()) {
                     Tool::alertBack('等級名稱已經存在');
                 }
                 $this->model->Add_Level();
             }
             break;
         case 'delete':
             $templates->assgin('title', '刪除等級');
             $templates->assgin('delete', true);
             if ($_GET['action'] == 'delete') {
                 //在刪除等級之前,首先進行驗證,如果這個等級有管理員在,則不允許刪除這個等級
                 if ($this->model->Date_Exist()) {
                     Tool::alertBack('這個等級有管理員存在,請先刪除這個管理員');
                 }
                 $this->model->Delete_Level();
             }
             break;
         default:
             echo '非法操作';
             break;
     }
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:49,代碼來源:LevelAction.class.php

示例11: setCount

 private function setCount()
 {
     if (isset($_GET['cid']) && isset($_GET['id']) && isset($_GET['type'])) {
         parent::__construct($this->_tpl, new CommentModel());
         $this->_model->id = $_GET['id'];
         if (!$this->_model->getOneComment()) {
             Tool::alertBack('this comment not existing');
         }
         if ($_GET['type'] == 'sustain') {
             $this->_model->setSustain() ? Tool::alertLocation('succeed', 'feedback.php?cid=' . $_GET['cid']) : Tool::alertLocation('fail', 'feedback.php?cid=' . $_GET['cid']);
         }
         if ($_GET['type'] == 'oppose') {
             $this->_model->setOppose() ? Tool::alertLocation('succeed', 'feedback.php?cid=' . $_GET['cid']) : Tool::alertLocation('fail', 'feedback.php?cid=' . $_GET['cid']);
         }
     }
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:16,代碼來源:FeedBackAction.class.php

示例12: ckeUp

 public function ckeUp()
 {
     if (isset($_GET['type'])) {
         //查看了源代碼,他的名稱是:upload
         $_fileupload = new FileUpload('upload', $_POST['MAX_FILE_SIZE']);
         $_ckefn = $_GET['CKEditorFuncNum'];
         $_path = $_fileupload->getPath();
         $_img = new Image($_path);
         $_img->ckeImg(650, 0);
         $_img->out();
         echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction({$_ckefn},\".{$_path}\",'圖片上傳成功!');</script>";
         exit;
     } else {
         Tool::alertBack('警告:由於非法操作導致上傳失敗!');
     }
 }
開發者ID:yjf0503,項目名稱:Mall,代碼行數:16,代碼來源:CallAction.class.php

示例13: checkLength

 public static function checkLength($str, $length, $flag)
 {
     if ($flag == 'min') {
         return mb_strlen($str, 'utf-8') < $length ? true : false;
     } else {
         if ($flag == 'max') {
             return mb_strlen($str, 'utf-8') > $length ? true : false;
         } else {
             if ($flag == 'equal') {
                 return mb_strlen(trim($str)) == $length ? false : true;
             } else {
                 Tool::alertBack('長度傳值有誤!');
             }
         }
     }
 }
開發者ID:denglitong,項目名稱:mvc,代碼行數:16,代碼來源:Validate.class.php

示例14: Get_List_Nav

 private function Get_List_Nav()
 {
     if (isset($_GET['id'])) {
         global $templates;
         $model = new NavModel();
         $object = $model->Get_One_Nav();
         $child_object = $model->selectchildNav_nolimit();
         $templates->assgin('nav_name', $object->name);
         $templates->assgin('nav_id', $object->id);
         $templates->assgin('child_nav', $child_object);
         $par_object = $model->Get_Parnav();
         $templates->assgin('par_name', $par_object->name);
         $templates->assgin('par_id', $par_object->id);
     } else {
         Tool::alertBack('此導航不存在');
     }
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:17,代碼來源:ListAction.class.php

示例15: 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::alertBack('this image type not supported');
     }
     return $img;
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:17,代碼來源:Image.class.php


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