Forums: Remove record - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Remove record After job done remove record and add to history Rate Topic: -----

#1 User is offline   stan 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 17-October 13

Posted 20 April 2019 - 12:29 PM

Hello i have a problem..i have app employees.every morning they receive job list..i need when they finish (for example 1 job) record remove from list page and move to history table.on edit page i have field 'job is done' when they finish, they press update and after update i need to remove record and they will start new job..Thank you
0

#2 User is offline   ronald 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 66
  • Joined: 19-January 18

Posted 22 April 2019 - 02:03 PM

I do not see it complicated, you would have to delete the record and insert in the other table
$sql = "delete from cobros where id_cobros= ".$values['id_cobro'];
CustomQuery($sql);	


$sql = "INSERT INTO new_plantel_instructores (id_instituto, id_persona,fecha_insercion) values ($id_instituto, ".$values['id_persona'].",'".$fecha_actual."')";
CustomQuery($sql);

0

#3 User is offline   Mark Kramer 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 75
  • Joined: 06-June 12
  • Gender:Male
  • Location:Midwest USA

Posted 22 April 2019 - 11:25 PM

Another option it to have a "Completed" integer field with a default of '0" in your table. (I use a check mark for this field.)
Then on your in sql code: for the page.

SELECT
*
FROM `Your Table`
WHERE (`Completed` = 0)



When they finish, they select the "Completed" check box then save and it will not show up as still being open when listed because the check box saves the numeral "1" to the field in the record.




MK
0

#4 User is offline   stan 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 17-October 13

Posted 23 April 2019 - 04:02 PM

View Postronald, on 22 April 2019 - 10:03 AM, said:

I do not see it complicated, you would have to delete the record and insert in the other table
$sql = "delete from cobros where id_cobros= ".$values['id_cobro'];
CustomQuery($sql);	


$sql = "INSERT INTO new_plantel_instructores (id_instituto, id_persona,fecha_insercion) values ($id_instituto, ".$values['id_persona'].",'".$fecha_actual."')";
CustomQuery($sql);


i add this code on event: after update..Nothing happen. maybe i did something wrong, please help me
$sql = "delete from Jobs where id_Jobs= ".$values['id_Jobs'];
CustomQuery($sql);


$sql = "INSERT INTO History (id_Jobs, id_Confirmation,data_insercion) values ($id_Jobs, ".$values['id_Confirmation'].",'".$data_actual."')";
CustomQuery($sql);
0

#5 User is offline   stan 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 17-October 13

Posted 23 April 2019 - 04:05 PM

View PostMark Kramer, on 22 April 2019 - 07:25 PM, said:

Another option it to have a "Completed" integer field with a default of '0" in your table. (I use a check mark for this field.)
Then on your in sql code: for the page.

SELECT
*
FROM `Your Table`
WHERE (`Completed` = 0)



When they finish, they select the "Completed" check box then save and it will not show up as still being open when listed because the check box saves the numeral "1" to the field in the record.




MK

ok but i need this jobs record save on history table, for billing and other..can you please explain me how can i see this record when i need it
0

#6 User is offline   Mark Kramer 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 75
  • Joined: 06-June 12
  • Gender:Male
  • Location:Midwest USA

Posted 25 April 2019 - 05:07 AM

View Poststan, on 23 April 2019 - 11:05 AM, said:

View PostMark Kramer, on 22 April 2019 - 07:25 PM, said:

Another option it to have a "Completed" integer field with a default of '0" in your table. (I use a check mark for this field.)
Then on your in sql code: for the page.

SELECT
*
FROM `Your Table`
WHERE (`Completed` = 0)



When they finish, they select the "Completed" check box then save and it will not show up as still being open when listed because the check box saves the numeral "1" to the field in the record.




MK

ok but i need this jobs record save on history table, for billing and other..can you please explain me how can i see this record when i need it



Just create a list page with the WHERE (`Completed` = 1) to show completed records only.

SELECT
*
FROM `Your Table`
WHERE (`Completed` = 1)


Or you could remove the "WHERE" Clause completely and all records will show. In a nut shell , you are filtering your records by the "Completed" field value.
0

#7 User is offline   ronald 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 66
  • Joined: 19-January 18

Posted 30 April 2019 - 11:57 PM

View Poststan, on 23 April 2019 - 04:02 PM, said:

View Postronald, on 22 April 2019 - 10:03 AM, said:

I do not see it complicated, you would have to delete the record and insert in the other table
$sql = "delete from cobros where id_cobros= ".$values['id_cobro'];
CustomQuery($sql);	


$sql = "INSERT INTO new_plantel_instructores (id_instituto, id_persona,fecha_insercion) values ($id_instituto, ".$values['id_persona'].",'".$fecha_actual."')";
CustomQuery($sql);


i add this code on event: after update..Nothing happen. maybe i did something wrong, please help me
$sql = "delete from Jobs where id_Jobs= ".$values['id_Jobs'];
CustomQuery($sql);


$sql = "INSERT INTO History (id_Jobs, id_Confirmation,data_insercion) values ($id_Jobs, ".$values['id_Confirmation'].",'".$data_actual."')";
CustomQuery($sql);



if you do nothing, your id may be empty, try with $oldvalues ​​['id_Jobs']
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users