• 28-01-2024, 23:08:52
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhaba form içinde excell dosyasıyla birlikte diğer form elemanlarını da post etmek istiyorum. Nasıl yapabilirim.
                    <form method="post" enctype="multipart/form-data" id="form">
                      <div class="form-row">
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Şablon</label>
                            <select class="form-control form-control-sm" id="sablon" name="sablon">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT DISTINCT sablon,kod FROM sablon order by kod asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->sablon?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Mükellef</label>
                            <select class="form-control form-control-sm" id="mukellef" name="mukellef">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT * FROM mukellef order by ad asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->ad?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Yıl</label>
                            <select class="form-control form-control-sm" id="yil" name="yil">
                              <option value="">Seçiniz</option>
                              <option value="2024">2024</option>    
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Ay</label>
                            <select class="form-control form-control-sm" id="ay" name="ay">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT * FROM veri where tur=2 order by kod asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->ad?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Fatura İşlem</label>
                            <select class="form-control form-control-sm" id="islem" name="islem">
                              <option value="">Seçiniz</option>
                              <option value="1">Alış</option>
                              <option value="2">Satış</option>                          
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlFile1">Dosya Seçiniz</label>
                            <input type="file" id="sortpicture" name="sortpic" class="form-control-file">
                        </div>                    
                      </div>
                      
                      <div class="form-row justify-content-center">
                        <div class="form-group col-md-3">
                            <button type="button" name="rapor" id="rapor" class="btn btn-primary btn-sm form-control mt-2" style="border-radius: 10px;">Excel Getir</button>
                        </div>
                      </div>
                    </form>
        <script type="text/javascript">
            //<!-- Excell Yükle-->
            $('#rapor').on('click', function() {
                document.getElementById("yeni").innerHTML="";
                var form1 = $("#form").serialize();
                var file_data = $('#sortpicture').prop('files')[0];  
                var form_data = new FormData();
                form_data.append('file', file_data);
                $("#wait").css("display", "block");
                $.ajax({
                    url: 'excel_islemyukle.php',
                    dataType: 'text',
                    cache: false,
                    contentType: false,
                    processData: false,
                    data: form_data,                        
                    type: 'post',
                    success: function(php_script_response){
                        $('#yeni').html(php_script_response);
                        $("#wait").css("display", "none");
                    }
                 });
            });
        </script>
  • 28-01-2024, 23:14:59
    #2
    fatihbozkurt adlı üyeden alıntı: mesajı görüntüle
    Merhaba form içinde excell dosyasıyla birlikte diğer form elemanlarını da post etmek istiyorum. Nasıl yapabilirim.
                    <form method="post" enctype="multipart/form-data" id="form">
                      <div class="form-row">
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Şablon</label>
                            <select class="form-control form-control-sm" id="sablon" name="sablon">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT DISTINCT sablon,kod FROM sablon order by kod asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->sablon?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Mükellef</label>
                            <select class="form-control form-control-sm" id="mukellef" name="mukellef">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT * FROM mukellef order by ad asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->ad?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Yıl</label>
                            <select class="form-control form-control-sm" id="yil" name="yil">
                              <option value="">Seçiniz</option>
                              <option value="2024">2024</option>    
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Ay</label>
                            <select class="form-control form-control-sm" id="ay" name="ay">
                              <option value="">Seçiniz</option>
                                <?php
                                $sorgux = DB::get("SELECT * FROM veri where tur=2 order by kod asc");
                                foreach($sorgux as $satirx)
                                {
                                ?>
                                    <option value="<?php echo $satirx->kod; ?>"><?=$satirx->ad?></option>
                                <?php
                                }
                                ?>                                  
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlInput1">Fatura İşlem</label>
                            <select class="form-control form-control-sm" id="islem" name="islem">
                              <option value="">Seçiniz</option>
                              <option value="1">Alış</option>
                              <option value="2">Satış</option>                          
                            </select>
                        </div>
                        <div class="form-group col">
                            <label for="exampleFormControlFile1">Dosya Seçiniz</label>
                            <input type="file" id="sortpicture" name="sortpic" class="form-control-file">
                        </div>                    
                      </div>
                      
                      <div class="form-row justify-content-center">
                        <div class="form-group col-md-3">
                            <button type="button" name="rapor" id="rapor" class="btn btn-primary btn-sm form-control mt-2" style="border-radius: 10px;">Excel Getir</button>
                        </div>
                      </div>
                    </form>
        <script type="text/javascript">
            //<!-- Excell Yükle-->
            $('#rapor').on('click', function() {
                document.getElementById("yeni").innerHTML="";
                var form1 = $("#form").serialize();
                var file_data = $('#sortpicture').prop('files')[0];  
                var form_data = new FormData();
                form_data.append('file', file_data);
                $("#wait").css("display", "block");
                $.ajax({
                    url: 'excel_islemyukle.php',
                    dataType: 'text',
                    cache: false,
                    contentType: false,
                    processData: false,
                    data: form_data,                        
                    type: 'post',
                    success: function(php_script_response){
                        $('#yeni').html(php_script_response);
                        $("#wait").css("display", "none");
                    }
                 });
            });
        </script>
    $('#rapor').on('click', function() {
        document.getElementById("yeni").innerHTML="";
        
        var form_data = new FormData($("#form")[0]);
    
        var file_data = $('#sortpicture').prop('files')[0];
        form_data.append('file', file_data);
    
        $("#wait").css("display", "block");
    
        $.ajax({
            url: 'excel_islemyukle.php',
            dataType: 'text',
            cache: false,
            contentType: false,
            processData: false,
            data: form_data,
            type: 'post',
            success: function(php_script_response){
                $('#yeni').html(php_script_response);
                $("#wait").css("display", "none");
            }
        });
    });
  • 28-01-2024, 23:21:47
    #3
    MusaPekel adlı üyeden alıntı: mesajı görüntüle
    $('#rapor').on('click', function() {
        document.getElementById("yeni").innerHTML="";
        
        var form_data = new FormData($("#form")[0]);
    
        var file_data = $('#sortpicture').prop('files')[0];
        form_data.append('file', file_data);
    
        $("#wait").css("display", "block");
    
        $.ajax({
            url: 'excel_islemyukle.php',
            dataType: 'text',
            cache: false,
            contentType: false,
            processData: false,
            data: form_data,
            type: 'post',
            success: function(php_script_response){
                $('#yeni').html(php_script_response);
                $("#wait").css("display", "none");
            }
        });
    });
    Teşekkür ederim sağolun.