This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (filter_var($data_text, FILTER_VALIDATE_URL) === FALSE) { | |
| echo "no"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $button = []; | |
| $button['text'] = stripcslashes("Рассказать друзьям Telegram"); | |
| $button['switch_inline_query'] = $url; | |
| $keyboard[] = array($button); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $url = "http://test.ru/; | |
| $this->curl->create($url); | |
| $this->curl->option(CURLOPT_HTTPHEADER, ['Content-Type: application/json' , "Authorization: Bearer ".$this->api_eth ]); | |
| $this->curl->get(); | |
| $result = $this->curl->execute(); | |
| $result = json_decode($result); | |
| if (!$result AND $this->curl->error_code > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="form-group"> | |
| <label> | |
| <input type="checkbox" name="inp" class="minimal"> | |
| Minimal skin checkbox | |
| </label> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //проверить | |
| $rules['rules'] = 'required|trim|alpha_numeric|min_length[3]'; | |
| $rules['field'] = 'alias'; | |
| $rules['label'] = 'код мероприятия'; | |
| //@dosc https://www.codeigniter.com/userguide3/libraries/form_validation.html | |
| $this->form_validation->set_data(['alias' => $alias]); | |
| $this->form_validation->set_rules([$rules]); | |
| if (!$this->form_validation->run()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class MY_Form_validation extends CI_Form_validation { | |
| function run($module = '', $group = '') { | |
| (is_object($module)) AND $this->CI = &$module; | |
| return parent::run($group); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function get_winner_opros($id_opros) { | |
| $this->db->limit(1); | |
| $this->db->select('id_file, count(*) as count'); | |
| $this->db->group_by('id_file'); | |
| $this->db->order_by('count', 'desc'); | |
| $this->db->where('id_opros', $id_opros); | |
| $files_votes = $this->db->get('files_votes'); | |
| if ($files_votes->num_rows() <= 0) { | |
| return FALSE; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Экспортировать выплаты сотрудникам в EXCEL | |
| */ | |
| public function export_pays_xls($pays) { | |
| if ($pays->num_rows() <= 0) { | |
| return FALSE; | |
| } | |
| $this->load->model("Lead_model"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Посчитать расстояние между двумя точками в координатах | |
| * @src http://dmitry.im/mysql-dist/ | |
| * @example | |
| * $lat1 = 55.130974; | |
| $lon1 = 61.420328; | |
| $lat2 = 55.130682; | |
| $lon2 = 61.421776; | |
| $res = $this->getDistance($lat1, $lon1, $lat2, $lon2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //$res - массив который надо отсортировать по полю in_group | |
| //по возрастанию | |
| usort($res, function($a, $b){ | |
| return ($a['in_group'] - $b['in_group']); | |
| }); | |
| //по убыванию | |
| usort($res, function($a, $b){ | |
| return ($b['in_group'] - $a['in_group']); |
NewerOlder