Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    10
    Vote Rating
    0
    Valik71 is on a distinguished road

      0  

    Default Unanswered: Problems on the server with requests and PUT and DELETE

    Unanswered: Problems on the server with requests and PUT and DELETE


    I created a table for ExtJS 4.2.0 On localhost there is no problem and it works. When transferring to the server appears incomprehensible situation. The server is not working.
    I add, edit and delete records from MySQL REST way.

    PHP Code:
    var store Ext.create('Ext.data.Store', {        
        
    autoLoadtrue,        
        
    autoSynctrue,       
        
    model'Row',       
        
    proxy: {            
            
    type'rest',           
            
    url'../php/main.php',            
            
    reader: {                
                
    type'json'                          
            
    },            
            
    writer: {                
                
    type'json'            
            
    }               
        }    
    }); 
    Get the data from the database using method GET, add and change - the method PUT, delete - DELETE.
    Method GET works fine. http://eht.****.org/php/main.php?_dc...art=0&limit=25
    With PUT and DELETE - problem. http://eht.****.org/php/main.php/2?_dc=1366485321278
    What is this : main.php/2?

  2. #2
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    35
    Answers
    2
    Vote Rating
    6
    krullj is on a distinguished road

      0  

    Default


    It looks like the "2" might be the ID of the record you're trying to use PUT or DELETE on. That's just how REST works. It's helpful that you put the ExtJS version, but overall you didn't provide enough information for someone else to help you solve the problem.

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    10
    Vote Rating
    0
    Valik71 is on a distinguished road

      0  

    Default Thanks!

    Thanks!


    And what information is needed? On my localhost everything works, moved to a remote server, and that's a mistake.

  4. #4
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    35
    Answers
    2
    Vote Rating
    6
    krullj is on a distinguished road

      0  

    Default


    Sorry, I should have been more specific in my first post. Basically anything another person would need to set up a test to see if they can reproduce your problem. For instance, your store has a model of "Row" but we don't know what that looks like or have a sample of the data you're working with. What methods you called to actually make the PUT and DELETE requests happen would be helpful as well.

  5. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    10
    Vote Rating
    0
    Valik71 is on a distinguished road

      0  

    Default


    Sorry for my english.
    My link http://auto-pcl.org/row.html
    Try to remove or edit the line.This will cause an error.
    My PHP:
    PHP Code:
    $data_req = (isset($_REQUEST['data'])) ? json_decode(stripslashes($_REQUEST['data'])) : null;
    if (isset(
    $_REQUEST['data'])) {
        
    $data_req =  json_decode(stripslashes($_REQUEST['data']));

    else {               
         
    $data_req json_decode(file_get_contents('php://input'));                   
    }

    switch (
    $_SERVER["REQUEST_METHOD"])
    {
        case 
    'GET':
        
           
    $result mysql_query("SELECT * FROM `$table` ORDER BY `id` ASC"$con);
            while (
    $row mysql_fetch_assoc($result)) {
                for (
    $i=0$i mysql_num_fields($result); $i++) {
                    
    $meta mysql_fetch_field($result$i);
                }
                
    $rows[] = $row;
            }    
            echo 
    json_encode($rows);
            break;

        case 
    'PUT':
                    
            foreach (
    $data_req as $field => $value$data[$field] = $value;        
            
    $rowindex = ($data['id']!=null) ? $data['id'] : 0;
            
            if (
    $rowindex==0) {            
                unset(
    $data['id']);                                
                
    $t "INSERT INTO `$table` (";
                foreach (
    $data as $field => $value$t.="`$field`,";
                
    $t substr ($t0, -1);
                
    $t.=") VALUES (";
                foreach (
    $data as $value$t.="'$value',";
                
    $t substr ($t0, -1);
                
    $t.=")";
            }
            else{        
                
    $t "UPDATE `$table` SET ";        
                foreach (
    $data_req as $field => $value$t $t."`$field` = '$value',";
                
    $t substr($t,0,-1);
                
    $t $t " WHERE `id` = ".$rowindex;
            }        
            
    mysql_query($t);
            
            break;
            
        case 
    'DELETE':
            
            foreach (
    $data_req as $field => $value$data[$field] = $value;        
            
    $id = isset($data['id']) ? $data['id'] : 0;        
            
    $result mysql_query("DELETE FROM `$table` WHERE `id`= $id"$con); 
            
    mysql_query($result);
            break;
        
        default:
            break;

    Once again I say that on Localhost it works for me. I tried on different servers and everywhere there is an error.
    Model.
    PHP Code:
    Ext.define('Row', {
        
    extend'Ext.data.Model',
        
    fields: [        
            {
    name'id'type'int'useNulltrue},
            {
    name'descr',     type'int'},
            {
    name'sched',     type'int'},
            {
    name'change'type'int'},        
            {
    name'prev'type'int'},
            {
    name'thisp',    type'int'},
            {
    name'stored'type'int'},        
            {
    name'retainage'type'int'}
        ]
    }); 
    PHP Code:
    var grid Ext.create('Ext.grid.Panel', {
            
    storestore,
            
    renderTo'grid1',
            
    //width: 800,
            
    height400,
            
    layout'fit',
            
    style'padding: 20px',
            
    title'<h2>CONTINUATION </h2>',  
            
    plugins: [rowEditing],
            
    iconCls'icon-grid',        
            
    features: [{
                
    ftype'summary'            
            
    }],
            
            
    columns: [
            
    Ext.create('Ext.grid.RowNumberer'),        
            {
                
    /*xtype: 'rownumberer',
                renderer: function (v, p, record, rowIndex) {
                    if (this.rowspan) {
                        p.cellAttr = 'rowspan="' + this.rowspan + '"';
                    }
                    return rowIndex + 1;
                },*/
                
    text      'ID',            
                
    width    50
                
    dataIndex'id',
                
    summaryRenderer: function(){ return '<strong>Totals:</strong> ';}
            },
            {            
                
    text     'Description of work',
                
    flex1,            
                
    dataIndex'descr',
                
    field: {
                    
    xtype'textfield'
                
    },
                
    summaryType'sum',
                
    summaryRenderer: function(valuesummaryDatadataIndex) {
                    return 
    value;
                }
            },
            {            
                
    text     'Scheduled value',
                
    width    90,
                
    dataIndex'sched',
                
    field: {
                    
    xtype'textfield'
                
    },
                
    summaryType'sum',
                
    summaryRenderer: function(valuesummaryDatadataIndex) {
                    return 
    value;
                }
            },
            {
                
    text     'Change orders to data',
                
    width    120,
                
    dataIndex'change',
                
    field: {
                    
    xtype'textfield'
                
    },
                
    summaryType'sum',
                
    summaryRenderer: function(valuesummaryDatadataIndex) {
                    return 
    value;
                }
            },
            {
                
    text     'Adjusted scheduled values',
                
    width    140,
                
    dataIndex'adjusted',
                
    renderer: function(valuemetaDatarecordrowIdxcolIdxstoreview) {
                    return 
    record.get('sched') + record.get('change');
                },
                
    summaryType: function(records){
                    var 
    0,
                        
    length records.length,
                        
    total 0,
                        
    record;

                    for (
    0length; ++i) {
                        
    record records[i];
                        
    total += record.get('sched') + record.get('change');
                    }
                    return 
    total;
                },
                
    summaryType'sum'            
            
    },
            {
                
    text     'Work Completed',
                 
    columns: [{
                        
    text     'Previous Application',
                        
    width    110,
                        
    dataIndex'prev',
                        
    field: {
                            
    xtype'textfield'
                        
    },
                        
    summaryType'sum',
                        
    summaryRenderer: function(valuesummaryDatadataIndex) {
                            return 
    value;
                        }
                    }, {
                        
    text     'This period',
                        
    width    65,                   
                        
    dataIndex'thisp',
                        
    field: {
                            
    xtype'textfield'
                        
    },
                        
    summaryType'sum',
                        
    summaryRenderer: function(valuesummaryDatadataIndex) {
                            return 
    value;
                        }
                    }]
                
            },
            {
                
    text     'Materials presently stored',
                
    width    135,
                
    dataIndex'stored',
                
    field: {
                    
    xtype'textfield'
                
    },
                
    summaryType'sum',
                
    summaryRenderer: function(valuesummaryDatadataIndex) {
                    return 
    value;
                }
            },
            {
                
    text     'Total Completed and Stored to Data',
                
    width    185
                
    dataIndex'total',
                
    renderer: function(valuemetaDatarecordrowIdxcolIdxstoreview) {
                    return 
    record.get('prev') + record.get('thisp') + record.get('stored');
                },
                
    summaryType: function(records){
                    var 
    0,
                        
    length records.length,
                        
    total 0,
                        
    record;

                    for (
    0length; ++i) {
                        
    record records[i];
                        
    total += record.get('prev') + record.get('thisp') + record.get('stored');
                    }
                    return 
    total;
                },
                
    summaryType'sum'                     
            
    },
            {
                
    text     '% complete',
                
    width    70
                
    dataIndex'perComplete',
                
    renderer: function(valuemetaDatarecordrowIdxcolIdxstoreview) {
                    return 
    Math.floor((record.get('sched') + record.get('change')) / (record.get('prev') + record.get('thisp') + record.get('stored')) * 100);
                },
                
    summaryType: function(records){
                    var 
    0,
                        
    length records.length,
                        
    total 0,
                        
    record;

                    for (
    0length; ++i) {
                        
    record records[i];
                        
    total += record.get('sched');
                    }
                    return 
    total/length;
                },
                
    summaryType'sum'                
            
    },
            {
                
    text     'Balance to Finish',
                
    width    90
                
    dataIndex'balance',
                
    renderer: function(valuemetaDatarecordrowIdxcolIdxstoreview) {
                    return (
    record.get('sched') + record.get('change')) - (record.get('prev') + record.get('thisp') + record.get('stored')) ;
                },
                
    summaryType: function(records){
                    var 
    0,
                        
    length records.length,
                        
    total 0,
                        
    record;

                    for (
    0length; ++i) {
                        
    record records[i];
                        
    total += (record.get('sched') + record.get('change')) - (record.get('prev') + record.get('thisp') + record.get('stored'));
                    }
                    return 
    total;
                },
                
    summaryType'sum'        
                
            
    },
            {
                
    text     'Retainage to date',
                
    dataIndex'retainage',
                
    field: {
                    
    xtype'textfield'
                
    },
                
    summaryType'sum',
                
    summaryRenderer: function(valuesummaryDatadataIndex) {
                    return 
    value;
                },
            }
        ],
            
            
    dockedItems: [{
                
    xtype'toolbar',
                
    items: [{
                    
    tooltip'Add a new row',
                    
    text'New row',
                    
    iconCls'add',
                    
    handler: function(){
                        
    // пустая запись
                        
    store.insert(0, new Row());
                        
    rowEditing.startEdit(00);
                    }
                }, 
    '-', {
                       
    itemId'delete',
                      
    tooltip'Delete selected row',
                       
    text'Delete row',
                       
    iconCls'delete',
                    
    disabledtrue,
                    
    handler: function(){
                        var 
    selection grid.getView().getSelectionModel().getSelection()[0];
                        if (
    selection) {
                            
    store.remove(selection);
                        }
                                        }
                }]    
            }]        
        });
         
    grid.getSelectionModel().on('selectionchange', function(selModelselections){
            
    grid.down('#delete').setDisabled(selections.length === 0);
        }); 

Thread Participants: 1

Tags for this Thread