One Hat Cyber Team
Your IP :
216.73.216.24
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
nosc
/
public_html
/
admin
/
Edit File:
browse_action.php
<? $page_title="Administration centre: action"; require("header.php"); require("../auth/auth.php3"); echo "<body>"; require("defs_authors.php3"); $db_handle = mysql_connect($host, $user, $password); switch ($what_todo) { case "envelope": echo "<H1>Printing the envelopes for the selected authors</H1>"; //=============== if ($selected) { //something selected while (list($key,$val)=each($selected)) { //echo "key=$key, val=$val<br>"; $res = mysql_db_query($database,"select id,last_name,title, first_name, middle_name, city, street, postal_code, country, affiliation from Authors where id='$key' order by last_name,first_name"); while ($entry = mysql_fetch_array($res) ) { if ($fp = fopen("envelope.tex", "w" )) {//file fwrite($fp,"\documentclass[12pt,a4paper,twocolumn]{article} \usepackage{mathptm} \pagestyle{empty} \begin{document} \\thispagestyle{empty} \vspace*{20mm} \vfill \Large"); fwrite($fp, "\hskip 8cm\begin{minipage}[htc]{14cm} \begin{center}"); fwrite($fp,"$entry[title] $entry[first_name] $entry[middle_name] $entry[last_name]\par $entry[affiliation]\par $entry[street]\par $entry[postal_code] $entry[city]\par \\textsc {{$entry[country]}}"); fwrite($fp, "\end{center} \end{minipage} "); } //file fwrite($fp, "\end{document}"); fclose($fp); echo "<div>"; $page++; echo "<em>Page $page</em><br>"; echo "<p>Making the DVi file for entry no. $entry[id]...</p>"; echo "<code>"; system("latex envelope.tex", $retcode); echo "</code>"; echo "Done."; echo "<p>Making the PostScript & printing...</p>"; /* echo "<code>"; system("dvips -f labels.dvi -o envelope.ps", $retcode); echo "</code>"; echo "Done."; */ echo "<code>"; system("dvips -f envelope.dvi -t landscape |$print_command", $retcode); echo "</code>"; echo "Done."; //$id= $entry[id]; //echo "<br>id =$id; selectedid=$selected[$id]"; echo "</div>"; }//entry } //now tell what has actually been done echo "<div class=success><center>Total $page pages printed using the command \"$print_command\"</center></div>"; } else { //nothing selected echo "<div class=dark><center>The selection is empty---nothing to do.</center></div>"; } break; case "letter": $max_title_chars=30; //$db_handle = mysql_connect($host, $user, $password); //browse the letters table echo "<h1>Composing/choosing/sending a letter to the following authors:</h1>"; echo "<div><center>"; $ind=0; while(list($key,$val) = each($selected)) { $selected_indices[] = $key; $ind++; $q_ptr = mysql_db_query($database,"select id,last_name, first_name, middle_name, city from Authors where id='$key' order by last_name,first_name,city"); $q = mysql_fetch_array($q_ptr); echo "<B>$ind.</B>  <em>$q[first_name] $q[middle_name] $q[last_name]  ($q[city]) </em>"; } echo "<br><hr> Total $ind addressees."; echo "</center></div>"; echo "<h1>Letters table</h1>"; $res = mysql_db_query($database,"select id,text,subject, date from Letters order by date"); echo "<div>"; echo "<center>"; echo "<form method=\"POST\" action=\"browse_letters_action.php3\">"; echo "<select name=\"id_selected\" size=7>\n"; if ($res) {//res while($row = mysql_fetch_array($res)) { $short_text=substr($row[text],0,$max_title_chars); print("<option value=\"$row[id]\">no. $row[id] [$row[subject]], \"$short_text\", $row[date]</option>\n"); } print("</select><br>\n"); echo "</center></div>"; echo "<div class=success><DL><DT><h3>Choose an action</h3>"; echo "<DD><input checked type=\"radio\" name=todo value=\"modify\"> Modify an old letter   "; echo "<DD><input type=\"radio\" name=todo value=\"add\">Write a new letter\n   "; echo "<DD><input type=\"radio\" name=todo value=\"addcopy\"> Write a letter using an old one as a template\n"; echo "</DL>"; echo "</div> "; echo "<input type=hidden name=\"selected[19]\" value=\"$selected[19]\"> "; //try to pass further the array $selected: //while(list($key,$val) = each($selected)) while ($i = current($selected_indices)) { // echo ".. passing '$selected[$i]' as 'selected[$i]' <br>"; echo "<input type=hidden name=selected[$i]\" value=\"$selected[$i]\"> "; next($selected_indices); } echo "<center><input type=\"submit\" value=\"Proceed\"> </center>\n"; print("</form>"); echo "</div>"; }//res break; case "labels": //echo $selected[10]; if ($selected) { //something selected echo "<h1>Producing the little envelope labels</h1>"; echo "<p>Generating the file..."; if (!is_writeable("labels.tex")) echo "not writeable!"; if ($fp = fopen("labels.tex", "w" )) { //file $text = "\documentclass[12pt,a4paper]{article} \usepackage{mathptm} \usepackage[czech,british]{babel} \pagestyle{empty} \begin{document} \\thispagestyle{empty} \large"; echo "."; while (list($key,$val)=each($selected)) { //echo "key=$key, val=$val<br>"; echo "<center>Processing entry no. $key...]</center>"; $res = mysql_db_query($database,"select id, last_name, title, first_name, middle_name,city, street,state postal_code, country, affiliation from Authors where id='$key' order by last_name,first_name,city"); // if(!$res) die(mysql_error("MySQL error")); echo "<div>"; while ($entry = mysql_fetch_array($res)) { //entry $text=$text."\begin{minipage}[htc]{12cm} \begin{center}"; $text=$text."$entry[title]~$entry[first_name] $entry[middle_name] $entry[last_name]\par $entry[affiliation]\par "; if ($entry[street]) $text=$text."$entry[street]\par "; if ($entry[state]) $text=$text."$entry[state], "; $text=$text."$entry[postal_code]~$entry[city]\par \sc $entry[country]"; echo "."; $text=$text."\end{center} \end{minipage} \vskip 1cm \dotfill \bigskip "; echo "."; } } //browse selected }//file $text=$text."\end{document}"; echo "."; fwrite($fp,$text); fclose($fp); echo ". Done."; } //if selected echo "</div>"; echo "<div>"; echo "<p>Making the DVi file...</p>"; echo "<code>"; print nl2br(system("latex labels.tex", $retcode)); echo "</code>"; echo "</div>"; echo "<div>"; echo "<p>Making the PDF file...</p>"; echo "<code>"; print nl2br(system("pdflatex labels.tex", $retcode)); echo "</code>"; echo "</div>"; echo "<div>"; echo "<p>Making the PostScript...</p>"; echo "<code>"; print nl2br(system("dvips -f labels.dvi | $print_command ", $retcode)); echo "</code>"; echo "</div>"; echo "<div>"; $print_what="labels.ps"; echo "<div> Done: <a href=labels.pdf>labels.pdf</a></div>"; //to be ajusted! /* echo "The <a href=labels.ps>PostScript file</a> has been produced. <form action=run_something.php3><input type=hidden name=print_what> You can <input type=submit value=print> it now by using the print command <input type=text name=something value=\"lpr -Plp314\"> </form>"; */ echo "Done!"; echo "</div>"; break; } require("footer.php3"); ?> </body> </html>
Simpan