⚠ 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

How to aitoload a selection without clicking it



navajo

navajo
  • profile picture
  • Member

Posted 15 February 2018 - 18:38 PM

I am a PHP dummy.

 

How do I change this view in (exaple.php in views) so that it automatically loads the customer database for example, without having to select it on the menu? In other words, I want to bypass the select customer and load the data automatically.

 

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
foreach($css_files as $file): ?>
    <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<?php foreach($js_files as $file): ?>
    <script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
</head>
<body>
    <div>
        <a href='<?php echo site_url('examples/customers_management')?>'>Customers</a> |
        <a href='<?php echo site_url('examples/orders_management')?>'>Orders</a> |
        <a href='<?php echo site_url('examples/products_management')?>'>Products</a> |
        <a href='<?php echo site_url('examples/offices_management')?>'>Offices</a> |
        <a href='<?php echo site_url('examples/employees_management')?>'>Employees</a> |        
        <a href='<?php echo site_url('examples/film_management')?>'>Films</a> |
        <a href='<?php echo site_url('examples/multigrids')?>'>Multigrid [BETA]</a>
        
    </div>
    <div style='height:20px;'></div>  
    <div>
        <?php echo $output; ?>
    </div>
</body>
</html>

 


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 16 February 2018 - 03:46 AM

Well - its simple - u just have to by default pass in the data what is there in the action for loading the customers in default action.. !! and its done!

 

Happy GCing :)


navajo

navajo
  • profile picture
  • Member

Posted 16 February 2018 - 06:11 AM

Simple if you know what you are doing. As a three week old PHP learner that has not touched programming in over 30 years, i still do not understand what to pass where. Simply put, when you select Customers, what array is the information (from href) being populated to??

 

The last language I ever used was Turbo Pascal if I want to give my age away.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 16 February 2018 - 06:30 AM

Welcome back to the world of programing :)

 

I am way too small to suggest stuff into you - still, i will like to give a small piece of advice - dive a bit into codeigniter first - get hang of MVC and then u can have better control on using GroceryCRUD. No doubt, you can explore and learn quite enough with GC itself. (Just a piece of advice)

 

For you to go through without doing much coding hastle - i will give you a small code that you can put it into the index method

redirect('example/customers')

What this will do is - redirect you directly to the customers functionality whenever it lands onto the examples page.

 

So with single line of code - your requirement is covered up.

 

Happy GCIng :)


navajo

navajo
  • profile picture
  • Member

Posted 16 May 2018 - 13:06 PM

Thanks you, worked perfectly.

 

Really enjoy GC. May just have outgrown some of it's available functionality. Will see what Enterprise offer over free version.