⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

my form not displayed



Ari Prasasti

Ari Prasasti
  • profile picture
  • Member

Posted 22 May 2013 - 06:47 AM

hi all,

sorry if my english so bad.

 

grocery form when event edit or add, can't displayed form only button ( save, save and go back , cancel )

 

please help..

 

Thanks

 

error form : [attachment=545:error-grocerycrud.jpg]

 

my localhost - work : [attachment=546:seharusnya.jpg]

 

php info :  [attachment=548:phpinfo.jpg]

 

mysql ver : [attachment=547:mysql.jpg]


davidoster

davidoster
  • profile picture
  • Member

Posted 22 May 2013 - 07:20 AM

1. Make sure that your hosting provider supports at least, 5.1.6. Check here

2. Check that the paths to your views (and the theme you use) are accessible from the web chmod 775


Ari Prasasti

Ari Prasasti
  • profile picture
  • Member

Posted 22 May 2013 - 08:22 AM

1. Make sure that your hosting provider supports at least, 5.1.6. Check here

2. Check that the paths to your views (and the theme you use) are accessible from the web chmod 775

 

1. phpinfo by hosting provider is

[sharedmedia=core:attachments:548]
ver 5.3.16
 
mysql : 
[sharedmedia=core:attachments:547]
5168
 
2.path view has been chmod 775 include asset grocery
 
but my problem not solved, my field form not displayed ..
 
anyone can help me.. :)

davidoster

davidoster
  • profile picture
  • Member

Posted 22 May 2013 - 09:23 AM

Can you post your controller's code?


Ari Prasasti

Ari Prasasti
  • profile picture
  • Member

Posted 22 May 2013 - 09:32 AM

Can you post your controller's code?

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard extends CI_Controller {
	 private $user_data;
	function __construct(){
	parent::__construct();
			$this->load->database();
		    $this->load->library('grocery_CRUD'); 
			$this->load->helper(array('form', 'url'));
			$this->load->library('form_validation'); 
			$this->load->model('model_login');
			$this->load->view("adminstar/header");
			$this->user_data = $this->session->userdata;
			
			$now = time();
			$expired = $this->session->userdata('expired');
			if($now < $expired)
			{
				if ($this->session->userdata('username') == FALSE)
				{
					redirect('adminstar/admin/logout'); 
				} 
			}
			else
			{
				redirect('adminstar/admin/logout'); 
			}
			
	}
	
	function index()
	{   
		$this->load->view("adminstar/dashboard");
		$this->load->view("adminstar/footer"); 
	}
	
	function _home_output($output = null){ 
        $output->userinfo = $this->user_data; 
		$this->load->view('adminstar/crud',$output);
		$this->load->view("adminstar/footer");
	}
	
	function content()
	{
		    $crud = new grocery_CRUD();
                        $crud->set_model('MY_grocery_Model');
                        $crud->set_primary_key('menu','star_menu');
			$crud->set_table('star_content');
			$crud->columns('menu','title','image','publish','createdt','createby','modifieddt','modifiedby');	 
			$crud->set_subject('Content');
			$crud->display_as('ID_cat','Category');  
			$crud->set_relation('menu','star_menu','menu'); 
                        $crud->set_primary_key('ID','star_menu');
			$crud->required_fields('title','content','publish'); 
			$crud->set_field_upload('image','assets/uploads/img'); 
			$crud->field_type('publish','dropdown',
            array(1 => 'Publish Content', 2 => 'Disable Content'));
			$this->HiddenField($crud);   
			$output = $crud->render(); 
 
			$this->_home_output($output);

	}
	
	// function category_content()
	// {
			// $crud = new grocery_CRUD();
			// $crud->set_table('star_categorycontent');
			// $crud->columns('ID','name_cat','createdt','createby','modifieddt','modifiedby');	 
			// $crud->set_subject('Category Content');
			// $crud->display_as('name_cat','Category');  
			// $crud->required_fields('name_cat');   
			// $this->HiddenField($crud);   
			// $output = $crud->render(); 
			// $this->_home_output($output);
	// }
	function news()
	{

			$crud = new grocery_CRUD();
                        //$crud->set_model('MY_grocery_model');
			$crud->set_table('star_news');
			$crud->columns('ID','title','news','image','publish','createdt','createby','modifieddt','modifiedby');	 
			$crud->set_subject('News');  
			$crud->required_fields('title','news','publish'); 
			$crud->set_field_upload('image','assets/uploads/newsImg'); 
			$crud->field_type('publish','dropdown',
            array('1' => 'Publish Content', '2' => 'Disable Content'));
			$this->HiddenField($crud);   
			$output = $crud->render(); 
			$this->_home_output($output);
	}
	
	function HiddenField($crud)
	{

        //date_default_timezone_set("Asia/Jakarta");
	$crud->field_type('createby', 'hidden','');
	$crud->field_type('createdt', 'hidden',''); 
	$crud->field_type('modifiedby', 'hidden','');
	$crud->field_type('modifieddt', 'hidden','');  
	
	   $url = explode('/',uri_string());
	   $c = count($url);
	   if($c > 3)
	   {
			if($url[3] == 'add'){  
						   $crud->field_type('createby', 'hidden',$this->user_data['username']);
						   $crud->field_type('createdt', 'hidden',date("Y-m-d H:i:s"));     
		   } elseif($url[3] == 'edit') { 
						   $crud->field_type('modifiedby', 'hidden',$this->user_data['username']);
						   $crud->field_type('modifieddt', 'hidden',date("Y-m-d H:i:s"));        
		   }   
	   }
				
	}
	
	
}

davidoster

davidoster
  • profile picture
  • Member

Posted 22 May 2013 - 09:56 AM

Which function does not display correctly?


Ari Prasasti

Ari Prasasti
  • profile picture
  • Member

Posted 22 May 2013 - 10:35 AM

Which function does not display correctly?

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Guestbook extends CI_Controller {
	 private $user_data;
	function __construct(){
	parent::__construct();
			$this->load->database();
		    $this->load->helper('url'); 
		    $this->load->library('grocery_CRUD'); 
            $this->load->library('image_CRUD');	 
			$this->load->library('gc_dependent_select');
			$this->load->helper(array('form', 'url'));
			$this->load->library('form_validation'); 
			$this->load->model('model_login');  
			$this->load->view("adminstar/header");
			$this->user_data = $this->session->userdata;
			//echo $this->session->userdata('username');
			$now = time();
			$expired = $this->session->userdata('expired');
			if($now < $expired)
			{
				if ($this->session->userdata('username') == FALSE)
				{
					redirect('adminstar/admin/logout'); 
				} 
			}
			else
			{
				redirect('adminstar/admin/logout'); 
			}
			
	}
	
	function index()
	{  
		$this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
	}
	
	function _home_output($output = null){ 
        $output->userinfo = $this->user_data; 
		$this->load->view('adminstar/crud',$output);
		$this->load->view("adminstar/footer");
	}
	
//Here Function not displayed field event edit or del

	function setting_guestbook()
	{
                 
		$crud = new grocery_CRUD();
$crud->set_model('MY_grocery_model');
		$crud->set_table('star_guestbook');
		$crud->columns('ID','name','email','coment','publish');	 
		$crud->set_subject('Guest Book'); 
		$crud->field_type('publish','dropdown',
                 array('1' => 'Publish Content', '2' => 'Disable Content'));
		$crud->unset_add();
		$crud->unset_delete();
		$output = $crud->render(); 
		$this->_home_output($output);
	}
	 
	// this is the string replaced within the cell - this example refers to a localhost location, change it according to your needs
	function showImage($value) 
	{  
	   return "<a href = '" . base_url('assets/uploads/client') .'/'. $value . "' class='image-thumbnail'> <img src='" . base_url('assets/uploads/client') .'/'. $value . "' width=300px height=220px > </a>";
	}
		 
	
}

davidoster

davidoster
  • profile picture
  • Member

Posted 28 May 2013 - 08:07 AM

On this function function setting_guestbook()

the add and delete doesn't display because you have 

$crud->unset_add();

$crud->unset_delete();

 

Also on this line, $crud->set_model('MY_grocery_model');

MY_grocery_model is the name of the model you use?

Is this model functioning properly?