HELP with LDR to trigger a phone

Thank you 1st of all

let me just say bouth codes in seperate compiles great and they work ( explect the "programable delay" in the 1st one that is suposed to be the 2th code).
what i need to try is with your advise combine the 2 and make them work as 1

TY
xmodpt