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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 12,320
» Latest member: nandhinichandran
» Forum threads: 68,561
» Forum posts: 427,554

Full Statistics

Latest Threads
how to pass array of chec...
Forum: General Help
2 hours ago
» Replies: 0   » Views: 12
CI 3.1 for Website Buildi...
Forum: Choosing CodeIgniter
3 hours ago
» Replies: 6   » Views: 3,630
Introducing TastyIgniter ...
Forum: Spotlight
4 hours ago
» Replies: 20   » Views: 22,265
Hours spent on computer?
Forum: Lounge
5 hours ago
» Replies: 32   » Views: 12,548
Do you have a hobby?
Forum: Lounge
5 hours ago
» Replies: 26   » Views: 9,520
automatic logout after in...
Forum: General Help
8 hours ago
» Replies: 0   » Views: 35
Shopping cart library not...
Forum: CodeIgniter 2.x
8 hours ago
» Replies: 1   » Views: 27
Which web hosting to use
Forum: Lounge
Yesterday, 02:58 PM
» Replies: 29   » Views: 14,631
How many pets do you own?
Forum: Lounge
Yesterday, 02:51 PM
» Replies: 10   » Views: 4,534
Which browser do you guys...
Forum: Lounge
Yesterday, 02:48 PM
» Replies: 44   » Views: 12,090

 
  how to add 2 row data in mpdf
Posted by: kvanaraj - 10-12-2018, 11:29 PM - Forum: Lounge - Replies (4)

I want to add two rowdata in one value using mpdf 

Code:
<td align="center"><h3>'. $row_dummy['remun'].'</h3></td>
<td align="center"><h3>'. $row_dummy['lum'].'</h3></td>
i try 1
Code:
<td align="center"><h3>'. <?php {$row_dummy['remun']+$row_dummy['lum']} ?> .' </h3></td>


no display


  Error 404 en Controladores
Posted by: Aryam - 10-12-2018, 03:00 PM - Forum: Regional User Groups - No Replies

Hola a todos!!

Pues soy nueva poniendo en marcha este tipo de proyectos y pues de momento estoy tratando de configurar un proyecto de codeigniter dentro del portal cloud de azure, por medio de un web app. La cuestión es que me tira un error 404 cuando intenta accesar al metodo de validacion de credenciales en el login, y pues supongo que sera igual para los otros metodos de los controladores.

Las carpetas las tengo de la siguiente forma:


xpbc2017
       application
       config
                    routes.php
                    database.php
                    config.php
        views
        controllers
                   login
                          backend
                                  ValidateUser.php
                          usuario
                          Login.php
                   models
          system
          templates
          web.config
          index.php

Este es mi web.config


Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
       <rewrite>
         <rules>
           <rule name="Rule" stopProcessing="true">
             <match url="^(.*)$" ignoreCase="false" />
             <conditions>
               <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
               <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
               <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
               <add input="{REQUEST_FILENAME}" pattern="^.+\.(css|js|jpg|jpeg|png|gif|ico|htm|html|eot|woff|ttf|svg|txt|pdf|swf)$"  matchType="IsFile"  negate="true" />
             </conditions>
             <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
           </rule>
         </rules>
       </rewrite>
     </system.webServer>
</configuration>


este es mi config.php


Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['base_url'] = 'https://xpbc-app-2018.azurewebsites.net/';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'REQUEST_URI';
$config['url_suffix'] = '';
$config['language']     = 'english';
$config['charset'] = 'UTF-8';
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$config['composer_autoload'] = FALSE;
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
$config['allow_get_array'] = TRUE;
$config['log_threshold'] = 0;
$config['log_path'] = '';
$config['log_file_extension'] = '';
$config['log_file_permissions'] = 0644;
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['error_views_path'] = '';
$config['cache_path'] = '';
$config['cache_query_string'] = FALSE;
$config['encryption_key'] = 'pass';
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'cisession';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['cookie_prefix']        = '';
$config['cookie_domain']        = '';
$config['cookie_path']          = '/';
$config['cookie_secure']        = FALSE;
$config['cookie_httponly']      = FALSE;
.
.

Mi routes


Code:
$route['default_controller'] = 'login';
$route['login'] = 'login/frontend/Login';
$route['validateUser'] = 'login/backend/ValidateUser/newUser';
$route['menu_principal'] = 'MainMenu';
$route['usuario-agregarUsuario'] = 'usuario/AgregarUsuario';
$route['usuario-modificarUsuario'] = 'usuario/ModificarUsuario';
$route['usuario-eliminarUsuario'] = 'usuario/EliminarUsuario';
$route['usuario-consultarUsuario'] = 'usuario/ConsultarUsuario';

Este tema realmente me ha dado dolores de cabeza y pues por eso estoy aca pidiendo de su ayuda, algun consejo o una pista de lo que pueda ser estare poniendola en marcha, y les agradezco de antemano a quienes se tomen la molestia de comentar.

Muchas gracias


  Casting variable to my class
Posted by: omid_student - 10-12-2018, 12:44 PM - Forum: General Help - No Replies

Hi
I have two class in php file
Below code is my php file
There are no problem in this code
My only problem is PHPStorm cannot show class fields
But when i delcare example $user = new user(); and when i use $user-> , PHPStorm show fields
I need casting variable to user class to show field when i try use this class

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Test extends CI_Controller
{

 
   function __construct()
 
   {
 
       parent::__construct();
 
   }

 
   function index() {

 
       $this->db->select('first_name,last_name');
 
       $user_c  $this->db->get('user')->row(0,'user');
 
       echo $user_c->first_name;

 
   }

}

class 
user {
 
   var $first_name;
 
   var $last_name;


This picture is when i use class directly
   

And this picture when i use only variable
   


  Losing session while using redis Driver
Posted by: gmedel - 10-12-2018, 09:48 AM - Forum: Issues - Replies (5)

Hi guys,
I'm having problems with the redis driver and wanted to know if anyone has experienced the same issues

Platform: Codeigniter 3.1.9 PHP 7.2.1

If I try to make many subsequent AJAX calls I usually lose the session.

For example I try to call 10 different endpoints in subsequent calls. 
At least 1 of the calls will fail everytime when I use the redis driver, this does not happen if I'm using files for storing the session data.

It's not that the session is lost (if I open another tab and visit a page that's not ajax heavy I'll still be logged in)
But for an unknown reason codeigniter is not able to retrieve the session when it's making that many calls while using the redis driver

Has anyone experienced this issue?

Thanks a lot in advance


  Which is the best tool for PHP Development?
Posted by: Kosha_Shah - 10-12-2018, 06:20 AM - Forum: Lounge - Replies (4)

PHPStorm and Netbeans are the best PHP IDE, as per my view.  
What's your thought?


  Autoload Libraries (from CI3)
Posted by: Alex1Strakhov - 10-12-2018, 02:46 AM - Forum: CodeIgniter 4 Support - Replies (2)

In CI3:

config/autoload.php

PHP Code:
$autoload['libraries'] = array('test_lib'); 

controller/Test.php

PHP Code:
class Test extends CI_Controller
{

 
   public function index()
 
   {
 
       echo $this->CI->test_lib->variable;

 
       $this->CI->test_lib->method();
 
   }




The library was connected automatically, access to it was in any part of the project.


How to make it so that in CI4 was like this:

PHP Code:
class Test extends CI_Controller
{

 
   public function index()
 
   {
 
       echo TestLib->variable;

 
       TestLib->method();
 
   }



  problem in routes.php
Posted by: DELE - 10-12-2018, 02:17 AM - Forum: General Help - Replies (3)

Code:
$route['tv']               = 'Controller_tv';
$route['tv/(:any)/(:num)'] = 'Controller_tv/$1/$2';    // tv/[category = popular,toprated, etc]/[pagination]
$route['tv/(:num)']        = 'Controller_tv/view/$1';  // tv/[id_tv]


if I access http://localhost/tv and http://localhost/tv/[category]/[pagination] its return true.
but if I access http://localhost/tv/[id_tv] its return 404 Page Not Found.

I know $route['tv/(:any)/(:num)'] and $route['tv/(:num)'] is collision. how i can fix it but not changings ( tv ).

thanks before


  no output display in dropdown list
Posted by: kvanaraj - 10-11-2018, 04:35 AM - Forum: General Help - Replies (6)

Code:
<select name="staff" id="staff" required>
<option value="">Select Staff</option>
<?php

while($row_subject = mysql_fetch_array($query_subject)) {
?>
<option value="<?php echo $row_subject['deo_code'];?>  
($this->input->post('staff') == $row_subject['deo_code'] ? ' selected' : '') ><?php echo $row_subject['deo_code']."-".$row_subject['deo_name'];?></option>
<?php } ?>
</select>


  ajax call to On success to select option
Posted by: jackey - 10-11-2018, 04:00 AM - Forum: General Help - Replies (9)

hi,
to get the view page with given below two select options , i used the following code.
how to get Selected option value  to sending with ajax ?
For second select option designation, cadre_id takes null value. how to pass selected option value here?

Can any one pls help me to solve this? 

[attachment=1361]


////////////ajax part////////////////

 $('select[name="dept_no"]').on('change', function() {
            var dept_no_ID = $(this).val();
            if(dept_no_ID) {
                $.ajax({
                    url:"<?php echo site_url('index.php/clerkAE/get_selected_dept_attached_post')?>/"+dept_no_ID,
                    type: "GET",
                    dataType: "json",
                    
                    success: function(data)
                    {
    $('#cadre_id').html('<option value="-1">-- Select Designation --</option>');

        $.each(data, function(i, data){
        $('#cadre_id').append("<option value='"+data.id+"'>"+data.designation+" / "+data.grade+"</option>");
        });
                    }
          
                });
            }else{
                $('select[name="cadre_id"]').empty();
            }
        });


/////////////controller/////////////
 public function get_selected_dept_attached_post($dept_no)
        {
           $userid=$this->session->userdata('id');
           $this->load->model('Model_user');
           $data = $this->Model_user->dept_attached_post($dept_no,$userid);
           echo json_encode($data);     
        }

/////////////model/////////////////
public function dept_attached_post($dept_no,$userid){
            
$query = $this->db->query("SELECT c.id,c.designation,c.grade 
FROM cadre c, dept_has_cadre dhc, assign_dept a_d 
WHERE c.id=dhc.cadre_id 
AND dhc.dept_id=".$dept_no." 
AND dhc.dept_id=a_d.dept_id
AND a_d.user_id=".$userid."
AND dhc.year = (SELECT MAX( YEAR ) max_year FROM dept_has_cadre ) ");  

 echo '<pre>', print_r($this->db->last_query(), true), '</pre>';
    echo '<pre>', print_r($this->db->error(), true), '</pre>';
    echo '<pre>', print_r($query->result(), true), '</pre>';
    
return $query->result(); 

/////////////view page ///////////

<div class="form-group"> <label class="col-sm-2 control-label"> Dept/Unit/Branch</label> 
    <div class="col-xs-4"> 
               
        <label><select name="dept_no" id="dept_no" class="form-control">
<option value="-1"> --- Select Dept/Unit/Branch --- </option>
         
        <?php foreach($information_assign_dept as $row) { ?>   
                      
        <option value="<?php echo $row->id; ?>" ><?php 
                 
                                         if ($row->faculty_id != 0){
                                         echo $row->dept_name. ' / '.$row->faculty_name;                                      
                                        
                                         }
                                         else{
                                           echo $row->dept_name;                                        
                                         }?>
        </option>
           
            <?php } ?>
        </select><span class="help-block"></span></label>         
    </div>
</div>


<div class="form-group"> 
    <label class="col-sm-2 control-label"> Designation </label> 
    <div class="col-xs-3"> 
        <label><select class="form-control" id="cadre_id" name="cadre_id">
            <option value="-1">--- Select Designation ---</option>
        </select><span class="help-block"></span></label>
    
    </div> 
  
    <label class="col-sm-2 control-label">Present Salary</label> 
    <div class="col-sm-2"> <label><input type="text" class="form-control" id="present_salary" name="present_salary"/><span class="help-block"></span></label></div>
</div>

 

////////////////////////out put//////////////

SELECT c.id,c.designation,c.grade
FROM cadre c, dept_has_cadre dhc, assign_dept a_d
WHERE c.id=dhc.cadre_id
AND dhc.dept_id=1
AND dhc.dept_id=a_d.dept_id
AND a_d.user_id=4
AND dhc.year = (SELECT MAX( YEAR ) max_year FROM dept_has_cadre )

Array
(
   [code] => 0
   [message] =>
)

Array
(
   [0] => stdClass Object
       (
           [id] => 1
           [designation] => Senior Lecturer
           [grade] => Grade 2
       )

)

[{"id":"1","designation":"Senior Lecturer","grade":"Grade 2"}]


  how to sum all td values ?
Posted by: kvanaraj - 10-11-2018, 02:33 AM - Forum: General Help - Replies (2)

Code:
<td><?php echo $row['remun'];?></td>
 <td><?php echo $row['lum'];?></td>

Code:
for example
Ist column   2nd column
100              150
200              150
300              150
Code:
<input type="text"  name="grand_total" id="grand_total" />
Code:
<script>    
 $('#dynamic-table tr').each(function() {
  if (!this.rowIndex) return; // skip first row
  var customerId = this.cells[4].innerHTML;
  alert(customerId);
 $("#grand_total").val(customerId);
});
i get only first row value but i want sum of all fields.



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