codeigniter

Multiple mysql ORDER BY's for multidimensional ordering/grouping

半世苍凉 提交于 2020-01-07 04:08:11
问题 I have a set of data that needs to be ordered in multiple ways simultaneously. Simplified, the table can be summarised as: Task id group (int) date (date) complete (0/1) I need to produce a list of these tasks, sorted primarily by 'complete', secondarily by 'date' and then grouped by 'group'. The group is what's causing the issue for me and I have a feeling this might be better achieved with PHP, as it may not be possible as part of the query - tips on the best way to approach this are

Multiple mysql ORDER BY's for multidimensional ordering/grouping

走远了吗. 提交于 2020-01-07 04:08:06
问题 I have a set of data that needs to be ordered in multiple ways simultaneously. Simplified, the table can be summarised as: Task id group (int) date (date) complete (0/1) I need to produce a list of these tasks, sorted primarily by 'complete', secondarily by 'date' and then grouped by 'group'. The group is what's causing the issue for me and I have a feeling this might be better achieved with PHP, as it may not be possible as part of the query - tips on the best way to approach this are

Codeigniter 3 - pagination from array - links not showing up

二次信任 提交于 2020-01-07 03:27:12
问题 I'm building in CI3 and pulling data from a MSSQL database (no offset, are you kidding?), so i've been force to paginate from an array (see How to get CI pagination to work with a array();). Everything is working, I can manually add digits to the url (segment) and get the required results but i can't get the pagination links to show up at all. I have been through the other similar questions on this site but none seem to relate. Any Help would be greatly appreciated. The Route - $route['orders

PHP/Codeigniter Logical Operator

試著忘記壹切 提交于 2020-01-07 03:22:09
问题 $total_cost_for_A = $this->admin_model->total_cost_for_A($branch, $department, $date); $total_cost_for_B = $this->admin_model->total_cost_for_B($branch, $department, $date); The variables $total_cost_for_A and $total_cost_for_B hold the returned value from a mysql summation queries in the model. The queries return false if no record was found. Now, I'm trying to perform this operation. if(($total_cost_for_A === FALSE) && ($total_cost_for_B === FALSE)) { $data['no_record'] = 'No Record Found!'

How to change data in custom loaded config array

不羁的心 提交于 2020-01-07 03:10:08
问题 I'm doing pagination using Codeigniter pagination class. My current config variable is: $config['base_url'] = base_url('admin/sub_categories'); $config['total_rows'] = $this->sub_categories_model->get_count(); $config['base_url'] = ""; $config['total_rows'] = ""; $config['per_page'] = 30; $config['first_link'] = 'Эхнийх'; $config['last_link'] = 'Сүүлийх'; $config['full_tag_open'] = '<ul class="pagination">'; $config['full_tag_close'] = '</ul>'; $config['first_link'] = false; $config['last

Retrieving data from two tables in CodeIgniter

一笑奈何 提交于 2020-01-07 03:08:37
问题 I want to display some categories and their member data like this: Fruits Orange Grape Apple Animals Cat Dog Horse But what I got is something like this: Fruits Orange Fruits Grape Fruits Apple Animals Cat Animals Dog Animals Horse Here is what I did. In category_model: function getCategoryMembers(){ $this->db->join('members','members.category_id=categories.id','left'); return $this->db->get('categories')->result(); } In controller, I pass the member and category data. $data['members'] =

Converting Unicode character to text in PHP is not working

只谈情不闲聊 提交于 2020-01-07 03:08:20
问题 I am trying to convert Unicode character to text in PHP. But the string is the mixture of Unicode characters and text. But it is not working. I followed this link (Unicode character in PHP string) <?php $unicodeChar = "{'singer': u'', 'name': u'\\\\u101c\\\\u1031\\\\u1011\\\\u1032\\\\u101c\\\\u103d\\\\u103e\\\\u1004\\\\u1037\\\\u103a\\\\u101c\\\\u102d\\\\u102f\\\\u1000\\\\u103a'}\\r\\n\\r\\n artist : Thar Gyi\\r\\n album : Sal Pone Ta Pone\\r\\n genre : R&B\\r\\n copyright : MyanmarSongs.NET\

CodeIgniter 3 - configuring log_threshold

不羁岁月 提交于 2020-01-07 03:05:02
问题 Ok I got confused. Inside application/config.php it says in comments: | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | |

CodeIgniter 3 - configuring log_threshold

泄露秘密 提交于 2020-01-07 03:04:26
问题 Ok I got confused. Inside application/config.php it says in comments: | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | |

Dropdown required not working in codeigniter

喜欢而已 提交于 2020-01-07 03:01:11
问题 I want to make the mail is field required, but somehow its not working, am i missing something? <div class="col-md-5 "> <div class="control-group form-group"> <label class="control-label"> Escalation Email Ids </label> <div class="controls"> <?php $options=a rray(); if(count($useridsoptions)){ foreach($useridsoptions as $key=>$val){ $options[$key]=$val; } } echo form_dropdown('esc_users[]', $options, explode(",",$row->esc_users),'id="esc_users" class="form-control function col-md-12 select2",