codeigniter

Return query result with if condition

给你一囗甜甜゛ 提交于 2019-12-24 12:28:43
问题 I have some table structure like this. table property_day propday_id | date | property_id | check_in | check_out ------------------------------------------------------ 1 | 2017-03-26 | 5 | 0 | 0 2 | 2017-03-27 | 5 | 0 | 0 3 | 2017-03-28 | 5 | 0 | 0 4 | 2017-03-29 | 5 | 0 | 0 table rooms room_id | name | property_id ---------------------------- 1 | Deluxe | 5 2 | Superior | 5 3 | Executive | 5 I want to show all that room with if condition inside query. I show that room with date check in and

CodeIgniter - Disallowed Key Characters via $_GET

别说谁变了你拦得住时间么 提交于 2019-12-24 12:16:42
问题 I am getting echoed "Disallowed Key Characters." in my CodeIgniter application when I have a http_cookie sent via GET from a SSL relay site (a payment gateway) to my application. My question is if there's any way that I can get this http_cookie through this "_clean_input_keys" (defined in system/libraries/Input.php) method that cause this Disallowed-message and exits? The parameter contains a getenv("HTTP_COOKIE") set into a hidden input and needs to be used to keep the session alive even

CodeIgniter Mod Rewrite Rules and the Controller

人盡茶涼 提交于 2019-12-24 12:13:29
问题 Learning PHP, I am playing around with mod_rewrite and CodeIgniter. I have configured my .htaccess file correctly with RewriteEngine On RewriteRule ^(resources)/(.*) $1/$2 [L] RewriteRule ^(user_guide)/(.*) $1/$2 [L] RewriteRule (.*) index.php?$1 [L] I understand a bit of regex, and can appreciate what happens here. The rewrite rules are applied and the server than handles the final URL which in the above case- attaches index.php (the front controller) to the "pretty" URL. So far so good. I

getting posts from Wordpress to out of WP in codeigniter view

会有一股神秘感。 提交于 2019-12-24 12:12:58
问题 I use codeigniter and need to display last 3 posts at footer from blog as blabla.com/blog located. when I create a test.php file as below. it works well, test.php <?php // Include Wordpress define('WP_USE_THEMES', false); require('./blog/wp-blog-header.php'); query_posts('showposts=3'); ?> <ul> <?php while (have_posts()): the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> but when I copy same code to footer_view.php of codeigniter

Grocery CRUD Join table

拥有回忆 提交于 2019-12-24 11:45:01
问题 Need some help to make a relationship between products and quantity. Table1: Products Columns: id , code, unit, name, size , cost , price - Table2: qty_products Columns: id , product_id , warehouse_id , quantity the relation between products here is id from products and product_id from qty_products a simple query for this result is: SELECT p.id, p.code, p.unit, p.name, p.size, p.cost, p.price, s.quantity, s.warehouse_id FROM products p INNER JOIN qty_products s ON s.product_id = p.id this

You did not select a file to upload CodeIgniter

廉价感情. 提交于 2019-12-24 11:37:20
问题 $this->upload->data() result is Array ( [file_name] => 72f59510f9bbf05933c89e4951acc29d [file_type] => [file_path] => ./inst/public/uploads/ [full_path] => ./inst/public/uploads/72f59510f9bbf05933c89e4951acc29d [raw_name] => 72f59510f9bbf05933c89e4951acc29d [orig_name] => [client_name] => [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => ) error: Array ( [error] => You did not select a file to upload. ) upload function function

CodeIgniter: How to pass variables to a model while loading

浪子不回头ぞ 提交于 2019-12-24 11:34:55
问题 In CI, I have a model... <?php class User_crud extends CI_Model { var $base_url; var $category; var $brand; var $filter; var $limit; var $page_number; public function __construct($category, $brand, $filter, $limit, $page_number) { $this->base_url = base_url(); $this->category = $category; $this->brand = $brand; $this->filter = $filter; $this->limit = $limit; $this->page_number = $page_number; } public function get_categories() { // output $output = ""; // query $this->db->select("name");

Message: Undefined variable: data - CodeIgniter

Deadly 提交于 2019-12-24 11:34:45
问题 Hi guys I have this code and I am not sure what I am doing wrong, data is being defined as far as I can see, these are the errors I am getting: A PHP Error was encountered Severity: Notice Message: Undefined variable: data Filename: models/site_model.php Line Number: 14 A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/BLOCK/system/core/Exceptions.php:185) Filename: core

PayPal IPN notification receiving multiple notification for the same payment

我们两清 提交于 2019-12-24 11:29:35
问题 I would like to know why I'm receiving multiple IPN notification for one payment, and how I can stop this. I would like keep only one notification. // STEP 2: Post IPN data back to paypal to validate //$ch = curl_init('https://www.paypal.com/cgi-bin/webscr'); $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT

_remap or URI Routing in codeigniter

删除回忆录丶 提交于 2019-12-24 11:28:18
问题 I am currently looking into the PHP Framework Codeigniter and understand the main concepts so far until the Controllers section about _remapping. I have a understanding how _remapping overwrites the behaviour of controller methods over the URI eg from www.example.com/about_me to www.example.com/about-me. What i would like to hear is peoples opinions on what to use- _remapping method or the URI Routing method? Im only asking this as when researching these methods and someone has been troubled