You've already forked ci_restful
first commit
This commit is contained in:
18
application/views/add.php
Normal file
18
application/views/add.php
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
<form action="<?php echo base_url().'api/barang/add_barang' ?> " method="post">
|
||||
<table class="add" cellspacing="20">
|
||||
<tr>
|
||||
<td>Nama Barang</td>
|
||||
<td colspan="3"><input type="text" name="nama_barang" value="" class="input"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Harga</td>
|
||||
<td colspan="3"><input type="text" name="harga" value="" class="input"/></td>
|
||||
</tr>
|
||||
<tr><td></td>
|
||||
<td></td>
|
||||
<td><input type="submit" name="submit" value="Simpan"/></td>
|
||||
<td><button type="button" name="Cancel" value="OK">Cancel</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
10
application/views/index.html
Normal file
10
application/views/index.html
Normal file
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
89
application/views/welcome_message.php
Normal file
89
application/views/welcome_message.php
Normal file
@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Welcome to CodeIgniter</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
background-color: #fff;
|
||||
margin: 40px;
|
||||
font-family: Lucida Grande, Verdana, Sans-serif;
|
||||
font-size: 14px;
|
||||
color: #4F5155;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #003399;
|
||||
background-color: transparent;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #444;
|
||||
background-color: transparent;
|
||||
border-bottom: 1px solid #D0D0D0;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin: 24px 0 2px 0;
|
||||
padding: 5px 0 6px 0;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: Monaco, Verdana, Sans-serif;
|
||||
font-size: 12px;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #D0D0D0;
|
||||
color: #002166;
|
||||
display: block;
|
||||
margin: 14px 0 14px 0;
|
||||
padding: 12px 10px 12px 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Welcome to CodeIgniter!</h1>
|
||||
|
||||
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="<?php echo site_url('api/example/users');?>">Users</a> - defaulting to XML</li>
|
||||
<li><a href="<?php echo site_url('api/example/users/format/csv');?>">Users</a> - get it in CSV</li>
|
||||
<li><a href="<?php echo site_url('api/example/user/id/1');?>">User #1</a> - defaulting to XML</li>
|
||||
<li><a href="<?php echo site_url('api/example/user/id/1/format/json');?>">User #1</a> - get it in JSON</li>
|
||||
<li><a id="ajax" href="<?php echo site_url('api/example/users/format/json');?>">Users</a> - get it in JSON (AJAX request)</li>
|
||||
</ul>
|
||||
|
||||
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
|
||||
|
||||
<p><br />Page rendered in {elapsed_time} seconds</p>
|
||||
|
||||
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
// Bind a click event to the 'ajax' object id
|
||||
$("#ajax").bind("click", function( evt ){
|
||||
// Javascript needs totake over. So stop the browser from redirecting the page
|
||||
evt.preventDefault();
|
||||
// AJAX request to get the data
|
||||
$.ajax({
|
||||
// URL from the link that was clicked on
|
||||
url: $(this).attr("href"),
|
||||
// Success function. the 'data' parameter is an array of objects that can be looped over
|
||||
success: function(data, textStatus, jqXHR){
|
||||
alert('Successful AJAX request!');
|
||||
},
|
||||
// Failed to load request. This could be caused by any number of problems like server issues, bad links, etc.
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
alert('Oh no! A problem with the AJAX request!');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user