Advertisement
fernandezekiel

Untitled

Nov 13th, 2012
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public function checkConversionRequirements($attribute,$params)
  2. {
  3. //ichecheck lang
  4. //conditions:
  5. //kelangan may value ung $customer_name IF Create new customer
  6. //kelangan naman nakaselect ung Dropdown kapag hindi nakacheck ung create new customer
  7. if(!$this->hasErrors())
  8. {
  9. if($this->isNewAccount)
  10. {
  11. if($this->customer_name == null || $this->customer_name == "")//kelangan may nilagay sya sa name ng customer kasi create new customer erh
  12. $this->addError('customer_name', 'Name is required if you are creating a new customer');
  13.  
  14. }
  15. else
  16. {
  17. if($this->customer_id == 0)
  18. $this->addError('customer_id', 'You must select from the existing customers');
  19.  
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement