[Ask] Option Multiple Check Box FPDF

Discussion in 'Desain Web dan Programming' started by xpreborn, 15 Oct 2016.

Thread Status:
Not open for further replies.
  1. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Selamat siang om,
    Izin tanya yach,
    Saya lg coba FPDF dinamis yang sumbernya : http://fpdf.org/en/tutorial/tuto1.htm
    Kendalanya multiple check boxnya ga fungsi, misal dioption ada pilihan 1, 2, 3, 4, 5 lalu saya pilih 2 dan 5 maka hasilnya hanya 5 saja 2 tidak ikut, kira2 dmn masalahnya yach Om ?
    Berikut kode yang saya pakai :

    Potongan form.php :
    Code:
            <div class="form-group">
            <label class="control-label">Check BOX</label>
            <div class="col-sm-8 input-group">
            <input type="checkbox" class="form-control1" name="check_list[]" value="1.Tangan" >1.Tangan<br>
            <input type="checkbox" class="form-control1" name="check_list[]" value="2.Kaki" >2.Kaki<br>
            <input type="checkbox" class="form-control1" name="check_list[]" value="3.Pendengaran" >3.Pendengaran<br>
            <input type="checkbox" class="form-control1" name="check_list[]" value="4.Badan" >4.Badan<br>
            <input type="checkbox" class="form-control1" name="check_list[]" value="5.Tidak Ada" >5.Tidak Ada
            </div>
            </div>
    123.php action formnya :
    Code:
    <?php
    require('fpdf.php');
    
    $dropdownselect=$_POST['dropdownselect'];
    $radiobutonoption=$_POST['radiobutonoption'];
    if(!empty($_POST['check_list'])) {
        foreach($_POST['check_list'] as $check) {
        $checkbox = "$check";
        }
    }
    $inputtext=$_POST['inputtext'];
    $textarea=$_POST['textarea'];
    
    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetFont('Arial','B',16);
    
    echo "Drop Down Option : $dropdownselect<br>";
    echo "Radio Option : $radiobutonoption<br>";
    echo "Check Box Option : $checkbox<br>";
    echo "Input Text : $inputtext<br>";
    echo "Text Area : $textarea<br>";
    
    $pdf->Output();
    ?>
    Kira2 apa yg salah/yg kurang yach Om dari yg diatas agar bs multiple selectnya fungsi

    Terimakasih banyak Om,
     
  2. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Untuk ini status masih belum solve yach Om, jadi jika ada saran2 sangat dibutuhkan
     
  3. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Solved,
    saya pakai echo implode(',', $_POST['check_list']);

    Case closed,
     
  4. Adhie

    Adhie Expert 1.0

    Messages:
    733
    Likes Received:
    56
    Trophy Points:
    28
    Coba pakai MPDF mas, lebih mudah manage nya daripada FPDF. Hanya sekedar saran sih.
     
    xpreborn likes this.
  5. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Thanks Om sarannya,
    Iya benar Om FPDF ini emang rada2 bingung pakainya,
    Akan saya coba baca2 tentang MPDPnya
     
  6. Adhie

    Adhie Expert 1.0

    Messages:
    733
    Likes Received:
    56
    Trophy Points:
    28
    Good luck
     
    xpreborn likes this.
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...