function my_print_r_toggle($html_id, $array) { echo "<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"collapse\" data-target=\"#" . $html_id . "\">details</button>"; echo "<div id=\"" . $html_id . "\" class=\"collapse out\">"; my_print_r($array); echo "</div>\n"; }
function f5() { $c = extract(array("111" => 1), EXTR_PREFIX_ALL, "prefix"); echo "Extracted:"; var_dump($c); my_print_r(get_defined_vars()); }
my_echo_title('Response for a text Internet search with full comparisons for the first two results'); my_print_r(copyscape_api_text_search_internet($exampletext, 'ISO-8859-1', 2)); my_echo_title('Response for a check balance request'); my_print_r(copyscape_api_check_balance()); my_echo_title('Response for a URL add to private index request'); my_print_r(copyscape_api_url_add_to_private('http://www.copyscape.com/example.html')); my_echo_title('Response for a text add to private index request'); $response = copyscape_api_text_add_to_private($exampletext, 'ISO-8859-1', 'Extract from Declaration of Independence', 'EXAMPLE_1234'); my_print_r($response); $handle = $response['handle']; my_echo_title('Response for a URL private index search'); my_print_r(copyscape_api_url_search_private('http://www.copyscape.com/example.html')); my_echo_title('Response for a delete from private index request'); my_print_r(copyscape_api_delete_from_private($handle)); my_echo_title('Response for a text search of both Internet and private index with full comparisons for the first result (of each type)'); my_print_r(copyscape_api_text_search_internet_and_private($exampletext, 'ISO-8859-1', 1)); } function my_echo_title($title) { echo '<P><BIG><B>' . htmlspecialchars($title) . ':</B></BIG></P>'; flush(); } function my_print_r($variable) { echo '<PRE>' . htmlspecialchars(print_r($variable, true)) . '</PRE><HR>'; flush(); } /* E. Functions used internally */ function copyscape_api_url_search($url, $full = null, $operation = 'csearch')
/** * Affiche le tableau à la façon de print_r ou l ecrit dans un fichier * @Parametres tableau * @Return */ function my_print_r($tab) { global $echo_file, $dest_mode; my_echo("Array<br />(<br />\n"); my_echo("<blockquote>\n"); foreach($tab as $key => $value) { if(is_array($value)) { my_echo("[$key] => "); my_print_r($value); } else { my_echo("[$key] => $value<br />\n"); } } my_echo("</blockquote>\n"); my_echo(")<br />\n"); }
private function getFormData($values, $path_rew_new = '', $path_rew_old = '', $repeat = 0) { $this->tree_run++; if ($this->debug) { echo "<hr>"; } if ($this->debug) { echo "BEGIN getFormData level_run=" . $this->tree_run . ", path_rew_new={$path_rew_new}, path_rew_old={$path_rew_old}<br>"; } if ($this->debug) { my_print_r($this->tree_level); } if ($this->debug) { my_print_r($this->repeat); } if ($this->debug) { echo "<hr>"; } $record = array(); $repeat_first = TRUE; // my_print_r($this->md_langs); if (is_array($values) && count($values) > 0) { foreach ($values as $row) { foreach ($this->md_langs as $key => $md_lang) { $end_div = array(); if ($this->debug) { echo "<strong>MD_ID=" . $row['MD_ID'] . ' [' . $this->md_langs[$key] . '] ' . $row['LABEL_TEXT'] . ", level=" . $row['MD_LEVEL'] . ", form_code=" . $row['FORM_CODE'] . "</strong><br>"; } if ($this->debug) { echo "11111"; my_print_r($this->tree_level); } if ($key > 0 && $row['MULTI_LANG'] == 0) { continue; } if ($row['FORM_IGNORE'] == 1) { $this->setTreeLevel($this->tree_run, $row['MD_LEVEL'], 0); continue; } if ($key == 0) { $end_div = $this->getRepeat($this->tree_run, $row['MD_LEVEL']); if ($this->debug) { echo "end_div="; my_print_r($end_div); } $record['end_div'] = $this->getTreeLevel($this->tree_run, $row['MD_LEVEL']); } else { $record['end_div'] = array(); } if (count($end_div) > 0 && $key == 0) { $record['end_div'] = array_merge($record['end_div'], $end_div); } $record['start_div'] = 1; if ($this->debug) { echo "22222"; my_print_r($this->tree_level); } if ($row['ONLY_VALUE'] == 0 && $key == 0) { $this->setTreeLevel($this->tree_run, $row['MD_LEVEL']); } if ($this->debug) { echo "33333"; my_print_r($this->tree_level); } $this->setRadioButton($this->tree_run, $row['FORM_CODE'], $row['MD_LEVEL']); $record['md_path'] = $row['MD_PATH']; if ($this->tree_run > 1 && $path_rew_old != '' && $path_rew_new != '') { $record['md_path'] = str_replace($path_rew_old, $path_rew_new, $record['md_path']); } $record['next_lang'] = $key == 0 ? 0 : 1; $record['pack'] = $this->getFormPack($this->tree_run, $row['FORM_PACK'], $row['MD_LEVEL'], $record['md_path']); $record['md_id'] = $row['MD_ID']; if ($repeat_first === TRUE) { $record['repeat'] = $repeat; $repeat_first = FALSE; } else { $record['repeat'] = 0; } //$record['repeat'] = $repeat; $record['package_id'] = $row['PACKAGE_ID']; $record['el_id'] = $row['EL_ID']; $record['value_lang'] = $row['MULTI_LANG'] == 1 ? $md_lang : 'xxx'; $record['rb'] = 0; if ($row['FORM_CODE'] == 'R') { // RADIOBUTTON $pom = $this->getRadioButton($this->tree_run, $row['MD_LEVEL'], $row['MD_ID'], $record['md_path']); $record['form_code'] = 'R'; $record['rb'] = 1; $record['rb_id'] = $pom['rb_id']; $record['rb_checked'] = $pom['rb_checked']; } if ($row['MD_LEFT'] == $row['MD_RIGHT'] - 1) { // DATA $pom = $this->getFormCode($row['FORM_CODE'], $row['FROM_CODELIST'], $row['EL_ID'], $record['value_lang'], $record['md_path']); $record['form_code'] = $pom['form_code']; $record['value'] = $pom['value']; } else { // LABEL $record['form_code'] = $row['FORM_CODE'] == 'R' ? 'R' : 'L'; $record['value'] = ''; } $record['mandt_code'] = $row['MANDT_CODE']; $record['inspire_code'] = $row['INSPIRE_CODE']; $record['label'] = $row['LABEL_TEXT']; $record['help'] = $row['LABEL_HELP']; $record['max_nb'] = $row['MAX_NB']; // Opakování if ($row['MAX_NB'] == '' && $key == 0) { //if ($row['MAX_NB'] == '') { $this->setNewRepeat($this->tree_run, $record['md_path'], $row['MD_PATH'], $row['MD_ID'], $row['MD_LEVEL']); } $pom = $this->getButtonExe(trim($row['BUTTON_EXE'])); $record['button_text'] = $pom['text']; $record['button_action'] = $pom['action']; if ($row['ONLY_VALUE'] == 1) { $idx = count($this->form_data) - 1; $this->form_data[$idx]['form_code'] = $record['form_code']; $this->form_data[$idx]['value'] = $record['value']; $this->form_data[$idx]['md_path'] = $record['md_path']; //$rs[$idx]['el_id'] = $record['el_id']; } else { array_push($this->form_data, $record); } } } } if ($this->debug) { my_print_r($this->tree_level); } if ($this->debug) { echo "================== E N D E =====================================================<br>"; } $this->tree_run--; }
my_echo("</tr>\n"); } my_echo("</table>\n"); } my_echo("</td>\n"); my_echo("</tr>\n"); $cpt++; } my_echo("</table>\n"); if($chrono=='y') {my_echo("<p>Fin de l'opération: ".date_et_heure()."</p>\n");} my_echo("</blockquote>\n"); if($debug_import_comptes=='y') { my_echo("DEBUG_PROFbis_1<br /><pre style='color:green'><b>prof</b><br />\n"); my_print_r($prof); my_echo("</pre><br />DEBUG_PROFbis_2<br />\n"); } $temoin_au_moins_une_matiere=""; $temoin_au_moins_un_prof=""; // Affichage des infos Enseignements et divisions: //my_echo("<a name='divisions'></a><h3>Affichage des divisions</h3>\n"); //my_echo("<a name='divisions'></a><h5>Affichage des divisions</h5>\n"); my_echo("<a name='divisions'></a><h5>Affichage des divisions"); if($chrono=='y') {my_echo(" (<i>".date_et_heure()."</i>)");} my_echo("</h5>\n"); my_echo("<blockquote>\n"); for($i=0;$i<count($divisions);$i++) { //my_echo("<p>\$divisions[$i][\"code\"]=".$divisions[$i]["code"]."<br />\n"); //my_echo("<h4>Classe de ".$divisions[$i]["code"]."</h4>\n");