This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| routes: | |
| resources :drugs do | |
| collection do | |
| get :find_by_dci | |
| end | |
| #match '/drugs/find_by_dci/:id', :controller => 'drugs', :action =>'find_by_dci' | |
| resources :line_drugs | |
| end | |
| controller: | |
| def find_by_dci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coffee: | |
| $modal = $('#modal') | |
| $modal_close = $modal.find('.close') | |
| $modal_container = $('#modal-container') | |
| #pt toate linkurile cu data-remote! | |
| $(document).on 'ajax:success', 'a[data-remote]',(xhr, data, status) -> | |
| $modal | |
| .html(data.html) | |
| .prepend(modal, close) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| programZi([Zi, Luna, An], DurataConsultului) -> | |
| Programari = boss_db:find(programare, [{data, 'equals', string:join([An, Luna, Zi], "-")}], [{order_by, ora}]), | |
| Pacienti = [ boss_db:find(PacientId) || {programare, _,_,_,_,PacientId} <-Programari], | |
| OreInterval = [{Ora, Minut, DurataConsultului} || Ora<-lists:seq(1,12), Minut<-lists:seq(1,60,DurataConsultului)], | |
| ProgramulZileiCuProgramari = lists:zipwith(combinaOreleCuProgramarile(OreInterval, Programari),OreInterval, Programari), | |
| {json, [{programari, Programari}, {pacienti, Pacienti}, {program, ProgramulZileiCuProgramari} ]}. | |
| combinaOreleCuProgramarile(OraGenerata = {OraMomentului, MinutulMomentului, DurataConsultului}, | |
| Programare = {programare, _Id, _Data, {OraProgramarii, MinutulProgramarii, _SecundaProgramarii}, DurataProgramarii, Pacient}) | |
| when OraMomentului == OraProgramarii -> |
OlderNewer