当前位置: 首页>>代码示例>>PHP>>正文


PHP valid::URL方法代码示例

本文整理汇总了PHP中valid::URL方法的典型用法代码示例。如果您正苦于以下问题:PHP valid::URL方法的具体用法?PHP valid::URL怎么用?PHP valid::URL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在valid的用法示例。


在下文中一共展示了valid::URL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 public function edit()
 {
     $this->template->content = new View('teams/edit');
     $this->template->title = 'Редактирование конады';
     $this->selected_page = PAGE_TEAMS;
     $this->selected_subpage = null;
     if (!$this->haveAccess()) {
         return;
     }
     $this->template->content->champ = $this->db->select('*')->from('cups_store')->where('1=1 AND back_up_id is null AND moder_rating > 0')->orderby('cp_name', 'asc')->get();
     $this->getFootballerInfo();
     if ($_POST) {
         $data['tm_name'] = trim($_POST['footballer']['name']);
         $data['tm_photo'] = trim($_POST['footballer']['photo']);
         $data['cp_id'] = intval(@$_POST['footballer']['champ']);
         $data['moder_id'] = $this->moderId;
         $data['tm_status'] = ITEM_STATUS_NEW;
         if (empty($data['tm_name'])) {
             $this->error .= 'Укажите название команды' . $this->NL();
         }
         if (empty($data['cp_id'])) {
             $this->error .= 'Укажите чемпионат' . $this->NL();
         }
         if (empty($data['tm_photo'])) {
             $this->error .= 'Укажите адрес фотографии игрока для анкеты' . $this->NL();
         } elseif (!valid::URL($data['tm_photo'])) {
             $this->error .= 'Укажите правильный адрес фотографии для анкеты' . $this->NL();
         }
         if (is_null($this->error)) {
             if (!$this->haveAccessByStatus($this->template->content->item->tm_status)) {
                 $this->error .= 'Запрещённая операция' . $this->NL();
             } else {
                 $id = intval($this->uri->segment('id'));
                 $this->makeCopy('teams_store', 'tm_id', $id, 'tm_status');
                 $status = $this->db->update('teams_store', $data, array('tm_id' => $id));
                 if (count($status)) {
                     $this->info = 'Команда отредактирована.';
                     url::redirect(url::site() . "teams/info/id/" . intval($this->uri->segment('id')) . '/updated/yes');
                     exit;
                 }
             }
         }
     }
 }
开发者ID:rootree,项目名称:vk-footboller-content-system,代码行数:44,代码来源:teams.php

示例2: edit

 public function edit()
 {
     $this->template->content = new View('coaches/edit');
     $this->template->title = 'Редактирование тренера';
     $this->selected_page = PAGE_COACHES;
     $this->selected_subpage = null;
     if (!$this->haveAccess()) {
         return;
     }
     $this->getFootballerInfo();
     $this->template->content->teams = $this->db->select('*')->from('teams_store')->join('cups_store', 'cups_store.cp_id', 'teams_store.cp_id', ' AND cups_store.back_up_id is null AND cups_store.moder_rating > 0')->where('1=1 and teams_store.back_up_id IS NULL')->orderby('tm_id', 'desc')->get();
     if ($_POST) {
         $data['ch_name'] = trim($_POST['footballer']['name']);
         $data['tm_id'] = intval(@$_POST['footballer']['team']);
         $data['ch_photo'] = trim($_POST['footballer']['photo']);
         $data['moder_id'] = $this->moderId;
         $data['ch_status'] = ITEM_STATUS_NEW;
         if (empty($data['ch_name'])) {
             $this->error .= 'Укажите имя тренера' . $this->NL();
         }
         if (!$data['tm_id']) {
             $this->error .= 'Укажите команду' . $this->NL();
         }
         if (empty($data['ch_photo'])) {
             $this->error .= 'Укажите адрес фотографии тренера для анкеты' . $this->NL();
         } elseif (!valid::URL($data['ch_photo'])) {
             $this->error .= 'Укажите правильный адрес фотографии для анкеты' . $this->NL();
         }
         if (is_null($this->error)) {
             if (!$this->haveAccessByStatus($this->template->content->item->ch_status)) {
                 $this->error .= 'Запрещённая операция' . $this->NL();
             } else {
                 $id = intval($this->uri->segment('id'));
                 $this->makeCopy('coaches_store', 'ch_id', $id, 'ch_status');
                 $status = $this->db->update('coaches_store', $data, array('ch_id' => $id));
                 if (count($status)) {
                     $this->info = 'Тренер отредактирован.';
                     url::redirect(url::site() . "coaches/info/id/" . intval($this->uri->segment('id')) . '/updated/yes');
                     exit;
                 }
             }
         }
     }
 }
开发者ID:rootree,项目名称:vk-footboller-content-system,代码行数:44,代码来源:coaches.php

示例3: add

 public function add()
 {
     $this->template->content = new View('sponsors/add');
     $this->template->title = 'Добавление спонсора';
     $this->selected_page = PAGE_SPONSORS;
     $this->selected_subpage = Sponsors_Controller::SUBPAGE_ADD;
     if (!$this->haveAccess()) {
         return;
     }
     if ($_POST) {
         $data['sp_name'] = trim($_POST['footballer']['name']);
         $data['sp_level'] = trim(@$_POST['footballer']['level']);
         $data['sp_rating'] = trim(@$_POST['footballer']['rating']);
         $data['sp_photo'] = trim($_POST['footballer']['photo']);
         $data['moder_id'] = $this->moderId;
         $data['sp_status'] = ITEM_STATUS_NEW;
         if (empty($data['sp_name'])) {
             $this->error .= 'Укажите название спонсора' . $this->NL();
         }
         if (!$data['sp_level']) {
             $this->error .= 'Укажите уровень' . $this->NL();
         }
         if (!$data['sp_rating']) {
             $this->error .= 'Укажите рейтинг' . $this->NL();
         }
         if (empty($data['sp_photo'])) {
             $this->error .= 'Укажите адрес фотографии спонсора для анкеты' . $this->NL();
         } elseif (!valid::URL($data['sp_photo'])) {
             $this->error .= 'Укажите правильный адрес фотографии' . $this->NL();
         }
         if (is_null($this->error)) {
             $status = $this->db->insert('sponsors_store', $data);
             if (count($status)) {
                 $this->info = 'Спонсор добавлен.';
                 url::redirect(url::site() . "sponsors/info/id/" . $status->insert_id());
                 exit;
             }
         }
     }
 }
开发者ID:rootree,项目名称:vk-footboller-content-system,代码行数:40,代码来源:sponsors.php

示例4: edit

 public function edit()
 {
     $this->template->content = new View('stadiums/edit');
     $this->template->title = 'Редактирование стадиона';
     $this->selected_page = PAGE_STADIUMS;
     $this->selected_subpage = null;
     if (!$this->haveAccess()) {
         return;
     }
     $this->getFootballerInfo();
     if ($_POST) {
         $data['st_name'] = trim($_POST['footballer']['name']);
         $data['st_city'] = trim($_POST['footballer']['city']);
         $data['st_country_code'] = intval($_POST['footballer']['country']);
         $data['st_level'] = trim(@$_POST['footballer']['level']);
         $data['st_photo'] = trim($_POST['footballer']['photo']);
         $data['moder_id'] = $this->moderId;
         $data['st_status'] = ITEM_STATUS_NEW;
         if (empty($data['st_name'])) {
             $this->error .= 'Укажите название стадиона' . $this->NL();
         }
         if (empty($data['st_city'])) {
             $this->error .= 'Укажите город стадиона' . $this->NL();
         }
         if (!$data['st_country_code']) {
             $this->error .= 'Выбирете принадлежность к стране' . $this->NL();
         }
         if (!$data['st_level']) {
             $this->error .= 'Укажите с которого доступен стадион' . $this->NL();
         }
         if (empty($data['st_photo'])) {
             $this->error .= 'Укажите адрес фотографии стадиона' . $this->NL();
         } elseif (!valid::URL($data['st_photo'])) {
             $this->error .= 'Укажите правильный адрес фотографии стадиона' . $this->NL();
         }
         if (is_null($this->error)) {
             if (!$this->haveAccessByStatus($this->template->content->item->st_status)) {
                 $this->error .= 'Запрещённая операция' . $this->NL();
             } else {
                 $id = intval($this->uri->segment('id'));
                 $this->makeCopy('stadiums_store', 'st_id', $id, 'st_status');
                 $status = $this->db->update('stadiums_store', $data, array('st_id' => $id));
                 if (count($status)) {
                     $this->info = 'Стадион отредактирован.';
                     url::redirect(url::site() . "stadiums/info/id/" . intval($this->uri->segment('id')) . '/updated/yes');
                     exit;
                 }
             }
         }
     }
 }
开发者ID:rootree,项目名称:vk-footboller-content-system,代码行数:51,代码来源:stadiums.php

示例5: edit

 public function edit()
 {
     $this->template->content = new View('footballers/edit');
     $this->template->title = 'Редактирование футболиста';
     $this->selected_page = PAGE_FOOTBALLERS;
     $this->selected_subpage = null;
     if (!$this->haveAccess()) {
         return;
     }
     $this->template->content->teams = $this->db->select('*')->from('teams_store')->join('cups_store', 'cups_store.cp_id', 'teams_store.cp_id', ' AND cups_store.back_up_id is null AND cups_store.moder_rating > 0')->where('1=1 and teams_store.back_up_id IS NULL')->orderby('tm_id', 'desc')->get();
     $this->getFootballerInfo();
     if ($_POST) {
         $data['ft_name'] = trim($_POST['footballer']['name']);
         //  $data['ft_desc'] = trim($_POST['footballer']['desc']);
         $data['tm_id'] = intval(@$_POST['footballer']['team']);
         $data['ft_line'] = intval(@$_POST['footballer']['line']);
         //   $data['ft_level'] = trim(@$_POST['footballer']['level']);
         //  $data['ft_rating'] = trim(@$_POST['footballer']['rating']);
         $data['ft_photo'] = trim($_POST['footballer']['photo']);
         $data['ft_photo_best'] = trim($_POST['footballer']['photo_best']);
         $data['ft_year'] = intval($_POST['footballer']['year']);
         $data['moder_id'] = $this->moderId;
         $data['ft_status'] = ITEM_STATUS_NEW;
         if (empty($data['ft_name'])) {
             $this->error .= 'Укажите имя игрока' . $this->NL();
         }
         /*
                     if(empty($data['ft_desc'])){
                         $this->error .= 'Укажите описание' . $this->NL();
                     }*/
         if (!$data['ft_line']) {
             $this->error .= 'Укажите амплуа' . $this->NL();
         }
         if ($data['ft_year'] > 2000 || $data['ft_year'] < 1940) {
             $this->error .= 'Укажите год рождения, с коректным годом (четырёх значное число)' . $this->NL();
         }
         /*
                     if(!$data['ft_level']){
                         $this->error .= 'Укажите уровень' . $this->NL();
                     }
         
                     if(!$data['ft_rating']){
                         $this->error .= 'Укажите рейтинг' . $this->NL();
                     }*/
         if (!$data['tm_id']) {
             $this->error .= 'Укажите команду' . $this->NL();
         }
         if (empty($data['ft_photo'])) {
             $this->error .= 'Укажите адрес фотографии игрока для анкеты' . $this->NL();
         } elseif (!valid::URL($data['ft_photo'])) {
             $this->error .= 'Укажите правильный адрес фотографии для анкеты' . $this->NL();
         }
         if (empty($data['ft_photo_best'])) {
             $this->error .= 'Укажите адрес лучшей фотографии игрока' . $this->NL();
         } elseif (!valid::URL($data['ft_photo_best'])) {
             $this->error .= 'Укажите правильный адрес лучшей фотографии' . $this->NL();
         }
         if (is_null($this->error)) {
             if (!$this->haveAccessByStatus($this->template->content->item->ft_status)) {
                 $this->error .= 'Запрещённая операция' . $this->NL();
             } else {
                 $id = intval($this->uri->segment('id'));
                 $this->makeCopy('footballers_store', 'ft_id', $id, 'ft_status');
                 $status = $this->db->update('footballers_store', $data, array('ft_id' => $id));
                 if (count($status)) {
                     $this->info = 'Футболист отредактирован.';
                     url::redirect(url::site() . "footballers/info/id/" . intval($this->uri->segment('id')) . '/updated/yes');
                     exit;
                 }
             }
         }
     }
 }
开发者ID:rootree,项目名称:vk-footboller-content-system,代码行数:73,代码来源:footballers.php


注:本文中的valid::URL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。