Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,788
» Latest member: JobeHead
» Forum threads: 68,119
» Forum posts: 425,045

Full Statistics

Latest Threads
Get data from two tables ...
Forum: General Help
3 minutes ago
» Replies: 1   » Views: 35
PHP 7.2.8 Has Been Releas...
Forum: Lounge
23 minutes ago
» Replies: 0   » Views: 6
PHPbenchmarks.com
Forum: Choosing CodeIgniter
2 hours ago
» Replies: 1   » Views: 101
Error reporting sending t...
Forum: General Help
3 hours ago
» Replies: 3   » Views: 36
SELECT selected CHECKBOX ...
Forum: Issues
4 hours ago
» Replies: 4   » Views: 57
PHP file_exists() functio...
Forum: General Help
5 hours ago
» Replies: 5   » Views: 169
Private Messages - defaul...
Forum: News & Discussion
5 hours ago
» Replies: 5   » Views: 5,891
How to add session data
Forum: Libraries & Helpers
7 hours ago
» Replies: 3   » Views: 79
codeigniter 3.1.9 with ap...
Forum: General Help
Yesterday, 06:21 PM
» Replies: 18   » Views: 519
Session issue
Forum: CodeIgniter 3.x
Yesterday, 03:06 PM
» Replies: 1   » Views: 56

 
  Count problem
Posted by: Germanikus - 07-16-2018, 02:33 PM - Forum: Regional User Groups - Replies (1)

Hello everybody,
I'm trying to write a count that tells me it's WHERE.
Was still working.
But if I hit GROUP BY a different number comes out.
As a result, "3" should come

That's the code right now

PHP Code:
   $query02 $this->db->query("SELECT COUNT(warenkorb_wantsUSER_id) anzahl02 FROM warenkorb WHERE warenkorb_havesUSER_id = 3 AND warenkorb.warenkorb_status = 2");
 
   foreach ($query02->result() as $row02){} 

IMG:
[Image: 5m89n2ob.png]


Question Do I need to separate ajax methods from its main controller?
Posted by: kaitenz - 07-16-2018, 01:13 AM - Forum: Best Practices - Replies (4)

I'm so confused. I want to make my files organized.

Here's my scenario. I have to create an ajax requests in a single controller, lets call it "Dashboard". Now, I need to use ajax to get stats from my database to my dashboard every minute. So, to avoid confusion on where this ajax script belong, what I did was put all my ajax script to their corresponding controller.

PHP Code:
class Dashboard extends CI_Controller
{
    public function 
index()
    {
        
$this->load->view('my_dashboard');
    }

    
/**
     * Ajax
     */
    
public function ajax_stats_sales()
    {
        
// Code here
    
}

    public function 
ajax_stats_users()
    {
        
// Code here
    
}

    public function 
ajax_stats_prod()
    {
        
// Code here
    
}


Now, one idea pops out in my head. What if I put all AJAX scripts/pages to one controller so I keep it organized.
PHP Code:
class Ajax extends CI_Controller
{
    
// All ajax methods here. Not only on dashboard (ex: Ajax for User Accounts, Blogs, etc.)




Any ideas? What is the best practice for this?


  Foreign key and model relation
Posted by: Jyothigowda - 07-16-2018, 12:52 AM - Forum: Model-View-Controller - Replies (1)

How to add foreign key in table in table migration and hoe to do model relation?


  Load method location
Posted by: osgaldor - 07-15-2018, 10:50 PM - Forum: Model-View-Controller - Replies (2)

Hi:

I've been studying Code Igniter's source code and I'm puzzled by something.  Where is the "load" object?  What class is it in?  When we say $this-load->view()  where is that load object?  I looked at the Loader class but that doesn't seem to be it.

Can anyone tell me where to find this in the source?

Thanks!


  domain alias with base_url
Posted by: anthos1984 - 07-15-2018, 09:39 PM - Forum: Lounge - Replies (3)

Supposed I install CI in site: subdomain.maindomain.com which I have base_url subdomain.maindomain.com
I also rent domain call http://www.otherdomain.com which is an alias for subdomain.maindomain.com.

When I go to http://www.otherdomain.com, It will open subdomain.maindomain.com. So how to keep base_url to http://www.otherdomain.com when
I use that domain for browsing?

I mean to make 2 domains looks as separate domain.


  CI4 Db
Posted by: scalla - 07-15-2018, 07:18 PM - Forum: CodeIgniter 4 Support - Replies (7)

Can I extend the ci4 db classes??


  Hide item price if user is not logged in
Posted by: chanceymwa - 07-15-2018, 08:56 AM - Forum: Lounge - Replies (3)

I wanna hide the price from unregistered  and registered users that are not logged in  my code 

I have used the  same syntax  to hide links as below and works perfect

PHP Code:
                    <?php 
                        
if($obj->hasloggedin)
                        {
                            echo 
'<a href="catalogue">CATALOGUES</a>';
                        }
                        else 
                        {
                            echo 
'';                
                        }
                    
?>



but i seem not to get around nesting another if statement  under another if statement.(brings a blank page Undecided )

anyone with an idea to resolve this Confused
PHP Code:
            <?php 
            
if($obj->hasloggedin)
            {
                echo 
'
                <form class="form-horizontal qtyFrm" onsubmit = "addtocartwithquantity($(this).attr('
action')+'/'+$('#qty').val(),this,event);" action = "<?php echo  base_url().'cart/addtocart/'.$obj->product['product_id'];?>">
                  <div class="control-group">
                    <label class="control-label">
                        <?php 
                            
if($obj->product["discount_status"] == "1")
                            {
                                echo 
'
                                    <strong>Price&nbsp;:</strong>&nbsp;<span class = "price-number" style = "text-decoration:line-through;color : red;">R '
.$obj->product["product_price"].'</span><br />
                                    <strong>Discount&nbsp;Price&nbsp;:</strong>&nbsp;<span class = "price-number" style = "">R'
.$obj->product["discount_price"].' </span>
                                '
;
                            }
                            else
                            {
                                echo 
'<strong>Price&nbsp;:</strong>&nbsp;<span class = "price-number">R '.$obj->product["product_price"].'</span>';
                            }
                        
?>
                    </label>
                    <div class="controls" style="clear: both;margin-left: 0px;">
                        <input type="number" id = "qty" class="span1 num_inc" placeholder="Qty."/>
                      <button type="submit" class="btn btn-large btn-success pull-right"> Add to cart <i class=" icon-shopping-cart"></i>
                      </button>
                    </div>                    
                  </div>
                </form>
                ';

                
                echo '<li class="">';
            }
            else 
            {
                echo '<li class="">';                
            }
        ?>


  It works but is it the correct way?
Posted by: dreamweaver - 07-15-2018, 04:48 AM - Forum: Lounge - Replies (2)

"<?php echo site_url('uploads/'); echo $horse->picture; ?>">


  environment not supported
Posted by: rkhy - 07-14-2018, 10:12 PM - Forum: Installation & Setup - Replies (4)

Hello
i have moved the files and database from an existing working codeigniter website to another server. Updated the database configuration accordingly. But when i try to access the site, it says "Your environment does not support this system"

here is the link to the site http://172.245.190.247/

can any one tell me what could be the issue? 
thanks and regards
Ravi Kumar


  cannot call method in another system
Posted by: kvanaraj - 07-14-2018, 04:43 AM - Forum: General Help - No Replies

my local system working properly , when i upload in server after press submit button it gets error

This site can’t be reached
127.0.0.1 refused to connect.
ERR_CONNECTION_REFUSED


<form id="contact-form"  class="form-horizontal" method="post" action="<?php echo base_url(); ?>loginMe" onsubmit="return validateForm(this);">



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.