This is a migrated thread and some comments may be shown as answers.

Cruds php

0 Answers 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
dejla
Top achievements
Rank 1
dejla asked on 07 May 2013, 06:32 AM
Here the ficihiers! the cruds they walk not by clicking on the buttons, nothing happens!
index.php 
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<div id="example" class="k-content">
<div id="grid"></div><script>
$(document).ready(function() {
$("#grid").kendoGrid({

culture:"fr-FR",
dataSource: {
transport: {
read: "historiqueRecharges.php",
update: {url:"update.php", type:"POST"},
create: {url:"create.php",type:"POST"},
destroy: {url:"destroy.php",type:"POST"}
},
batch: true,

schema: { 
data:"data"
},


pageSize: 15
},
editable: "inline",
height: 430,
scrollable: true,
filterable: {
extra: false,
operators: {
string: {
startswith: "Starts with",
eq: "Is equal to",
neq: "Is not equal to"
}
}
},
pageable: true,
toolbar: ["create"],
columns: [

{
field: "id",
width: 130,
filterable: {
ui: cityFilter
}
},
{
field: "nom",
filterable: {
ui: titleFilter
}
},

{ command: [{text:"Edit record", name:"edit"}, {text:"Delete record",name:"destroy"}], title: " ", width: "210px" }
]
});
});function titleFilter(element) {
element.kendoAutoComplete({
dataSource: titles
});
}function cityFilter(element) {
element.kendoDropDownList({
dataSource: cities,
optionLabel: "--Select Value--"
});
}</script>
</div></body>
</html>
update.php
<?php
header("Content-type: application/json");
$con = mysql_connect("host", "user", "password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
} else {
mysql_select_db("database", $con);

$rs = mysql_query("DELETE FROM Table WHERE Id = " . $_POST['models'][0]['Id']);
if ($rs) {
echo json_encode($rs);
}
else {
header("HTTP/1.1 500 Internal Server Error");
echo "Failed on delete: " . $_POST['models'][0]['Column1'];
}
mysql_close($con);
}
?>

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
dejla
Top achievements
Rank 1
Share this question
or