Google chart is not working on server side - php

I have a view that shows a chart depending on a date time range and one value from select list, it is currently working perfect in my local, but in my server it just dont chart anything, can anyone help me pls.
Here is the view code:
<html>
<head>
<title>Gráfico</title>
<link href="<?php echo base_url(); ?>css/bootstrap-combined.min.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>css/bootstrap-glyphicons.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Lato:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link href="<?php echo base_url(); ?>estilos.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen"
href="<?php echo base_url(); ?>css/bootstrap-datetimepicker.min.css"> <meta charset="utf-8" />
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
//Funcion para generar un gráfico en Lineas
function LineChart() {
var data = google.visualization.arrayToDataTable(<?= $grafico2;?>);
var options = {
title: '<?php echo "Paquetes recibidos por la IP: ".$ip." en las fechas: ".$fechainicio." - ".$fechafin; ?>',
'width':900,
'height':400,
hAxis: {title: 'Fechas', titleTextStyle: {color: 'black'},},
vAxis: {title: 'Paquetes', titleTextStyle: {color: 'black'},}
};
var chart = new google.visualization.LineChart(document.getElementById('linechart_div'));
chart.draw(data, options);
}
google.setOnLoadCallback(LineChart);
</script>
</head>
<body>
<div id="contenido">
<div class="container">
<?php include_once "header.php"; ?>
<?php echo form_open('home/graph'); ?>
<font color="#27A7D6">Seleccione fecha inicial:<br></font>
<div id="datetimepicker" class="input-append date">
<input type="text" name="fechainicio"></input>
<span class="add-on">
<i data-time-icon="glyphicon glyphicon-time" data-date-icon="glyphicon glyphicon-minus"></i>
</span>
</div>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/jquery-1.11.0.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.es.js">
</script>
<script type="text/javascript">
$('#datetimepicker').datetimepicker({
format: 'yyyy/MM/dd hh:mm:ss',
language: 'es'
});
</script>
<font color="#27A7D6">Seleccione fecha final:<br></font>
<div id="datetimepicker2" class="input-append date">
<input type="text" name="fechafin"></input>
<span class="add-on">
<i data-time-icon="glyphicon glyphicon-time" data-date-icon="glyphicon glyphicon-minus"></i>
</span>
</div>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/jquery-1.11.0.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript"
src="<?php echo base_url(); ?>js/bootstrap-datetimepicker.es.js">
</script>
<script type="text/javascript">
$('#datetimepicker2').datetimepicker({
format: 'yyyy/MM/dd hh:mm:ss',
language: 'es'
});
</script>
<!-- INICIO DEL SELECT IP-->
<?php
require_once ('funciones.php');
$con=fullconectar();
$res=mysql_query("select * from alarmas",$con);
?>
<font color="#27A7D6">Seleccione su IP:<br></font>
<select id="ip" name ="ip" style="width:235px">
<?php while($fila=mysql_fetch_array($res)){ ?>
<option><?php echo $fila['ip']; ?></option>
<?php } ?>
</select>
<div><input type="submit" value="Enviar" /></div>
<?php echo form_close(); ?>
<?php echo "Total de tiempo offline para la IP: ".$ip." entre las fechas: ".$fechainicio." - ".$fechafin.": ".$tiempooff." minutos."; ?>
<div id="linechart_div"></div>
</div></div>
</body>
</html>

Looking at the actual output, the problematic line is here:
var data = google.visualization.arrayToDataTable(<?= $grafico2;?>);
You'll notice that the <?= $grafico2;?> didn't get parsed by your PHP engine. This indicates that you don't have short-tags enabled on your server. For the moment, just swich that line to:
var data = google.visualization.arrayToDataTable(<?php echo $grafico2;?>);
But you'll probably want to enable short-tags for the future.

Related

How to display Select all option at last using bootstrap multiselect?

In multi select dropdown Select all option should be displayed at last after displaying all other options...
Ex : Select All
Black
Red
What i want is
Ex : Black
Red
Select All
i am referring below link
https://github.com/davidstutz/bootstrap-multiselect
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<meta name='viewport' content='width=device-width'>
<link href="<?php echo base_url();?>assets/css/fonts.css" rel="stylesheet" type="text/css" />
<script src="<?php echo base_url();?>assets/js/anglr/library/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link href="<?php echo base_url();?>assets/css/bootstrap.min.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link href="<?php echo base_url();?>assets/css/bootstrap-multiselect.css"
rel="stylesheet" type="text/css" />
<script src="<?php echo base_url();?>assets/js/anglr/controller/bootstrap_multiselect.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#lstFruits').multiselect({
includeSelectAllOption: true,
selectedBottom:true
});
});
</script>
<script type="text/javascript">
var web_link2="<?php echo base_url();?>";
$(function () {
$('#btnSelected2').click(function () {
var selected = $("#lstFruits option:selected");
var message = "";
selected.each(function () {
message += $(this).val() + "\n";
});
var array_split=message.split(',');
var document_array = document.getElementById('selectedtoken').value;
window.location.href = web_link2+"campaign/confirm_unsubscribe/"+document_array+'-'+message;
});
});
</script>
</head>
<body>
<div class="subscribe-Container">
<header class="subscribe-Header">
<a class="link"><img src="<?php echo base_url();?>assets/images/opend-logo.png" class="logo-img" alt="Opend" title="Opend"></a>
</header>
<div class="subscribe-Content">
<h1>admin#opend.com</h1>
<?php if(!isset($msg)||$msg=='')
{
?>
<p>Please Confirm your unsubscribe request Opend by Clicking on "Unsubscribe" button below to remove your email address</p>
<select id="lstFruits" multiple>
<option value="v"><?php echo $vertical_name?></option>
<option value="c">Contact List</option>
</select>
<input type="hidden" id="selectedtoken" value="<?php echo $mail_token_var?>"/>
<!--<button class="" id="btnSelected2" value="Unsubscribe"></button>-->
<a class="unsub_button" id="btnSelected2" >Unsubscribe</a>
<?php } else echo $msg; ?>
</div>
</div>
</body>
</html>
I tried using the below mentioned code
use this script for select all functionality for your multiselect dropdown
html
<select id="lstFruits" multiple>
<option value="v"><?php echo $vertical_name?></option>
<option value="c">Contact List</option>
<option id="select_all">Select All<option>
</select>
JS
$('#select_all').click(function() {
$('#lstFruits option').prop('selected', true);
});

Error in displaying the ajax result using Codeigniter and Mysql

I just need a little help here about displaying my table query result. When i checked the response from my ajax I shows. But when passing to the views it doesn't shows. Here's my code:
Controller/user.php
<?php
class User extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model('user_model');
}
public function index(){
$this->load->view( 'index' );
}
public function read() {
echo json_encode( $this->user_model->getAll() );
}
}
?>
Model/user_model.php
<?php
class User_Model extends CI_Model{
public function __construct(){
parent::__construct();
}
public function getAll(){
$qGetAllData = $this->db->get('user');
if($qGetAllData->num_rows() > 0){
return $qGetAllData->result();
}else{
return array();
}
}
}
?>
View/index.php
<html>
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo base_url(); ?>" />
<link type="text/css" rel="stylesheet" href="css/smoothness/jquery-ui-1.8.2.custom.css" />
<link type="text/css" rel="stylesheet" href="css/styles.css" />
</head>
<body>
<table id="records"></table>
<div id="tabs">
<ul>
<li>Read</li>
<li>Create</li>
</ul>
<div id="read">
<table id="records"></table>
</div>
<div id="create"></div>
</div>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery-templ.js"></script>
<script type="text/template" id="readTemplate">
<tr>
<td>${id}</td> //doesn't display ID
<td>${name}</td> //doesn't display Name
<td>${email}</td> //doesn't display EMial
</tr>
</script>
<script type="text/javascript" src="js/myjs.js"></script>
</body>
</html>
Javascript/myjs.js
$(document).ready(function(){
$( '#tabs' ).tabs({
fx: { height: 'toggle', opacity: 'toggle' }
});
$.ajax({
url: 'index.php/user/read',
datatype: 'json',
success: function(response){
$('#readTemplate').render(response).appendTo('#records');
}
});
});
That's all guys. I just don't know where's my error.
I think you have issue with just render data.
please review this link for reference.
Please try below code.
Your html : View/index.php
<html>
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo base_url(); ?>" />
<link type="text/css" rel="stylesheet" href="css/smoothness/jquery-ui-1.8.2.custom.css" />
<link type="text/css" rel="stylesheet" href="css/styles.css" />
</head>
<body>
<table id="records"></table>
<div id="tabs">
<ul>
<li>Read</li>
<li>Create</li>
</ul>
<div id="read">
<table id="records"></table>
</div>
<div id="create"></div>
</div>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery-templ.js"></script>
<script type="text/javascript" src="js/myjs.js"></script>
</body>
</html>
Your JS : js/myjs.js
var readtpl = "<tr><td>${id}</td><td>${name}</td><td>${email}</td></tr>";
$.template( "readTemplate", readtpl );
$(document).ready(function(){
$( '#tabs' ).tabs({
fx: { height: 'toggle', opacity: 'toggle' }
});
$.ajax({
url: 'index.php/user/read',
datatype: 'json',
success: function(response){
$.tmpl( "readTemplate", response ).appendTo( "#records" );
}
});
});

Issues with html css on codeigniter template

thanks for rading my question, i have an issue with codeigniter, i use an php page as base template for my whole site.
In that template i have a div on the top of the page with differents flags to choose the idiom.
For some reason it only works in one page, and not on the others.
Here is my template
<?php
if (!function_exists("cortar_string")) {
function cortar_string($cadena)
{
return substr( $cadena, 0, 50 );
}
}
if (!function_exists("muestra_mes")) {
function muestra_mes($mes)
{
$r = "";
switch($mes)
{
case 1:
$r = "Enero<br/>January";
break;
case 2:
$r = "Febrero<br/>February";
break;
case 3:
$r = "Marzo<br/>March";
break;
case 4:
$r = "Abril<br/>April";
break;
case 5:
$r = "Mayo<br/>May";
break;
case 6:
$r = "Junio<br/>June";
break;
case 7:
$r = "Julio<br/>July";
break;
case 8:
$r = "Agosto<br/>August";
break;
case 9:
$r = "Septiembre<br/>September";
break;
case 10:
$r = "Octubre<br/>October";
break;
case 11:
$r = "Noviembre<br/>November";
break;
case 12:
$r = "Diciembre<br/>December";
break;
}
return $r;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="robots" content="index, follow" />
<meta name="keywords" content="soporte tecnico, laptop, pc, caracas, grupo soporte tecnico gl, soporte tecnico caracas, informatica, telecomunicaciones, gts, tecnología, ti, it, servicios, igs, campus tecnologicos, continuidad de negocios, comunicaciones integradas, arquitectura y estrategia de ti, mantenimiento y soporte tecnico, middleware, seguridad, privacidad, servidores, data center, outsourcing, almacenamiento de datos, Diseño de Paginas web, aplicaciones web, Venezuela, Maracaibo, Zulia, COL, Cabimas, Ojeda, San Francisco, tecnología, computación, laptops, equipos, computadoras, servicio, sistemas, tecnico, biometrico" />
<meta property="og:title" content="<?php echo $titulo; ?>"/>
<meta property="og:type" content="info" />
<meta property="og:description" content="Sitio de Servicios y Soluciones en Computación, desarrollo de sistemas de información, sitios web, y aplicaciones web. Asesorias en Informática, Soporte técnico Preventivo y Correctivo.">
<meta name="description" content="Sitio de Servicios y Soluciones en Computación, desarrollo de sistemas de información, sitios web, y aplicaciones web. Asesorias en Informática, Soporte técnico Preventivo y Correctivo." />
<meta property="og:image" content="http://i47.photobucket.com/albums/f195/warbandit69/TarjetaRicardo1-1.jpg"/>
<title><?php echo $titulo; ?></title>
<meta charset="utf-8">
<link rel="stylesheet" href="<?php echo base_url(); ?>/css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="<?php echo base_url(); ?>/css/style.css" type="text/css" media="all">
<script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/cufon-yui.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/Humanst521_BT_400.font.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/Humanst521_Lt_BT_400.font.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/roundabout.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/roundabout_shapes.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/gallery_init.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/cufon-replace.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>/js/loopedslider.min.js"></script>
<div id="fb-root"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<!--[if lt IE 7]>
<link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="all">
<![endif]-->
<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5.js"></script>
<script type="text/javascript" src="js/IE9.js"></script>
<![endif]-->
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="<?php echo base_url(); ?>/source/jquery.fancybox.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/jquery.fancybox.css?v=2.1.5" media="screen" />
<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
<script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
<script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
<script type="text/javascript">
$(document).ready(function() {
/*
* Simple image gallery. Uses default settings
*/
$('.fancybox').fancybox();
/*
* Different effects
*/
// Change title type, overlay closing speed
$(".fancybox-effects-a").fancybox({
helpers: {
title : {
type : 'outside'
},
overlay : {
speedOut : 0
}
}
});
// Disable opening and closing animations, change title type
$(".fancybox-effects-b").fancybox({
openEffect : 'none',
closeEffect : 'none',
helpers : {
title : {
type : 'over'
}
}
});
// Set custom style, close if clicked, change title type and overlay color
$(".fancybox-effects-c").fancybox({
wrapCSS : 'fancybox-custom',
closeClick : true,
openEffect : 'none',
helpers : {
title : {
type : 'inside'
},
overlay : {
css : {
'background' : 'rgba(238,238,238,0.85)'
}
}
}
});
// Remove padding, set opening and closing animations, close if clicked and disable overlay
$(".fancybox-effects-d").fancybox({
padding: 0,
openEffect : 'elastic',
openSpeed : 150,
closeEffect : 'elastic',
closeSpeed : 150,
closeClick : true,
helpers : {
overlay : null
}
});
/*
* Button helper. Disable animations, hide close button, change title type and content
*/
$('.fancybox-buttons').fancybox({
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
helpers : {
title : {
type : 'inside'
},
buttons : {}
},
afterLoad : function() {
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
}
});
/*
* Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
*/
$('.fancybox-thumbs').fancybox({
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
arrows : false,
nextClick : true,
helpers : {
thumbs : {
width : 50,
height : 50
}
}
});
/*
* Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
*/
$('.fancybox-media')
.attr('rel', 'media-gallery')
.fancybox({
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
arrows : false,
helpers : {
media : {},
buttons : {}
}
});
/*
* Open manually
*/
$("#fancybox-manual-a").click(function() {
$.fancybox.open('1_b.jpg');
});
$("#fancybox-manual-b").click(function() {
$.fancybox.open({
href : 'iframe.html',
type : 'iframe',
padding : 5
});
});
$("#fancybox-manual-c").click(function() {
$.fancybox.open([
{
href : '1_b.jpg',
title : 'My title'
}, {
href : '2_b.jpg',
title : '2nd title'
}, {
href : '3_b.jpg'
}
], {
helpers : {
thumbs : {
width: 75,
height: 50
}
}
});
});
});
</script>
<style type="text/css">
.fancybox-custom .fancybox-skin {
box-shadow: 0 0 50px #222;
}
</style>
</head>
<body>
<!-- header -->
<section id="preheader">
<div class="menu_lateral">
<center>
<?php $a = base_url();
$a1 = explode("//",$a);
//print_r($a1);
$a2 = explode("/",$a1[1]);
$web = $a2[0];
?>
<img src="<?php echo base_url(); ?>/images/flags/Venezuela-32.png" alt="Español Venezuela" />
<img src="<?php echo base_url(); ?>/images/flags/Colombia-32.png" alt="Español Colombia" />
<img src="<?php echo base_url(); ?>/images/flags/Spain-32.png" alt="Español España" />
<img src="<?php echo base_url(); ?>/images/flags/Argentina-32.png" alt="Español Argentina" />
<img src="<?php echo base_url(); ?>/images/flags/Chile-32.png" alt="Español Chile" />
<img src="<?php echo base_url(); ?>/images/flags/Mexico-32.png" alt="Español Mexico" />
<img src="<?php echo base_url(); ?>/images/flags/Panama-32.png" alt="Español Panama" />
<a href="http://translate.google.co.ve/translate?sl=auto&tl=pt&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/Brazil-32.png" alt="Portugues Brasil" /></a>
<a href="http://translate.google.co.ve/translate?sl=auto&tl=pt&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/Portugal-32.png" alt="Portugues Portugal" /></a>
<a href="http://translate.google.co.ve/translate?sl=auto&tl=en&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/United-States-32.png" alt="Ingles Estados Unidos USA" /></a>
<a href="http://translate.google.co.ve/translate?sl=auto&tl=en&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/United Kingdom_32.png" alt="England" /></a>
</center>
</div>
</section>
<header>
<div class="container">
<h1>Soluciones Ríos</h1>
<nav>
<ul>
<li>
<?php
if ($seleccion=="inicio") {
echo anchor("welcome/index","Bienvenido", array("class" => "current"));
}
else
{
echo anchor("welcome/index","Bienvenido");
}
?>
</li>
<li><?php
if ($seleccion=="sobre") {
echo anchor("welcome/sobre","Sobre Mi", array("class" => "current"));
}
else
{
echo anchor("welcome/sobre","Sobre Mi");
}
?>
</li>
<li>
<?php
if ($seleccion=="servicios") {
echo anchor("welcome/servicios","Servicios", array("class" => "current"));
}
else
{
echo anchor("welcome/servicios","Servicios");
}
?>
</li>
<li>
<?php
if ($seleccion=="productos") {
echo anchor("welcome/productos","Productos", array("class" => "current"));
}
else
{
echo anchor("welcome/productos","Productos");
}
?>
</li>
<li>
<?php
if ($seleccion=="contacto") {
echo anchor("welcome/contacto","Contacto", array("class" => "current"));
}
else
{
echo anchor("welcome/contacto","Contacto");
}
?>
</li>
<li>
<?php
if ($seleccion=="mapa") {
echo anchor("welcome/mapa","Mapa", array("class" => "current"));
}
else
{
echo anchor("welcome/mapa","Mapa");
}
?>
</li>
</ul>
</nav>
</div>
</header>
<!-- #gallery -->
<section id="gallery">
<div class="container">
<?php
if (isset($proyectos)) {
$this->load->view($proyectos);
}
?>
</div>
</section>
<!-- /#gallery -->
<?php $this->load->view($main_content); ?>
<!-- footer -->
<footer>
<div class="container">
<div class="wrapper">
<div class="fleft"><div>Sigueme #ricardojriosr <div class="fb-like" data-href="https://www.facebook.com/pages/Ricardo-R%C3%ADos/285721804823546?ref=hl#" data-width="450" data-layout="button_count" data-show-faces="true" data-send="true"></div></div></div>
<div class="fright"><script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<a rel="nofollow" href="mailto:ricardojriosr#gmail.com" target="_blank">ricardojriosr#gmail.com</a> | +58 414-6518896 <u>Skype</u>: ricardojriosr83
</div>
</div>
</footer>
<script type="text/javascript"> Cufon.now(); </script>
</body>
</html>
Here is my website
P.D.: you can see the CSS form the source code of my webpage, thanks

jquery tooltip Help Needed

How to write php code(variable) in tooltip
Here is my code:-
<head>
<link type="text/css" rel="stylesheet" href="css/screen.css" media="screen" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="js/chilltip-packed.js"></script>
<script type="text/javascript">
$(function() {
$('.ChillTip').ChillTip();
$('.ChillTip1').ChillTip({
CTBK:'#fff',
CTBC:'#000',
CTW:'150'
});
});
</script>
</head>
<body>
<?php
$abc= 'Urvisha';
?>
For more info.
<button class="ChillTip" title="This is a button example">BUTTON</button>
</body>
I want the $abc in my tooltip
if i am writing $abc inside title="" then $abc is displaying not its value
plz help me.....
You just need to echo the variable into the HTML:
<button class="ChillTip" title="<?php echo $abc?>">BUTTON</button>

Jquery color picker not working after ajax call

In my site I have added a jQuery color picker textbox as like:
http://www.eyecon.ro/colorpicker/
When loading page through ajax then this color picker is not working. That means color picker is not working after ajax call.
How can i solve this problem?
My site is a CodeIgniter site:
This is my index page source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Rock website</title>
<link href="<?php echo base_url();?>style/style_user_admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>style/jquery-jvert-tabs-1.1.4.css" />
<script type="text/javascript" src="<?php echo base_url();?>/js/ajaxupload.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/colorpicker.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/eye.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/utils.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/layout.js?ver=1.0.2"></script>
<link rel="stylesheet" href="<?php echo base_url();?>css/colorpicker.css" type="text/css" />
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-jvert-tabs-1.1.4.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>js/jquery.cleditor.css" />
<script type="text/javascript" src="<?php echo base_url();?>js/jquery.cleditor.js"></script>
<script type="text/javascript">
$(document).ready(function(){
page_setup();
});
</script>
<script type="text/javascript">
function page_setup()
{
$.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/super_admin/page_setup/",
success: function(msg){
//alert(msg);
$("#page_setup").html(msg).show();
}
});
}
</script>
</head>
<body>
<div class="wraper">
<div class="welcome_to_admin">
Super Admin Panel
</div>
<div class="admin_main">
<div id="vtabs1">
<div>
<ul>
<li>Page Setup</li>
</ul>
</div>
<div>
<div id="page_setup">
<!--
load the page_setup.php page here
-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>
This is the super_admin controller code:
public function page_setup()
{
$this->load->view('super_admin/page_setup');
}
This is the page_setup.php page code:
<div class="tab1_rgt_part">
<div class="message_to_send_11">Color Settings</div>
<div class="tab1_main_part" style="margin-top:20px;">
<div class="tab1_left_part">Welcome Page Bg Color</div>
<input type="text" maxlength="6" size="6" id="colorpickerField1" value="00ff00" />
</div>
try adding the color picker after loading the html:
function page_setup()
{
$.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/super_admin/page_setup/",
success: function(msg){
//alert(msg);
$("#page_setup").html(msg).show();
$("#colorpickerField1").ColorPicker(
onChange: function (hsb, hex, rgb) {
$(this).val(hex);
}
);
}
});
}
$('#colorpickerField1, #colorpickerField2, #colorpickerField3,#colorpickerField4).ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
$(el).val("#"+hex);
//$(el).css("background-color","#"+hex);
$(el).ColorPickerHide();
},
onBeforeShow: function () {
$(this).ColorPickerSetColor(this.value);
}
})
I found the answer.Add this code in a script tag at the top of the view page

Categories