Jump to content


ssfthurber

Member Since 04 Jun 2013
Offline Last Active Mar 15 2014 03:04 PM
-----

Posts I've Made

In Topic: Tabs in forms

18 February 2014 - 10:51 PM

welll not promised but looking at the requirements.. today i decided to build the extension for grocery crud with tabs...

Here i have added the functionality. It can be obtained from either of the links below

 

https://github.com/b...zer/POWER-GCrud     - for complete package ... - u can ignore this if u don't want to include all other power pack features. Also has got a bit of modifications over the last commit of mine so any1 who have had downloaded - may upgrade to this ...

 

https://github.com/b...er/gc_with_tabs    - in case any1 just want to include just the grocery crud with tabs functionality.

 

the last function (customer_management3) in the examples.php controller is where it demonstrates how to use the feature. It is simple enough .. enjoy!!!!

 

Happy GCing :)

i like the tabs piece but it gives this warning:

Message: require_once(grocery_crud.php): failed to open stream: No such file or directory


In Topic: Add custom action button in edit form

18 February 2014 - 07:19 PM

you asked about adding custom buttons on an edit form, if i've read correctly. in the edit state, the key is in a URL segment. have the controller use that to build the URL string you need then use your view to inject code for a button into the body. i do this sort of hing s often that my views have more hooks than anything else, and end up having mostly stuff like this:

<?php foreach($css_files as $file): ?><link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" /><?php endforeach; ?>
<?php global $inject_after_cssfiles; echo $inject_after_cssfiles; ?>
<?php global $inject_after_cssinline; echo $inject_after_cssinline; ?>
<?php global $inject_atop_js; echo $inject_atop_js; ?>
<?php foreach($js_files as $file): ?><script src="<?php echo $file; ?>"></script><?php endforeach;?>
<?php global $inject_after_jsfiles; echo $inject_after_jsfiles; ?>
<div id="this_page_body" >
<?php 
global $inject_atop_body; 
echo $inject_atop_body; 
global $extraJS; 
$output.=$extraJS;
echo $output; 
?>
</div>

In Topic: Two different edit screens?

18 February 2014 - 07:02 PM

there are a couple of hacks that i've used to deal with "unusual "actions".

to add an action that does edit differently from the declarations you have in the CRUD, the new action would route to a URL that is the same as the edit url except that you have include a segment that the CRUD checks to determine the alternate edit field list. then use the trick elsewhere on this forum to clean up the URL. alternatively the action URL could go to a small function that sets a flag in sessions then redirects back to the edit URL and just have the CRUD look for that session flag to determine the field list.

i've had to do this sort of thing and a complex user registration process because, for example, you don't know the id of an added record at the time the success message is set so you can't use the message to jump yourself to the next step so instead i go to a redirector, and by then the id is knowable. ok i digress but you get the general idea. 


In Topic: Connection between the three tables

18 February 2014 - 06:51 PM

 

Hello. There are 3 tables. The first Students id_student, name), the second "Universities" (id_university, title). And a third table relative LINK (id_student, id_university, release_year). How can I write code to link? Here is the SQL query that should be
SELECT s.name, u.title, l.release_year FROM `students` AS `s`
		INNER JOIN `link` As `l` On l.student_id = s.student_id
		INNER JOIN `universities` As `u` On u.university_id = l.university_id

the sql code can be put in a view then use the view name instead of a table name


In Topic: import excel

18 February 2014 - 06:43 PM

HI there

That exactly what i want to know.I am a beginner in Excel processing issues.And i want to know some easy methods to import multiple row excel.Is there a fine tool which supports to do that in crud?

Thanks for any suggestions.

you may find the PHPexcel library in this CI-GC distro useful: https://github.com/sfthurber/cim-xa