Школоло / Говнокод #1258 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DBCtrls, DB, DBTables, Grids, DBGrids;

type
  TForm_magnituda = class(TForm)
    DataSource2: TDataSource;
    Table1: TTable;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    DBGrid1: TDBGrid;
    Table1Id: TStringField;
    Table1Data: TStringField;
    Table1Shirota: TStringField;
    Table1Dolgota: TStringField;
    Table1Magnituda: TStringField;
    Table1Glubina: TStringField;
    Table1Bal: TStringField;
    Table1Local: TStringField;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_magnituda: TForm_magnituda;

implementation
uses unit1;
{$R *.dfm}

procedure TForm_magnituda.Button1Click(Sender: TObject);
begin
form1.show;
form_magnituda.Hide;
end;

procedure TForm_magnituda.Button2Click(Sender: TObject);
begin
form_magnituda.Table1.Append;
end;

end.

guest guest, (Updated )

Комментарии (0)

Школоло / Говнокод #1257 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
unit form_view;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, Grids, DBGrids, DB, DBTables, StdCtrls, Mask, DBCtrls,
  ComCtrls;

type
  TF_view = class(TForm)
    MMenu: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    Table1: TTable;
    DataSource1: TDataSource;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    StatusBar1: TStatusBar;
    N4: TMenuItem;
    N5: TMenuItem;
    N12: TMenuItem;
    N13: TMenuItem;
    DBGrid1: TDBGrid;
    Button_next: TButton;
    Button_prior: TButton;
    Button_first: TButton;
    Button_last: TButton;
    Button_new: TButton;
    Table1Id: TStringField;
    Table1Data: TStringField;
    Table1Shirota: TStringField;
    Table1Dolgota: TStringField;
    Table1Magnituda: TStringField;
    Table1Glubina: TStringField;
    Table1Bal: TStringField;
    Table1Local: TStringField;
    procedure N1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure N11Click(Sender: TObject);
    procedure Button_firstClick(Sender: TObject);
    procedure Button_nextClick(Sender: TObject);
    procedure Button_priorClick(Sender: TObject);
    procedure Button_lastClick(Sender: TObject);
    procedure Button_newClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_view: TF_view;

implementation
uses unit2, form_poisk;
{$R *.dfm}

procedure TF_view.N1Click(Sender: TObject);
begin
close;
end;

procedure TF_view.Button2Click(Sender: TObject);
begin

form_magnituda.Show;
end;

procedure TF_view.N5Click(Sender: TObject);
begin
f_view.Hide;
form_magnituda.Show;
end;

procedure TF_view.N7Click(Sender: TObject);
begin
poisk.Show;
end;

procedure TF_view.N3Click(Sender: TObject);
begin
f_view.Table1.Active:=false;
f_view.Hide;
f_view.Show;
f_view.Button_next.Visible:=true;
f_view.Button_prior.Visible:=true;
f_view.Button_first.Visible:=true;
f_view.Button_last.Visible:=true;
f_view.Button_new.Visible:=false;
f_view.DBGrid1.Visible:=true;
f_view.StatusBar1.SimpleText:='           режим просмотра базы';

продолжение

guest guest, (Updated )

Комментарии (0)

Школоло / Говнокод #1256 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
unit vhod;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, DBTables, Grids, DBGrids, Mask, DBCtrls, jpeg,
  ExtCtrls, Menus;

type
  TForm_vhod = class(TForm)
    Image1: TImage;
    Label1: TLabel;
    Button_vhod: TButton;
    Button_vyhod: TButton;
    procedure Button_vhodClick(Sender: TObject);
    procedure Button_vyhodClick(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_vhod: TForm_vhod;

implementation
uses form_view;
{$R *.dfm}

procedure TForm_vhod.Button_vhodClick(Sender: TObject);
begin
f_view.Show;
end;

procedure TForm_vhod.Button_vyhodClick(Sender: TObject);
begin
close;
end;

end.

база данных

guest guest, (Updated )

Комментарии (0)

Яuбy / Говнокод #1255 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
def properties_file2hash(_property_file, _link_hash=nil)
    r_hash = Hash.new
    if _property_file &&  FileTest::exist?(_property_file)
      f = File::open(_property_file,'r')
      begin
        _lines = f.readlines
        _lines.each{|_line|
          _strip_line = _line.strip
          if (_strip_line.length > 0)&&(_strip_line[0,1]!='#')
            var_plat = _line.split('::')
            if var_plat.length > 1
              if (RUBY_PLATFORM.include?(var_plat[0]))
                _line = var_plat[1]
                var_plat[2..-1].collect{|x| _line=_line+'::'+x} if var_plat.length > 2
              else
                _line = ''
              end
            end
            var = _line.split('=')
            if var.length > 1
              _value = var[1].strip
              var[2..-1].collect{|x| _value=_value+'='+x} if var.length > 2
              if _link_hash 
                _value = resolve_link(_value, _link_hash)
              end
              r_hash[var[0].strip]=_value
            end
          end
        }
      ensure
        f.close unless f.nil?
      end
      return r_hash      
    end

Реальный кусок... Весь код проги(не моей)... ТАКОЙ.

guest guest, (Updated )

Комментарии (20, +20)

Змея / Говнокод #1254 Ссылка на оригинал

0

  1. 1
  2. 2
if (len(filter(lambda path: path == "../stubs", os.sys.path)) == 0):
    os.sys.path.insert(0, '../stubs')

Хитрая провека на то, нет ли уже "../stubs" в sys.path.

guest guest, (Updated )

Комментарии (5, +5)

"PHP" / Говнокод #1253 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
global $scan, $scan1, $scan2, $pri1, $pri2, $host, $i1, $hits;
global $server1, $server2;
global $item;
global $use_1, $term_1, $trun1, $bop_1;
global $use_2, $term_2, $trun2, $bop_2;
global $use_3, $term_3, $trun3, $bop_3;
global $use_4, $term_4, $trun4, $bop_4;
global $use_5, $term_5, $trun5, $bop_5;
$ver1=ord(substr(phpversion(),0,1))-48;
$ver2=ord(substr(phpversion(),2,1))-48;
$ver=$ver1*10+$ver2;
#echo $ver;
if ($ver>42)extract($_REQUEST);
if ($format == "1.2.840.10003.5.109.10") {
	$pri2=1;
	$pri1=1;
	$pxml=0;
}
 
if (($scan==tounicode("список"))||($scan1==tounicode("список"))||($scan2==tounicode("список")))
   {
        if (strlen($term_2)>0)
             {
                $term_1=$term_2;
                $use_1=$use_2;
             }
        if (strlen($term_3)>0)
             {
                $term_1=$term_3;
                $use_1=$use_3;
             }
        include("func.php");
        $target=$host[0];
        $field1="@attr 1=" . $use_1;
        $term1=$term_1;
        if (strlen($term1)==0)
/*            {
              echo "<title>z39.50</title><BODY bgcolor=FFFFE6 TEXT=000000 LINK=brown VLINK=brown topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><center><table width=70% border=1 cellpadding=25 cellspacing=0><td valign=top><font face='arial,helvetica' size=6 color=#333333>Шлюз Z39.50</font><hr><font color=brown><p><b>Для просмотра списка введите, пожалуйста, первую букву поискового терма<p><br><a href='javascript:history.back()'><img src=back.gif border=0></A></td></table>";
              exit;
            }  */
              {
                $term_1='0';
                $term1=$term_1;
              }
        $syntax="RUSMarc";
        $element="F";
        $number=15;
?>

guest guest, (Updated )

Комментарии (0)

"PHP" / Говнокод #1252 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
unction int2hex($intega){
   $Ziffer = "0123456789ABCDEF";
return $Ziffer[($intega%256)/16].$Ziffer[$intega%16];
}

function url_encode($text){
   $text = urlencode($text);
   if(!strpos($text,"%C3"))
       for($i=129;$i<255;$i++){
           $in = "%".int2hex($i);
           $out = "%C3%".int2hex($i-64);
           $text = str_replace($in,$out,$text);
       }
return $text;
}

function tounicode ($string){
$unistring="";
for($i=0;$i<strlen($string);$i++){
	$current=$string[$i];
	$codcurrent=ord($current);
	if($codcurrent>255):
       		$unicurrent=utf8_encode($current);
		$unistring=$unistring.$unicurrent;
	elseif($codcurrent<192):
		if($codcurrent==184):
                       $unicurrent=chr(209).chr($codcurrent-39);
                       $unistring=$unistring.$unicurrent;
		elseif($codcurrent==168):
                       $unicurrent=chr(208).chr($codcurrent-39);
                       $unistring=$unistring.$unicurrent;
		elseif($codcurrent==147):
				$unicurrent=utf8_encode("\"");
                        $unistring=$unistring.$unicurrent;
		elseif($codcurrent==148):
				$unicurrent=utf8_encode("\"");
                        $unistring=$unistring.$unicurrent;
		elseif($codcurrent==151):
				$unicurrent=utf8_encode("-");
                        $unistring=$unistring.$unicurrent;
		
		else:
              		$unicurrent=utf8_encode($current);
               		$unistring=$unistring.$unicurrent;
		endif;
	
	else:
		if ($codcurrent<240):
			$unicurrent=chr(208).chr($codcurrent-48);
			$unistring=$unistring.$unicurrent;
		else:
			$unicurrent=chr(209).chr($codcurrent-112);
			$unistring=$unistring.$unicurrent;
		endif;
		
	endif;
}
return $unistring;
}

guest guest, (Updated )

Комментарии (1, +1)

"PHP" / Говнокод #1251 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
<?
ob_start();
session_start();
include("includes/applicationTop.php");
?>
<?
if($_SESSION["CONTACT_ID"]=="" || $_SESSION["CONTACT_ID"]==0)
{
	$contact_id=$_GET['contact_id'];
}
else
{
	$contact_id = $_SESSION["CONTACT_ID"];
}
if($_SESSION["ORDER_ID"]=="" || $_SESSION["ORDER_ID"]==0)
{
	$order_id=$_GET['order_id'];
}
else
{
	$order_id = $_SESSION["ORDER_ID"];
}

$selBillingInfo = "SELECT * FROM `contact` WHERE `contact_id`='".$contact_id."'";
$resBillingInfo = $db->select_data($selBillingInfo);
$selOrderInfo = "SELECT * FROM `order` WHERE `order_id`='".$order_id."'";
$resOrderInfo = $db->select_data($selOrderInfo);
?>
<? $exesql=mysql_query("select * from admin_updation where id = 1"); 
$rs=mysql_fetch_object($exesql); $to_mail=$rs->paypal_id;?> 
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td width="30"><img src="images/spacer.gif" width="30" height="1" /></td>
	<td><form class="formclass" method="post" action="https://www.paypal.com/cgi-bin/webscr"  id="myform" name="theForm" ><!--<form class="formclass" method="post" action="https://www.paypal.com/cgi-bin/webscr"  id="myform" name="theForm" >-->
		<input name="validate" value="1" type="hidden">
		<input type="hidden" name="order_id" value="<?=$order_id?>" />
		<?
		$paypal[site_url]="http://говносайт";
		$paypal[success_url]="/paymentReceipt.php?success=paypal&pt=paypal&contact_id=$contact_id&order_id=$order_id";
		$paypal[cancel_url]="/paymentReceipt.php?success=failed&pt=paypal&contact_id=$contact_id&order_id=$order_id";
		$paypal[notify_url]="/ipn/ipn.php";
		$paypal[return_method]="2"; //1=GET 2=POST
		$paypal[currency_code]="USD"; //[USD,GBP,JPY,CAD,EUR]
		$paypal[lc]="US";
		$paypal[url]="https://www.sandbox.paypal.com/cgi-bin/webscr"; // For Test 
		$paypal[post_method]="fso"; //fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
		$paypal[curl_location]="/usr/local/bin/curl";
		$paypal[bn]="toolkit-php";
		$paypal[cmd]="_xclick";
		$paypal[display_comment]="0"; //0=yes 1=no
		$paypal[comment_header]="Comments";
		$paypal[continue_button_text]="Continue >>";
		$paypal[background_color]="1"; //""=white 1=black
		$paypal[display_shipping_address]="1"; //""=yes 1=no
		$paypal[display_comment]="1"; //""=yes 1=no
		?>
		<!--<input type="hidden" name="business" value="manentang@gmail.com">--><? // For Live ?>
		
		<input type="hidden" name="business" value="<?=$to_mail?>"><? // For Test ?>
		<!--<input type="hidden" name="business" value="prashant_sonwane@rediffmail.com">--><? // For Test ?>
		<input type="hidden" name="item_name" value="Говнобрэнд">
		<input type="hidden" name="cmd" value="<?=$paypal[cmd]?>">
		<input type="hidden" name="redirect_cmd" value="<?=$paypal[cmd]?>">
		<input type="hidden" name="image_url" value="">
		<input type="hidden" name="return" value="<? echo "$paypal[site_url]$paypal[success_url]"; ?>">
		<input type="hidden" name="cancel_return" value="<? echo "$paypal[site_url]$paypal[cancel_url]"; ?>">
		<input type="hidden" name="notify_url" value="<? echo "$paypal[site_url]$paypal[notify_url]"; ?>">
		<input type="hidden" name="rm" value="<?=$paypal[return_method]?>">
		<input type="hidden" name="currency_code" value="<?=$paypal[currency_code]?>">
		<input type="hidden" name="lc" value="<?=$paypal[lc]?>"><input type="hidden" name="bn" value="<?=$paypal[bn]?>">
		<input type="hidden" name="cbt" value="<?=$paypal[continue_button_text]?>"><input type="hidden" name="no_shipping" value="<?=$paypal[display_shipping_address]?>">
		<input type="hidden" name="no_note" value="<?=$paypal[display_comment]?>">
		<input type="hidden" name="order_id" value="<?=$order_id?>"><input type="hidden" name="amount" value="<?=$resOrderInfo[0]['amount']?>">
		<input type="hidden" name="first_name" value="<?=$resBillingInfo[0]['first_name']?>">	<input type="hidden" name="last_name" value="<?=$resBillingInfo[0]['last_name']?>">
		<input type="hidden" name="company" value="<?=$resBillingInfo[0]['company']?>"><input type="hidden" name="address" value="<?=$resBillingInfo[0]['address']?>">
		<input type="hidden" name="city" value="<?=$resBillingInfo[0]['city']?>"><input type="hidden" name="state" value="<?=$resBillingInfo[0]['state']?>">
		<input type="hidden" name="zip" value="<?=$resBillingInfo[0]['zip']?>">
		<input type="hidden" name="country" value="<?=$resBillingInfo[0]['country']?>">
		<input type="hidden" name="phone" value="<?=$resBillingInfo[0]['phone']?>"> 	<input type="hidden" name="email " value="<?=$resBillingInfo[0]['email']?>">	<input type="hidden" name="a3" value="<?=$resOrderInfo[0]['amount']?>">
		<input type="hidden" name="p3" value="1">	<input type="hidden" name="t3" value="M"> <input type="hidden" name="no_note" value="1">
		<input type="hidden" name="src" value="1"><input type="hidden" name="sra" value="1">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="text_body"> </td>
		  </tr>
		  <tr>
			<td align="left"></td>
		  </tr>
		</table>
	  </form></td>
	<td width="15"><img src="images/spacer.gif" width="15" height="1" /></td>
  </tr>
</table>
<script language="JavaScript">
objfrm = document.getElementById("myform");
objfrm.submit();
</script>

А вот занятный способ переброса посетителя на paypal.
С помощью невидимой формы, который сама засабмитится (может быть).

Источник тот же, что у #1244-#1245, #1248-#1250

guest guest, (Updated )

Комментарии (8, +8)