Welcome Guest, Not a member yet? Register   Sign In
Post sheet
#1

(This post was last modified: 12-13-2014, 05:55 AM by juninhodeluca.)

Hello guys,
I have an webapp which the user insert a specific sheet. Those sheets are predefined by the admin. So... some sheets have 15 lines, other ones have 50.
On submit, the user can to choose to SAVE or to SEND or to EXPORT or to PRINT the sheet.
But, if the user choice be SEND or EXPORT or PRINT, the sheet need to save itself first.

I am using something like that:

PHP Code:
Class Sheet {

 
   public function save() {
 
       // form validation run here
 
       // save in DB
 
   }

 
   public function send() {
 
       // form validation run here
 
       // save in DB
 
       // write the output file
 
   }




Of course I have a redundance in validating and saving the data into DB.

I tried to do something like that

PHP Code:
   public function send() {
 
       $this->save();
 
       //code to write
 
   

and also tried changing save to a static method

PHP Code:
   public function send() {
 
       self::save()
 
       // code to write
 
   


None work.
Some suggestion?
Reply


Messages In This Thread
Post sheet - by juninhodeluca - 12-13-2014, 05:54 AM
RE: Post sheet - by InsiteFX - 12-13-2014, 06:59 AM
RE: Post sheet - by Narf - 12-14-2014, 08:49 AM
RE: Post sheet - by Rufnex - 12-13-2014, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB