array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":2,"value":2,"text":"פסק-דין"},{"parent":4,"value":4,"text":"צו על תנאי"}],"CodeTypes":[2,4],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":"1"}', ) ); $options2 = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":1,"value":1,"text":"החלטה"}],"CodeTypes":[1],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":1}', ) );*/ $options = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":1,"value":1,"text":"החלטה"}],"CodeTypes":[1],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":1}', ) ); $options2 = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":2,"value":2,"text":"פסק-דין"}],"CodeTypes":[2],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":1}', ) ); $context = stream_context_create($options); $context2 = stream_context_create($options2); $result = @file_get_contents($url, false, $context); $result2 = @file_get_contents($url, false, $context2); $start_template_link = 'https://supremedecisions.court.gov.il/Home/Download?path=HebrewVerdicts\19\340\045\g01&fileName=19045340.G01&type=2'; /*function construction_link($path_file,$filename,$typecode){ $template_link = 'https://supremedecisions.court.gov.il/Home/Download?path=' . $path_file . '&fileName=' . $filename . '&type='.$typecode; return $template_link; } function construction_pdf($path_file,$filename,$typecode){ $template_link = 'https://supremedecisions.court.gov.il/Home/Download?path=' . $path_file . '&fileName=' . $filename . '&type='.$typecode; return $template_link; }*/ $array_big_links = json_decode($result, true); $array_big_links2 = json_decode($result2, true); print_r($array_big_links); print_r($array_big_links2); //$result_2 = iconv("Windows-1255", "UTF-8", $result); //require_once ABSPATH . '/wp-content/themes/pdin/phpQuery.php'; //require_once ABSPATH . 'wp-admin/includes/post.php'; /*$array_get = get_posts(array('post_type' => 'product','posts_per_page' => 200,'paged' => 19)); foreach($array_get as $post) { setup_postdata($post); $changeid = get_the_ID(); $date_for_slash = get_post_meta($changeid,'_text_field_link_doc',true); $urlhtml = str_replace('type=4','type=2',$date_for_slash); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $urlhtml); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_ENCODING , ''); $result = curl_exec($curl); curl_close($curl); $result2 = iconv("Windows-1255", "UTF-8", $result); if(!empty($result)) {print_r('Не пусто! '.$changeid.'
');} else {print_r('Совсем не густо! '.$changeid.'
');} if(empty($result2)) { $bool = false; do { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $urlhtml); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_ENCODING , ''); $result = curl_exec($curl); curl_close($curl); $result2 = iconv("Windows-1255", "UTF-8", $result); if(!empty($result2)) { $document = phpQuery::newDocument($result2); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html(); $my_post = array(); $my_post['ID'] = $changeid; $my_post['post_content'] = $lmth; // Обновляем данные в БД wp_update_post( wp_slash($my_post) ); carbon_set_post_meta($changeid, 'main_content_product', $lmth); $bool = true; } print_r($bool); } while ($bool == false); } else { $document = phpQuery::newDocument($result2); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html(); $my_post = array(); $my_post['ID'] = $changeid; $my_post['post_content'] = $lmth; // Обновляем данные в БД wp_update_post( wp_slash($my_post) ); carbon_set_post_meta($changeid, 'main_content_product', $lmth); } } wp_reset_postdata();*/ //$contextt = stream_context_create($optionss); //$full_html = file_get_contents($start_template_link, false, $contextt); /*$document = phpQuery::newDocument($result); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html();*/ /*$changeid = '12903'; $date_for_slash = get_post_meta($changeid,'_text_field_link_doc',true); $urlhtml = str_replace('type=4','type=2',$date_for_slash); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $urlhtml); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_ENCODING , ''); $result = curl_exec($curl); curl_close($curl); $result2 = iconv("Windows-1255", "UTF-8", $result); print_r($result2); $document = phpQuery::newDocument($result2); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html(); carbon_set_post_meta($changeid, 'main_content_product', ''); carbon_set_post_meta($changeid, 'main_content_product', $lmth); $array_add = array('post_content' => ''); $postadd = wp_insert_post($array_add,true); $array_add = array('post_content' => $lmth); $postadd = wp_insert_post($array_add,true);*/ /*$class_order = wc_get_order('12972'); $items_get = $class_order->get_items(); foreach ($items_get as $item_key => $item_values) { $item_data = $item_values->get_data(); $product_id = $item_data['product_id']; print_r($product_id); wp_update_post(array( 'ID' => $product_id, 'post_status' => 'draft' )); print_r(get_post_status($product_id)); }*/ /*foreach($array_big_links['data'] as $abl) { $is_nois = post_exists($abl['CaseName'],'','','product'); }*/ /*foreach($array_big_links['data'] as $abl) { $exit_link = construction_link($abl['Path'], $abl['FileName'], $abl['TypeCode']); $exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); $TypeCode = $abl['TypeCode']; if($TypeCode == 1 || $TypeCode == 2) { if($TypeCode == 1) { $n_cat = array(17); } else if($TypeCode == 2) { $n_cat = array(18); } $array_add = array( 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'post_type' => 'product', 'post_title' => $abl['CaseName']//, //'post_content' => $lmth ); $is_nois = post_exists($abl['CaseName'],'','','product'); if($is_nois == 0) { $postadd = wp_insert_post($array_add,true); wp_set_object_terms($postadd, $n_cat, 'product_cat'); if( is_wp_error($postadd) ){ echo $postadd->get_error_message(); } else { // теперь можно использовать $post_id, чтобы например добавить // произвольные поля записи с помощью add_post_meta() или update_post_meta() $product = wc_get_product( $postadd ); $product->update_meta_data( '_text_field_id_case', $abl['CaseId'] ); $product->update_meta_data( '_text_field_num_case', $abl['CaseNum'] ); $product->update_meta_data( '_text_field_link_doc', $exit_pdf ); $product->update_meta_data( '_text_field_title_doc', $abl['CaseDesc'] ); $product->update_meta_data( '_text_field_date_doc', $abl['VerdictsDtString'] ); //$product->update_meta_data( '_textarea_content_main', $lmth ); // Сохраняем все значения $product->save(); } } } } foreach($array_big_links2['data'] as $abl) { $exit_link = construction_link($abl['Path'], $abl['FileName'], $abl['TypeCode']); $exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); $TypeCode = $abl['TypeCode']; if($TypeCode == 1 || $TypeCode == 2) { if($TypeCode == 1) { $n_cat = array(17); } else if($TypeCode == 2) { $n_cat = array(18); } $array_add = array( 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'post_type' => 'product', 'post_title' => $abl['CaseName']//, //'post_content' => $lmth ); $is_nois = post_exists($abl['CaseName'],'','','product'); if($is_nois == 0) { $postadd = wp_insert_post($array_add,true); wp_set_object_terms($postadd, $n_cat, 'product_cat'); if( is_wp_error($postadd) ){ echo $postadd->get_error_message(); } else { // теперь можно использовать $post_id, чтобы например добавить // произвольные поля записи с помощью add_post_meta() или update_post_meta() $product = wc_get_product( $postadd ); $product->update_meta_data( '_text_field_id_case', $abl['CaseId'] ); $product->update_meta_data( '_text_field_num_case', $abl['CaseNum'] ); $product->update_meta_data( '_text_field_link_doc', $exit_pdf ); $product->update_meta_data( '_text_field_title_doc', $abl['CaseDesc'] ); $product->update_meta_data( '_text_field_date_doc', $abl['VerdictsDtString'] ); //$product->update_meta_data( '_textarea_content_main', $lmth); // Сохраняем все значения $product->save(); } } } }*/ //header('Content-type: text/plain; charset=UTF-8'); //die(); // <<<<<<<<<<<<<<<<==========вывод на страницу /*ignore_user_abort(true); $url = 'https://supremedecisions.court.gov.il/Home/SearchVerdicts'; $dt_from = date('Y-m-d\TH:i:s\.000\Z',time()-30*24*60*60); $dt_to = date('Y-m-d\TH:i:s\.000\Z',time()-0*24*60*60); $options = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"4311","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":null,"CodeTypes":[],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":1}', ) ); $context = stream_context_create($options); $result = @file_get_contents($url, false, $context); // <<<<<<<<<<<<<<<<==========вывод на экран $array_big_links = json_decode($result, true); //print_r($array_big_links['data']); //$exit_link = construction_link($abl['Path'], $abl['FileName'], $abl['TypeCode']); //$exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); //print_r($array_big_links['data']); foreach($array_big_links['data'] as $abl) { //if($abl['Id'] == '652471') { $exit_link = construction_link($abl['Path'], $abl['FileName'], 2); $exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); $TypeCode = $abl['TypeCode']; if($TypeCode == 1 || $TypeCode == 2) { if($TypeCode == 1) { $n_cat = array(17); } else if($TypeCode == 2) { $n_cat = array(18); } $array_add = array( 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'post_type' => 'product', 'post_title' => $abl['CaseName'] ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $exit_link); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_ENCODING , ''); $result = curl_exec($curl); curl_close($curl); $result2 = iconv("Windows-1255", "UTF-8", $result); $document = phpQuery::newDocument($result2); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html(); //$is_nois = post_exists('',$lmth,'','product'); //$is_nois = get_page_by_title($abl['CaseName'],'ARRAY_A','product'); $is_and_nois = exists_all($abl['CaseName'], $abl['VerdictsDtString']); } //} }*/ $arrays = get_posts(array('post_type' => 'product','posts_per_page' => -1)); foreach($arrays as $post) { setup_postdata($post); $conta = get_the_content('','',get_the_ID()); $conten = carbon_get_post_meta(get_the_ID(),'main_content_product'); //print_r($conta); if(empty($conten)) { $link_verd = get_post_meta(get_the_ID(),'_text_field_link_doc',true); /*$urlhtml = str_replace('type=4','type=2',$link_verd); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $urlhtml); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_ENCODING , ''); $result = curl_exec($curl); curl_close($curl); $result2 = iconv("Windows-1255", "UTF-8", $result); $document = phpQuery::newDocument($result2); $remova = $document->find('.Ruller38')->remove(); $div_html = $document->find('div.WordSection1'); $lmth = $div_html->html(); print_r(get_the_ID()); print_r($lmth); print_r('был найден и исправлен пустой контент
'); $my_post = array(); $my_post['ID'] = get_the_ID(); $my_post['post_content'] = $lmth; // Обновляем данные в БД wp_update_post( wp_slash($my_post) ); carbon_set_post_meta(get_the_ID(), 'main_content_product', $lmth);*/ print_r($link_verd); print_r('Пустой контент!
'); } /*$titla = get_the_title(get_the_ID()); //$titla2 = 'קבוצת קדם חיזוק וחידוש מבנים בעמ נ. עד עד חברה לנאמנות בע"מ'; $date_verd = get_post_meta(get_the_ID(),'_text_field_date_doc',true); $casetitle_verd = get_post_meta(get_the_ID(),'_text_field_title_doc',true); $year_verd = get_post_meta(get_the_ID(),'_text_field_date_year',true); $link_verd = get_post_meta(get_the_ID(),'_text_field_link_doc',true); $urlhtml = str_replace('type=4','type=2',$link_verd); $returnes = exists_all($titla, $date_verd,get_the_ID(),$casetitle_verd,$year_verd,$urlhtml); print_r($returnes);*/ } wp_reset_postdata(); /*ignore_user_abort(true); $url = 'https://supremedecisions.court.gov.il/Home/SearchVerdicts'; $dt_from = date('Y-m-d\TH:i:s\.000\Z',time()-30*24*60*60); $dt_to = date('Y-m-d\TH:i:s\.000\Z',time()-0*24*60*60); $options = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":2,"value":2,"text":"פסק-דין"},{"parent":4,"value":4,"text":"צו על תנאי"}],"CodeTypes":[2,4],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":"1"}', ) ); $options2 = array( 'http' => array( 'header' => "Content-type: application/json;charset=UTF-8\r\n", 'method' => 'POST', 'content' => '{"document":{"Year":null,"Counsel":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"CaseNum":null,"Technical":null,"fromPages":null,"toPages":null,"dateType":1,"PublishFrom":"'.$dt_from.'","PublishTo":"'.$dt_to.'","publishDate":8,"translationDateType":1,"translationPublishFrom":"'.$dt_from.'","translationPublishTo":"'.$dt_to.'","translationPublishDate":8,"SearchText":[{"Text":"","textOperator":1,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Judges":null,"Parties":[{"Text":"","textOperator":2,"option":"2","Inverted":false,"Synonym":false,"NearDistance":3,"MatchOrder":false}],"Mador":null,"CodeMador":[],"TypeCourts":null,"TypeCourts1":null,"TerrestrialCourts":null,"LastInyan":null,"LastCourtsYear":null,"LastCourtsMonth":null,"LastCourtCaseNum":null,"Old":false,"JudgesOperator":2,"Judgment":null,"Type":[{"parent":1,"value":1,"text":"החלטה"}],"CodeTypes":[1],"CodeJudges":[],"Inyan":null,"CodeInyan":[],"AllSubjects":[{"Subject":null,"SubSubject":null,"SubSubSubject":null}],"CodeSub2":[],"Category1":null,"Category3":null,"CodeCategory3":[],"Volume":null,"Subjects":null,"SubSubjects":null,"SubSubSubjects":null},"lan":1}', ) ); $context = stream_context_create($options); $context2 = stream_context_create($options2); $result = @file_get_contents($url, false, $context); // <<<<<<<<<<<<<<<<==========вывод на экран $result2 = @file_get_contents($url, false, $context2); // <<<<<<<<<<<<<<<<==========вывод на экран $start_template_link = 'https://supremedecisions.court.gov.il/Home/Download?path=HebrewVerdicts\19\340\045\g01&fileName=19045340.G01&type=2'; $array_big_links = json_decode($result, true); $array_big_links2 = json_decode($result2, true); require_once ABSPATH . '/wp-content/themes/pdin/phpQuery.php'; require_once ABSPATH . 'wp-admin/includes/post.php'; foreach($array_big_links['data'] as $abl) { $exit_link = construction_link($abl['Path'], $abl['FileName'], 2); $exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); $TypeCode = $abl['TypeCode']; if($TypeCode == 1 || $TypeCode == 2) { if($TypeCode == 1) { $n_cat = array(17); } else if($TypeCode == 2) { $n_cat = array(18); } $array_add = array( 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'post_type' => 'product', 'post_title' => $abl['CaseName'] ); $is_nois = exists_all($abl['CaseName'], $abl['VerdictsDtString'],$abl['CaseDesc'],$abl['Year'],$exit_link); if($is_nois[0] == 'true') { print_r('Добавляй
'); } else { print_r('НЕДОБАВЛЯЙ ИВКОЕМ СЛУЧАЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕ
'); print_r($is_nois[1]); print_r($abl); } } } foreach($array_big_links2['data'] as $abl) { $exit_link = construction_link($abl['Path'], $abl['FileName'], 2); $exit_pdf = construction_pdf($abl['Path'], $abl['FileName'], 4); $TypeCode = $abl['TypeCode']; if($TypeCode == 1 || $TypeCode == 2) { if($TypeCode == 1) { $n_cat = array(17); } else if($TypeCode == 2) { $n_cat = array(18); } $array_add = array( 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'post_type' => 'product', 'post_title' => $abl['CaseName'] ); $is_nois = exists_all($abl['CaseName'], $abl['VerdictsDtString'],$abl['CaseDesc'],$abl['Year'],$exit_link); if($is_nois[0] == 'true') { print_r('Добавляй
'); } else { print_r('НЕДОБАВЛЯЙ ИВКОЕМ СЛУЧАЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕ
'); print_r($is_nois[1]); print_r($abl); } } }*/ //wp_footer(); ?>