/admin/pages/saveDetails.php
PHP | 38 lines | 13 code | 1 blank | 24 comment | 0 complexity | c017563e040f31265f5c3ffdfe16381f MD5 | raw file
Possible License(s): GPL-3.0
- <?php
- /**
- * Created by JetBrains PhpStorm.
- * User: predragjevtic
- * Date: 10/4/12
- * Time: 2:18 PM
- * To change this template use File | Settings | File Templates.
- */
- require_once '../../framework/lib/setup.php';
- //print_r($_POST);
- //print_r($_POST['setting']);
- foreach($_POST['setting'] as $key=>$value){
- $attrSet = AttributeSet::find_by_id($key);
- $detailsArr = array();
- $attrSet->name = $_POST['attrName'][$key];
- foreach($value as $keyD=>$detailID){
- $detailsArr[] = $keyD;
- }
- $attrSet->details = implode(',', $detailsArr);
- $attrSet->save();
- }
- //
- //foreach($_POST['sr_details'] as $key=>$values){
- // $detail = explode('|||', $key);
- // if($detail[1] == 0){
- // $pD = new ProductDetails();
- // }else{
- // $pD =ProductDetails::find_by_id($detail[1]);
- // }
- //
- // $pD->value_sr = $values;
- // $pD->productID = $_POST['product_id'];
- // $pD->value_en = $_POST['en_details'][$key];
- // $pD->detailID =$detail[0];
- // $pD->save();
- //}
- redirect_to(ADMIN.'atribute-set');