Check-in [2085f4dd1c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Complete search function.
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1:2085f4dd1c9f28dfc807197c018d6d85ce5f4129
User & Date: tux 2014-09-14 18:25:57
Context
2014-09-14
20:01
index.cgi: Fix saving projects. index.cgi: Move search function further down in routing. styles/default/header.cgi: Fix encoding. styles/default/footer.cgi: Remove submit section. check-in: ae5c4a2dbb user: tux tags: develop
18:25
Complete search function. check-in: 2085f4dd1c user: tux tags: develop
2014-08-11
11:19
Replace jQuery with zepto. check-in: 4aa0832dc6 user: tux tags: develop
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.cgi.

583
584
585
586
587
588
589



590
591

592
593
594
595

596



597
598



599
600
601
602
603
604
605
		;;
	*\ search\ *)
		terms="$(GET search)"
		TITLE="$TITLE - Søg: $terms"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'




		sqlite3 $db "SELECT id,title FROM projects WHERE id LIKE $terms OR title LIKE $terms OR desc LIKE $terms OR music LIKE $terms OR participants LIKE $terms" | while read result

		do
			result_id="$(echo $result | cut -d '|' -f 1)"
			result_title="$(echo $result | cut -d '|' -f 2)"
			cat << EOT

			<a href="${script}?view&amp;p=$result_id">$result_id - $result_title</a>



EOT
		done



		html_tmpl 'footer'
		;;
	*\ browse\ *)
		category="$(GET cat)"
		startid="$(GET startid)"
		maxid=$(sqlite3 $db "SELECT MAX(id) FROM projects")
		minid=$(sqlite3 $db "SELECT MIN(id) FROM projects")







>
>
>

<
>




>
|
>
>
>


>
>
>







583
584
585
586
587
588
589
590
591
592
593

594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
		;;
	*\ search\ *)
		terms="$(GET search)"
		TITLE="$TITLE - Søg: $terms"
		header
		html_tmpl 'header'
		html_tmpl 'dashboard'
		cat << EOT
		<table>
EOT


		sqlite3 $db "SELECT id,title FROM projects WHERE id LIKE \"%$terms%\" OR title LIKE \"%$terms%\" OR desc LIKE \"%$terms%\" OR music LIKE \"%$terms%\" OR participants LIKE \"%$terms%\" ORDER BY id DESC" | while read result
		do
			result_id="$(echo $result | cut -d '|' -f 1)"
			result_title="$(echo $result | cut -d '|' -f 2)"
			cat << EOT
			<tr>
				<td><a href="${script}?view&amp;p=$result_id">$result_id</a></td>
				<td><a href="${script}?view&amp;p=$result_id">$result_title</a></td>
			</tr>

EOT
		done
		cat << EOT
	</table>
EOT
		html_tmpl 'footer'
		;;
	*\ browse\ *)
		category="$(GET cat)"
		startid="$(GET startid)"
		maxid=$(sqlite3 $db "SELECT MAX(id) FROM projects")
		minid=$(sqlite3 $db "SELECT MIN(id) FROM projects")