- Beranda
- Programmer Forum
help gan... php array checkbox smarty
...
TS
andryyantroy
help gan... php array checkbox smarty
untuk para agan-agan ane minta tolong... ane lagi buat skripsi, ane stack di masalah checkbox gan,
jadi gini gan ane buat web buat pendaftaran haji dengan smarty,php,mysql
nah permasalahnya di checkbox gan... ilustrasinya ketika sudah daftar muncul di masterdata atau simplenya untuk melihat peserta yang sudah daftar... setalah ada data peserta di situ ada checkbox pula di situ yang bertujuan untuk di berangkatkan ketika di checklist di situ, pas di checklist satu-persatu ane mau si persrta yang di checklist pindah data atau pindah table mysql, kesulitan ane gan pas di check list cuma muncul array nya gan di blkng/inspect htmlnya, harusnya klo di cheklist satu-satu ada ID satu-satu peseta tersubut
ini phpnya
<?
elseif(isset($_POST["berangkat"]))
{
//this is enter array
print_r ($_POST["brr"]);
$queryhji = "SELECT * FROM as_hji_berangkat ORDER BY createdDate DESC";
$sqlhji = mysqli_query($connect, $queryhji);
$numshji = mysqli_num_rows($sqlhji);
$i = 1;
$datahji[] = array( 'noPorsi' => $dthji['noPorsi'],
'hajiID' => $dthji['hajiID'],
'tanggalDaftar' => $dthji['tanggalDaftar'],
'fullName' => $dthji['fullName'],
'no' => $i);
$i++;
$page = "sudah_berangkat_haji.tpl";
}
ini buat viewnya
<form role="form" name="" method="POST" action="akan_berangkat_haji.php">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Tanggal Daftar</th>
<th>No Porsi</th>
<th>Haji ID</th>
<th>Nama</th>
<th>Status</th>
<th>Berangkat</th>
</tr>
</thead>
<tbody>
{section name=datahji loop=$datahji}
<tr class="odd gradeX">
<td>{$datahji[datahji].no}</td>
<td>{$datahji[datahji].tanggalDaftar}</td>
<td>{$datahji[datahji].noPorsi}</td>
<td>{$datahji[datahji].hajiID}</td>
<td>{$datahji[datahji].fullName}</td>
<td>{$datahji[datahji].status}</td>
<td>
<input type="checkbox" name="brr[]" value="{$datahji[datahji].noPorsi}"></input>
</td>
</tr>
{/section}
</tbody>
</table>
<button type="submit" name="berangkat">Berangkat</button>
</form>
</div>
thks gan
jadi gini gan ane buat web buat pendaftaran haji dengan smarty,php,mysql
nah permasalahnya di checkbox gan... ilustrasinya ketika sudah daftar muncul di masterdata atau simplenya untuk melihat peserta yang sudah daftar... setalah ada data peserta di situ ada checkbox pula di situ yang bertujuan untuk di berangkatkan ketika di checklist di situ, pas di checklist satu-persatu ane mau si persrta yang di checklist pindah data atau pindah table mysql, kesulitan ane gan pas di check list cuma muncul array nya gan di blkng/inspect htmlnya, harusnya klo di cheklist satu-satu ada ID satu-satu peseta tersubut
ini phpnya
<?
elseif(isset($_POST["berangkat"]))
{
//this is enter array
print_r ($_POST["brr"]);
$queryhji = "SELECT * FROM as_hji_berangkat ORDER BY createdDate DESC";
$sqlhji = mysqli_query($connect, $queryhji);
$numshji = mysqli_num_rows($sqlhji);
$i = 1;
$datahji[] = array( 'noPorsi' => $dthji['noPorsi'],
'hajiID' => $dthji['hajiID'],
'tanggalDaftar' => $dthji['tanggalDaftar'],
'fullName' => $dthji['fullName'],
'no' => $i);
$i++;
$page = "sudah_berangkat_haji.tpl";
}
ini buat viewnya
<form role="form" name="" method="POST" action="akan_berangkat_haji.php">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Tanggal Daftar</th>
<th>No Porsi</th>
<th>Haji ID</th>
<th>Nama</th>
<th>Status</th>
<th>Berangkat</th>
</tr>
</thead>
<tbody>
{section name=datahji loop=$datahji}
<tr class="odd gradeX">
<td>{$datahji[datahji].no}</td>
<td>{$datahji[datahji].tanggalDaftar}</td>
<td>{$datahji[datahji].noPorsi}</td>
<td>{$datahji[datahji].hajiID}</td>
<td>{$datahji[datahji].fullName}</td>
<td>{$datahji[datahji].status}</td>
<td>
<input type="checkbox" name="brr[]" value="{$datahji[datahji].noPorsi}"></input>
</td>
</tr>
{/section}
</tbody>
</table>
<button type="submit" name="berangkat">Berangkat</button>
</form>
</div>
thks gan
nona212 memberi reputasi
1
487
2
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
20.2KThread•4.3KAnggota
Terlama
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru