CodeIgniter

43

Solutions

58

Contributors

CodeIgniter is an open-source software rapid development web framework used to build dynamic websites with PHP. The software is partly based on the model–view–controller (MVC) pattern, although models and views are optional. It is typically recognized for its speed when compared to other PHP frameworks.

Share tech news, updates, or what's on your mind.

Sign up to Post

I would like to embed an example amcharts demo into page, but I can not work out were to past the code.

The demo amchart: https://www.amcharts.com/demos/column-chart-with-axis-break/

Page I want to embed chart is attached.

I have also attached the above php file where I have posted in the chart code.

When I try the chart does not seem to display but rather a white space.

My page before inserting:

http://prntscr.com/oesas4

Mp page after inserting

http://prntscr.com/oesbcp

errors on page after insert:

http://prntscr.com/oesbot
modal_audit_view.php
code-with-chart.php
0
Fundamentals of JavaScript
LVL 13
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

i am new to codeigniter, just have 15 days of experience. i have to ask how to implement a div block of input type text for kids name, grade and course base on number of kids entered by parents??
i have a input type " number of kids" and based on that i want to display a div of level and input type according to number of kids entered like if parents entered 3 kids then i want a div with 3 labels and input type of name and grades...please help me
0
I had earlier posted about the PHP undefined variable issue i was facing, but i managed to solve it somehow and after that there is a small element that is not working if i could be helped with. So it is an online noticeboard system for a school and it has a users dashboard, teachers, and the admin. So the users dashboard is okay except when a user uploads a picture, it says not found technically i was having issues regarding the image as a undefined variable, and now it says not found. Earlier it was all working well.  also there is something about the user's updating password, when they update a password, says successful then when u log out and log in with the old password, i yet manage to log in with both old and new passwords. what could be the issue there?
Below is attached a screenshot for how the user dashboard looks like.
so here is the user's view for dashboard_header page:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Online Notice Board User Dashboard</title>

    <!-- Bootstrap core CSS -->
    <link href="<?php echo 

Open in new window

0
Hello,
I have codeigniter web application and its work fine on chrome on windows pc ... but it's very slow on android chrome. I tired to install mozile firefox and its same.
I have samasung galaxy tab tab t585.
so where it could be the problem ?
thanks.
0
Hello
I have a vps server with mysql apache andphp installed, and working codeigniter php script.
I have the SSh password. but I lost my phpmyadmin uername password.
What can I do?
0
Hi Experts

Could you point if  phpCAS that uses API for authenticating users against a CAS server (WebSSO CAS) could be integrated at an existing Codeigniter project?

CAS - Central Authentication Server

I'm implementing a SSO (Single Sign-On)  funcionality to allow a web app conexion based on user id and  correspondent user's data obtained from LDAP (AD-Active Directory)

phpCAS

I'm planning to implement the SSO functionality at PHP Codeigniter's site index.php.

Thanks in advance!
0
I keep getting this error every time I go to the chargeticket_list page.

Controller

public function chargeticket_list() {
$data['charge_tickets'] = $this->Chargeticket_model->list_charges($this->input->post('date1'), $this->input->post('date2'));
$this->load->view( 'inc/header' );
$this->load->view( 'chargeticket/chargeticket_list', $data );
$this->load->view( 'inc/footer' );
}

Open in new window

Model

public function list_charges($date1, $date2) //This function returns an array
    {   $this->db->join( 'customers', 'charges.idcustomers = customers.idcustomers' );
        $this->db->where('ch_date >=', $date1);
        $this->db->where('ch_date <=', $date2);
        $query = $this->db->get('charges'); //create query
        return $query->result_array(); //creates array from query
    }

Open in new window

View

<script type="text/javascript">

$(document).ready(function (){
    $('.date1').datepicker({
dateFormat: 'yy-mm-dd'});
});

$(document).ready(function (){
    $('.date2').datepicker({
dateFormat: 'yy-mm-dd'});
});
</script>

<div class="container">
<?php 
    $attributes = array('id'=>'chargeticket_list', 'class'=> 'form-horizontal');
    echo form_open('chargeticket/chargeticket_list', $attributes);
?>

<div class="form-group">
    <?php $ldata = array('class' => 'control-label col-sm-4');
    echo form_label('From','date1', $ldata ); 
    $data = array('class' => 'form-control date1','name' => 'date1');?>
    <div class="col-sm-4"><?php 

Open in new window

0
I am working with some folk who are using Expression Engine Version 2. something.  They are considering upgrading to the latest version.  I know that version 2 and version 3 have a different directory setup.  Is there any definitive docs on how to upgrade with minimal pain? Tutorials? Plugins? How to videos?  I'm in the exploratory phase of this project and will appreciate any input on upgrading EE from 2.... to 3.0 - 4.0 and beyond!
0
Hi Experts

Have an odd request to get done.  I have two applications, one in normal php (property application) and other in framework codeigniter (support application).  I need a way to be able to login from property app into support application automatically once logged into Property application.  Hope that makes...

When i click a link "support", goes to external application, and will prompt to login.  The same login credentials exist on both applications..and what needs to happen is some kind of login process based on the session from property app...that way a user would not have to login again..

Is this possible?
0
OK I think this is the weirdest yet.  To me, anyway.

If I leave in lines 3,4,5 the code appears to work (displays the array, shows no error).

If I comment out those lines, it fails
Severity: Notice

Message: Undefined offset: 0

Filename: models/Week_fixtures_model.php

Line Number: 490

if ( $query->num_rows() == 1)
		{
			echo "<PRE>";
			print_r($query->result_array());
			echo "</PRE>";
			$arr_venue_info['name'] = $query->result_array[0]['name'];
			$arr_venue_info['mapref'] = $query->result_array[0]['mapref'];
			return $arr_venue_info;	
		}
		else // no ground found.
		{
			$arr_venue_info['name'] = $venue;
			$arr_venue_info['mapref'] = 'No map';
			return $arr_venue_info;	
		}

Open in new window


Can anyone shed any light on this please?  I'm using CodeIgniter if that is relevant.
0
Ensure you’re charging the right price for your IT
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Parse error: syntax error, unexpected T_CONST in C:\wamp\www\codeigniter\system\core\CodeIgniter.php on line 58
0
Hi experts,
I need to reproduce this query in CodeIgniter, using ActiveRecord.  I've got very close but CI is putting backquotes where they are not wanted (the yellow-highlighted ones).
Here's the query and CI's interpretation of it...
query as interpreted by CIand here's the code I used to get it.  Part of this stems from CI's lack of support for UNION.
public function get_squad ($fixture_id, $side)
	{	
		$team_clause = 'X';
		if($side=='1') {$team_clause = ' p_1sts ';}
		if($side=='2') {$team_clause = ' p_2nds ';}
		if($side=='3') {$team_clause = ' p_3rds ';}
		if($side=='4') {$team_clause = ' p_4ths ';}
		if($side=='S') {$team_clause = ' p_sundays ';}
		if($side=='T') {$team_clause = ' p_sundays_res ';}
		if($side=='V') {$team_clause = ' p_young_vets ';}
		if($side=='W') {$team_clause = ' p_senior_vets ';}
		
		$this->db->select('first_name, surname, id AS "player_id", "Y" AS "player_picked", fp_keeper AS "keeper", fp_owes_subs AS "subs", fp_if_fit AS "fit", fp_if_available AS "available"');
		$this->db->from('fixtures_players');
		$this->db->join('players_members', 'fp_player_id = id', 'INNER');
		$this->db->where('fp_fixture_id', $fixture_id);
		$this->db->group_by(array('first_name', 'surname'));
		$first_half_inner_union = $this->db->get_compiled_select(); 		
		
		$this->db->select('first_name, surname, id AS "player_id", "N" AS "player_picked", "" AS "keeper", "" AS "subs", "" AS "fit", "" AS "available"');
		$this->db->from('players_members');
		

Open in new window

0
Weird!  Hopefully this is an easy 1000 points for someone.

This is taken straight from the manual, and I get an error - anyone see it?  I'm using CodeIgniter if that's relevant at all.

syntax error, unexpected '$v' (T_VARIABLE) in C:\xampp\htdocs1\fobg\application\controllers\week_fixtures.php on line 31

public function date_chosen()
      {            
            $a = array(1, 2, 3, 17);

            foreach ($a as $v) {
                echo "Current value of \$a: $v.\n";
            }
      }

also flagged up in Dreamweaver:
DW screenshot
0
Hello experts,

I am trying to check if the post data obtained for 'fields' is empty. I have tried different conditions to check if the array is empty or not. Even if the 'fields' is empty, the if condition executes. It would be great if someone could suggest me as to how to go about with this.

View:
<h4>Alternatives</h4><input type="text" style="width:700px;display: inline" id="fields" name="fields[]" placeholder="Enter Method Name" class="form-control method_list_list"/> <input type="button" name="addmore" id="addmore" class="btn btn-success" value="Add More"/>

Model:
public function addmethodtotask(){
	 $conn= mysqli_connect("localhost","root","","cognitivewalkthrough");
	 $taskid=  $_POST['taskid'];
	$description =  $_POST['reason'];
	$action = $_POST['action'];

//if (isset($_POST['fields']) && $_POST['fields'] != "") {
	if (isset($_POST['fields']) && $_POST['fields'] != NULL) {
	// if (count($_POST['fields'])>0 && !empty($_POST['fields'])) {
		 echo "whey am i here";
				foreach ( $_POST['fields'] as $key=>$value ) {
					$sql_website = sprintf("INSERT INTO method (methodname,description,action) VALUES ('%s','%s','%s')",mysqli_real_escape_string($conn,$value),mysqli_real_escape_string($conn,$description),mysqli_real_escape_string($conn,$action) );
					$this->db->query($sql_website);
					$inserted_method_id = $this->db->insert_id();
				}
	}
        

Open in new window

0
I added codeigniter 'table' to my project and i got desired outcome for view except for the fact that the way i had it before i was able to delete record by clicking on them since they were anchor tags, i would like to know how to recreate this in new table format. Thanks!
site_model.php
site.php
options_view.php
Capture2.PNG
Capture.PNG
0
how to logout in php using codeignter
0
how to create login page in php using codeigniter
0
Hi Experts

Could you point a way to make a Codeigniter view have a very long timeout?

This view maintains a dashboard open in a TV during a long time. This dashboard presents information from time to time by using code like:

 $.getJSON("survey_dashboard/get_totais", function (data) {
	$.each(data, function (g, grupo) {
		if (grupo.GRUPO == 'TOTAL') {
			total = grupo;
		} else if (grupo.GRUPO == 'ATIVO') {
			ativo = grupo;
		} else if (grupo.GRUPO == 'RECEPTIVO') {
			receptivo = grupo;
		} else if (grupo.GRUPO == 'VIVO') {
			vivo = grupo;
		}
	});

Open in new window


Where
survey_dashboard/get_totais

Open in new window


is a Controller function  that calls a SP

...
  public function get_totais() {

        $data = array();
        $data = $this->survey_model->new_get(array('query' => "CALL proc_pesquisa_totais()"));
        die(json_encode($data));
    }

Open in new window


Because an user first need to login the system to charge the dashboard-  this start countnig time,  after the timeout is reached the dashboard closes.

Does CI has a way to extend this time?

Thanks in advance
0
Hi Experts

Could you point whyat's needed to a Codeigniter app to correctly be started?

When opened the app presents this screen

img006
And index.php must be fired to make it start.


Another app under the same htdocs present  the login screen but only correctly runs if index.php is used in the path.

Thanks in advance!
0
Bootstrap 4: Exploring New Features
LVL 13
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Hi Experts

Could you point what is preventing a Codeigniter app that is perfectly running localy to run in a remote server?

I'm facing this amazing occurrence:
When the complete app is locally copied and pasted under remote server htdocs folder, the adjustments are done in config.php and database.php

img001
config.php
// IP Configured
$config['base_url'] = 'http://10.xxx.x.223/meetasas_system/'

Open in new window


database.php is correctly pointing DB after some changes.

When the app is called the controller auth is not found... but it exists as the picture below shows.

Is it a matter of any other configuration?

Could you point a workaround?

Thanks in advance!
0
I have to solve this issue which I'm not able to solve :( I have a blog in PHP and an ecommerce site built with CodeIgniter. Both sites have the same session informations shared, but if I go on the blog and I login, when I pass on the ecommerce the user is not recognized and the ecommerce ask for a new login to the user.

In the blog part I set the session in this way:

<?php

include("config.php");

if(isset($_GET['logout'])){
    $servername = 'localhost';
    $username = 'wtgecomm_ecomm';
    $password = 'ElFDeOD$o_qd';
    $dbname ='wtgecomm_ecommerce';
    $conn = new mysqli($servername, $username, $password, $dbname);
     $sql = "DELETE FROM `ci_sessions` WHERE id="."'".$_COOKIE['ci_session']."'";
    if (!$conn->query($sql)) {
   // printf("Message d'erreur : %s\n", $conn->error);
}
    //$result = $conn->query($sql);
    //var_dump($result);
$_SESSION['login_id'] = '';
$_SESSION['customer_id'] = '';
unset($_SESSION['customer_id']);
unset($_SESSION['client']);
unset($_COOKIE['ci_session']);
session_destroy();
//var_dump($_SESSION);
header( 'Location: /'); 
}
if(isset($_REQUEST['login_id']) && !empty($_REQUEST['login_id']) ){

    $ci_session = $_COOKIE['ci_sessions'];
    $login_id = $_REQUEST['login_id'];
//  $sql = "INSERT INTO `ci_sessions` (`id`,`data`) VALUES ('2121212','121212121212')";
//  $ctx->exec($sql) ;
    $servername = 'localhost';
    $username = 'wtgecomm_ecomm';
    $password = 'ElFDeOD$o_qd';
    $dbname ='wtgecomm_ecommerce';
    $conn = 

Open in new window

0
How do I return the results of a query as JSON echo to screen?
0
Hi Experts


Could you point what's preventing a query that perfectly runs under MySQL IDE produces no result when running in PHP?

And what is needed to workaround it?


The query uses a special character in the where clause:

$analista = $where['like']['created_by'];
	
//     print_r($analista);
//            die;
	
	$query['query'] = "
			SELECT  
				sg.nome_seguradora as cliente_corporativo,
				DATE_FORMAT(data, '%d/%m/%y') as mes,
				it._name as analista,
				IF(interna_externa = 'I', 'Interna',IF(interna_externa ='E', 'Externa','-')) as interna_externa,
				enviado_por,
				nome_reclamante,
				IF(genero = 'M','Masculino',IF(genero = 'F','Feminio','-')) as genero,
				IF(fisica_juridica = 'F','Física',IF(genero = 'J','Jurídica','-')) as fisica_juridica,
				cpf_cnpj as cpf_cnpj,
				DATE_FORMAT(data_atendimento, '%d/%m/%Y') as data_atendimento,
				sise,
				cc.descricao as nome_produto,
				se.descricao as servico,
				su.descricao as sub_servico,
				cidade,
				uf,
				mo.motivo as motivo,
				de.descricao as origem_problema,
				bp.descricao as base_prestador,
				enviado_por as agente,
				DATE_FORMAT(enviado_dpto_em, '%d/%m/%Y %H:%i:%s') as enviado_dpto_em,
				DATE_FORMAT(resposta_dpto_em, '%d/%m/%Y %H:%i:%s') as resposta_dpto_em,
				responsavel,
				acoes_dpto,
				comentarios,
				parecer,
				DATE_FORMAT(recebido_em, '%d/%m/%Y %H:%i:%s') as recebido_em,
				DATE_FORMAT(respondido_em, '%d/%m/%Y %H:%i:%s') as respondido_em,
				

Open in new window

0
Hi Experts

Couls you point a way to make Codeigniter to consider the UTF-8 characters in config.php?

// Actually using
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

//I'm trying to avoid to accept every character here - only UTF-8
//$config['permitted_uri_chars'] = '';

Open in new window


Thanks in advance!
0
I like learning object oriented php

but do not want to be bogged down by html, css, jquery, javascript, ajax

I know I can use command line php but if a client is paying me; client usually wants artwork.
A css designer will draw a picture of an expected form and I am forced CODE the html and css to the exact layout of the picture

then the client states the the textbox is 1 inch (.5 cm) too tall.



do other object oriented languages force me to learn so much design software


Please add many other object oriented programming zones
0

CodeIgniter

43

Solutions

58

Contributors

CodeIgniter is an open-source software rapid development web framework used to build dynamic websites with PHP. The software is partly based on the model–view–controller (MVC) pattern, although models and views are optional. It is typically recognized for its speed when compared to other PHP frameworks.

Top Experts In
CodeIgniter
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!