Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //...
- // Bagian Survey
- elseif ($_GET[module]=='survey'){
- ?>
- <tr><td class=judul_head colspan='5'>» Survey Wisata Terbaik</td></tr>
- <form class='survey_form'
- name='survey_form'
- method=POST action='?module=prosessurvey'
- onSubmit='return validasi(this)'>
- <tr valign='top'>
- <td>Nama Wisata</td>
- <td>:</td>
- <td>
- <select name='kategori'>
- <option value='0' selected='selected'>- Pilih Wisata -</option>
- <?php
- $sql="SELECT nama_kategori FROM kategori";
- $result=mysql_query($sql);
- while($record=mysql_fetch_array($result))
- {
- echo "<option value='".$record['id_kategori']."'>".$record['nama_kategori']."</option>\n";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr valign='top'>
- <td>Ketertarikan</td>
- <td>:</td>
- <td>
- <input type=radio name='ketertarikan'
- value='sm' checked='checked' />Sangat Menarik<br />
- <input type=radio name='ketertarikan'
- value='me' />Menarik<br />
- <input type=radio name='ketertarikan'
- value='km' />Kurang Menarik
- </td>
- </tr>
- <tr valign='top'>
- <td>Berikan nilai untuk Ketertarikan</td>
- <td>:</td>
- <td>
- <input type='text' name='nilai_ketertarikan' size='10' />
- Nilai rentang 10-100
- </td>
- </tr>
- <tr>
- <td>Kebersihan</td>
- <td>:</td>
- <td>
- <input type=radio name='kebersihan'
- value='sb' checked='checked' />Sangat Bersih<br />
- <input type=radio name='kebersihan'
- value='be' />Bersih<br />
- <input type=radio name='kebersihan'
- value='kb' />Kurang Bersih
- </td>
- </tr>
- <tr valign='top'>
- <td>Berikan nilai untuk Kebersihan</td>
- <td>:</td>
- <td>
- <input type='text' name='nilai_kebersihan' size='10' />
- Nilai rentang 10-100
- </td>
- </tr>
- <tr valign='top'>
- <td>Sarana</td>
- <td>:</td>
- <td>
- <input type=radio name='sarana'
- value='sl' checked='checked' />Sangat Lengkap<br />
- <input type=radio name='sarana'
- value='le' />Lengkap<br />
- <input type=radio name='sarana'
- value='kl' />Kurang Lengkap
- </td>
- </tr>
- <tr valign='top'>
- <td>Berikan nilai untuk Sarana</td>
- <td>:</td>
- <td>
- <input type='text' name='nilai_sarana' size='10' />
- Nilai rentang 10-100
- </td>
- </tr>
- <tr valign='top'>
- <td>Transportasi</td>
- <td>:</td>
- <td>
- <input type=radio name='transportasi'
- value='mu' checked='checked' />Mudah<br />
- <input type=radio name='transportasi'
- value='su' />Sulit<br />
- <input type=radio name='transportasi'
- value='ss' />Sangat Sulit
- </td>
- </tr>
- <tr valign='top'>
- <td>Berikan nilai untuk Transportasi</td>
- <td>:</td>
- <td>
- <input type='text' name='nilai_transportasi' size='10' />
- Nilai rentang 10-100
- </td>
- </tr>
- <tr>
- <td colspan='5' align='center'>
- <input type='submit' value='OK' id='ok' />
- <input type='button' value='Batal' onclick='location.href="index.php"' />
- </td>
- </tr>
- </form>
- <?php
- }
- // Bagian Survey Wisata Terbaik
- elseif ($_GET[module]=='prosessurvey'){
- $sql="INSERT INTO
- survey
- (id_survey,
- id_kategori,
- sm,me,km,
- sb,be,kb,
- sl,le,kl,
- mu,su,ss)
- VALUES
- ('{$_POST['id_survey']}',
- '{$_POST['kategori']}',
- '".($_POST['ketertarikan']=='sm'?$_POST['nilai_ketertarikan']:0)."',
- '".($_POST['ketertarikan']=='me'?$_POST['nilai_ketertarikan']:0)."',
- '".($_POST['ketertarikan']=='km'?$_POST['nilai_ketertarikan']:0)."',
- '".($_POST['kebersihan']=='sb'?$_POST['nilai_kebersihan']:0)."',
- '".($_POST['kebersihan']=='be'?$_POST['nilai_kebersihan']:0)."',
- '".($_POST['kebersihan']=='kb'?$_POST['nilai_kebersihan']:0)."',
- '".($_POST['sarana']=='sl'?$_POST['nilai_sarana']:0)."',
- '".($_POST['sarana']=='le'?$_POST['nilai_sarana']:0)."',
- '".($_POST['sarana']=='kl'?$_POST['nilai_sarana']:0)."',
- '".($_POST['transportasi']=='mu'?$_POST['nilai_transportasi']:0)."',
- '".($_POST['transportasi']=='su'?$_POST['nilai_transportasi']:0)."',
- '".($_POST['transportasi']=='ss'?$_POST['nilai_transportasi']:0)."')";
- ?>
- <tr><td class='judul_head'>» Status Nilai Survey</td></tr>
- <tr>
- <td class='isi'>
- <?php
- echo 'Nilai Survey Anda '.(mysql_query($sql)?'Berhasil':'Gagal').' di Proses!!!';
- ?>
- </td>
- </tr>
- <tr><td class='kembali'><br />[ <a href='index.php'>Kembali</a> ]</td></tr>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement