Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - heri.pmck

1
Questions / Re: Running Multiple Quries using Dynamic Table Row
@maumar
 
may i know your detail database, so i can learn too.

i'm trying to create a simple stock in and stock out app,
the table as follow:

items
-------
*id
item_name
item_stock

stock_in
---------
*id
stock_in_date

stock_in_detail
---------------
stock_in_id
item_id
stock_in_qty

Thank You
3
Questions / Master with Multiple Detail
hii,
i trying to make a simple Job database with job table as master and multiple detail such as, receive, quote, delivery etc as detail. shown at job list page,
the problem is, when i delete one of record of the detail table, such as P0002.
the list page not shown Job record J0001 anymore even the record still on the job table.
please see image job list page - job id not shown.jpg

how to make all master record shown when some of detail record are deleted.

Thank You
 
7
Bugs / Re: Action after delete
@alfre91‍ I noticed that the error from the previous query was because of no data in the $modeldata['id_data'] being used in the query. the new solution would be to add this 👇
Code: [Select]
$db->where('id',$rec_ids);
$prueba_id = $db->getValue('data', 'id_data');
to your Action Before Delete and add this 👇
Code: [Select]
$sql = "UPDATE prueba SET prueba.data_list = (prueba.data_list - 1) WHERE id = ".$prueba_id;
$db->rawQuery($sql);
to your Action After Delete. I hope this resolves your issue.

Attached the .ppm file below in case you encounter any issue.



i've the same problem, i can't update after delete
below is my test project, simple inventory. using PHPRad Classic 2.7.1 Trial,
i hope someone can help me. thank you

finally found newbee error,
this is what i do:
purchases>>Delete Page>> Action Before Delete:
Code: [Select]
$db->where('id',$rec_id);
$products_id = $db->getValue('purchases', 'product_id');

purchases>>Delete Page>>Action After Delete:
Code: [Select]
//$count_qty = $db->rawQuery("SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id");

//execute SQL statement and return the result
//$params    = array($products_id);
//$count_qty = $db->rawQuery("SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id", $params);

$sql = "UPDATE products SET products.received_inventory = (SELECT SUM(received_number) FROM purchases WHERE product_id=$products_id) WHERE id = $products_id ";
$db->rawQuery($sql);

 i originally want to use $count_qty instead a nested query, but it was fail to me.
please suggest with better sql query.

thank you
8
Bugs / Re: Action after delete
@alfre91‍ I noticed that the error from the previous query was because of no data in the $modeldata['id_data'] being used in the query. the new solution would be to add this 👇
Code: [Select]
$db->where('id',$rec_ids);
$prueba_id = $db->getValue('data', 'id_data');
to your Action Before Delete and add this 👇
Code: [Select]
$sql = "UPDATE prueba SET prueba.data_list = (prueba.data_list - 1) WHERE id = ".$prueba_id;
$db->rawQuery($sql);
to your Action After Delete. I hope this resolves your issue.

Attached the .ppm file below in case you encounter any issue.



i've the same problem, i can't update after delete
below is my test project, simple inventory. using PHPRad Classic 2.7.1 Trial,
i hope someone can help me. thank you