PageRenderTime 34ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/pages/saveDetails.php

https://bitbucket.org/designbyheart/original
PHP | 38 lines | 13 code | 1 blank | 24 comment | 0 complexity | c017563e040f31265f5c3ffdfe16381f MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. /**
  3. * Created by JetBrains PhpStorm.
  4. * User: predragjevtic
  5. * Date: 10/4/12
  6. * Time: 2:18 PM
  7. * To change this template use File | Settings | File Templates.
  8. */
  9. require_once '../../framework/lib/setup.php';
  10. //print_r($_POST);
  11. //print_r($_POST['setting']);
  12. foreach($_POST['setting'] as $key=>$value){
  13. $attrSet = AttributeSet::find_by_id($key);
  14. $detailsArr = array();
  15. $attrSet->name = $_POST['attrName'][$key];
  16. foreach($value as $keyD=>$detailID){
  17. $detailsArr[] = $keyD;
  18. }
  19. $attrSet->details = implode(',', $detailsArr);
  20. $attrSet->save();
  21. }
  22. //
  23. //foreach($_POST['sr_details'] as $key=>$values){
  24. // $detail = explode('|||', $key);
  25. // if($detail[1] == 0){
  26. // $pD = new ProductDetails();
  27. // }else{
  28. // $pD =ProductDetails::find_by_id($detail[1]);
  29. // }
  30. //
  31. // $pD->value_sr = $values;
  32. // $pD->productID = $_POST['product_id'];
  33. // $pD->value_en = $_POST['en_details'][$key];
  34. // $pD->detailID =$detail[0];
  35. // $pD->save();
  36. //}
  37. redirect_to(ADMIN.'atribute-set');