Hellow all im trying do works image crud from a action from grocery crud, i show you my code:
Controller:
{
$this->load->library('image_crud');
$image_crud = new image_crud();
$image_crud->set_table('photos');
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url')
->set_image_path('assets/uploads')
-> set_relation_field('inmueble_ID')
->set_title_field('title');
$output = $image_crud->render();
// load_plantilla load a template
$this -> load_plantilla('layout', $output, 'fotos_view');
}
function load_plantilla ($layout, $output, $content)
{
$this->template
->set_partial('head', 'template/head')
->set_partial('header', 'template/header')
->set_partial('subheader', 'template/subheader')
->set_partial('latizq', 'template/latizq')
->set_partial('content', $content)
->set_partial('subfooter', 'template/subfooter')
->set_partial('footer', 'template/footer')
->set_partial('foot', 'template/foot')
->build($layout, $output);
}
echo $output;
?>
well when i look the code from the google chrome this apear:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="http://xxxxx.xx/assets/backend/css/cpanel_ifcs.css" type="text/css" media="screen, projection" />
<!--[if lte IE 6]><link rel="stylesheet" href="http://xxxxx.xx/css/style_ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link type="text/css" rel="stylesheet" href="http://xxxxx.xx/assets/image_crud/css/fineuploader.css" />
<link type="text/css" rel="stylesheet" href="http://xxxxx.xx/assets/image_crud/css/photogallery.css" />
<link type="text/css" rel="stylesheet" href="http://xxxxx.xx/assets/image_crud/css/colorbox.css" />
<link rel="stylesheet" type="text/css" href="http://xxxxx.xx/assets/bootstrap/css/bootstrap.min.css" media="screen" />
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
</head>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div id="menu">
<ul class="nav nav-list">
<li class="nav-header">teoj.em@gmail.com</li>
<li class=""><a href="http://xxxxx.xx/cpanel">Panel de Control</a></li>
<li><a href="http://xxxxx.xx/cpanel/view_pages">Paginas</a></li>
<li><a href="http://xxxxx.xx/cpanel/view_clientes">Clientes</a></li>
<li><a href="http://xxxxx.xx/cpanel/view_inmuebles">Inmuebles</a></li>
<li><a href="http://xxxxx.xx/cpanel/view_alquileres">Alquileres</a></li>
<li><a href="http://xxxxx.xx/cpanel/view_contactos">Contactos</a></li>
<li class="divider"></li>
<li class=""><a href="http://xxxxx.xx/">Inicio</a></li>
<li><a href="http://xxxxx.xx/auth/logout">Logout</a></li>
</ul>
</div>
</div>
<div class="span10">
<script>
$(function(){
createUploader();
loadColorbox();
});
function loadColorbox()
{
$('.color-box').colorbox({
rel: 'color-box'
});
}
function loadPhotoGallery(){
$.ajax({
url: 'http://xxxxx.xx/cpanel/view_fotos/1/ajax_list',
cache: false,
dataType: 'text',
beforeSend: function()
{
$('.file-upload-messages-container:first').show();
$('.file-upload-message').html("Loading, please wait...");
},
complete: function()
{
$('.file-upload-messages-container').hide();
$('.file-upload-message').html('');
},
success: function(data){
$('#ajax-list').html(data);
loadColorbox();
}
});
}
function createUploader() {
var uploader = new qq.FineUploader({
element: document.getElementById('fine-uploader'),
request: {
endpoint: 'http://xxxxx.xx/cpanel/view_fotos/upload_file/1'
},
validation: {
allowedExtensions: ['jpeg', 'jpg', 'png', 'gif']
},
callbacks: {
onComplete: function(id, fileName, responseJSON) {
loadPhotoGallery();
}
},
debug: true,
/*template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
'<div class="qq-upload-button">Upload files here</div>' +
'<ul class="qq-upload-list"></ul>' +
'</div>',
fileTemplate: '<li>' +
'<span class="qq-upload-file"></span>' +
'<span class="qq-upload-spinner"></span>' +
'<span class="qq-upload-size"></span>' +
'<a class="qq-upload-cancel" href="#">Cancel</a>' +
'<span class="qq-upload-failed-text">Failed</span>' +
'</li>',
*/
});
}
function saveTitle(data_id, data_title)
{
$.ajax({
url: 'http://xxxxx.xx/cpanel/view_fotos/insert_title',
type: 'post',
data: {primary_key: data_id, value: data_title},
beforeSend: function()
{
$('.file-upload-messages-container:first').show();
$('.file-upload-message').html("Saving title...");
},
complete: function()
{
$('.file-upload-messages-container').hide();
$('.file-upload-message').html('');
}
});
}
window.onload = createUploader;
</script>
<!-- <div id="file-uploader-demo1" class="floatL upload-button-container"></div>
<div class="file-upload-messages-container hidden">
<div class="message-loading"></div>
<div class="file-upload-message"></div>
<div class="clear"></div>
</div>-->
<div id="fine-uploader"></div>
<div class="clear"></div>
<div id='ajax-list'>
</div> </div>
</div>
</div>
<script src="http://xxxxx.xx/assets/image_crud/js/jquery-1.8.2.min.js"></script>
<script src="http://xxxxx.xx/assets/image_crud/js/jquery-ui-1.9.0.custom.min.js"></script>
<script src="http://xxxxx.xx/assets/image_crud/js/fineuploader-3.2.min.js"></script>
<script src="http://xxxxx.xx/assets/image_crud/js/jquery.colorbox-min.js"></script>
<script src="http://xxxxx.xx/assets/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>