Sayfalar

15 Nisan 2021 Perşembe

Linux delete all files in folder or directory

rm -rf dir1

rm -rf /path/to/dir/

rm -rf /home/vivek/oldschoolpics/ 

6 Mart 2018 Salı

Full calendar


<script>
jQuery(document).ready(function() {

        jQuery('#calendar').fullCalendar({

            editable: false,
            navLinks: true, // can click day/week names to navigate views
            eventLimit: false, // allow "more" link when too many events
            height: "auto",
            locale: "tr",
            themeSystem:"jquery-ui",
            theme: true,
            themeName:"Redmond",
            events: {
                url: ' your ajax url',
                error: function() {
                    jQuery('#script-warning').show();
                }
            },
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,basicWeek,basicDay'
            },
            loading: function(bool) {

                if(bool){

                    jQuery.blockUI();

                }else{

                    jQuery.unblockUI();

                }
            },
            eventClick: function(calEvent, jsEvent, view) {

                DetayGoster(calEvent.id);


            }
        });

    });
</script>

<?php
// return ajax

     foreach ($data as $row){
           $return[] = array( "title"=> "your title","start"=> $startdate,"end"=>$enddate,"color"=>"your color","textColor" => "your text color","id"=>"your id");
        }
   echo json_encode($return);


?>

7 Aralık 2017 Perşembe

laravel datatable yajra


install yajra extensions      https://github.com/yajra/laravel-datatables


<table id="havuz_table" class="table table-hover table-bordered">
                       <thead>
                             <th></th>
                             <th></th>
                              <th></th>
                              <th></th>
                              <th></th>
                       </thead>
                       <tbody>
                      </tbody>
 </table>
         <script>

            var table = $('#havuz_table').DataTable({
                destroy: true,
                responsive: true,
                lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
                processing: true,
                serverSide: true,
                data: {"_token": "{{ csrf_token() }}"},
                //"bFilter": false,
                ajax: {

                    url: "{{URL::to('uzmangrup/mykdeneyimListeAjax').'/'.$tc}}"

                },

                deferRender: true,
                language: {
                    url: '/lib/datatables/media/language/Turkish.json'
                },
                columns: [

                    {
                        "title": "{!! Lang::get('global.title_deneyim_tipi') !!}",
                        "targets": 0,
                        "render": function (data, type, row) {

                            return alanlar_array[row['TIP']];
                        },
                        "orderable": true,
                        "searchable": true
                    },

                    {
                        "title": "{!! Lang::get('global.title_aciklama') !!}",
                        "targets": 2,
                        "render": function (data, type, row) {
                            return row['ACIKLAMA'];
                        },
                        "orderable": true,
                        "searchable": true
                    },
                    {
                        "title": "{!! Lang::get('global.title_myktecrube_sure') !!}",
                        "targets": 3,
                        "render": function (data, type, row) {
                            return row['SURE'];
                        },
                        "orderable": true,
                        "searchable": true
                    },
                    {
                        "title": "{!! Lang::get('global.title_duzenle') !!}",
                        "targets": 5,
                        "render": function (data, type, row) {

                            return '<button type="button" class="btn btn-xs btn-primary FuncDuzenlemeGetir" data-id="' + row['MYKDENEYIM_ID'] + '">{!! Lang::get('global.title_duzenle')!!}</button>';


                        },
                        "orderable": false,
                        "searchable": false
                    },
                    {
                        "title": "{!! Lang::get('global.title_duzenle') !!}",
                        "targets": 6,
                        "render": function (data, type, row) {

                            return '<button id="' + row['MYKDENEYIM_ID'] + '" type="button" class="btn btn-xs btn-danger sil">{!! Lang::get('global.title_sil') !!}</button>';

                        },
                        "orderable": false,
                        "searchable": false
                    }

                ]
            });
</script>
<?php
public function mykdeneyimListeAjax(Request $request, $tc)
    {

        return Datatables::of($this->repo->getMykdeneyim($tc))
            ->filterColumn('TARIH', function ($query, $keyword) {
                $query->whereRaw("TARIH like ?", ["%{$this->trTOenUpper($keyword)}%"]);
            })
            ->filterColumn('TUR', function ($query, $keyword) {
                $query->whereRaw("TUR like ?", ["%{$this->trTOenUpper($keyword)}%"]);
            })
            ->filterColumn('SURE', function ($query, $keyword) {
                $query->whereRaw("SURE like ?", ["%{$this->trTOenUpper($keyword)}%"]);
            })
            ->filterColumn('ACIKLAMA', function ($query, $keyword) {
                $query->whereRaw("ACIKLAMA like ?", ["%{$this->trTOenUpper($keyword)}%"]);
            })
            ->make(true);

    }
?>

              or without yajra plugin
<?php

$data=array(); 

$data["TARIH"]=.... // return sql query
$data["ACIKLAMA"]=.... // return sql query


$results = array(
    "sEcho" => 1,
    "iTotalRecords" => count($data),
    "iTotalDisplayRecords" => count($data),
    "aaData"=>$data);


echo json_encode($results);

?>


31 Ekim 2017 Salı

php sort change time of file

      $rootPath = "your path";
        $files= scandir($rootPath);
        $i=0;
        foreach ($files as $file){

            if($file != '.' and $file != '..')
            {
                $myfiles[$i]["name"]= $file;
                $myfiles[$i]["date"]=date ("d.m.Y H:i:s", filectime ('file path'.'/'.$file));
                $i++;

            }
        }
     
      $temp_array = array();
        foreach ($myfiles as $key => $row)
        {
            $temp_array[$key] = $row['date'];
        }
        array_multisort($temp_array, SORT_DESC, $myfiles); // result return $myfiles

25 Ekim 2017 Çarşamba

27 Nisan 2017 Perşembe

Php Soap Tc Sorgulama

$client = new SoapClient("https://tckimlik.nvi.gov.tr/
Service/KPSPublic.asmx?WSDL");
$requestData = array( 
"TCKimlikNo" => (float)$this->data['tcno'],
"Ad" => $first_name,"Soyad" => $last_name,
"DogumYili" => $birthYear
);
$result = $client->TCKimlikNoDogrula($requestData);
if ($result->TCKimlikNoDogrulaResult) {
echo "basarili"
}

14 Mart 2017 Salı

stop form submission

<form method="post" name="frm1" action="add.php">
<input  type="text"   value="aaaaa" >
<input  type="text"   value="aaaaa" >
<input type="button" value="cagir" onclick="call();">
</form>

<script>
function call(){

      if(condition){

         document.forms['frm1'].submit();   // action form  add.php


       }else{


        alert("stop action");

    }




}

</script>