codeigniter

PHPExcel print array result as HTML table in view

无人久伴 提交于 2021-02-11 13:57:54
问题 I'm using PHPExcel and CodeIgniter to make an application. I have my Model for Excel treatment: class modelExcel extends CI_Model { protected $excel; function __construct() { parent::__construct(); $this->load->library('Excel'); } function readReport() { //Função para retorno dos dados do arquivo Excel $this->excel = PHPExcel_IOFactory::load(APPPATH."/exceldata/wf.xlsx"); //Seleciona a planilha ativa $objWorksheet = $this->excel->getActiveSheet()->rangeToArray('D7:J7'); return $objWorksheet;

How to authenticate specific single page/URL in .htaccess and Codeigniter?

谁都会走 提交于 2021-02-11 13:52:48
问题 This is my .htaccess file <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] RewriteRule ^([^\.]+)$ $1.php/$1 [L] </IfModule> AuthType Basic AuthName "Restricted Content" AuthUserFile .htpasswd Require valid-user I have Add htaccess authentication only for this URL "welcome/list" no another all pages/URLs 回答1: #Set an environment variable for the URI you want to handle SetEnvIf Request_URI "

How to authenticate specific single page/URL in .htaccess and Codeigniter?

喜欢而已 提交于 2021-02-11 13:51:29
问题 This is my .htaccess file <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] RewriteRule ^([^\.]+)$ $1.php/$1 [L] </IfModule> AuthType Basic AuthName "Restricted Content" AuthUserFile .htpasswd Require valid-user I have Add htaccess authentication only for this URL "welcome/list" no another all pages/URLs 回答1: #Set an environment variable for the URI you want to handle SetEnvIf Request_URI "

Codeigniter Rest Server - Fatal error: Class 'CI_Exceptions' not found

孤者浪人 提交于 2021-02-11 12:44:52
问题 I try to create a rest API for my android app using CodeIgniter rest services. Everything is fine on localhost. but when I upload it on live server and test again it throws the error. I creating rest API very first time so I have no idea what I'm doing wrong. It still works fine on localhost. Please help me to find out where I make mistake or it is a live server problem. Your answers will be appreciated. Thanks 回答1: I'm going to give answer of my question. I hope this will help others to

codeigniter not equal query error

浪子不回头ぞ 提交于 2021-02-11 08:21:24
问题 How can i do not equal in my query in mysql database to codeigniter framework. My query shows not equal to the position of admin. Here is my query $query = $this->db->query('SELECT tbl_user_type.position, tbl_users.user_id, tbl_users.user_fname, tbl_users.user_lname, tbl_users.user_mname FROM tbl_users INNER JOIN tbl_user_type ON tbl_users.user_type = tbl_user_type.user_type WHERE !(tbl_user_type.position = Admin) '); return $query->result(); 回答1: Please use active records query to do this

codeigniter not equal query error

我们两清 提交于 2021-02-11 08:20:52
问题 How can i do not equal in my query in mysql database to codeigniter framework. My query shows not equal to the position of admin. Here is my query $query = $this->db->query('SELECT tbl_user_type.position, tbl_users.user_id, tbl_users.user_fname, tbl_users.user_lname, tbl_users.user_mname FROM tbl_users INNER JOIN tbl_user_type ON tbl_users.user_type = tbl_user_type.user_type WHERE !(tbl_user_type.position = Admin) '); return $query->result(); 回答1: Please use active records query to do this

codeigniter not equal query error

孤街醉人 提交于 2021-02-11 08:20:12
问题 How can i do not equal in my query in mysql database to codeigniter framework. My query shows not equal to the position of admin. Here is my query $query = $this->db->query('SELECT tbl_user_type.position, tbl_users.user_id, tbl_users.user_fname, tbl_users.user_lname, tbl_users.user_mname FROM tbl_users INNER JOIN tbl_user_type ON tbl_users.user_type = tbl_user_type.user_type WHERE !(tbl_user_type.position = Admin) '); return $query->result(); 回答1: Please use active records query to do this

Codeigniter Active Record where value in JSON object

99封情书 提交于 2021-02-11 08:09:56
问题 I have a question to ask. Firstly, I have a table, where the parent has parent_id is 0 and the child has parent_id equal parent id. parent_id of all children are stored as a json encoded array (one child record can have many parents). So, how can I get all the children of the parent when I pass one parent id. I tried but it won't work and I don't have a clue. Here's the code: function get_child_product($parent_id, $limit, $start) { $this -> db -> from('product'); $this -> db -> where(json

Codeigniter Active Record where value in JSON object

扶醉桌前 提交于 2021-02-11 08:08:20
问题 I have a question to ask. Firstly, I have a table, where the parent has parent_id is 0 and the child has parent_id equal parent id. parent_id of all children are stored as a json encoded array (one child record can have many parents). So, how can I get all the children of the parent when I pass one parent id. I tried but it won't work and I don't have a clue. Here's the code: function get_child_product($parent_id, $limit, $start) { $this -> db -> from('product'); $this -> db -> where(json

Codeigniter Active Record where value in JSON object

落花浮王杯 提交于 2021-02-11 08:06:38
问题 I have a question to ask. Firstly, I have a table, where the parent has parent_id is 0 and the child has parent_id equal parent id. parent_id of all children are stored as a json encoded array (one child record can have many parents). So, how can I get all the children of the parent when I pass one parent id. I tried but it won't work and I don't have a clue. Here's the code: function get_child_product($parent_id, $limit, $start) { $this -> db -> from('product'); $this -> db -> where(json