pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

PHP pastebin - collaborative debugging tool View Help


Posted by hafizan on Sun 8 Nov 01:08
report abuse | View followups from fgds | download | new post

  1. <?php
  2. /* this will be testing extjs  form
  3. // Conseptual  2 panel. First Panel  for viewing Data only.Second Panel Are for form.It will be used viewport(No choice).Direct  changing html
  4. // are to difficult to manipulate.
  5. Form will be posted at ajax method and will be refresh if new crud function created
  6. */
  7.  
  8. ?>
  9. <?php   //initialize the session
  10.                 session_start();
  11.                 include('class/class_form.php');
  12.                 $f=new personelClass;
  13.                 if (strlen($_SESSION['MM_UserLanguage'])==0) {
  14.                         // check if the any session equal to zero redirect to index.php
  15.                         $f->redirect("index.php");
  16.                 }
  17.  
  18.                 include('Connections/localhost.php');
  19.                 include('class/class_navigation.php');
  20.                 include('class/class_miscellaneous.php');
  21.                 include('language/'.$_SESSION['MM_UserLanguage'].'/text.php');
  22.                 include('class/class_date.php');
  23.  
  24.                 //declare object
  25.                 $d=new dateClass;
  26.                 $m=new miscellaneous;
  27.                 $ng = new navigation;
  28.  
  29.                 $starttime=$m->excute_time_start(); //check the execuation time
  30.                 $q->limit               =       5; // set as global class variable
  31.                 $q->offset              =       $_GET['offset']; // set as global class variable
  32.                 $q->page                =       $_SERVER['PHP_SELF']; // this filename
  33.                 $q->tablename   =       'todo'; // tablename
  34.                 $q->rowid               =       'todoId'; //rowid for delete   
  35.                 // everything given flexibility  on todo
  36.         ?>
  37. <html>
  38. <!-- basic extjs required file -->
  39. <script type="text/javascript" src="js/ext-base.js"></script>
  40. <script type="text/javascript" src="js/ext-all.js"></script>
  41. <!-- end of extjs required file -->
  42. <!-- UX for filtering Data -->
  43. <script type="text/javascript" src="js/menu/RangeMenu.js"></script>
  44. <script type="text/javascript" src="js/menu/ListMenu.js"></script>
  45. <script type="text/javascript" src="js/filter/GridFilters.js"></script>
  46. <script type="text/javascript" src="js/filter/Filter.js"></script>
  47. <script type="text/javascript" src="js/filter/StringFilter.js"></script>
  48. <script type="text/javascript" src="js/filter/DateFilter.js"></script>
  49. <script type="text/javascript" src="js/filter/ListFilter.js"></script>
  50. <script type="text/javascript" src="js/filter/NumericFilter.js"></script>
  51. <script type="text/javascript" src="js/filter/BooleanFilter.js"></script>
  52.  
  53. <!-- end of UX for filtering data -->
  54. <!-- this is UX Form add on -->
  55. <script type="text/javascript" src="js/combobox.js"></script>
  56. <Script type="text/javascript" src="js/colorpicker.js"></script>
  57. <script type="text/javascript" src="js/datetime.js"></script>
  58. <script type="text/javascript" src="js/grid.js"></script>
  59. <script type="text/javascript" src="js/ux/Spotlight.js"></script>
  60. <!-- end of UX Form add on -->
  61. <link rel="stylesheet" type="text/css" href="css/ext-all.css">
  62. <link rel="stylesheet" type="text/css" href="css/icons.css">
  63. <link rel="stylesheet" type="text/css" href="css/Ext.ux.grid.RowActions.css">
  64. <link rel="stylesheet" type="text/css" href="css/empty.css" id="theme">
  65. <link rel="stylesheet" type="text/css" href="css/webpage.css">
  66. <link rel="stylesheet" type="text/css" href="css/rowactions.css">
  67. <style>
  68. .word {
  69.         background-image: url(images/icon/page_word.png) !important;
  70. }
  71. .excel {
  72.         background-image:url(images/icon/page_excel.png) !important;
  73. }
  74. .pdf {
  75.         background-image:url(images/icon/page_white_acrobat.png) !important;
  76. }
  77. .printer {
  78.         background-image:url(images/icon/printer.png) !important;
  79. }
  80. .new {
  81.         background-image:url(images/icon/add.png) !important;
  82. }
  83. .update {
  84.         background-image:url(images/icon/application_edit.png) !important;
  85. }
  86. .remove {
  87.         background-image:url(images/icon/application_form_delete.png) !important;
  88. }
  89. </style>
  90. <!-- Some to create extjs form -->
  91. <script language="javascript" type="text/javascript">
  92.         Ext.onReady(function(){
  93.                                                
  94.                 Ext.BLANK_IMAGE_URL     =       'images/s.gif';
  95.         var encode                      =       false;
  96.         var local                       =       false;
  97.                 var store                       =       new Ext.data.JsonStore({
  98.                 autoDestroy             :       true,
  99.                 url                             :       'arnab.php',
  100.                 remoteSort              :       true,
  101.                 storeId                 :       'myStore',
  102.                 root                    :       'data',
  103.                 totalProperty   :       'total',
  104.                 fields: [       {       name            :       'todoId'                                },
  105.                                                 {       name            :       'todo_cde'                              },
  106.                                                 {       name            :       'todo_tle'                              },
  107.                                                 {       name            :       'department_loc_des'    },
  108.                                                 {       name            :       'asset_nme'                             },
  109.                                                 {       name            :       'todo_sts'                              },
  110.                                                 {       name            :       'date_sts',
  111.                                         type            :       'date',
  112.                                         dateFormat      :       'Y-m-d H:i:s'                   },
  113.                                                 {       name            :       'date_end',
  114.                                         type            :       'date',
  115.                                         dateFormat      :       'Y-m-d H:i:s'                   }       
  116.                                         ]
  117.         });
  118.                 var filters             =       new Ext.ux.grid.GridFilters({
  119.                 // encode and local configuration options defined previously for easier reuse
  120.                 encode  :       encode, // json encode the filter query
  121.                 local   :       local,   // defaults to false (remote filtering)
  122.                 filters: [      {       phpMode         :       true,
  123.                                                         type            :       'list',
  124.                                                         dataIndex       :       'todo_cde',
  125.                                                         column          :       'todo_cde',
  126.                                         table           :       'todo_cde',
  127.                                                         options         :       [       
  128.                                                         <?php   // initilize dummy value for strict setting php
  129.                                                                         $sql            =       NULL;
  130.                                                                         $row            =   NULL;
  131.                                                                         $str            =   NULL;
  132.                                                                         $sql    =       "
  133.                                                                         SELECT  *
  134.                                                                         FROM    `todo_cde`";
  135.                                                                         $q->query_view($sql);   
  136.                                                                         while ($row  = $q->fetch_array()) {
  137.                                                                                 $str.="['".$row['todo_cdeId']."','".$row['todo_cde_des']."'],";
  138.                                                                         }
  139.                                                                         $str.=$q->removeComa($str);
  140.                                                                         echo $str;
  141.                                                                         $q->free_result(); // free resouces query
  142.                                                                    ?>]
  143.                                                 },{     type            :       'string',
  144.                                                         dataIndex       :       'todo_tle',
  145.                                                         column          :       'todo_tle',
  146.                                                         table           :       'todo'
  147.                                         },{     phpMode         :       true,
  148.                                                         type            :   'list',
  149.                                                         dataIndex       :       'department_nme',
  150.                                                         column          :       'departmentId',
  151.                                                         table           :       'department',
  152.                                         options         :       [       
  153.                                                         <?php   // initilize dummy value for strict setting php
  154.                                                                 $sql            =       NULL;
  155.                                                                 $row            =   NULL;
  156.                                                                 $str            =   NULL;
  157.                                                                 $sql    =       "
  158.                                                                 SELECT  *
  159.                                                                 FROM    `department`";
  160.                                                                 $q->query_view($sql);   
  161.                                                                 while ($row  = $q->fetch_array()) {
  162.                                                                         $str.="['".$row['departmentId']."','".$row['department_nme']."'],";
  163.                                                                 }
  164.                                                                 $str.=$q->removeComa($str);
  165.                                                                 echo $str;
  166.                                                                 $q->free_result(); // free resouces query
  167.                                                            ?>]
  168.                                                 },{     phpMode         :       true,
  169.                                                         type            :       'list',
  170.                                                         dataIndex       :       'department_loc_des',
  171.                                                         column          :       'department_locId',
  172.                                                         table           :       'department_loc',
  173.                                         options         :       [       
  174.                                                                         <?php   // initilize dummy value for strict setting php
  175.                                                                                         $sql            =       NULL;
  176.                                                                                         $row            =   NULL;
  177.                                                                                         $str            =   NULL;
  178.                                                                                         $sql    =       "
  179.                                                                                         SELECT  *
  180.                                                                                         FROM    `department_loc`";
  181.                                                                                         $q->query_view($sql);   
  182.                                                                                         while ($row  = $q->fetch_array()) {
  183.                                                                                                 $str.="['".$row['department_locId']."','".$row['department_loc_des']."'],";
  184.                                                                                         }
  185.                                                                                         $str.=$q->removeComa($str);
  186.                                                                                
  187.                                                                                         echo $str;
  188.                                                                                         $q->free_result(); // free resouces query       ?>]
  189.                                                 },{     type            :   'string',
  190.                                                         dataIndex       :       'asset_nme',
  191.                                                         column          :       'asset_nme',
  192.                                                         table           :       'asset'
  193.                                         },{     type            :   'string',
  194.                                                         dataIndex       :       'todo_sts',
  195.                                                         column          :       'todo_sts',
  196.                                                        
  197.                                         },{     type            :       'date',
  198.                                                         dataIndex       :       'date_stt'            
  199.                                         },{     type            :       'date',
  200.                                                         dataIndex       :       'date_end'          
  201.                                         }]
  202.         });
  203.                 this.action             =       new Ext.ux.grid.RowActions({
  204.                 header          :       'Actions',
  205.                         dataIndex       :       'todoId',
  206.                         actions         :       [{
  207.                 iconCls         :       'update',
  208.             callback    : function(grid, record, action, row, col){
  209.                                 Ext.MessageBox.alert('message','This is for update button');
  210.                                 formPanel.form.load({
  211.                                         url             :       'arnab.php',
  212.                                         method  :       'POST',
  213.                                         waitMsg :       'Loading...',
  214.                                         params  :       { method :'read',mode:'update',todoId:record.data.todoId },
  215.                                         success :       function(form,action) {
  216.                                 Ext.MessageBox.alert('Message', 'Loaded OK');
  217.                                                 viewPort.items.get(1).expand();
  218.                                         },             
  219.                         failure :       function(action) {
  220.                                 Ext.MessageBox.alert('Message', 'Load failed.grid');
  221.                         }
  222.                                 });
  223.                         }
  224.                 },{
  225.                         iconCls         :       'remove',
  226.                         callback        :       function(grid, record, action, row, col) {
  227.                                 Ext.Msg.show({
  228.                                         title   :       'Delete record?',
  229.                                         msg             :       'Do you really want to delete </b><br/>There is no undo.',
  230.                                         icon    :       Ext.Msg.QUESTION,
  231.                                         buttons :       Ext.Msg.YESNO,
  232.                                         scope   :       this,
  233.                                         fn              :       function(response) {
  234.                                         if('yes' == response) {
  235.                                                 Ext.MessageBox.alert('message','nothing change');
  236.                                                 Ext.Ajax.request({
  237.                                                         url             :       'arnab.php',
  238.                                                         params  :       {       method:'delete',todoId:record.data.todoId },
  239.                                                         success :       function(){
  240.                                                                 Ext.MessageBox.alert('Message','Data have been Remove');       
  241.                                                                 store.reload();
  242.                                                         },
  243.                                                         failure :       function(){
  244.                                                                 Ext.MessageBox.alert('Message','Data failure update');
  245.                                                         }
  246.                                                 });
  247.                                         }
  248.                                 }
  249.                         });
  250.                         }
  251.                 }]
  252.         });
  253.                 var columnModel         =       [this.action,{
  254.                                 dataIndex       : 'todo_cde',
  255.                                 header          : 'Todo Code'
  256.                 },{             dataIndex       :       'todo_tle',
  257.                                 header          :       'Title'
  258.                 },{             dataIndex       :       'department_nme',
  259.                                 header          :       'Department'           
  260.                                
  261.                 }, {    dataIndex       :       'department_loc_des',
  262.                                 header          :       'Location'
  263.                 },{             dataIndex       :       'asset_nme',
  264.                                 header          :       'Asset Name'
  265.                 },{             dataIndex       :       'todo_sts',
  266.                                 header          :       'Status'
  267.                 },{             dataIndex       :       'date_stt',
  268.                                 header          :       'Start',
  269.                                 renderer        :       Ext.util.Format.dateRenderer('d-m-Y'),
  270.                                 filter          :       {       type    :       'date'                          }            
  271.                 },{             dataIndex       :       'date_end',
  272.                                 header          :       'End',
  273.                                 renderer        :       Ext.util.Format.dateRenderer('d-m-Y'),
  274.                                 filter          :       {       type    : 'date'                        }            
  275.                 },{             dataIndex       :       'todo_clr',
  276.                                 header          :       'Color'
  277.                 }];
  278.                 var grid                        =       new Ext.grid.GridPanel({
  279.                         border                          :       false,
  280.                         store                           :       store,
  281.                         autoHeight                      :       'auto',
  282.                         columns                         :       columnModel,
  283.                         loadMask                        :       true,
  284.                         plugins                         :       [this.action,filters],
  285.                         sm                                      :       new Ext.grid.RowSelectionModel({singleSelect: true}),
  286.                         listeners                       :       {
  287.                                 render                  : {
  288.                                         fn                      : function(){
  289.                                                                         store.load({
  290.                                                                                 params  :       {
  291.                                                                                         start   :       0,
  292.                                                                                         limit   :       50,
  293.                                                                                         method  :       'read',
  294.                                                                                         mode    :       'view'
  295.                                                                                 }
  296.                                                                         });
  297.                                                                 }
  298.                                                         }
  299.                                 },
  300.                                 bbar                            :       new Ext.PagingToolbar({
  301.                         store           :       store,
  302.                         pageSize        :       50,
  303.                         plugins         :       [filters]
  304.                 })
  305.                 });
  306.                 var gridPanel           =       new Ext.Panel ({
  307.                         title:'testing grid data',
  308.                         tbar :[ {       text : ' ',             iconCls : ' '           },
  309.                                         {       text    : 'New Record',        
  310.                                                 iconCls : 'new',
  311.                                                 handler :       function () {
  312.                                                         Ext.MessageBox.alert('message','you will add record');
  313.                                                         viewPort.items.get(1).expand();
  314.                                                 }
  315.                                         },{ text        : 'Words',     
  316.                                                 iconCls : 'word',
  317.                                                 handler : function() {
  318.                                                         Ext.MessageBox.alert('message','will open new page contain fake words');
  319.                                                 }
  320.                                         },{ text        : 'Excel',     
  321.                                                 iconCls : 'excel',
  322.                                                 handler : function() {
  323.                                                         Ext.MessageBox.alert('message','will open new page contain fake excel');
  324.                                                 }
  325.                                         },{ text : 'Pdf',              
  326.                                                 iconCls : 'pdf',
  327.                                                 handler : function() {
  328.                                                         Ext.MessageBox.alert('message','will open pdf');
  329.                                                 }
  330.                                         }],
  331.                                 items:[grid]
  332.                 });
  333.                 // viewport just save information,items will do separate
  334.                                 var departmentId                =       new Ext.ux.form.ComboBoxMatch({
  335.         <?php   $sql    =       NULL;
  336.                         $result =       NULL;
  337.                         $row    =       NULL;
  338.                         $str    =       NULL;
  339.                         $sql    =       "       SELECT  *
  340.                                                         FROM    `department`
  341.                                                         WHERE   1 ";
  342.                         $result =  mysql_query($sql) or die(mysql_error());     
  343.                         if(mysql_num_rows($result) >  0 ) {
  344.                                 // only  create store if exist data
  345.                                 echo "  store           : [ ";
  346.                                
  347.                                 while ($row      =  mysql_fetch_array($result)) {
  348.                                         $str.= "['".$row['departmentId']."','".$row['department_cde']." -- ".$row['department_nme']." (".$row['department_des'].") '],";
  349.                                 }
  350.                                 echo substr($str,0,-1);
  351.                                 echo "],";
  352.                         }       ?>     
  353.                         xtype           : 'combo',
  354.                         labelAlign      : 'left',
  355.                         fieldLabel      : 'Department',
  356.                         hiddenName      : 'departmentId',
  357.                         anchor          : '95%',
  358.                         emptyText               : 'Please Select Department',
  359.                         typeAhead               : false,
  360.                         triggerAction   : 'all',
  361.                         listener                : function () {
  362.                                 // load information  arnab.php
  363.                         },
  364.                         createValueMatcher: function(value) {
  365.                 value = String(value).replace(/\s*/g, '');
  366.                 if(Ext.isEmpty(value, false)){
  367.                         return new RegExp('^');
  368.                 }
  369.                 value = Ext.escapeRe(value.split('').join('\\s*')).replace(/\\\\s\\\*/g, '\\s*');
  370.                 return new RegExp('\\b(' + value + ')', 'i');
  371.                 }
  372.          });
  373.        
  374.                
  375.         departmentId.on('select', function() {
  376.                 // recall back the store
  377.                 department_locId.enable();
  378.                 var department_loc_store = new Ext.data.Store({
  379.                         proxy   :       new Ext.data.HttpProxy({
  380.                         url             :       'arnab.php'
  381.                         }),
  382.                 reader          :       department_loc_reader,
  383.                         remoteSort      :       false,
  384.                         baseParams      :       {method:'read',mode:'chained',departmentId:departmentId.getValue()  }
  385.                 });
  386.         department_locId.store=department_loc_store; //reference back store
  387.                 department_loc_store.load();
  388.     });
  389.  
  390.                 // map to array first so  can reload  when department is choosen,testingo
  391.                 var department_loc_reader = new Ext.data.JsonReader({ root:'data' }, [ 'value', 'text']);
  392.                
  393.                 // store will be remote 
  394.                 var department_locId            =       new Ext.ux.form.ComboBoxMatch({
  395.                         store                   :'',
  396.                         minChars                : 0,
  397.                         valueField              : 'value',
  398.                         displayField    : 'text',
  399.                         xtype           : 'combo',
  400.                         labelAlign      : 'left',
  401.                         fieldLabel      : 'Location ',
  402.                         hiddenName      : 'department_locId',
  403.                         anchor          : '95%',
  404.                         emptyText               : 'Please Select location',
  405.                         typeAhead               : false,
  406.                         triggerAction   : 'all',
  407.                        
  408.          });
  409.                 department_locId.disable();
  410.                
  411.                 
  412.                 var todo_cdeId          =       new Ext.ux.form.ComboBoxMatch({
  413.                 <?php   // predefine variable .Strict type setting
  414.                         $sql    =       NULL;
  415.                         $result =       NULL;
  416.                         $row    =       NULL;
  417.                         $str    =       NULL;
  418.                         $sql    =  "    SELECT  *
  419.                                                         FROM    `todo_cde`
  420.                                                         WHERE   1 ";
  421.                         $result =  mysql_query($sql) or die(mysql_error());     
  422.                         if(mysql_num_rows($result) >  0 ) {
  423.                                 // only  create store if exist data
  424.                                 echo "  store           : [ ";
  425.                                 $str= NULL; //  initilize dummy value
  426.                                 while ($row =  mysql_fetch_array($result)) {
  427.                                         $str.= "['".$row['todo_cdeId']."','".$row['todo_cde']." -- ".$row['todo_cde_des']."'],";
  428.                                 }
  429.                                 echo substr($str,0,-1);
  430.                                 echo "],";
  431.                         }       ?>     
  432.                         xtype           : 'combo',
  433.                         labelAlign      : 'left',
  434.                         fieldLabel      : 'Todo Code',
  435.                         name                    : 'todo_cdeId',
  436.                         hiddenName      : 'todo_cdeId',
  437.                         anchor                  : '95%',
  438.                         emptyText               : 'Please Select Asset',
  439.                         typeAhead               : false,
  440.                 triggerAction   : 'all',
  441.                         createValueMatcher: function(value) {
  442.                 value = String(value).replace(/\s*/g, '');
  443.                 if(Ext.isEmpty(value, false)){
  444.                         return new RegExp('^');
  445.                 }
  446.                 value = Ext.escapeRe(value.split('').join('\\s*')).replace(/\\\\s\\\*/g, '\\s*');
  447.                 return new RegExp('\\b(' + value + ')', 'i');
  448.                 }
  449.          });
  450.                 var todo_title          =       new Ext.form.TextField({
  451.                 labelAlign  :   'left',
  452.                 fieldLabel  :   'Todo Title',
  453.                 hiddenName  :   'todo_tle',
  454.                 name            :       'todo_tle',
  455.                 anchor      :   '95%'
  456.         });
  457.                 var todo_date           =       new Ext.form.DateField({
  458.                         labelAlign  :   'left',
  459.                         fieldLabel  :   'Todo Date',
  460.                         hiddenName  :   'todo_dte',
  461.                         name            :       'todo_dte',
  462.                         format          :       'd-m-Y',
  463.                         dateConfig      :       {
  464.                                 altFormats      :       'Y-m-d|Y-n-d',
  465.                                 allowBlank      :       true    
  466.                    },
  467.                         anchor      :   '95%'
  468.                 });
  469.                 var assetId                     =       new Ext.ux.form.ComboBoxMatch({
  470.                 <?php   $sql    =       NULL;
  471.                         $result =       NULL;
  472.                         $row    =       NULL;
  473.                         $str    =       NULL;
  474.                         $sql    =       "       SELECT  *
  475.                                                         FROM    `asset`
  476.                                                         WHERE   1 ";
  477.                         $result =  mysql_query($sql) or die(mysql_error());     
  478.                         if(mysql_num_rows($result) >  0 ) {
  479.                                 // only  create store if exist data
  480.                                 echo "  store           : [ ";
  481.                                
  482.                                 while ($row      =  mysql_fetch_array($result)) {
  483.                                         $str.= "['".$row['assetId']."','".$row['asset_nme']."'],";
  484.                                 }
  485.                                 echo substr($str,0,-1);
  486.                                 echo "],";
  487.                         }       ?>     
  488.                         xtype           : 'combo',
  489.                         fieldLabel      : 'Asset Code',
  490.                         hiddenName      : 'assetId',
  491.                         name                    : 'assetId',
  492.                         anchor          : '95%',
  493.                         emptyText               : 'Please Select Asset',
  494.                         typeAhead               : false,
  495.                         triggerAction   : 'all',
  496.                 createValueMatcher: function(value) {
  497.                 value = String(value).replace(/\s*/g, '');
  498.                 if(Ext.isEmpty(value, false)){
  499.                         return new RegExp('^');
  500.                 }
  501.                 value = Ext.escapeRe(value.split('').join('\\s*')).replace(/\\\\s\\\*/g, '\\s*');
  502.                 return new RegExp('\\b(' + value + ')', 'i');
  503.                 }
  504.                 });
  505.        
  506.        
  507.                 var todo_des            =       new Ext.form.HtmlEditor({
  508.                 title           :       'Description',
  509.                 labelAlign  :   'top',
  510.                 id                      :   'todo_des',
  511.                 name            :       'todo_des',
  512.                 hideLabel       :       true,
  513.                 height          :       200,
  514.                 anchor          :       '98%'
  515.         });
  516.                 var date_start          =       new Ext.ux.form.DateTime({
  517.                 labelAlign      :       'left',
  518.                 anchor      :   '95%',
  519.                 id                      :       'date_stt',
  520.                 name            :       'date_stt',
  521.                 fieldLabel      :       'Date/Time Start',
  522.    
  523.                 timeFormat      :       'H:i:s',
  524.         timeConfig      :       {
  525.                 altFormats      :       'H:i:s',
  526.                         allowBlank      :       true    
  527.         },
  528.                 dateFormat      :       'd-m-Y',
  529.                 dateConfig      :       {
  530.                 altFormats      :       'Y-m-d|Y-n-d',
  531.                         allowBlank      :       true    
  532.        }
  533.            
  534.         });
  535.                 var date_end            =       new Ext.ux.form.DateTime({
  536.                 labelAlign      : 'left',
  537.                 anchor      : '95%',
  538.                 id                      :       'date_end',
  539.                 name            :  'date_end',
  540.                 fieldLabel      :'Date/Time End',
  541.        
  542.                 timeFormat      :'H:i:s',
  543.         timeConfig      : {
  544.                 altFormats      :       'H:i:s',
  545.                         allowBlank      :       true    
  546.         },
  547.                 dateFormat:'d-m-Y',
  548.                 dateConfig: {
  549.                 altFormats      :       'Y-m-d|Y-n-d',
  550.                         allowBlank      :       true    
  551.        }
  552.            
  553.         });
  554.                 // hidden id for updated
  555.                 var todoId                      =       new Ext.form.Hidden({ name:'todoId'     });
  556.        
  557.                 var formPanel           =       new Ext.form.FormPanel({
  558.                 url                     :       'arnab.php',
  559.                         params          :       { method:'save',todoId:todoId.value },
  560.                         method          :       'post',
  561.                         frame       :    true,
  562.                         title       :   'Todo Form Entry',
  563.                 border      :   false,
  564.                         bodyStyle       :       'padding: 10px',  
  565.                 width           :       600,
  566.                         items           :       [{      layout          : 'column',
  567.                                                                 items           : [{
  568.                                                                                 columnWidth : 0.5,
  569.                                                                                 layout          : 'form',
  570.                                                                                 items           : [ todo_cdeId,todo_title,todo_date,date_start]
  571.                                                                 },{             columnWidth : 0.5,
  572.                                                                                 layout          : 'form',
  573.                                                                                 items           : [assetId,departmentId,department_locId,date_end]
  574.                                                                 }]
  575.                                                
  576.                                                 },todo_des],
  577.                         buttonVAlign:   'top',
  578.                         buttonAlign     :       'left',
  579.                         buttons         :       [       {               text    :       'Save',
  580.                                                                                 handler :       function () {
  581.                                                                                         formPanel.getForm().submit({
  582.                                                                                         waitMsg :       'Saving',
  583.                                                                                         params  :       { method:'save',todoId:todoId.value },
  584.                                                                                         success :       function(){
  585.                                                                                                 Ext.MessageBox.alert('Message','Data have been saved')
  586.                                                                                                 formPanel.getForm().reset();
  587.                                                                                                 store.reload();
  588.                                                                                                 viewPort.items.get(0).expand();
  589.                                                                                         },
  590.                                                                                         failure :       function(){
  591.                                                                                                 Ext.MessageBox.alert('Message','Data failure update');
  592.                                                                                         }       
  593.                                                                                 });
  594.                                                                                 }
  595.                                                                 },{     text    :       'Cancel',
  596.                                                                                 handler :       function(){ formPanel.getForm().reset(); } }]
  597.                 });    
  598.                 var viewPort            =       new Ext.Viewport({
  599.                         id                              :       'viewport',
  600.                         region                  :       'center',
  601.                         layout                  :       'accordion',
  602.                         layoutConfig    :       {
  603.                         // layout-specific configs go here
  604.                         titleCollapse   : true,
  605.                         animate                 : false,
  606.                         activeOnTop             : true
  607.                 },
  608.                         items   :       [gridPanel,formPanel]
  609.                 });
  610.        
  611.         });
  612. </script>
  613. <body>
  614. </body>
  615. </html>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post