Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- scroll -->
- <div style="background-color: #white; border: 0px solid 00000; color: black; font-family: arial; font-size: 12px; height: auto; overflow: auto; padding: 6px;
- width: 1010px;">
- <script type="text/javascript">
- var url;
- //kalender
- $('#cc').calendar({
- current:new Date()
- });
- $.fn.datebox.defaults.formatter = function(date){
- var y = date.getFullYear();
- var m = date.getMonth()+1;
- var d = date.getDate();
- return y+'/'+m+'/'+d;
- }
- //end kalender
- function upload_video(){
- jQuery('#dlg').dialog('open').dialog('setTitle','Tambah Berita');
- jQuery('#fupload').form('clear').form('load','<?php echo site_url('cuploadvideo/getTgl'); ?>');
- url = '<?php echo site_url('cuploadvideo/upload_video'); ?>';
- }
- function update(){
- var row = jQuery('#dg').datagrid('getSelected');
- if(row){
- jQuery('#dlg').dialog('open').dialog('setTitle','Edit Berita');
- jQuery('#fupload').form('load',row);
- url = '<?php echo site_url('cuploadvideo/update'); ?>';
- }
- }
- function save(){
- jQuery('#fupload').form('submit',{
- url: url,
- onSubmit: function(){
- return jQuery(this).form('validate');
- },
- success: function(result){
- var result = eval('('+result+')');
- if(result.success){
- jQuery('#dlg').dialog('close');
- jQuery('#dg').datagrid('reload');
- } else {
- jQuery.messager.show({
- title: 'Error',
- msg: result.msg
- });
- }
- }
- });
- }
- function remove_video(){
- var row = jQuery('#dg').datagrid('getSelected');
- if (row){
- jQuery.messager.confirm('Confirm','Are you sure you want to remove this user?',function(r){
- if (r){
- jQuery.post('<?php echo site_url('cuploadvideo/remove'); ?>',{Id:row.Id},function(result){
- if (result.success){
- jQuery('#dg').datagrid('reload');
- } else {
- jQuery.messager.show({
- title: 'Error',
- msg: result.msg
- });
- }
- },'json');
- }
- });
- }
- }
- </script>
- <table width="auto" id="dg" class="easyui-datagrid full-width simple-table responsive-table responsive-table-on"
- style="width:auto;height:auto;" title="Video"
- url="<?php echo site_url('cuploadvideo/gridvideo');?>" pageList="[25,50,75,100]"
- toolbar="#toolbar" pagination="true" rownumbers="true"
- collapsible="false" nowrap="true" fitColumns="false"
- striped="true" resizeHandle="both" showFooter="true"
- singleSelect="true" >
- <thead>
- <tr>
- <th field="Kode" width="50px" sortable="true">Kode</th>
- <th field="Kode_Video" sortable="true">Kode Video</th>
- <th field="Tanggal" width="100" sortable="true">Tanggal</th>
- <th field="Judul" width="150" sortable="true">Judul</th>
- <th field="img" width="150px" sortable="true">Video</th>
- <th field="Deskripsi" width="420px" sortable="true" >Deskripsi</th>
- </tr>
- </thead>
- </table>
- <div id="toolbar">
- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upload_video()">Tambah Video</a>
- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="update()">Edit Video</a>
- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="remove_video()">Hapus Video</a>
- </div>
- <div id="dlg" class="easyui-dialog" style="width:360px;height:490px;padding:5px 20px" closed="true" buttons="#dlg-buttons" modal="true">
- <form id="fupload" enctype="multipart/form-data" method="post" action="<?php echo site_url('cuploadvideo/upload_video'); ?>" novalidate>
- <div class="form-item">
- <label for="Kode">Kode</label><br />
- <input type="text" name="Kode" class="easyui-validatebox" required="true" size="47" maxlength="50" />
- </div>
- <br />
- <div class="form-item">
- <label for="Kode_Video">Kode Video</label><br />
- <input type="text" name="Kode_Video" class="easyui-validatebox" required="true" size="47" maxlength="50" />
- </div>
- <br />
- <div class="form-item" >
- <label for="Tanggal" >Tanggal</label><br />
- <input name="Tanggal" id="cc" type="text" required="true" class="easyui-datebox" style="width:305px;height:180px;" />
- </div>
- <br />
- <div class="form-item">
- <label for="Judul">Judul</label><br />
- <input type="text" name="Judul" class="easyui-validatebox" required="true" size="47" maxlength="50" />
- </div>
- <br />
- <div class="form-item">
- <label for="Deskripsi">Deskripsi</label><br />
- <textarea name="Deskripsi" style="width:300px;height:80px;"></textarea>
- </div>
- <br />
- <label for="File">File:</label><br />
- <input type="hidden" name="Id" id="Id" />
- <input type="file" name="file" size="35" maxlength="50">
- </form>
- </div>
- <div id="dlg-buttons">
- <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="save()">Save</a>
- <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">Cancel</a>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement