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

 
  How to add session data
Posted by: chillifish - 07-17-2018, 01:51 PM - Forum: Libraries & Helpers - Replies (3)

This may sound like a ridiculous question, but I'm trying to work out how to add data to the session (to indicate a user has logged in). The documentation here says:

Quote:You can simply assign data to the 
Code:
$_SESSION
 array, as with any other variable. Or as a property of 
Code:
$this->session
.

How do you add it as a property of $this->session? I can't seem to find a relevant method anywhere and everything online seems to point to set_userdata(), but apparently, that's the 'old' method. I don't want to use the 'old' method, I want to use the new one!


  problem with query
Posted by: jokerbwo - 07-17-2018, 10:15 AM - Forum: General Help - No Replies

I have a problem, I make the following query:
SELECT
    dop.ID_CAJERO,
    dop.NUM_SERIE,
    CONCAT(us.apUsuario,' ',us.amUsuario,' ',us.nomUsuario) AS TECNICO ,
    CASE
        WHEN dop.V_F IS NULL THEN FORMAT( dop.MONTO_PAGADO, 2 )
        ELSE FORMAT(dop.V_R,2)
    END as MONTO_PAGADO, 
    dop.FECHA_PAGO,
    dop.HORA_PAGO,
    dop.FOLIO_FORMAVALORADA,
    dop.FOLIO_CONTROL,
    dop.CONTRIBUYENTE,
    dop.SERIE_FOLIOS,
    ifnull(dop.V_R,dop.MONTO_
PAGADO) V_R,
    ifnull(dop.V_F,dop.MONTO_PAGADO) V_F,
    ifnull(dop.V_D,0) V_D,
    ifnull(dop.FECHA_APP,dop.FECHA_PAGO) FECHA_CAJERO   
FROM det_operacion dop
JOIN cat_cajeros cat on cat.NUMERO=dop.ID_CAJERO
JOIN cat_usuario us on us.idUsuario=cat.NOMBRE_TECNICO
WHERE dop.ESTATUS_PAGO = 'PAGADO'
-- AND dop.FOLIO_FORMAVALORADA between '429359' and '429382' and dop.ID_CAJERO = 7010
 AND dop.FECHA_PAGO BETWEEN '2018-05-01' AND '2018-07-15' and dop.ID_PROYECTO = 1
 AND dop.MONTO_PAGADO <= 79


  But it takes a long time to be done and it does not yield the results that I can do?


  Delete fle
Posted by: pippuccio76 - 07-17-2018, 10:14 AM - Forum: Libraries & Helpers - Replies (1)

Hi , in a cronjob i try to delete some file from db ,the file are at the same position of application (uploads folder) :

this is my code :

PHP Code:
public function elimina_immagini_limbo(){

 
       $lista_in_attesa_approvazione=$this->immagini_model->lista_in_attesa_approvazione();

 
       foreach ($lista_in_attesa_approvazione->result() as $v) {

 
           $path=FCPATH 'uploads/' $v->img;

 
           if (file_exists$path)) {
 
               // Remove file
 
               if (delete_file$path)) {
                    
                    
//remove file form db
 
                   $res $this->immagini_model->
 
                       deleteImmagini($v->id);
                    

 
                   if ($res) {

 
                       $return_text '1';

 
                   } else {

 
                       // Set status
 
                       $return_text '0|' $path;
 
                   }

 
               } else {
 
                   $return_text '2|' $path;
 
               }

 
               
            
}else{

 
             $return_text='3|'.$path;
 
           }

 
         echo $return_text.'<br>';
 
           
        
}


 
   }




but result are :

Code:
3|/membri/my_site/uploads/15316643072017 bollo opel.jpg
3|/membri/my_site/uploads/1531664322foto_profilo.jpg
3|/membri/my_site/uploads/1531664335foto_profilo.jpg
3|/membri/my_site/uploads/1531664348foto_profilo.jpg
3|/membri/my_site/uploads/1531664369libretto stilo.jpeg
3|/membri/my_site/uploads/1531664381foto_profilo.jpg
3|/membri/my_site/uploads/1531664387libretto stilo.jpeg
3|/membri/my_site/uploads/1531665327foto_profilo.jpg
3|/membri/my_site/uploads/1531676442foto_profilo.jpg
3|/membri/my_site/uploads/15316764562017 bollo opel.jpg

How can i delete file ?


  Onchnage event fire and get id in controller using ajax
Posted by: jaydevvara - 07-17-2018, 06:43 AM - Forum: General Help - Replies (7)

Hello guyz i need help in ajax when onchange event fire in dropdown i want the value in controller but i did not get it

Here is mu code:
VIEW:

     <select name="user_role" id="user_role" onchange="calculate(this)">

                                <option>--Select User--</option>  

                                <?php
                                foreach ($roll_get as $roll) {
                                    ?>
                                <option value="<?php echo $roll->user_id; ?>" id="<?php echo $roll->user_id; ?>"><?php echo $roll->full_name; ?></option>
                                    <?php
                                }
                                ?>
                            </select><br>
AJAX:
function calculate(id)
{
   
    var id=id;
   
    $.ajax({
          
            type:'POST',
            url:'welcome/user_manager',
            data:{'id':id},
            success:function(data){
            

            }
        });
}




CONTROLLER:

 public function user_manager() {

        
       $id=$this->input->post('id',true);
      

}


  Biometric integration in codeigniter
Posted by: Pavel33 - 07-17-2018, 05:00 AM - Forum: General Help - Replies (1)

Can i integrate biometric system in my codeigniter app,then which is the api


  Question about Single Dot Concatenation
Posted by: thanhtunguet - 07-17-2018, 03:55 AM - Forum: CodeIgniter 4 Discussion - Replies (1)

Hello,
I have read the PHP Coding Style Guide page. I have a question:

Why single dot concatenation must not be separated from their subjects?
As I understand, the single dot concatenation, like other 2-ary operation, should be separated from their subjects by one space per side (excluding alignment). I think it is more pretty, more clean. Please tell my why is this convention applied?

Thanks for explanation.


  Role based login and dynamic menu access by specific users
Posted by: jaydevvara - 07-17-2018, 01:39 AM - Forum: General Help - Replies (1)

Hello everyone i am new developer in  codeigniter, i need Role based login system and dynamic menu access by specific users so please help me.


  Database Forge ADD INDEX to TABLE
Posted by: HTLove - 07-17-2018, 12:20 AM - Forum: CodeIgniter 4 Feature Requests - Replies (2)

Hi.
In migrations cannot add index to table.

https://bcit-ci.github.io/CodeIgniter4/d...forge.html

You can views add index to table refer: https://laravel.com/docs/master/migratio...ng-indexes

Thanks.


  Environment affecting the configuration files in CLI mode
Posted by: kaitenz - 07-16-2018, 09:54 PM - Forum: General Help - Replies (8)

Hi,

Frustrated right now. I'm creating a cron job in CodeIgniter.

Now, I have 2 folders inside my config directory, namely: development and testing and inside of it are the config files that are set for different environment, especially the database.php

The environment is set inside my .htaccess with the following code:

Code:
<IfModule mod_env.c>
   SetEnv CI_ENV testing
</IfModule>

Please take note that my database (per environment):
  • development => 'mydatabase_dev'
  • testing          => 'mydatabase_test'
  • production    => 'mydatabase_live'
(I changed the names due to confidentiality, sorry)

And also, my current environment is set to "testing".

When I run a command, the error shows up:

PHP Code:
A PHP Error was encountered

Severity
   Warning
Message
    mysqli::real_connect(): (HY000/1049): Unknown database 'mydatabase_dev'
Filename   C:/var/www/html/MY/system/database/drivers/mysqli/mysqli_driver.php
Line Number
201

Backtrace
:
 
       FileC:/var/www/html/MY/application/core/CI_Exceptions.php
        Line
220
        Function
: include

 
       FileC:/var/www/html/MY/application/core/CI_Controller.php
        Line
36
        Function
__construct

        File
C:/var/www/html/MY/application/controllers/Cron.php
        Line
53
        Function
__construct

        File
C:/var/www/html/MY/index.php
        Line
315
        Function
: require_once



Database errorA Database Error Occurred

        Unable to connect to your database server using the provided settings
.
 
       Filenamecore/CI_Controller.php
        Line Number
36 

The database driver is looking for the non-existing database (because the mydatabase_dev is located in my laptop, while the mydatabase_live is located in our production server and mydatabase_test is located in our test servers.

It is annoying. Can't figure out why this is happening. This only happens in CLI and in the browser it works fine.


  Adding Data to a MultiDimensional Array...
Posted by: ryan_f - 07-16-2018, 08:29 PM - Forum: General Help - Replies (3)

Hey there---

I'm looking for help on how to do this...

I have the following array:
Array ( 
[0] => Array ( 
[ID] =>123
[Car] => Honda 
[Make] => Accord 
[Color] => White 

[1] => Array ( 
[ID] =>654
[Car] => Toyota 
[Make] => Camry
[Color] => Black 

[2] => Array ( 
[ID] =>789
[Car] => Nissan 
[Make] => Altima
[Color] => Red 

)

All in this variable:
$data['get_cars'] = $car_query->result_array();


Then I do a foreach with the IDs to grab the years...
Year of Honda with ID 123 is 2008
Year of Toyota with ID 654 is 2010
Year of Nissan with ID 789 is 2014

Now i have an array like this:
Array ( 
[0] => Array ( 
[Year] =>2010

[0] => Array ( 
[Year] =>2012

[0] => Array ( 
[Year] =>2015

)
How do I do this so I can add this to my original multidimensional array?



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