📜 ⬆️ ⬇️

ExtJS and PHP in the example

Good day,

When I started writing on ExtJS, there were not enough examples with PHP code on the Internet, there were articles, but they all boiled down to the fact that there was ExtJS code (book translations) without PHP. That's why I decided to write this article.

For starters, some tips for beginners ExtJS:
First: Do not know JavaScript? Do not be lazy to read a book on JS.
Secondly: Go to www.extjs.com there are many good examples of ExtJS with PHP.
And third: Use docs and examples from the ExtJS library.

Now for example. Let's write a small program for entering documents of consignment notes into the database. The invoice will consist of the number, date, the seller’s field (selection from the database), the buyer field (selection from the database), the invoice goods table and the table of the goods we have (from the database). The button “Save” invoice will be sent to the database.
This example is enough to understand the basis of the interaction between ExtJS and PHP. And so proceed, our form will look like this:
')
image

First, create the following directory and file structure:

image

ext - ExtJS library
index.php - no comments :)
app.js - the program itself

Also we will have more files:

config.php - connect to the database
get_org.php - getting the list of organizations from the database in JSON format
get_tovar.php - getting the list of products from the database in JSON format
save.php - saving the form in the database

Code index.php:
< html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  1. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  2. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  3. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  4. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  5. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  6. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  7. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  8. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  9. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  10. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  11. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  12. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  13. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  14. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  15. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  16. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  17. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  18. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  19. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  20. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  21. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  22. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  23. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  24. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  25. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  26. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  27. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  28. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  29. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  30. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  31. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  32. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  33. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  34. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  35. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  36. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  37. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  38. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  39. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  40. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  41. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  42. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  43. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  44. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
  45. < html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .
< html > < head > < title > ExtJS PHP </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=windows-1251" /> < link rel ="stylesheet" type ="text/css" href ="lib/ext/resources/css/ext-all.css" /> < script type ="text/javascript" src ="lib/ext/adapter/ext/ext-base.js" ></ script > <script type= "text/javascript" src= "lib/ext/ext-all.js" ></script> <script type= "text/javascript" src= "app.js" ></script> <style type= "text/css" > .movie_form { padding: 10px; } .movie-item { font:normal 12px tahoma, arial, helvetica, sans-serif; line-height:150%; padding:5px 20px 5px 10px; border:1px solid #fff; border-bottom:1px solid #eeeeee; white-space:normal; color:#555; } .movie-item h2 { display:block; font:inherit; font-weight:bold; color:#336699; } .movie-item h2 span { float : right; font-weight:normal; color:#555; margin:0 0 5px 5px; width:100px; display:block; clear:none; } </style> <script type= "text/javascript" src= "ext-lang-ru.js" > </ script > </ head > < body > < div > < div class ="movie_form" id ="form" ></ div > </ div > </ body > </ html > * This source code was highlighted with Source Code Highlighter .


App.js code:
  1. Ext.BLANK_IMAGE_URL = 'lib / ext / resources / images / default / s.gif' ;
  2. Ext.QuickTips.init ();
* This source code was highlighted with Source Code Highlighter .

We enter at the very beginning.
  1. // Template for Combo Box
  2. var _combo_tpl = new Ext.XTemplate (
  3. '<tpl for = \ ". \"> <div class = \ "movie-item \">' ,
  4. '<h2> <span> ID: {id_org} </ span> {name} </ h2>' ,
  5. 'TIN: {inn}' ,
  6. '</ div> </ tpl>'
  7. );
* This source code was highlighted with Source Code Highlighter .

Template to display a drop-down list.

image
  1. // Storage of the list of Organizations
  2. var _store_saller = new Ext.data.Store ({
  3. reader: new Ext.data.JsonReader ({root: 'rows' , id: 'id_org' , fields: [ 'id_org' , 'name' , 'inn' ]}))
  4. proxy: new Ext.data.HttpProxy ({url: 'get_org.php' })
  5. });
* This source code was highlighted with Source Code Highlighter .

The data storage for the list of organizations, data is obtained from the database via the get_org.php script, the script returns us the JSON response. An example script will be shown below.
  1. // ComboBox Fields Seller
  2. var _combo_saller = {
  3. xtype: 'combo' , name: 'prod' , fieldLabel: 'Seller' , store: _store_saller, anchor: '100%' , emptyText: 'Select ...' ,
  4. valueField: 'id_org' , displayField: 'name' , mode: 'remote' , triggerAction: 'all' ,
  5. tpl: _combo_tpl, itemSelector: 'div.movie-item' , minChars: 2
  6. }
  7. // Combo Box Buyer
  8. var _combo_bayer = {
  9. xtype: 'combo' , name: 'pok' , fieldLabel: 'Buyer' , store: _store_saller, anchor: '100%' , emptyText: 'Select ...' ,
  10. valueField: 'id_org' , displayField: 'name' , mode: 'remote' , triggerAction: 'all' ,
  11. tpl: _combo_tpl, itemSelector: 'div.movie-item' , minChars: 2
  12. }
* This source code was highlighted with Source Code Highlighter .

Comboboxes for the seller and buyer list. tpl: _combo_tpl - here we use the previously prepared template.
  1. // Storage for the inventory list of the current document
  2. var _store_tovar = new Ext.data.JsonStore ({
  3. root: 'tovar' ,
  4. fields: [
  5. {name: 'id' , type: 'float' },
  6. {name: 'name' },
  7. {name: 'col' , type: 'float' },
  8. {name: 'price' , type: 'float' }
  9. ]
  10. });
  11. // Storage for a list of all Products
  12. var _store_tovar_all = new Ext.data.JsonStore ({
  13. url: 'get_tovar.php' ,
  14. root: 'tovar' ,
  15. fields: [
  16. {name: 'id' , type: 'float' },
  17. {name: 'name' },
  18. {name: 'col' , type: 'float' },
  19. {name: 'price' , type: 'float' }
  20. ],
  21. autoLoad: true
  22. });
* This source code was highlighted with Source Code Highlighter .

The storage for the list of all Products (_store_tovar_all) retrieves data from the database via the get_tovar.php script, the script returns JSON. The type parameter: 'float' is more needed here for the correct sorting of data in the grid.
  1. // Grid Fields _grid_tovar
  2. var _grid_columns = [
  3. {header: "ID" , width: 30, dataIndex: 'id' , sortable: true , hidden: true },
  4. {id: 'title' , header: "Name" , width: 180, dataIndex: 'name' , sortable: true },
  5. {header: "Number" , width: 85, dataIndex: 'col' , sortable: true },
  6. {header: "Price" , width: 85, dataIndex: 'price' , sortable: true , align: 'center' }
  7. ]
  8. // Grid Fields _grid_tovar_all
  9. var _grid_columns_all = [
  10. {header: "ID" , width: 30, dataIndex: 'id' , sortable: true , hidden: true },
  11. {id: 'title' , header: "Name" , width: 180, dataIndex: 'name' , sortable: true },
  12. {header: "Number" , width: 85, dataIndex: 'col' , sortable: true },
  13. {header: "Price" , width: 85, dataIndex: 'price' , sortable: true , align: 'center' }
  14. ]
* This source code was highlighted with Source Code Highlighter .

Fields to be used in grids.
  1. // Grid list of products of the current document
  2. var _grid_tovar = new Ext.grid.GridPanel ({
  3. store: _store_tovar, // Storage
  4. enableDragDrop: true
  5. ddGroup: '_grid_tovar_DDGroup' ,
  6. columns: _grid_columns,
  7. stripeRows: true
  8. autoExpandColumn: 'title' ,
  9. frame: true
  10. height: 200,
  11. loadMask: true
  12. columnLines: true
  13. clicksToEdit: 1,
  14. // border: false,
  15. tbar: {
  16. items: [
  17. {
  18. text: 'Peel' ,
  19. handler: function () {
  20. _grid_tovar.getView (). refresh ();
  21. _grid_tovar_all.getView (). refresh ();
  22. _grid_tovar.store.removeAll ();
  23. }
  24. }, {
  25. text: 'Remove This Item' ,
  26. handler: function () {
  27. var s = _grid_tovar.getSelectionModel (). getSelections ();
  28. for ( var i = 0, r; r = s [i]; i ++) {
  29. _grid_tovar.store.remove (r);
  30. }
  31. }
  32. }
  33. ]
  34. }
  35. });
* This source code was highlighted with Source Code Highlighter .

Grid of the list of goods in the document, with a button for cleaning up the grid and deleting the selected position
  1. // Grid Of All Products List
  2. var _grid_tovar_all = new Ext.grid.GridPanel ({
  3. store: _store_tovar_all,
  4. enableDragDrop: true
  5. ddGroup: '_grid_tovar_all_DDGroup' ,
  6. columns: _grid_columns_all,
  7. stripeRows: true
  8. autoExpandColumn: 'title' ,
  9. frame: true
  10. height: 200,
  11. loadMask: true
  12. columnLines: true
  13. listeners: {
  14. rowdblclick: function (_grid_tovar_all, row, e) {
  15. var record_all = _grid_tovar_all.getStore (). getAt (row);
  16. var rec = record_all.copy ();
  17. var _button = new Ext.Button ({
  18. text: 'Save' ,
  19. handler: function () {
  20. rec.data [ 'col' ] = _panel.getForm (). findField ( 'fcol' ) .getValue ( true );
  21. rec.data [ 'price' ] = _panel.getForm (). findField ( 'fprice' ). getValue ( true );
  22. _grid_tovar.store.insert (0, rec);
  23. _grid_tovar.getView (). refresh ();
  24. _win.close ();
  25. }
  26. })
  27. var _panel = new Ext.FormPanel ({
  28. border: false , frame: true ,
  29. items: [
  30. {xtype: 'textfield' , name: 'fcol' , fieldLabel: 'Number' , value: '1' }, // selectOnFocus: true},
  31. {xtype: 'textfield' , name: 'fprice' , fieldLabel: 'Price' , value: rec.get ( 'price' )} //, selectOnFocus: true}
  32. ]
  33. })
  34. var _win = new Ext.Window ({
  35. title: rec.get ( 'name' ),
  36. border: false , resizable: false , width: 270,
  37. items: [_panel],
  38. buttons: [_button],
  39. keys: [{
  40. key: 13, // Enter key
  41. handler: function () {
  42. _button.focus ();
  43. }
  44. }],
  45. listeners: {
  46. activate: function () {
  47. _panel.getForm (). findField ( 'fcol' ) .focus ( true , 250);
  48. }
  49. }
  50. }). show ();
  51. }
  52. },
  53. keys: [
  54. {
  55. key: 27, // Esc key
  56. handler: function () {
  57. alert ( 'Esc' );
  58. }
  59. }, {
  60. key: 13, // Enter key
  61. handler: function () {
  62. alert ( 'Enter' );
  63. }
  64. }
  65. ]
  66. });
* This source code was highlighted with Source Code Highlighter .

Grid list of all products. rowdblclick is a double-click event on the grid. When clicked, a window (_win) opens to enter the quantity of goods and prices. After clicking the “Save” button or ENTER in the window, the already corrected data falls into the grid of the list of goods in the document. keys - given here as an example of working with keys. key: 13, // Enter key in the handler you can register an event for the ENTER button the same as with a double click on the grid.
  1. Ext.onReady ( function () {
* This source code was highlighted with Source Code Highlighter .

We start form generation.
  1. // Main form of the document
  2. var _form_sf = new Ext.FormPanel ({
  3. id: 'id_form_sf' ,
  4. url: 'save.php' ,
  5. renderTo: 'form' ,
  6. frame: true
  7. title: 'Invoice' ,
  8. width: 600,
  9. items: [
  10. {
  11. layout: 'column' ,
  12. items: [
  13. {
  14. columnWidth: .6,
  15. layout: 'form' ,
  16. items: [{xtype: 'textfield' , id: 'track-tip-num' , name: 'title' , fieldLabel: 'Number' , anchor: '95% ' }]
  17. }, {
  18. columnWidth: .4,
  19. layout: 'form' ,
  20. labelWidth: 40,
  21. items: [{xtype: 'datefield' , id: 'track-tip-data' , name: 'date' , fieldLabel: 'Date' , anchor: '100%' }]
  22. }
  23. ]
  24. },
  25. _combo_saller,
  26. _combo_bayer,
  27. _grid_tovar,
  28. _grid_tovar_all
  29. ],
  30. buttons: [
  31. {
  32. text: 'Save' ,
  33. handler: function () {
  34. var modifiedRecords = _grid_tovar.store.getRange ();
  35. if (modifiedRecords.length> 0) {
  36. var jsonData = "[" ;
  37. jsonData + = Ext.util.JSON.encode (modifiedRecords [0] .data);
  38. for ( var cnt = 1; cnt <modifiedRecords.length; cnt ++) {
  39. var record = modifiedRecords [cnt];
  40. jsonData + = ',' + Ext.util.JSON.encode (record.data);
  41. }
  42. jsonData = jsonData.substring (0, jsonData.length) + "]" ;
  43. };
  44. _form_sf.getForm (). submit ({
  45. // waitMsg: 'Transferring data ...',
  46. params : {
  47. prod_id: _form_sf.getForm (). findField ( 'prod' ) .getValue ( true ),
  48. pok_id: _form_sf.getForm (). findField ( 'pok' ) .getValue ( true ),
  49. data: jsonData
  50. },
  51. success: function (f, a) {
  52. Ext.Msg.alert ( 'Finish' , a.result.truemsg);
  53. },
  54. failure: function (f, a) {
  55. Ext.Msg.alert ( 'Error' , a.result.errormsg);
  56. }
  57. })
  58. }
  59. }, {
  60. text: 'Peel' ,
  61. handler: function () {
  62. _form_sf.getForm (). reset ();
  63. _grid_tovar.store.removeAll ();
  64. }
  65. }
  66. ]
  67. });
* This source code was highlighted with Source Code Highlighter .

Here is the main form of the document. save.php is a script for saving data. _combo_saller, _combo_bayer, _grid_tovar, _grid_tovar_all - this is our previously prepared data. When you click on the "Save" button, the jsonData variable is created from the document goods grid, which contains the document product grid in JSON format. Further, the save.php script prepares and passes parameters (params :), which are not passed by default to the form. Parameters prod_id, pok_id and data. The fact is that, from combo boxes, the form displays the displayed data by default, specifically the name of the organizations (displayField: 'name'), and we need the ID values ​​(valueField: 'id_org'), so we receive and pass them separately (prod_id: _form_sf. getForm (). findField ('prod'). getValue (true) and so on.). After the script, save.php processes and returns to us the answer in which it sends us information about how successful (success :) passed or not (failure :), the script can also return errors to specific fields of the form. An example save.php will be shown below.
  1. // Drag and Drop configuration for _grid_tovar
  2. var firstGridDropTargetEl = _grid_tovar.getView (). scroller.dom;
  3. var firstGridDropTarget = new Ext.dd.DropTarget (firstGridDropTargetEl, {
  4. ddGroup: '_grid_tovar_all_DDGroup' ,
  5. notifyDrop: function (ddSource, e, data) {
  6. var records = ddSource.dragData.selections;
  7. _grid_tovar.store.insert (0, records);
  8. _grid_tovar.getView (). refresh ();
  9. return true
  10. }
  11. });
  12. // Drag and Drop configuration for _grid_tovar_all
  13. var secondGridDropTargetEl = _grid_tovar_all.getView (). scroller.dom;
  14. var secondGridDropTarget = new Ext.dd.DropTarget (secondGridDropTargetEl, {
  15. ddGroup: '_grid_tovar_DDGroup' ,
  16. notifyDrop: function (ddSource, e, data) {
  17. var records = ddSource.dragData.selections;
  18. Ext.each (records, ddSource.grid.store.remove, ddSource.grid.store);
  19. _grid_tovar_all.getView (). refresh ();
  20. return true
  21. }
  22. });
  23. })
* This source code was highlighted with Source Code Highlighter .

And finally, the configuration of how the Drag and Drop of our grids will behave.

Now to the codes on php, and so:

Code config.php: (DB setting)
  1. <? php
  2. $ db_server = "localhost" ; // Database Host
  3. $ db_user = "root" ; // Database Login
  4. $ db_password = "" ; // DB Password
  5. $ db_dbname = "online" ; // DB name
  6. $ connect = @mysql_connect ($ db_server, $ db_user, $ db_password) // Create a connection ($ connect identifier)
  7. or die ( "Couldn't connect to MySQL: <br>" . mysql_error (). "<br>" . mysql_errno ());
  8. $ db = @mysql_select_db ($ db_dbname, $ connect) // Select the base
  9. or die ( "Couldn't select database: <br>" . mysql_error (). "<br>" . mysql_errno ());
* This source code was highlighted with Source Code Highlighter .

Code get_org.php: (get the list of organizations)
  1. <? php
  2. require ( 'config.php' );
  3. $ cmd = iconv ( 'UTF-8' , 'WINDOWS-1251' , $ _POST [ 'query' ]); // Request from Combobox
  4. $ query = 'SELECT id_org, name, inn FROM `organizatsii` WHERE` name` LIKE \'% ' . $ cmd. '% \' ORDER BY name ' ;
  5. $ query2 = 'SELECT id_org, name, inn FROM `organizatsii` WHERE` inn` LIKE \'% ' . $ cmd. '% \' ORDER BY name ' ;
  6. $ result = @mysql_query ($ query, $ connect) or die ( "Could not execute query: <br>" . mysql_error (). "<br>" . mysql_errno ());
  7. if (mysql_num_rows ($ result) == 0) {
  8. $ result = @mysql_query ($ query2, $ connect) or die ( "Couldn't execute query: <br>" . mysql_error (). "<br>" . mysql_errno ());
  9. }
  10. while ($ row = mysql_fetch_array ($ result)):
  11. $ row [ "name" ] = iconv ( 'WINDOWS-1251' , 'UTF-8' , $ row [ "name" ]);
  12. $ arr [] = $ row;
  13. endwhile;
  14. $ u2koi = array
  15. (
  16. '\ u0430' => 'a' , '\ u0410' => 'A' ,
  17. '\ u0431' => 'b' , '\ u0411' => 'B' ,
  18. '\ u0432' => 'in' , '\ u0412' => 'B' ,
  19. '\ u0433' => 'g' , '\ u0413' => 'G' ,
  20. '\ u0434' => 'd' , '\ u0414' => 'D' ,
  21. '\ u0435' => 'e' , '\ u0415' => 'E' ,
  22. '\ u0451' => 'yo' , '\ u0401' => 'yo' ,
  23. '\ u0436' => '' , '\ u0416' => '' ,
  24. '\ u0437' => '3' , '\ u0417' => '3' ,
  25. '\ u0438' => 'and' , '\ u0418' => 'And' ,
  26. '\ u0439' => 'd' , '\ u0419' => 'TH' ,
  27. '\ u043a' => 'k' , '\ u041a' => 'K' ,
  28. '\ u043b' => 'l' , '\ u041b' => 'L' ,
  29. '\ u043c' => 'm' , '\ u041c' => 'M' ,
  30. '\ u043d' => 'n' , '\ u041d' => 'H' ,
  31. '\ u043e' => 'o' , '\ u041e' => 'O' ,
  32. '\ u043f' => 'n' , '\ u041f' => ' N ' ,
  33. '\ u0440' => 'p' , '\ u0420' => 'P' ,
  34. '\ u0441' => 'c' , '\ u0421' => 'C' ,
  35. '\ u0442' => 't' , '\ u0422' => 'T' ,
  36. '\ u0443' => 'y' , '\ u0423' => 'Y' ,
  37. '\ u0444' => 'f' , '\ u0424' => 'F' ,
  38. '\ u0445' => 'x' , '\ u0425' => 'X' ,
  39. '\ u0446' => 'c' , '\ u0426' => 'C' ,
  40. '\ u0447' => 'h' , '\ u0427' => 'H' ,
  41. '\ u0448' => 'w' , '\ u0428' => 'W' ,
  42. '\ u0449' => 'u' , '\ u0429' => ' u ' ,
  43. '\ u044a' => '' , '\ u042a' => 'b' ,
  44. '\ u044b' => 's' , '\ u042b' => 'S' ,
  45. '\ u044c' => '' , '\ u042c' => '' ,
  46. '\ u044d' => 'e' , '\ u042d' => 'e' ,
  47. '\ u044e' => 'u' , '\ u042e' => 'U' ,
  48. '\ u044f' => 'i' , '\ u042f' => 'I' ,
  49. '\ r' => '' ,
  50. '\ n' => '<br />' ,
  51. '\ t' => ''
  52. );
  53. echo '{rows:' .strtr (json_encode ($ arr), $ u2koi). '}' ;
  54. ?>
* This source code was highlighted with Source Code Highlighter .

$ _POST ['query'] - a query passed from the combo box when writing something in it (filter). We have a combo box (minChars: 2) which means that if you write more than two characters in the combo box, the store will be updated (the store script will be re-executed, we have get_org.php), the query will be sent to the script. Thus, we can filter the list of organizations from the database.
$ u2koi = array ... - used to correctly retrieve Russian texts from the database.

Code get_tovar.php: (get the list of goods)
  1. <? php
  2. require ( 'config.php' );
  3. $ query = 'SELECT id, name, col, price FROM `tovar` ORDER BY name' ;
  4. $ result = @mysql_query ($ query, $ connect) or die ( "Could not execute query: <br>" . mysql_error (). "<br>" . mysql_errno ());
  5. while ($ row = mysql_fetch_array ($ result)):
  6. $ row [ "name" ] = iconv ( 'WINDOWS-1251' , 'UTF-8' , $ row [ "name" ]);
  7. $ arr [] = $ row;
  8. endwhile;
  9. $ u2koi = array
  10. (
  11. '\ u0430' => 'a' , '\ u0410' => 'A' ,
  12. '\ u0431' => 'b' , '\ u0411' => 'B' ,
  13. '\ u0432' => 'in' , '\ u0412' => 'B' ,
  14. '\ u0433' => 'g' , '\ u0413' => 'G' ,
  15. '\ u0434' => 'd' , '\ u0414' => 'D' ,
  16. '\ u0435' => 'e' , '\ u0415' => 'E' ,
  17. '\ u0451' => 'yo' , '\ u0401' => 'yo' ,
  18. '\ u0436' => '' , '\ u0416' => '' ,
  19. '\ u0437' => '3' , '\ u0417' => '3' ,
  20. '\ u0438' => 'and' , '\ u0418' => 'And' ,
  21. '\ u0439' => 'd' , '\ u0419' => 'TH' ,
  22. '\ u043a' => 'k' , '\ u041a' => 'K' ,
  23. '\ u043b' => 'l' , '\ u041b' => 'L' ,
  24. '\ u043c' => 'm' , '\ u041c' => 'M' ,
  25. '\ u043d' => 'n' , '\ u041d' => 'H' ,
  26. '\ u043e' => 'o' , '\ u041e' => 'O' ,
  27. '\ u043f' => 'n' , '\ u041f' => ' N ' ,
  28. '\ u0440' => 'p' , '\ u0420' => 'P' ,
  29. '\ u0441' => 'c' , '\ u0421' => 'C' ,
  30. '\ u0442' => 't' , '\ u0422' => 'T' ,
  31. '\ u0443' => 'y' , '\ u0423' => 'Y' ,
  32. '\ u0444' => 'f' , '\ u0424' => 'F' ,
  33. '\ u0445' => 'x' , '\ u0425' => 'X' ,
  34. '\ u0446' => 'c' , '\ u0426' => 'C' ,
  35. '\ u0447' => 'h' , '\ u0427' => 'H' ,
  36. '\ u0448' => 'w' , '\ u0428' => 'W' ,
  37. '\ u0449' => 'u' , '\ u0429' => ' u ' ,
  38. '\ u044a' => '' , '\ u042a' => 'b' ,
  39. '\ u044b' => 's' , '\ u042b' => 'S' ,
  40. '\ u044c' => '' , '\ u042c' => '' ,
  41. '\ u044d' => 'e' , '\ u042d' => 'e' ,
  42. '\ u044e' => 'u' , '\ u042e' => 'U' ,
  43. '\ u044f' => 'i' , '\ u042f' => 'I' ,
  44. '\ r' => '' ,
  45. '\ n' => '<br />' ,
  46. '\ t' => ''
  47. );
  48. echo '{tovar:' .strtr (json_encode ($ arr), $ u2koi). '}' ;
  49. ?>
* This source code was highlighted with Source Code Highlighter .

Code save.php: (and save)
<?PHP
$title = iconv('UTF-8', 'WINDOWS-1251', $_POST['title']);
$date = iconv('UTF-8', 'WINDOWS-1251', $_POST['date']);
$prod_id = iconv('UTF-8', 'WINDOWS-1251', $_POST['prod_id']);
$prod = iconv('UTF-8', 'WINDOWS-1251', $_POST['prod']);
$pok_id = iconv('UTF-8', 'WINDOWS-1251', $_POST['pok_id']);
$pok = iconv('UTF-8', 'WINDOWS-1251', $_POST['pok']);
$data = iconv('UTF-8', 'WINDOWS-1251', $_POST['data']);
if (($title == '') or ($date == '') or ($data == '')) $success = "false"; else $success = "true";
if ($title == '') {$err_title = "title: \" '' \","; $err_title_msg = " <br>";}
if ($date == '') {$err_date = "date: \" '' \","; $err_date_msg = " <br>";}
if ($data == '') {$err_data_msg = " ";}
print "{success: " .$success. ",errors: {".$err_title."".$err_date."null: \"null\"}, truemsg: \" : " .$title. ", : " .$date. " <br> : " .$prod. "<br> : " .$prod_id. "<br> : " .$pok. "<br> : " .$pok_id. "<br> : ".$data."\",errormsg:\"".$err_title_msg."".$err_date_msg."".$err_data_msg."\"}";
?>


I will not post the database creation sources, from the scripts you can see which tables and fields are used. If necessary, you can add or change fields. A script save.php rewrite for your needs. This article is a kind of template for beginners.

Well, that's all for now. Thank you all for your attention :) Successes in writing to ExtJS.

Source: https://habr.com/ru/post/91155/


All Articles