Advertisement
MixyPro

Kod za sveeeeeeeee

Jan 8th, 2015
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 21.28 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, jpeg, ExtCtrls, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ComboBox1: TComboBox;
  12.     RadioGroup1: TRadioGroup;
  13.     RadioGroup2: TRadioGroup;
  14.     RadioGroup3: TRadioGroup;
  15.     RadioGroup4: TRadioGroup;
  16.     GroupBox1: TGroupBox;
  17.     Image1: TImage;
  18.     Image2: TImage;
  19.     Image3: TImage;
  20.     Image4: TImage;
  21.     ComboBox2: TComboBox;
  22.     RadioGroup5: TRadioGroup;
  23.     Button1: TButton;
  24.     GroupBox2: TGroupBox;
  25.     Image5: TImage;
  26.     Button2: TButton;
  27.     Image6: TImage;
  28.     Image7: TImage;
  29.     Image8: TImage;
  30.     Label1: TLabel;
  31.     Label3: TLabel;
  32.     Label2: TLabel;
  33.     Button3: TButton;
  34.     Label4: TLabel;
  35.     Label5: TLabel;
  36.     Label6: TLabel;
  37.     Label7: TLabel;
  38.     Panel1: TPanel;
  39.     RadioGroup6: TRadioGroup;
  40.     RadioGroup7: TRadioGroup;
  41.     CheckBox1: TCheckBox;
  42.     Label8: TLabel;
  43.     Label9: TLabel;
  44.     Label10: TLabel;
  45.     Label11: TLabel;
  46.     Label12: TLabel;
  47.     Label13: TLabel;
  48.     Label14: TLabel;
  49.     Panel2: TPanel;
  50.     Label15: TLabel;
  51.     Label16: TLabel;
  52.     Label17: TLabel;
  53.     Label18: TLabel;
  54.     Label19: TLabel;
  55.     Label20: TLabel;
  56.     Label21: TLabel;
  57.     Panel3: TPanel;
  58.     Label22: TLabel;
  59.     Label23: TLabel;
  60.     Label24: TLabel;
  61.     Label25: TLabel;
  62.     Label26: TLabel;
  63.     Label27: TLabel;
  64.     Label28: TLabel;
  65.     CheckBox2: TCheckBox;
  66.     Button4: TButton;
  67.     Label29: TLabel;
  68.     Label30: TLabel;
  69.     procedure ComboBox1Change(Sender: TObject);
  70.     procedure RadioGroup2Click(Sender: TObject);
  71.     procedure RadioGroup3Click(Sender: TObject);
  72.     procedure RadioGroup1Click(Sender: TObject);
  73.     procedure RadioGroup4Click(Sender: TObject);
  74.     procedure RadioGroup5Click(Sender: TObject);
  75.     procedure Button1Click(Sender: TObject);
  76.     procedure Button2Click(Sender: TObject);
  77.     procedure Button3Click(Sender: TObject);
  78.     procedure RadioGroup6Click(Sender: TObject);
  79.     procedure RadioGroup7Click(Sender: TObject);
  80.     procedure CheckBox1Click(Sender: TObject);
  81.     procedure CheckBox2Click(Sender: TObject);
  82.     procedure Button4Click(Sender: TObject);
  83.   private
  84.     { Private declarations }
  85.   public
  86.     { Public declarations }
  87.   end;
  88.  
  89. var
  90.   Form1: TForm1;
  91. zv, zv1, zv2, da:real;
  92. x:string;
  93. i:integer;
  94. implementation
  95.  
  96. {$R *.dfm}
  97.  
  98. procedure TForm1.ComboBox1Change(Sender: TObject);
  99. begin
  100. Case ComboBox1.ItemIndex of
  101. 0: begin
  102. Label8.Caption:='';
  103. Label9.Caption:='';
  104. Label10.Caption:='';
  105. Label11.Caption:='';
  106. Label12.Caption:='';
  107. Label13.Caption:='';
  108. Label14.Caption:='';
  109. Label15.Caption:='';
  110. Label16.Caption:='';
  111. Label17.Caption:='';
  112. Label18.Caption:='';
  113. Label19.Caption:='';
  114. Label20.Caption:='';
  115. Label21.Caption:='';
  116. Label22.Caption:='';
  117. Label23.Caption:='';
  118. Label24.Caption:='';
  119. Label25.Caption:='';
  120. Label26.Caption:='';
  121. Label27.Caption:='';
  122. Label28.Caption:='';
  123. Image1.Visible:=false;
  124. Image2.Visible:=true;
  125. Image3.Visible:=false;
  126. Image4.Visible:=false;
  127. Image5.Visible:=false;
  128. Image6.Visible:=false;
  129. Image7.Visible:=false;
  130. Image8.Visible:=false;
  131. RadioGroup1.Visible:=true;
  132. RadioGroup2.Visible:=true;
  133. RadioGroup3.Visible:=false;
  134. RadioGroup4.Visible:=false;
  135. RadioGroup5.Visible:=false;
  136. ComboBox2.Top:=144;
  137. RadioGroup1.ItemIndex:=-1;
  138. RadioGroup2.ItemIndex:=-1;
  139. RadioGroup3.ItemIndex:=-1;
  140. RadioGroup4.ItemIndex:=-1;
  141. RadioGroup5.ItemIndex:=-1;
  142. Label1.Visible:=false;
  143. Label2.Visible:=false;
  144. Label3.Visible:=false;
  145. GroupBox2.Visible:=false;  
  146. RadioGroup7.Visible:=false;
  147. end;
  148. 1: begin
  149. Label8.Caption:='';
  150. Label9.Caption:='';
  151. Label10.Caption:='';
  152. Label11.Caption:='';
  153. Label12.Caption:='';
  154. Label13.Caption:='';
  155. Label14.Caption:='';
  156. Label15.Caption:='';
  157. Label16.Caption:='';
  158. Label17.Caption:='';
  159. Label18.Caption:='';
  160. Label19.Caption:='';
  161. Label20.Caption:='';
  162. Label21.Caption:='';
  163. Label22.Caption:='';
  164. Label23.Caption:='';
  165. Label24.Caption:='';
  166. Label25.Caption:='';
  167. Label26.Caption:='';
  168. Label27.Caption:='';
  169. Label28.Caption:='';
  170. Image1.Visible:=true;
  171. Image2.Visible:=false;
  172. Image3.Visible:=false;
  173. Image4.Visible:=false;
  174. Image5.Visible:=false;
  175. Image6.Visible:=false;
  176. Image7.Visible:=false;
  177. Image8.Visible:=false;
  178. RadioGroup1.Visible:=true;
  179. RadioGroup2.Visible:=true;
  180. RadioGroup3.Visible:=false;
  181. RadioGroup4.Visible:=false;
  182. RadioGroup5.Visible:=false;
  183. ComboBox2.Top:=144;
  184. RadioGroup1.ItemIndex:=-1;
  185. RadioGroup2.ItemIndex:=-1;
  186. RadioGroup3.ItemIndex:=-1;
  187. RadioGroup4.ItemIndex:=-1;
  188. RadioGroup5.ItemIndex:=-1;
  189. Label1.Visible:=false;
  190. Label2.Visible:=false;
  191. Label3.Visible:=false;
  192. GroupBox2.Visible:=false;    
  193. RadioGroup7.Visible:=false;
  194. end;
  195. 2: begin
  196. Label8.Caption:='';
  197. Label9.Caption:='';
  198. Label10.Caption:='';
  199. Label11.Caption:='';
  200. Label12.Caption:='';
  201. Label13.Caption:='';
  202. Label14.Caption:='';  
  203. Label15.Caption:='';
  204. Label16.Caption:='';
  205. Label17.Caption:='';
  206. Label18.Caption:='';
  207. Label19.Caption:='';
  208. Label20.Caption:='';
  209. Label21.Caption:='';
  210. Label22.Caption:='';
  211. Label23.Caption:='';
  212. Label24.Caption:='';
  213. Label25.Caption:='';
  214. Label26.Caption:='';
  215. Label27.Caption:='';
  216. Label28.Caption:='';
  217. Image1.Visible:=false;
  218. Image2.Visible:=false;
  219. Image3.Visible:=true;
  220. Image4.Visible:=false;
  221. Image5.Visible:=false;
  222. Image6.Visible:=false;
  223. Image7.Visible:=false;
  224. Image8.Visible:=false;
  225. RadioGroup1.Visible:=true;
  226. RadioGroup2.Visible:=true;
  227. RadioGroup3.Visible:=false;
  228. RadioGroup4.Visible:=false;
  229. RadioGroup5.Visible:=false;
  230. ComboBox2.Top:=144;
  231. RadioGroup1.ItemIndex:=-1;
  232. RadioGroup2.ItemIndex:=-1;
  233. RadioGroup3.ItemIndex:=-1;
  234. RadioGroup4.ItemIndex:=-1;
  235. RadioGroup5.ItemIndex:=-1;
  236. Label1.Visible:=false;
  237. Label2.Visible:=false;
  238. Label3.Visible:=false;
  239. GroupBox2.Visible:=false;
  240. RadioGroup7.Visible:=false;
  241. end;
  242. 3: begin  
  243. Label8.Caption:='';
  244. Label9.Caption:='';
  245. Label10.Caption:='';
  246. Label11.Caption:='';
  247. Label12.Caption:='';
  248. Label13.Caption:='';
  249. Label14.Caption:='';  
  250. Label15.Caption:='';
  251. Label16.Caption:='';
  252. Label17.Caption:='';
  253. Label18.Caption:='';
  254. Label19.Caption:='';
  255. Label20.Caption:='';
  256. Label21.Caption:='';
  257. Label22.Caption:='';
  258. Label23.Caption:='';
  259. Label24.Caption:='';
  260. Label25.Caption:='';
  261. Label26.Caption:='';
  262. Label27.Caption:='';
  263. Label28.Caption:='';
  264. Image1.Visible:=false;
  265. Image2.Visible:=false;
  266. Image3.Visible:=false;
  267. Image4.Visible:=true;
  268. Image5.Visible:=false;
  269. Image6.Visible:=false;
  270. Image7.Visible:=false;
  271. Image8.Visible:=false;
  272. RadioGroup1.Visible:=false;
  273. RadioGroup2.Visible:=false;
  274. RadioGroup3.Visible:=false;
  275. RadioGroup4.Visible:=false;
  276. RadioGroup1.ItemIndex:=-1;
  277. RadioGroup2.ItemIndex:=-1;
  278. RadioGroup3.ItemIndex:=-1;
  279. RadioGroup4.ItemIndex:=-1;
  280. RadioGroup5.ItemIndex:=-1;
  281. ComboBox2.Top:=144;
  282. Label1.Visible:=false;
  283. Label2.Visible:=false;
  284. Label3.Visible:=false;
  285. GroupBox2.Visible:=false;
  286. RadioGroup7.Visible:=true;
  287. end;
  288. end;
  289. end;
  290. procedure TForm1.RadioGroup2Click(Sender: TObject);
  291. begin
  292. Label8.Caption:='00:45h';
  293. Label9.Caption:='05:00h';
  294. Label10.Caption:='06:45h';
  295. Label11.Caption:='12:00h';
  296. Label12.Caption:='18:00h';
  297. Label13.Caption:='21:00h';
  298. Label14.Caption:='23:30h';
  299. Case RadioGroup2.ItemIndex of
  300. 4,3,2: begin
  301. GroupBox2.Top:=256;
  302. Panel2.Visible:=true;
  303. Panel3.Visible:=false;
  304. Label15.Caption:='06:00h';
  305. Label16.Caption:='';
  306. Label17.Caption:='07:30h';
  307. Label18.Caption:='';
  308. Label19.Caption:='09:00h';
  309. Label20.Caption:='';
  310. Label21.Caption:='12:00h';
  311. Label22.Caption:='13:45h';
  312. Label23.Caption:='';
  313. Label24.Caption:='15:00h';
  314. Label25.Caption:='';
  315. Label26.Caption:='17:00h';
  316. Label27.Caption:='';
  317. Label28.Caption:='19:00h';
  318. end;
  319. 1, 0:begin
  320. GroupBox2.Top:=344;
  321. Panel2.Visible:=true;
  322. Panel3.Visible:=true;
  323. Label15.Caption:='06:00h';
  324. Label16.Caption:='06:30';
  325. Label17.Caption:='07:30h';
  326. Label18.Caption:='08:00h';
  327. Label19.Caption:='09:00h';
  328. Label20.Caption:='10:30h';
  329. Label21.Caption:='12:00h';
  330. Label22.Caption:='13:45h';
  331. Label23.Caption:='14:20h';
  332. Label24.Caption:='15:00h';
  333. Label25.Caption:='16:00h';
  334. Label26.Caption:='17:00h';
  335. Label27.Caption:='18:00h';
  336. Label28.Caption:='19:00h';
  337. end;
  338. 5,6,7,8,9,10:begin
  339. panel3.Visible:=false;
  340. Panel2.Visible:=true;
  341. GroupBox2.Top:=256;
  342. Label15.Caption:='';
  343. Label16.Caption:='';
  344. Label17.Caption:='';
  345. Label18.Caption:='';
  346. Label19.Caption:='';
  347. Label20.Caption:='';
  348. Label21.Caption:='';
  349. Label22.Caption:='';
  350. Label23.Caption:='';
  351. Label24.Caption:='';
  352. Label25.Caption:='';
  353. Label26.Caption:='';
  354. Label27.Caption:='';
  355. Label28.Caption:='';
  356. end;
  357. end;
  358. Case ComboBox1.ItemIndex of
  359. 0: begin
  360. case RadioGroup2.ItemIndex of
  361. 0: begin
  362. Label1.Caption:='Zvecan.';
  363. zv:=50;
  364. da:=3;
  365. end;
  366. 1: begin
  367. zv:=70;
  368. Label1.Caption:='Grabovac.';
  369. da:=4;
  370. end;
  371. 2: begin
  372. zv:=110;
  373. Label1.Caption:='Socanica.';
  374. da:=24;
  375. end;
  376. 3: begin
  377. zv:=200;
  378. Label1.Caption:='Leposavic.';
  379. da:=35;
  380. end;
  381. 4: begin
  382. zv:=240;
  383. Label1.Caption:='Lesak.';
  384. da:=40;
  385. end;
  386. 5: begin
  387. zv:=270;
  388. Label1.Caption:='Rudnica.';
  389. da:=50;
  390. end;
  391. 6: begin
  392. zv:=300;
  393. Label1.Caption:='Raska.';
  394. da:=61;
  395. end;
  396. 7: Begin
  397. zv:=350;
  398. Label1.Caption:='Selevac.';
  399. da:=67;
  400. end;
  401. 8: begin
  402. zv:=420;
  403. Label1.Caption:='Usce.';
  404. da:=90;
  405. end;
  406. 9: Begin
  407. zv:=450;
  408. Label1.Caption:='Usce stanica.';
  409. da:=94;
  410. end;
  411. 10: begin
  412. zv:=700;
  413. Label1.Caption:='Kraljevo.';
  414. da:=150;
  415. end;
  416. end;
  417. end;
  418. 1: begin
  419. case RadioGroup2.ItemIndex of
  420. 0: begin
  421. Label1.Caption:='Zvecan.';
  422. zv:=45;
  423. da:=3;
  424. end;
  425. 1: begin
  426. zv:=65;
  427. Label1.Caption:='Grabovac.';
  428. da:=4;
  429. end;
  430. 2: begin
  431. zv:=105;
  432. Label1.Caption:='Socanica.';  
  433. da:=24;
  434. end;
  435. 3: begin
  436. zv:=190;
  437. Label1.Caption:='Leposavic.';
  438. da:=35;
  439. end;
  440. 4: begin
  441. zv:=220;
  442. Label1.Caption:='Lesak.';  
  443. da:=40;
  444. end;
  445. 5: begin
  446. zv:=250;
  447. Label1.Caption:='Rudnica.';
  448. da:=50;
  449. end;
  450. 6: begin
  451. zv:=290;
  452. Label1.Caption:='Raska.';
  453. da:=61;
  454. end;
  455. 7: Begin
  456. zv:=330;
  457. Label1.Caption:='Selevac.';
  458. end;
  459. 8: begin
  460. zv:=380;
  461. Label1.Caption:='Usce.';
  462. end;
  463. 9: Begin
  464. zv:=420;
  465. Label1.Caption:='Usce stanica.';
  466. end;
  467. 10: begin
  468. zv:=690;
  469. Label1.Caption:='Kraljevo.';
  470. end;
  471. end;
  472. end;
  473. 2: begin
  474. case RadioGroup2.ItemIndex of
  475. 0: begin
  476. Label1.Caption:='Zvecan.';
  477. zv:=45;
  478. end;
  479. 1: begin
  480. zv:=65;
  481. Label1.Caption:='Grabovac.';
  482. end;
  483. 2: begin
  484. zv:=100;
  485. Label1.Caption:='Socanica.';
  486. end;
  487. 3: begin
  488. zv:=180;
  489. Label1.Caption:='Leposavic.';
  490. end;
  491. 4: begin
  492. zv:=210;
  493. Label1.Caption:='Lesak.';
  494. end;
  495. 5: begin
  496. zv:=240;
  497. Label1.Caption:='Rudnica.';
  498. end;
  499. 6: begin
  500. zv:=260;
  501. Label1.Caption:='Raska.';
  502. end;
  503. 7: Begin
  504. zv:=300;
  505. Label1.Caption:='Selevac.';
  506. da:=67;
  507. end;
  508. 8: begin
  509. zv:=400;
  510. Label1.Caption:='Usce.';
  511. da:=90;
  512. end;
  513. 9: Begin
  514. zv:=410;
  515. Label1.Caption:='Usce stanica.';
  516. da:=94;
  517. end;
  518. 10: begin
  519. zv:=680;
  520. Label1.Caption:='Kraljevo.';
  521. da:=150;
  522. end;
  523. end;
  524. end;
  525. end;
  526. end;
  527. procedure TForm1.RadioGroup3Click(Sender: TObject);
  528. begin  
  529. GroupBox2.Top:=256;
  530. RadioGroup4.ItemIndex:=-1;
  531. RadioGroup2.ItemIndex:=-1;
  532. Label8.Caption:='03:00h';
  533. Label9.Caption:='';
  534. Label10.Caption:='08:00h';
  535. Label11.Caption:='';
  536. Label12.Caption:='16:00h';
  537. Label13.Caption:='';
  538. Label14.Caption:='18:35h';
  539. Case ComboBox1.ItemIndex of
  540. 0: begin
  541. Case RadioGroup3.ItemIndex of
  542. 0: begin
  543. zv:=1000;
  544. da:=170;
  545. end;
  546. 1:begin
  547. zv:=1150;
  548. da:=235;
  549. end;
  550. 2:begin
  551. zv:=1250;
  552. da:=270;
  553. end;
  554. 3:begin
  555. zv:=1400;
  556. da:=345;
  557. end;
  558. end;
  559. case RadioGroup3.ItemIndex of
  560. 0: Label1.Caption:='Kragujevac.';
  561. 1: Label1.Caption:='Batocina.';
  562. 2: Label1.Caption:='Smederevo.';
  563. 3: Label1.Caption:='Beograd.';
  564. end;
  565. end;
  566. 1: begin
  567. Case RadioGroup3.ItemIndex of
  568. 0: begin
  569. zv:=990;
  570. da:=170;
  571. end;
  572. 1:begin
  573. zv:=1130;
  574. da:=235;
  575. end;
  576. 2:begin
  577. zv:=1220;
  578. da:=270;
  579. end;
  580. 3:begin
  581. zv:=1370;
  582. da:=245;
  583. end;
  584. end;
  585. case RadioGroup3.ItemIndex of
  586. 0: Label1.Caption:='Kragujevac.';
  587. 1: Label1.Caption:='Batocina.';
  588. 2: Label1.Caption:='Smederevo.';
  589. 3: Label1.Caption:='Beograd.';
  590. end;
  591. end;
  592. 2: begin
  593. Case RadioGroup3.ItemIndex of
  594. 0: begin
  595. zv:=980;
  596. da:=170;
  597. end;
  598. 1:begin
  599. zv:=1120;
  600. da:=235;
  601. end;
  602. 2:begin
  603. zv:=1210;
  604. da:=270;
  605. end;
  606. 3:begin
  607. zv:=1350;
  608. da:=345;
  609. end;
  610. end;
  611. case RadioGroup3.ItemIndex of
  612. 0: Label1.Caption:='Kragujevac.';
  613. 1: Label1.Caption:='Batocina.';
  614. 2: Label1.Caption:='Smederevo.';
  615. 3: Label1.Caption:='Beograd.';
  616. end;
  617. end;
  618. end;
  619. end;
  620. procedure TForm1.RadioGroup1Click(Sender: TObject);
  621. begin
  622. If ComboBox1.ItemIndex=-1 then
  623. begin
  624. ShowMessage('Niste odabrali prevoznika, izaberite jednog od ponudjenih.');
  625. ComboBox1.SetFocus;
  626. end
  627. else
  628. Case RadioGroup1.ItemIndex of
  629. 0: begin
  630. RadioGroup3.Visible:=true;
  631. RadioGroup4.Visible:=false;
  632. Label7.Caption:='Autoput.';
  633. end;
  634. 1: begin
  635. RadioGroup3.Visible:=false;
  636. RadioGroup4.Visible:=true;
  637. Label7.Caption:='Ib.Mag.';
  638. end;
  639. end;
  640. end;
  641.  
  642. procedure TForm1.RadioGroup4Click(Sender: TObject);
  643. begin
  644. RadioGroup2.ItemIndex:=-1;
  645. RadioGroup3.ItemIndex:=-1;
  646. begin          
  647. GroupBox2.Top:=256;
  648. Label8.Caption:='00:45h';
  649. Label9.Caption:='05:00h';
  650. Label10.Caption:='06:45h';
  651. Label11.Caption:='12:00h';
  652. Label12.Caption:='18:00h';
  653. Label13.Caption:='21:00h';
  654. Case ComboBox1.ItemIndex of
  655. 0: begin
  656. case RadioGroup4.ItemIndex of
  657. 0:begin
  658. zv:=800;
  659. da:=160;
  660. end;
  661. 1:begin
  662. zv:=760;
  663. da:=180;
  664. end;
  665. 2:begin
  666. zv:=940;
  667. da:=210;
  668. end;
  669. 3:begin
  670. zv:=1000;
  671. da:=236;
  672. end;
  673. 4:begin
  674. zv:=1150;
  675. da:=260;
  676. end;
  677. 5:begin
  678. zv:=1250;
  679. da:=300;
  680. end;
  681. 6:begin
  682. zv:=1350;
  683. da:=350;
  684. end;
  685. end;
  686. case RadioGroup4.ItemIndex of
  687. 0: Label1.Caption:='Mrcajevci.';
  688. 1: Label1.Caption:='Preljina.';
  689. 2: Label1.Caption:='Gornji Milanovac.';
  690. 3: Label1.Caption:='Ljig.';
  691. 4: Label1.Caption:='Stepojevac.';
  692. 5: Label1.Caption:='Lazarevac.';
  693. 6: Label1.Caption:='Beograd.';
  694. end;
  695. end;
  696. 1: begin
  697. case RadioGroup4.ItemIndex of
  698. 0:begin
  699. zv:=740;
  700. end;
  701. 1:begin
  702. zv:=770;
  703. end;
  704. 2:begin
  705. zv:=910;
  706. end;
  707. 3:begin
  708. zv:=950;
  709. end;
  710. 4:begin
  711. zv:=1100;
  712. end;
  713. 5:begin
  714. zv:=1200;
  715. end;
  716. 6:begin
  717. zv:=1300;
  718. end;
  719. end;
  720. case RadioGroup4.ItemIndex of
  721. 0: Label1.Caption:='Mrcajevci.';
  722. 1: Label1.Caption:='Preljina.';
  723. 2: Label1.Caption:='Gornji Milanovac.';
  724. 3: Label1.Caption:='Ljig.';
  725. 4: Label1.Caption:='Stepojevac.';
  726. 5: Label1.Caption:='Lazarevac.';
  727. 6: Label1.Caption:='Beograd.';
  728. end;
  729. end;
  730. 3: begin
  731. case RadioGroup4.ItemIndex of
  732. 0:begin
  733. zv:=720;
  734. end;
  735. 1:begin
  736. zv:=760;
  737. end;
  738. 2:begin
  739. zv:=900;
  740. end;
  741. 3:begin
  742. zv:=960;
  743. end;
  744. 4:begin
  745. zv:=1100;
  746. end;
  747. 5:begin
  748. zv:=1190;
  749. end;
  750. 6:begin
  751. zv:=1290;
  752. end;
  753. end;
  754. case RadioGroup4.ItemIndex of
  755. 0: Label1.Caption:='Mrcajevci.';
  756. 1: Label1.Caption:='Preljina.';
  757. 2: Label1.Caption:='Gornji Milanovac.';
  758. 3: Label1.Caption:='Ljig.';
  759. 4: Label1.Caption:='Stepojevac.';
  760. 5: Label1.Caption:='Lazarevac.';
  761. 6: Label1.Caption:='Beograd.';
  762. end;
  763. end;
  764. end;
  765. end;
  766. end;
  767. procedure TForm1.RadioGroup5Click(Sender: TObject);
  768. begin
  769. Label8.Caption:='01:45h';
  770. Label9.Caption:='';
  771. Label10.Caption:='05:40h';
  772. Label11.Caption:='';
  773. Label12.Caption:='13:00h';
  774. Label13.Caption:='';
  775. case RadioGroup5.ItemIndex of
  776. 0: begin
  777. zv:=390;
  778. da:=70;
  779. end;
  780. 1: begin
  781. zv:=425;
  782. da:=85;
  783. end;
  784. 2: begin
  785. zv:=550;
  786. da:=90;
  787. end;
  788. 3: begin
  789. zv:=700;
  790. da:=110;
  791. end;
  792. end;
  793. case RadioGroup5.ItemIndex of
  794. 0: Label1.Caption:='Osojane.';
  795. 1: Label1.Caption:='Klina.';
  796. 2: Label1.Caption:='Gorazdevac.';
  797. 3: Label1.Caption:='Siga, Brestovik.';
  798. end;
  799. end;
  800.  
  801. procedure TForm1.Button1Click(Sender: TObject);
  802. begin    
  803. Label8.Caption:='';
  804. Label9.Caption:='';
  805. Label10.Caption:='';
  806. Label11.Caption:='';
  807. Label12.Caption:='';
  808. Label13.Caption:='';
  809. Label14.Caption:='';
  810. Label15.Caption:='';
  811. Label16.Caption:='';
  812. Label17.Caption:='';
  813. Label18.Caption:='';
  814. Label19.Caption:='';
  815. Label20.Caption:='';
  816. Label21.Caption:='';
  817. Label22.Caption:='';
  818. Label23.Caption:='';
  819. Label24.Caption:='';
  820. Label25.Caption:='';
  821. Label26.Caption:='';
  822. Label27.Caption:='';
  823. Label28.Caption:='';
  824. Label29.Caption:='';
  825. Label30.Caption:='';
  826. ComboBox1.ItemIndex:=-1;
  827. ComboBox1.Text:='Odaberite prevoznika:';
  828. Image1.Visible:=false;
  829. Image2.Visible:=false;
  830. Image3.Visible:=false;
  831. Image4.Visible:=false;
  832. Image5.Visible:=false;
  833. Image6.Visible:=false;
  834. Image7.Visible:=false;
  835. Image8.Visible:=false;
  836. ComboBox2.ItemIndex:=-1;
  837. ComboBox2.Text:='Odaberite popust:';
  838. ComboBox2.Top:=144;
  839. RadioGroup1.ItemIndex:=-1;
  840. RadioGroup2.ItemIndex:=-1;
  841. RadioGroup3.ItemIndex:=-1;
  842. RadioGroup4.ItemIndex:=-1;
  843. RadioGroup5.ItemIndex:=-1;
  844. RadioGroup2.Visible:=false;
  845. RadioGroup3.Visible:=false;
  846. RadioGroup4.Visible:=false;
  847. RadioGroup5.Visible:=false;
  848. Label1.Visible:=false;
  849. Label2.Visible:=false;
  850. Label3.Visible:=false;
  851. GroupBox2.Visible:=false;
  852. ComboBox2.Visible:=true;
  853. CheckBox1.Checked:=false;
  854. end;
  855.  
  856. procedure TForm1.Button2Click(Sender: TObject);
  857. var
  858. s,p, sb:string;
  859. sb1:integer;
  860. begin
  861. i:=random(51);
  862. i:=i+1;
  863. sb1:=random(36445);
  864. sb1:=sb1+291;
  865. if ComboBox1.ItemIndex=-1 then
  866. begin
  867. ShowMessage('Niste odabrali prevoznika, izaberite jednog od ponudjenih.');
  868. ComboBox1.SetFocus;
  869. end
  870. else
  871. Label8.Visible:=true;
  872. Label9.Visible:=true;
  873. Label10.Visible:=true;
  874. Label11.Visible:=true;
  875. Label12.Visible:=true;
  876. Label13.Visible:=true;
  877. Label14.Visible:=true;
  878. Label15.Visible:=true;
  879. Label16.Visible:=true;
  880. Label17.Visible:=true;
  881. Label18.Visible:=true;
  882. Label19.Visible:=true;
  883. Label20.Visible:=true;
  884. Label21.Visible:=true;
  885. Label22.Visible:=true;
  886. Label23.Visible:=true;
  887. Label24.Visible:=true;
  888. Label25.Visible:=true;
  889. Label26.Visible:=true;
  890. Label27.Visible:=true;
  891. Label28.Visible:=true;
  892. Label29.Visible:=true;
  893. Label30.Visible:=true;
  894. begin
  895. If ComboBox2.ItemIndex=-1 then
  896. zv1:=zv;
  897. Str(i, s);
  898. Label3.Caption:=s;
  899. str(sb1, sb);
  900. Label30.Caption:=sb;
  901. Str(da:4:0, p);
  902. Label4.Caption:=p;
  903. Label4.Visible:=true;
  904. Label1.Visible:=true;
  905. Label2.Visible:=true;
  906. Label3.Visible:=true;
  907. GroupBox2.Visible:=true;
  908. if CheckBox1.Checked=true then
  909. Begin
  910. zv1:=zv*2*0.80;
  911. Str(zv1:6:1, x);
  912. Label2.Caption:=x;
  913. end
  914. else
  915. begin
  916. case ComboBox2.ItemIndex of
  917. 0: begin
  918. zv1:=zv;
  919. end;
  920. 1: begin
  921. zv1:=zv*0.70;
  922. end;
  923. 2: begin
  924. zv1:=zv*0.70;
  925. end;
  926. 3: begin
  927. zv1:=zv*0.80;
  928. end;
  929. 4: begin
  930. zv1:=zv*0;
  931. end;
  932. end;
  933. end;
  934. Str(zv1:6:0, x);
  935. Label2.Caption:=x;
  936. case ComboBox1.ItemIndex of
  937. 0: begin
  938. Image5.Visible:=false;
  939. Image6.Visible:=true;
  940. Image7.Visible:=false;
  941. Image8.Visible:=false;
  942. Label1.Visible:=true;
  943. end;
  944. 1: begin
  945. Image5.Visible:=true;
  946. Image6.Visible:=false;
  947. Image7.Visible:=false;
  948. Image8.Visible:=false;
  949. Label1.Visible:=true;
  950. Label1.Visible:=true;
  951. end;
  952. 2: begin
  953. Image5.Visible:=false;
  954. Image6.Visible:=false;
  955. Image7.Visible:=true;
  956. Image8.Visible:=false;
  957. Label1.Visible:=true;
  958. end;
  959. 3: begin
  960. Image5.Visible:=false;
  961. Image6.Visible:=false;
  962. Image7.Visible:=false;
  963. Image8.Visible:=true;
  964. Label1.Visible:=true;
  965. end;
  966. end;
  967. if RadioGroup5.Visible=false then
  968. If RadioGroup1.ItemIndex=-1 then
  969. begin
  970. Label7.Caption:='Ib.Mag';
  971. end
  972. else
  973. Label7.Caption:='Ib.Mag';
  974. end;
  975. end;
  976. procedure TForm1.Button3Click(Sender: TObject);
  977. begin
  978. close;
  979. end;
  980.  
  981. procedure TForm1.RadioGroup6Click(Sender: TObject);
  982. begin
  983. Label8.Caption:='00:00h';
  984. Label9.Caption:='02:00h';
  985. Label10.Caption:='08:45h';
  986. Label11.Caption:='12:30h';
  987. Label12.Caption:='14:20h';
  988. Label13.Caption:='16:15h';
  989. Label14.Caption:='18:00';
  990. GroupBox2.Top:=256;
  991. case RadioGroup6.ItemIndex of
  992. 0: begin
  993. zv:=100;
  994. da:=20;
  995. end;
  996. 1: begin
  997. zv:=180;
  998. da:=31;
  999. end;
  1000. 2: begin
  1001. zv:=360;
  1002. da:=52;
  1003. end;
  1004. 3: begin
  1005. zv:=680;
  1006. da:=81;
  1007. end;
  1008. 4: begin
  1009. zv:=730;
  1010. da:=002;
  1011. end;
  1012. 5: begin
  1013. zv:=890;
  1014. da:=145;
  1015. end;
  1016. 6: begin
  1017. zv:=1000;
  1018. da:=173;
  1019. end;
  1020. end;
  1021. case RadioGroup6.ItemIndex of
  1022. 0: Label1.Caption:='Vucitrn.';
  1023. 1: Label1.Caption:='Milosevo.';
  1024. 2: Label1.Caption:='Pristina.';
  1025. 3: Label1.Caption:='Porujevo.';
  1026. 4: Label1.Caption:='Kursumlija.';
  1027. 5: Label1.Caption:='Prokuplje.';
  1028. 6: Label1.Caption:='Nis.';
  1029. end;
  1030. end;
  1031.  
  1032. procedure TForm1.RadioGroup7Click(Sender: TObject);
  1033. begin
  1034. If ComboBox1.ItemIndex=-1 then
  1035. begin
  1036. ShowMessage('Niste odabrali prevoznika, izaberite jednog od ponudjenih.');
  1037. ComboBox1.SetFocus;
  1038. end
  1039. else
  1040. Case RadioGroup7.ItemIndex of
  1041. 0: begin
  1042. RadioGroup5.Visible:=true;
  1043. RadioGroup6.Visible:=false;
  1044. Label7.Caption:='Nis.';
  1045. end;
  1046. 1: begin
  1047. RadioGroup5.Visible:=false;
  1048. RadioGroup6.Visible:=true;
  1049. Label7.Caption:='Brestovik.';
  1050. end;
  1051. end;
  1052. end;
  1053.  
  1054. procedure TForm1.CheckBox1Click(Sender: TObject);
  1055. begin
  1056. Case ComboBox1.ItemIndex of
  1057. 0:begin
  1058. If CheckBox1.Checked=true then
  1059. begin
  1060. ComboBox2.Visible:=false;
  1061. RadioGroup2.Top:=144;
  1062. RadioGroup4.Top:=360;
  1063. RadioGroup3.Top:=360;
  1064. ComboBox2.ItemIndex:=-1;
  1065. ComboBox2.Text:='Odaberite destinaciju';
  1066. end
  1067. else
  1068. begin
  1069. CheckBox1.Visible:=true;
  1070. ComboBox2.Visible:=true;
  1071. RadioGroup2.Top:=168;
  1072. RadioGroup4.Top:=384;
  1073. RadioGroup3.Top:=384;
  1074. end;
  1075. end;
  1076. 1:begin
  1077. If CheckBox1.Checked=true then
  1078. begin
  1079. ComboBox2.Visible:=false;
  1080. RadioGroup2.Top:=144;
  1081. RadioGroup4.Top:=360;
  1082. RadioGroup3.Top:=360;
  1083. ComboBox2.ItemIndex:=-1;
  1084. ComboBox2.Text:='Odaberite destinaciju';
  1085. end
  1086. else
  1087. begin
  1088. CheckBox1.Visible:=true;
  1089. ComboBox2.Visible:=true;
  1090. RadioGroup2.Top:=168;
  1091. RadioGroup4.Top:=384;
  1092. RadioGroup3.Top:=384;
  1093. end;
  1094. end;
  1095. 2:begin
  1096. If CheckBox1.Checked=true then
  1097. begin
  1098. ComboBox2.Visible:=false;
  1099. RadioGroup2.Top:=144;
  1100. RadioGroup4.Top:=360;
  1101. RadioGroup3.Top:=360;
  1102. ComboBox2.ItemIndex:=-1;
  1103. ComboBox2.Text:='Odaberite destinaciju';
  1104. end
  1105. else
  1106. begin
  1107. CheckBox1.Visible:=true;
  1108. ComboBox2.Visible:=true;
  1109. RadioGroup2.Top:=168;
  1110. RadioGroup4.Top:=384;
  1111. RadioGroup3.Top:=384;
  1112. end;
  1113. end;
  1114. 3: begin
  1115. If CheckBox1.Checked=true then
  1116. begin
  1117. ComboBox2.Visible:=false;
  1118. RadioGroup5.Top:=144;
  1119. RadioGroup6.Top:=144;
  1120. ComboBox2.ItemIndex:=-1;
  1121. ComboBox2.Text:='Odaberite destinaciju';
  1122. end
  1123. else
  1124. begin
  1125. CheckBox1.Visible:=true;
  1126. ComboBox2.Visible:=true;
  1127. RadioGroup5.Top:=144;
  1128. RadioGroup6.Top:=176;
  1129. end;
  1130. end;
  1131. end;
  1132. end;
  1133. procedure TForm1.CheckBox2Click(Sender: TObject);
  1134. begin
  1135. If CheckBox2.Checked then
  1136. Button4.Enabled:=true
  1137. else
  1138. Button4.Enabled:=false;
  1139. end;
  1140.  
  1141. procedure TForm1.Button4Click(Sender: TObject);
  1142. begin
  1143. end;
  1144.  
  1145. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement