f0ska

f0ska does not currently provide support for this item.

2730 comments found.

sebheg

sebheg Purchased

I need help and I am willing to pay $30 someone who can help me with the following:

I have a simple table called “done”, which consists of 3 columns ID, done, user. ID is an auto increment value. done stores a serialized array in which I plan to store values true or false for pages on my website. The true or false indicates if the pages are marked as “done” by the user. user stores a user id.

I have a webpage where logged in users can mark pages as “done” once they have finished editing a page. Therefore the user clicks on a button with a checkmark.

What I am trying to achive with xCRUD is the following: I want to put a simple, single button (no tables around it, just a button) on each page.

When the page is loaded, the button state should be either “checked/done” or “unchecked/not done”, depending on the serialized value stored in the done column for that particular page and user (one table row per user, hence the user id stored in column user.

When the user clicks on the button, the button should send an ajax request and toggle the done state for that page and for that user in the serialized value in the db.

I am using Bootstrap theme and would really, really appreciate your help (paid!).

Thank you :)

JinRoh

JinRoh Purchased

@sebheg : How do you call your page ? It’s a XCRUD page ?
Your data in your table is something like ? :
ID,DONE,USER
1,{FALSE,TRUE,TRUE},JOHN
2,{FALSE,FALSE,TRUE},TOM
I don’t understand why you need XCRUD.
sebheg

sebheg Purchased

@JinRoh yes, the pages contain XCRUD generated content. This is why I wanted to use XCRUD for this (as well).

The table “done” looks like this:

ID | done | user

1 | “array(“page1.php” -> false, “page2.php” -> true, “page3.php” -> true); | 123

2 | “array(“page1.php” -> true, “page2.php” -> false, “page3.php” -> true); | 345

3 | “array(“page1.php” -> true, “page2.php” -> true, “page3.php” -> false); | 567

So when user 345 loads page3.php, the button will show checkmark/done. So when user 567 loads page3.php, the button will show no checkmark/not done.

The data in column done is stored as a serialized array.

I have tried many ways to create an AJAX button like this. I tried to copy the export CSV and print buttons, I tried to use the xcrud->button function.

The problem is: I need to pass the user id – for security reasons – in my query (not only the “primary” ID, like it is shown on the examples page http://xcrud.com/demos/index.php?page=ordering&theme=default). And when I create a call_back function, like movetop/movebottom on the example page, I can only access the primary ID (and not the entire XCRUD object – if this was the case, I could pass the user id with the set_var() and get_var() command).

JinRoh

JinRoh Purchased

@sebheg : to pass data from your row, you can use array_attributes :
$xcrud->button('#','Stats','glyphicon glyphicon-stats','btn btn-success',array('data-user'=>'{user}'));
so the result is
<a class="xcrud-button btn btn-success" href="#" title="Stats" data-user="123">
<i class="glyphicon glyphicon-stats">
</i>
</a>
sebheg

sebheg Purchased

@JinRoh THANK YOU! This was exactly what I needed! Thank you for your outstanding support, especially since you are not the author. I’d like to buy you a beer (via PayPal). Please email me seb.heg at arcor dot de. :)

Tiennes

Tiennes Purchased

Thanks for your replies! @JinRoh, where should the custom sql query be placed in the relation? Consider the code below:

$xcrud->relation('prod_costumer','tbl_costumers','costumer_id','costumer_name', '', 'costumer_name asc');

Many thanks in advance!

JinRoh

JinRoh Purchased

@sebheg : Drink beer to my health…. cheers :grin:

JinRoh

JinRoh Purchased

@Tiennes : Custom SQL query ? Custom SQL query is in read only.
Can you copy/paste your XCRUD definition from $xcrud = Xcrud::get_instance(); to echo $xcrud->render(); With that I/we can check what is wrong.

Hi f0ska,

Could you please sent to me a detail step for using XCRUD on joomla. I have follow the instruction but this plugin cannot working

Always show “table(‘users’); ?> render(); ?> “

Hello,

This is a PRE-SALE question:

I’ve been use the Editor.Datatables plugin in my datatable with this code:

{ extend: “selectedSingle”, text: “Actualizar”, action: function ( e, dt, node, config ) { // Immediately set precio to the minvalue and submit selectedrow = table.row( { selected: true } ).data(); minvalue = Math.min(selectedrow.precioComp1,selectedrow.precioComp2,selectedrow.precioComp3); //console.log(minvalue); editor .edit( table.row( { selected: true } ).index(), false ) .set( ‘precio’, (minvalue )) .submit(); } }

The objective of that is i have a table with this template:

ID | Name | Precio | precioComp1 | precioComp2 | precioComp3 1 | TEST | 5 | 4 | 6 | 9

What i want, is when we click the button “Actualizar”, all the rows set in Precio the minvalue and aply a—minvalue (-1 to the min value)

Can i do that with XCRUD? If yes, how?

Let me know please,

Regards

@ rizalnugraha : You need a plugin like “Sourcerer” to insert your PHP code in aricle.
{source}
<?php
$xcrud1 = Xcrud::get_instance();
$xcrud1->table('test');
echo $xcrud1->render();
?>
{/source}
by
by
by
by
by
by