Jump to content

Sradesign

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by Sradesign

  1. Bravo that fixed my code completely. Below I put the complete code in case any one need it. $user->setTrackChanges(Wire::trackChangesOn | Wire::trackChangesValues); $usertitle = $input->post->usertitle; $fname = $input->post->fname; $lname = $input->post->lname; $user->of(false); $user->usertitle = $usertitle; $user->fname = $fname; $user->lname = $lname; $user->save(array('resetTrackChanges' => false)); $new_changes = $user->getChanges(true); foreach($new_changes as $row => $innerArray){ foreach($innerArray as $innerRow => $value){ $change_box .= $row . " : " .$value . "<br>"; } } echo $change_box;
  2. Wanze it will send me an array with empty value like this: if I use : $new_changes = $user->getChanges(true); $change_box = json_encode($new_changes); I get this: {"address":[null],"zipcode":[null]}
  3. Yes I have a reason for not sanitizing for now but thanks for checking the code and again thanks for the help.
  4. amazing thanks Wanze another thing how can we show the previous and also new value of the changed fields too?
  5. I did turned it on but nothing changed I did used $user->setTrackChanges(true); inside the if for POST and outside also nothing changed.
  6. I checked it but I get empty array always see my code below: if($input->post->submitpiform) { if(!is_dir($upload_path)) { if(!wireMkdir($upload_path)) throw new WireException("No upload path!"); } // New wire upload $doc1_photo = new WireUpload('doc1'); // Reference field name in HTML form that uploads photos $doc1_photo->setMaxFiles(1); $doc1_photo->setOverwrite(true); $doc1_photo->setDestinationPath($upload_path); $doc1_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); $doc2_photo = new WireUpload('doc2'); // Reference field name in HTML form that uploads photos $doc2_photo->setMaxFiles(1); $doc2_photo->setOverwrite(true); $doc2_photo->setDestinationPath($upload_path); $doc2_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); $doc3_photo = new WireUpload('doc3'); // Reference field name in HTML form that uploads photos $doc3_photo->setMaxFiles(1); $doc3_photo->setOverwrite(true); $doc3_photo->setDestinationPath($upload_path); $doc3_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); $doc4_photo = new WireUpload('doc4'); // Reference field name in HTML form that uploads photos $doc4_photo->setMaxFiles(1); $doc4_photo->setOverwrite(true); $doc4_photo->setDestinationPath($upload_path); $doc4_photo->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files1 = $doc1_photo->execute(); $files2 = $doc2_photo->execute(); $files3 = $doc3_photo->execute(); $files4 = $doc4_photo->execute(); $usertitle = $input->post->usertitle; $fname = $input->post->fname; $lname = $input->post->lname; $dob = $input->post->dob; $country_of_residence = $input->post->country_of_residence; $country_of_citizenship = $input->post->country_of_citizenship; $address = $input->post->address; $address2 = $input->post->address2; $city = $input->post->city; $state = $input->post->state; $zipcode = $input->post->zipcode; $phone = $input->post->phone; $user->of(false); $user->usertitle = $usertitle; $user->fname = $fname; $user->lname = $lname; $user->dob = $dob; $user->country_of_residence = $country_of_residence; $user->country_of_citizenship = $country_of_citizenship; $user->address = $address; $user->address2 = $address2; $user->city = $city; $user->state = $state; $user->zipcode = $zipcode; $user->phone = $phone; $user->save(); $new_changes = $user->getChanges(); $string = join(',', $new_changes); $session->message(__($string)); foreach($files1 as $filename) { $user->doc1->removeAll(); $user->doc1->add($upload_path . $filename); $user->message("Added file 1 : $filename"); unlink($upload_path . $filename); } foreach($files2 as $filename) { $user->doc2->removeAll(); $user->doc2->add($upload_path . $filename); $user->message("Added file 2 : $filename"); unlink($upload_path . $filename); } foreach($files3 as $filename) { $user->doc3->removeAll(); $user->doc3->add($upload_path . $filename); $user->message("Added file 3 : $filename"); unlink($upload_path . $filename); } foreach($files4 as $filename) { $user->doc4->removeAll(); $user->doc4->add($upload_path . $filename); $user->message("Added file 4 : $filename"); unlink($upload_path . $filename); } $user->save(); $user->of(true); $fullname = $usertitle.' '.$fname.' '.$lname; // $mailadmin = $modules->get('WireMailSmtp'); // $mailadmin->sendSingle(true); // $mailadmin->to('sradesign.net@gmail.com', 'Ali Mahmoudi'); // $mailadmin->cc(array('ali@vinsonfinancials.com')); // $mailadmin->from = 'info@vinsonfinancials.com'; // $mailadmin->fromName = 'Vinson Financials'; // $mailadmin->subject('Test'); // $mailadmin->bodyHTML($fullname.' Account Details Have Been Updated Successfully.<br><br>Date of Birth: '.$dob.'<br>Country of Residence: '.$country_of_residence.'<br>Country of Citizenship: '.$country_of_citizenship.'<br>Address: '.$address.'<br>Address 2: '.$address2.'<br>City: '.$city.'<br>State: '.$state.'<br>Zip Code: '.$zipcode.'<br>Phone: '.$phone); // $numSent = $mailadmin->send(); // $mailuser = new wireMail(); // $mailuser->to($user->email, $fullname); // $mailuser->from = 'info@vinsonfinancials.com'; // $mailuser->fromName = 'Vinson Financials'; // $mailuser->subject('Test'); // $mailuser->bodyHTML('Your Account Details Have Been Updated Successfully.'); // $numSent = $mailuser->send(); $session->message(__('Personal Information Successfully Updated')); $this->session->redirect($this->page->url); }
  7. ok lets give you a practical example. You have users with some custom fields for user template. now when a user change his data how do you compare the new data with the old one please give me an example.
  8. Bravo that worked perfectly thank you very much again Martijn.
  9. ok let me try to see if it gives me the desired result.
  10. Yes Ivan is going to be compared with the data saved but since I have to get the data from the page one time and get it again after save for comparison I thought maybe there is a better way to do it cause for example some of my pages have hundreds of fields and maybe only one filed changed so I said to myself lets ask maybe there is a better way to save processing the data.
  11. Thanks Martijn look forward to see your solution.
  12. Martijn another issue I have WireMailSMTP and also using your module too now when I have such code as below: $mail = wireMail(); $mail->sendSingle(true); $mail->to('sradesign.net@gmail.com', 'Ali Mahmoudi'); $mail->cc(array('ali@vinsonfinancials.com')); $mail->from = 'info@vinsonfinancials.com'; $mail->fromName = 'Vinson Financials'; $mail->subject('Test'); $mail->bodyHTML($fullname.' Account Details Have Been Updated Successfully'); $numSent = $mail->send(); it trough me errors like below: Error: Exception: Method WireMailBranding::sendSingle does not exist or is not callable in this context or Error: Exception: Method WireMailBranding::cc does not exist or is not callable in this context
  13. Thank you very much I will take look and poke it a little bit and will update the topic. Great module and thank you for making such a cool module.
  14. no I have a form that after save I send an email to client I want to send some of the data from the form to wrapper itself for example in the footer
  15. Martjin one question is there anyway to send some dynamic data also to the wrapper it self ?for example we have placed the {bodyHTML} inside our content box and I want to also send data to another part of my template. How can I achieve this? Best Regards, Ali.M
  16. Hi guys, I saw some post to track changes an specific filed or just show and instance of before and after save but what I want is a bit different, I have for example a form with 50 fields I want to send an email that shows only the fields that their value changed and what it was before and what it is now. How I can achieve this ? please give me your thoughts. Best Regards, Ali.M
  17. Martijn I have a problem when I have installed Mail Branding and wireMailSMTP together I get the below error : Error: Exception: Method WireMailSmtp::template does not exist or is not callable in this context (in /home/omegatel/public_html/wire/core/Wire.php line 358) My Silly mistake downloaded the module but didn't installed it
  18. you can use datatables and a bit of coding and easily achieve what you want if you want I will make a sample for you.
  19. you just witness that it is make a small silly mistake and you get random values
  20. Woooow I don't believe such a silly mistake
  21. Hi I have an strange problem with sorting of my page details using API. I use this code for getting the sorted result : <?php $notes = $pages->find("parent=/notes/,limit=20,sort=-modified"); foreach($notes as $note){ if($user->name = $note->createdUser->name){ ?> <li style="padding: 5px"> <div class="row"> <div class="col-md-8"> <div class="desc"> <span class="label label-sm bg-<?php echo $crm_color; ?>"> <i class="fa fa-<?php echo $crm_icon; ?>"></i> <?php echo $note->crm_type; ?> </span> <?php echo substr($note->crm_comment, 0, 30).' ...'; ?> </div> </div> <div class="col-md-4 text-right"> <i class="fa fa-clock-o"></i> <?php echo date("Y/m/d h:s", $note->modified); ?> </div> </div> </li> <?php } } ?> and look at the result in attachment the dates are random.
  22. Ok I got a small mistake and put the $session->removeNotices(); inside the submit condition I put it out and it seems like to fix the issue for now.
×
×
  • Create New...