QUR_SEL($sql); //echo $sql.'
'.print_r($rez,1).''; if(!$rez['err']&&$rez['kol']) { foreach ($rez['rez'] as $key => $val) { $id_file = $val['id']; echo $val['id'].':'.$val['file'].'
'.print_r($arr,1).''; //[Б1.О.01] => Array( // [ezfo_ze] => 4 [schitatVplane] => + [index] => Б1.О.01 [name] => История России // [ekzamen] => 2 [zachet] => 1 [zachetsocenk] => 0 [kp] => 0 [kr] => 0 // [kafcod] => 51 [kafname] => Управления и таможенного дела // [json] => {\"1\":{\"1\":{\"ze\":\"2\",\"lekcii\":\"20\",\"pr\":10,\"srp\":\"0.25\",\"sr\":\"41.75\"},\"2\":{\"ze\":\"2\",\"lekcii\":\"18\",\"pr\":10,\"sr\":\"17\",\"krat\":\"0.35\",\"kontrol\":\"26.65\"}}} // [kontrol] => 0 // [json1] => Array ( // [1] => Array ( // [1] => Array ( [ze] => 2 [lekcii] => 20 [pr] => 10 [srp] => 0.25 [sr] => 41.75 ) // [2] => Array ( [ze] => 2 [lekcii] => 18 [pr] => 10 [sr] => 17 [krat] => 0.35 [kontrol] => 26.65) // ) // ) //) foreach ($arr as $index => $data) { $data['id_file'] = $id_file; $check1 = check_discip($data); if($check1['err']==1){ echo $data['index'].' '.$data['name'].$check1['msg'].'
'.print_r($plans,1).''; //exit(); } } } /** * Проверка JSON дисциплины * @param $param * @return array|mixed */ function check_discip($param){ GLOBAL $DB; $out=array(); $sql = 'SELECT id,json FROM acs_fshp_uchebplans WHERE id_file='.$param['id_file'].' AND index1="'.$param['index'].'" AND name="'.$param['name'].'"'; $rez = $DB->QUR_SEL($sql); if(!$rez['err']&&$rez['kol']) { $discip = $rez['rez'][0]; if($discip['json']!=json_encode($param['json1'],JSON_UNESCAPED_UNICODE)){ $out['err'] = 1; $out['msg'] = '
'.print_r(json_decode($discip['json'],1),1).' | ';
$out['msg'] .= ''.print_r($param['json1'],1).' | ';
$out['msg'] .= '