├── README.md ├── ajaxCRUD.class.php ├── css ├── badicon.gif ├── checkicon.gif ├── cuscosky.css ├── default.css ├── fieldbg.gif ├── index.html └── loading.gif ├── examples ├── calendar.gif ├── events │ ├── events.php │ ├── footer.php │ ├── header.php │ ├── index.php │ ├── readme.txt │ ├── sql.sql │ ├── stylesheet.css │ ├── uploads │ │ ├── 10K_-_Six03.JPG │ │ ├── 1927_5K-TrickOrTrotTemp.png │ │ ├── 2208_5K_-_AppleHarvest.jpg │ │ ├── 3381_5K-TrickOrTrotTemp.png │ │ ├── 5K_-_AppleHarvest.jpg │ │ ├── 5K_-_FathersDay.JPG │ │ ├── 5K_-_Horne.JPG │ │ ├── 5K_-_Komen.JPG │ │ ├── 5K_-_MothersDay.JPG │ │ ├── 5K_-_RedBarn2.jpg │ │ ├── 5K_-_Redhook.jpg │ │ ├── 5K_-_Run_Before_You_Crawl.jpg │ │ ├── 5K_-_SMA.JPG │ │ ├── 5K_-_SpiritofRecovery.JPG │ │ ├── 5K_-_Turkey_Trot.jpg │ │ ├── 5M_-_Paddys.JPG │ │ ├── 9868_Upstream-Color-2013-Stills.jpg │ │ ├── Biutiful.jpg │ │ ├── Bud-light.jpg │ │ ├── LearnSnowsport.JPG │ │ ├── Logo-Animated-Transparent-Forever.gif │ │ ├── SRS.png │ │ ├── Volleyball.jpg │ │ ├── Volleyball_green.jpg │ │ ├── Volleyball_heart.jpg │ │ ├── Volleyball_shamrock.jpg │ │ ├── download.jpg │ │ ├── dumbo.jpg │ │ ├── halo_4.jpg │ │ ├── hottub.jpg │ │ ├── hr_the_walking_dead.jpg │ │ ├── nfl_wildcard.gif │ │ ├── primer-film.jpg │ │ ├── princess_bride.jpeg │ │ ├── soccer.jpg │ │ ├── stella.jpg │ │ ├── stella2.jpg │ │ ├── superbown_2014.jpg │ │ ├── tv-question-mark.jpg │ │ ├── untitled.png │ │ ├── v_for_vendetta.png │ │ └── whiskey_and_chess.jpg │ └── youre-invited.png ├── example.php ├── example.sql ├── example2.php ├── example3.php ├── example4.php ├── includes │ ├── images │ │ ├── calendar.gif │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ ├── ui-icons_217bc0_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_469bdd_256x240.png │ │ ├── ui-icons_6da8d5_256x240.png │ │ ├── ui-icons_cd0a0a_256x240.png │ │ ├── ui-icons_d8e7f3_256x240.png │ │ └── ui-icons_f9bd01_256x240.png │ ├── jquery.ui.all.css │ ├── jquery.ui.base.css │ ├── jquery.ui.core.css │ ├── jquery.ui.core.js │ ├── jquery.ui.datepicker.css │ ├── jquery.ui.datepicker.js │ ├── jquery.ui.theme.css │ └── readme.txt ├── install.php ├── readme.txt ├── uploads │ └── readme.txt └── where_clause_test.php ├── js ├── javascript_functions.js ├── jquery.maskedinput.js ├── jquery.min.js ├── jquery.validate.min.js └── validation.js └── preheader.php /README.md: -------------------------------------------------------------------------------- 1 | FULL CLASS DOCUMENTATION HERE: 2 | http://www.ajaxcrud.com/api/ 3 | 4 | Any questions or issues? -- support forum and reference material featured on the website www.ajaxcrud.com 5 | 6 | USING EXAMPLE SCRIPTS: 7 | 8 | 1) To install this class you must first manually CREATE a database. This is done (locally) by going 9 | into your mySQL terminal window and using the SQL "CREATE DATABASE [database_name]". 10 | 11 | If you are using an online host, you'll have to go into its control panel (eg C-panel) and create a database. 12 | 13 | 2) Make sure a database user has complete access to the database in question (SELECT, UPDATE, CREATE, DELETE) 14 | 15 | 3) Edit the file "preheader.php" and fill in your database information 16 | 17 | 4) Navigate to the file "/examples/install.php" 18 | 19 | 5) Navigate to the file "/examples/example.php" to test out the class!! 20 | 21 | 22 | 23 | ~Loud Canvas Media Staff 24 | www.loudcanvas.com 25 | 26 | 27 | NB: Make sure you include any "header" info (e.g. any HTML, echo statements, etc) AFTER you 28 | include the ajaxCRUD class. -------------------------------------------------------------------------------- /ajaxCRUD.class.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/ajaxCRUD.class.php -------------------------------------------------------------------------------- /css/badicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/css/badicon.gif -------------------------------------------------------------------------------- /css/checkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/css/checkicon.gif -------------------------------------------------------------------------------- /css/cuscosky.css: -------------------------------------------------------------------------------- 1 | /* 2 | Cusco Sky table styles 3 | written by Braulio Soncco http://www.buayacorp.com 4 | */ 5 | 6 | table, th, td { 7 | border: 1px solid #D4E0EE; 8 | border-collapse: collapse; 9 | font-family: "Trebuchet MS", Arial, sans-serif; 10 | color: #555; 11 | } 12 | 13 | caption { 14 | font-size: 150%; 15 | font-weight: bold; 16 | margin: 5px; 17 | } 18 | 19 | td, th { 20 | padding: 4px; 21 | } 22 | 23 | thead th { 24 | text-align: center; 25 | background: #E6EDF5; 26 | color: #4F76A3; 27 | font-size: 100% !important; 28 | } 29 | 30 | tbody th { 31 | font-weight: bold; 32 | } 33 | 34 | tbody tr { background: #FCFDFE; } 35 | 36 | tbody tr.odd { background: #F7F9FC; } 37 | 38 | table a:link { 39 | color: #718ABE; 40 | text-decoration: none; 41 | } 42 | 43 | table a:visited { 44 | color: #718ABE; 45 | text-decoration: none; 46 | } 47 | 48 | table a:hover { 49 | color: #718ABE; 50 | text-decoration: underline !important; 51 | } 52 | 53 | tfoot th, tfoot td { 54 | font-size: 85%; 55 | } -------------------------------------------------------------------------------- /css/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | HUNDREDS of other stylesheets which work with this class can be found here - http://icant.co.uk/csstablegallery 3 | Try a few demos using the style dropdown box for our demo here - http://www.ajaxcrud.com/ 4 | */ 5 | 6 | .paging_links{ 7 | font-family:Verdana, Arial, Helvetica, sans-serif; 8 | font-size:10px; 9 | /* color:#F5E000;*/ 10 | color:#445276; 11 | } 12 | 13 | .ajaxCRUD { 14 | background: #F4F2FD; 15 | border-color: #BBB1ED; 16 | border-style: solid; 17 | border-width: 0px; 18 | padding:4px; 19 | border-collapse:collapse; 20 | margin-top:10px; 21 | margin-bottom:10px; 22 | } 23 | 24 | .ajaxCRUD th{ 25 | background: #CFDBF3; 26 | font-weight: bold; 27 | color:#445276; 28 | font-size: 12px; 29 | } 30 | 31 | .ajaxCRUD th a{ 32 | color: #173D7F; 33 | } 34 | 35 | .ajaxCRUD td a{ 36 | border-bottom: 1px dotted #ba0000; 37 | font-size: 11px; 38 | text-decoration: none; 39 | } 40 | 41 | .ajaxCRUD td a:hover{ 42 | color: #000; 43 | border-bottom: 1px solid #ba0000; 44 | } 45 | 46 | .ajaxCRUD td{ 47 | font-family: Arial, Verdana; 48 | font-size: 11px; 49 | background: #F9F8FB; 50 | color: #716E6E; 51 | font-weight:normal; 52 | /* text-align: center; */ 53 | vertical-align: middle; 54 | } 55 | 56 | .ajaxCRUD td, .ajaxCRUD th{ 57 | padding: 5px 5px; 58 | } 59 | table td.odd, table tr.odd, tr.odd td, tbody tr.odd th{ 60 | background-color: #f2f2f2; 61 | } 62 | 63 | .editingSize{ 64 | font-size: 10px; 65 | } 66 | 67 | .vertical, .vertical td, .vertical th{ 68 | text-align:left; 69 | } 70 | 71 | input, select, textarea{ 72 | font-size: 100%; 73 | border-top: 1px solid #7c7c7c; 74 | border-left: 1px solid #c3c3c3; 75 | border-right: 1px solid #c3c3c3; 76 | border-bottom: 1px solid #ddd; 77 | background: #fff url("fieldbg.gif") repeat-x top; 78 | color: #333; 79 | padding: 2px 0 2px 2px; 80 | } 81 | 82 | .btn{ 83 | font-size: 11px; 84 | } 85 | .report, .alertgood { 86 | text-align: left; 87 | border-top: 1px solid #9c9; 88 | border-bottom: 1px solid #9c9; 89 | padding: 5px 5px 5px 30px; 90 | font-size: 11px; 91 | margin: 0 20px 15px 20px; 92 | color: #060; 93 | background: url("checkicon.gif") #e2f9e3 left no-repeat; 94 | } 95 | 96 | .error, .alertbad { 97 | text-align: left; 98 | font-weight: bold; 99 | border-top: 1px solid #c99; 100 | border-bottom: 1px solid #c99; 101 | padding: 5px 5px 5px 27px; 102 | font-size: 11px; 103 | margin: 0 20px 15px 20px; 104 | background: url("badicon.gif") #c00 left no-repeat; 105 | color: #fff; 106 | } -------------------------------------------------------------------------------- /css/fieldbg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/css/fieldbg.gif -------------------------------------------------------------------------------- /css/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/css/index.html -------------------------------------------------------------------------------- /css/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/css/loading.gif -------------------------------------------------------------------------------- /examples/calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/calendar.gif -------------------------------------------------------------------------------- /examples/events/events.php: -------------------------------------------------------------------------------- 1 | setCSSFile("cuscosky.css"); 12 | 13 | $viewPastEvents = FALSE; 14 | if ($_REQUEST['eventFilter'] == 'pastEvents') $viewPastEvents = TRUE; 15 | 16 | ?> 17 | 19 | 20 | 21 | 22 | insertHeader(); ?> 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | Upcoming Events:\n"; 36 | } 37 | else{ 38 | echo "

Previous/Past Events:

\n"; 39 | } 40 | ?> 41 | 42 |
43 | Filter Events: 44 |
45 | 49 |
50 |
51 |

52 | 53 | omitPrimaryKey(); 56 | #Create custom display fields 57 | $tblEvent->displayAs("pkEventID","Event ID"); 58 | $tblEvent->displayAs("fldTitle","Title"); 59 | $tblEvent->displayAs("fldDate", "Date"); 60 | $tblEvent->displayAs("fldTime", "Time"); 61 | $tblEvent->displayAs("fldLocation", "Location"); 62 | $tblEvent->displayAs("fldAdditionalInformation", "Additional Information"); 63 | $tblEvent->displayAs("fldImage", "Image"); 64 | $tblEvent->displayAs("fldType", "Public/Private?"); 65 | 66 | $tblEvent->disallowDelete(); 67 | 68 | $validValues = array("Public", "Private"); 69 | $tblEvent->defineAllowableValues("fldType", $validValues); 70 | //$tblEvent->category_required['fldType'] = FALSE; 71 | 72 | $tblEvent->addOrderBy("ORDER BY fldDate ASC"); 73 | 74 | #Add filter boxes (if i wanted them) 75 | //$tblEvent->addAjaxFilterBox("fldFirstName"); 76 | //$tblEvent->addAjaxFilterBox("fldLastName"); 77 | //$tblEvent->addAjaxFilterBox("fldAttending"); 78 | 79 | $today = date("Y-m-d"); 80 | if (!$viewPastEvents){ 81 | #Add Where clause - only show future events 82 | $tblEvent->addWhereClause("WHERE (fldDate >= \"$today\") OR fldDate = \"0000-00-00\""); 83 | $signupText = "Sign up for Event"; 84 | $tblEvent->setFileUpload("fldImage", "uploads/", "uploads/"); 85 | } 86 | else{ 87 | #Add Where clause - only show past events 88 | $tblEvent->addWhereClause("WHERE (fldDate < \"$today\") AND fldDate != \"0000-00-00\""); 89 | $signupText = "View Who Signed Up"; 90 | $tblEvent->turnOffAjaxEditing(); 91 | } 92 | 93 | $tblEvent->addButtonToRow($signupText, "index.php"); 94 | 95 | $tblEvent->setTextareaHeight("fldAdditionalInformation", 70); 96 | 97 | #set the number of rows to display (per page) 98 | //$tblEvent->setLimit(25); 99 | 100 | $tblEvent->setAddPlaceholderText("fldDate", "YYYY-mm-dd"); 101 | $tblEvent->setAddPlaceholderText("fldTime", "7:00pm"); 102 | $tblEvent->setAddFieldNote("fldDate", "Make sure to enter in format YYYY-mm-dd."); 103 | $tblEvent->setAddFieldNote("fldImage", "If you want to add an image to the event (optional)."); 104 | $tblEvent->setAddFieldNote("fldType", "Public means anyone can come; Private means you want this event to be exclusive."); 105 | 106 | //$tblEvent->addButtonToRowWindowOpen = "same"; //this is default behavior so i have it commented out 107 | 108 | $tblEvent->formatFieldWithFunction("fldDate", "highlightDate"); 109 | $tblEvent->formatFieldWithFunction("fldImage", "showImage"); 110 | 111 | $tblEvent->modifyFieldWithClass("fldDate", "datepicker"); 112 | 113 | $tblEvent->showTable(); 114 | 115 | include ('footer.php'); 116 | 117 | function highlightDate($date){ 118 | if ($date == "0000-00-00") return "NOT YET SET"; 119 | 120 | if ($date == date("Y-m-d")){ 121 | return $date . "
(TODAY/TONIGHT!)"; 122 | } 123 | return $date; 124 | } 125 | 126 | function showImage($image){ 127 | if ($image){ 128 | return "\n"; 129 | } 130 | return ""; 131 | } 132 | 133 | ?> -------------------------------------------------------------------------------- /examples/events/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Powered by ajaxCRUD      © LCM
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/events/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | <?=$page_title?> 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
View/Create/Edit Events!    
21 |
22 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /examples/events/index.php: -------------------------------------------------------------------------------- 1 | doActionOnShowTable = false; //this ensures showTable() does not call doAction; i do not want to do this because my onAdd callback function creates a cookie 43 | $tblEventAttendee->omitPrimaryKey(); 44 | 45 | #Create custom display fields 46 | //$tblEventAttendee->displayAs("pkAttendeeID","User ID"); 47 | $tblEventAttendee->displayAs("fldFirstName","First Name"); 48 | $tblEventAttendee->displayAs("fldLastName", "Last Name"); 49 | $tblEventAttendee->displayAs("fldPhone", "Phone #"); 50 | $tblEventAttendee->displayAs("fldWillBeLate", "Will You Be Late?"); 51 | $tblEventAttendee->displayAs("fldTimeArriving", "Arrival Time"); 52 | $tblEventAttendee->displayAs("fldComments", "Comments/Other"); 53 | 54 | $tblEventAttendee->displayAs("fldIPAddress", "IPAddress"); 55 | $tblEventAttendee->omitFieldCompletely("fldIPAddress"); 56 | $tblEventAttendee->omitFieldCompletely("fkEventID"); 57 | $tblEventAttendee->omitFieldCompletely("fldPhone"); 58 | $tblEventAttendee->omitFieldCompletely("fldAttending"); 59 | 60 | $tblEventAttendee->validateDeleteWithFunction("canRowBeModifiedOrDeleted"); 61 | $tblEventAttendee->validateUpdateWithFunction("canRowBeModifiedOrDeleted"); 62 | 63 | $tblEventAttendee->defineCheckbox("fldWillBeLate"); 64 | $tblEventAttendee->addOrderBy("ORDER BY fldFirstName ASC"); 65 | 66 | #Add WHERE clause so we only display information specific to the event that was selected 67 | $tblEventAttendee->addWhereClause("WHERE fkEventID = $eventID"); 68 | 69 | #I could add filter boxes to the top, but have chosen not to do so; commenting these out 70 | //$tblEventAttendee->addAjaxFilterBox("fldFirstName"); 71 | //$tblEventAttendee->addAjaxFilterBox("fldLastName"); 72 | //$tblEventAttendee->addAjaxFilterBox("fldAttending"); 73 | 74 | //using addValueOnInsert so when someone signs up it will automatically add them to this event 75 | $tblEventAttendee->addValueOnInsert("fkEventID", $eventID); 76 | 77 | //using addValueOnInsert to track their IP address 78 | $tblEventAttendee->addValueOnInsert("fldIPAddress", $_SERVER["REMOTE_ADDR"]); 79 | 80 | $tblEventAttendee->setTextboxWidth("fldTimeArriving", 8); 81 | $tblEventAttendee->setTextboxWidth("fldLastName", 25); 82 | $tblEventAttendee->setTextareaHeight("fldComments", 70); //comment field should be a bit wider height 83 | 84 | #set the number of rows to display (per page) 85 | $tblEventAttendee->setLimit(25); //after 25 people, the resultset will paginate 86 | 87 | $tblEventAttendee->setAddPlaceholderText("fldTimeArriving", $fldTime); 88 | $tblEventAttendee->setAddFieldNote("fldTimeArriving", "Leave blank if you'll be on time."); 89 | $tblEventAttendee->setAddFieldNote("fldWillBeLate", "If you will be arriving late, please enter the time in the next box."); 90 | 91 | $tblEventAttendee->modifyFieldWithClass("fldTimeArriving", "time"); 92 | $tblEventAttendee->modifyFieldWithClass("fldLastName", "required"); 93 | $tblEventAttendee->modifyFieldWithClass("fldFirstName", "required"); 94 | 95 | $tblEventAttendee->formatFieldWithFunction("fldWillBeLate", "displayWillBeLate"); 96 | $tblEventAttendee->formatFieldWithFunctionAdvanced("fldTimeArriving", "displayArrivalTime"); 97 | 98 | $tblEventAttendee->emptyTableMessage = "No one has signed up yet! Press the 'Add Person' button below to sign up for this event."; 99 | $tblEventAttendee->addMessage = "You have been added to this event."; 100 | $tblEventAttendee->setCSSFile("cuscosky.css"); //i liked this table feel; but any css can be used from http://icant.co.uk/csstablegallery 101 | 102 | #implement a callback function on signing up to create cookie 103 | $tblEventAttendee->onAddExecuteCallBackFunction("onAddCallBackFunction"); 104 | 105 | //if event expired, do not allow people to sign up for it or change who had attended 106 | if ($eventExpired){ 107 | $tblEventAttendee->disallowAdd(); 108 | $tblEventAttendee->disallowDelete(); 109 | $tblEventAttendee->turnOffAjaxEditing(); 110 | $tblEventAttendee->omitFieldCompletely("fldWillBeLate"); 111 | $tblEventAttendee->omitFieldCompletely("fldTimeArriving"); 112 | } 113 | 114 | //this needs to be very low in the excution path to ensure the obj is loaded correctly with every other piece of logic 115 | //typically doAction is called within the showTable() method, but i do not want to do that because i modify headers with my onAdd callback function 116 | if (isset($_REQUEST['action']) && $_REQUEST['action'] != ''){ 117 | $tblEventAttendee->doAction($_REQUEST['action']); 118 | } 119 | 120 | include ('header.php'); 121 | 122 | if ($eventExpired){ 123 | displayExpiration(); 124 | } 125 | 126 | echo "

$fldType Event: $fldTitle - " . date("M d, Y", strtotime($fldDate)) . " @ $fldTime

\n"; 127 | if ($fldType == "Public"){ 128 | echo "
YOU'RE invited! Who me? Yes, you! Can friends come?? YES!! All are welcome.
This is a PUBLIC event. You are welcome to join. Don't feel an invitation is required. Just sign up below to let us know you'll be there. :-)

"; 129 | } 130 | 131 | echo "
"; 132 | 133 | $marginLeft = "30%;"; 134 | if ($fldImage){ 135 | echo "
"; 136 | $marginLeft = "5px;"; 137 | } 138 | 139 | echo "
"; 140 | echo " 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 |
What*$fldType Event: $fldTitle
When$eventDate @ $fldTime
Where$fldLocation
Additional Info" . hyperlinkText($fldAdditionalInformation) . "
"; 159 | echo "
\n"; 160 | echo "



\n"; 161 | 162 | $today = date("Y-m-d"); 163 | $events = q("SELECT pkEventID, fldDate, fldTitle FROM tblEvent WHERE fldDate >= \"$today\" ORDER BY fldDate DESC"); 164 | 165 | if (count($events) > 0){?> 166 | 167 |
168 | Upcoming Public Events: 169 |
170 | 185 |
186 |
187 |

188 | 189 | 190 | Who's coming?? If you are, please add yourself to the list by pressing \"Add Person\" below

\n"; 194 | 195 | $tblEventAttendee->showTable(); 196 | 197 | if ($eventExpired){ 198 | displayExpiration(); 199 | } 200 | 201 | include ('footer.php'); 202 | 203 | 204 | function onAddCallBackFunction($array){ 205 | global $idsAdded, $report_msg, $error_msg; 206 | 207 | $newID = $array['pkAttendeeID']; 208 | $fkEventID = $array['fkEventID']; 209 | 210 | $firstName = $array['fldFirstName']; 211 | $lastName = $array['fldLastName']; 212 | 213 | $countMatchingRows = q1("SELECT COUNT(*) FROM tblEventAttendee WHERE fldFirstName = \"$firstName\" AND fldLastName = \"$lastName\" AND fkEventID = $fkEventID"); 214 | 215 | if ($countMatchingRows > 1){ 216 | $success = qr("DELETE FROM tblEventAttendee WHERE pkAttendeeID = $newID"); 217 | if ($success){ 218 | $error_msg[] = "Ignore that last message...it seems you have added yourself TWICE! You idiot! The system automatically deleted your second entry."; 219 | return; 220 | } 221 | else{ 222 | $error_msg[] = "Error deleting the second database entry."; 223 | return; 224 | } 225 | } 226 | 227 | $idsAdded[] = $newID; //array push 228 | 229 | //set cookie 10 years in the future 230 | setcookie( 231 | "ajaxCRUDEventID_$newID", 232 | "cookieset", 233 | time() + (10 * 365 * 24 * 60 * 60) 234 | ); 235 | 236 | //print_r($_COOKIE); 237 | } 238 | 239 | function canRowBeModifiedOrDeleted($id){ 240 | global $idsAdded; 241 | 242 | $ip = q1("SELECT fldIPAddress FROM tblEventAttendee WHERE pkAttendeeID = $id"); 243 | 244 | if (in_array($id, $idsAdded)){ 245 | return true; 246 | } 247 | 248 | //check to see if cookie is set for signing up to this event 249 | if (isset($_COOKIE['ajaxCRUDEventID_' . $id]) && $_COOKIE['ajaxCRUDEventID_' . $id] != ""){ 250 | return true; 251 | } 252 | //if the ip address is the same most likely it's the person to signed up (will not always work if user is behind a proxy server) 253 | if ($ip == $_SERVER["REMOTE_ADDR"]){ 254 | return true; 255 | } 256 | 257 | return false; 258 | } 259 | 260 | //change display of ints to YES/NO values 261 | function displayWillBeLate($val){ 262 | if ($val == 1){ 263 | return "Yes"; 264 | } 265 | return "No"; 266 | } 267 | 268 | //display how null/empty values for the late field are shown 269 | function displayArrivalTime($val, $id){ 270 | $late = q1("SELECT fldWillBeLate FROM tblEventAttendee WHERE pkAttendeeID = $id"); 271 | 272 | if ($val == "" && $late == 0){ 273 | return "On Time"; 274 | } 275 | else if ($val == "" && $late == 1){ 276 | return "Late"; 277 | } 278 | 279 | //if jokers entered time in 24-hour format, convert time to 12-hour format (just because we can) 280 | $time_in_12_hour_format = date("g:ia", strtotime($val)); 281 | return $time_in_12_hour_format; 282 | } 283 | 284 | //display text urls in the description as active links 285 | function hyperlinkText($text) { 286 | 287 | if (!$text) return "N/A"; 288 | 289 | //$text = displayBlank($text); 290 | 291 | //Not perfect but it works - please help improve it. 292 | $text=preg_replace('/([^(\'|")]((f|ht){1}tp(s?):\/\/)[-a-zA-Z0-9@:%_\+.~#?&;\/\/=]+[^(\'|")])/','\\1', $text); 293 | $text=preg_replace("/(^|[ \\n\\r\\t])([^('|\")]www\.([a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)(\/[^\/ \\n\\r]*)*[^('|\")])/", '\\1\\2', $text); 294 | $text=preg_replace("/(^|[ \\n\\r\\t])([^('|\")][_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}[^('|\")])/",'\\1\\2', $text); 295 | 296 | return $text; 297 | } 298 | 299 | function displayExpiration(){ 300 | echo "

!! THIS EVENT HAS EXPIRED !! IT IS OVER ... IN THE PAST ... DONE ... COMPLETE ... NO MORE

\n"; 301 | } 302 | ?> -------------------------------------------------------------------------------- /examples/events/readme.txt: -------------------------------------------------------------------------------- 1 | The example in this folder could be considered a "complete web app." 2 | 3 | ajaxCRUD was not originally intended to be a framework for creating entire web "apps" or functional sites. However, that said, it is a very powerful tool and can be employed to deploy lightweight functional tools very quickly/easliy. 4 | 5 | This app was made it in just under 2 hours to help my friends can I easily create and manage attendence of "events" taking place throughout the week/month. 6 | 7 | Requirements: 8 | 1) Any person can create an event (events have a date, time, image, and description) 9 | 2) Anyone can "opt in" to any active event (i.e. signup) 10 | 3) If a person will be late, they can be able to indicate what time they will show up 11 | 4) Ideally only those who sign up can edit/delete their acceptance 12 | 13 | 14 | Req 1 accomplished by basic ajaxCRUD interface (events.php) 15 | Req 2 accomplsihed by basic ajaxCRUD interface (index.php) with WHERE clause (addWhereClause) to pull event info 16 | Req 3 accomplished by checkbox (defineCheckbox) and formating the field display (formatFieldWithFunction) 17 | Req 4 accomplished by IP address setting/checking in database and cookie setting and using validateDeleteWithFunction, validateUpdateWithFunction, addValueOnInsert, and onAddExecuteCallBackFunction 18 | 19 | This is a fairly basic app, but shows the power of ajaxCRUD in helping make life (and coding) faster and simpler. -------------------------------------------------------------------------------- /examples/events/sql.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.0.5 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Mar 07, 2014 at 01:22 AM 7 | -- Server version: 5.0.96-community 8 | -- PHP Version: 5.3.17 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | -- 14 | -- Table structure for table `tblEvent` 15 | -- 16 | 17 | CREATE TABLE IF NOT EXISTS `tblEvent` ( 18 | `pkEventID` int(11) NOT NULL auto_increment, 19 | `fldTitle` varchar(150) default NULL, 20 | `fldDate` date default NULL, 21 | `fldTime` varchar(15) default NULL, 22 | `fldLocation` varchar(150) default NULL, 23 | `fldAdditionalInformation` text, 24 | `fldImage` varchar(150) default NULL, 25 | `fldType` varchar(20) default NULL, 26 | PRIMARY KEY (`pkEventID`) 27 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ; 28 | 29 | -- 30 | -- Dumping data for table `tblEvent` 31 | -- 32 | 33 | INSERT INTO `tblEvent` (`pkEventID`, `fldTitle`, `fldDate`, `fldTime`, `fldLocation`, `fldAdditionalInformation`, `fldImage`, `fldType`) VALUES 34 | (1, 'Public Event: Soccer Pick-up/Practice', '2013-10-27', '11:30am', 'Leary Field - Portsmouth, NH (Near South Playground)', NULL, NULL, NULL), 35 | (3, 'Public Event: Great Bay 5K', '2013-10-26', '9:00am', 'Greenland, NH', 'Site: http://www.greatbaystewards.org/13GB5K.cfm Team Name: LM Runaways', NULL, NULL), 36 | (4, 'Public Event: Hit and Run 5K', '2020-10-11', 'TBD', 'Boston', 'Site: http://hitandrun5k.com/', 'Logo-Animated-Transparent-Forever.gif', 'Public'), 37 | (5, 'Movie Nite #1. Remember Remember the Fifth of November - V for Ventetta', '2013-11-05', '7:00pm', 'Sean''s place (2 Alex Court Somersworth)', '(Inaugural Movie Night Tradition). Open invite; invite any friends.
I will have popcorn. We will pool funds and order food (chinese or pizza).

\nRemember, remember, the fifth of November, Gunpowder Treason and Plot', 'v_for_vendetta.png', NULL), 38 | (6, 'Finish my Keg!', '2013-11-02', '8:00pm', 'Sean\\''s house (2 Alex Ct Somersworth NH)', 'Nothing too fancy. Maybe play some Cards Against Humanity, watch a movie, and/or play beerpong & darts. Most importantly though - we need to finish my keg. I have bud light and an abundance of it! Bring a bathing suit if you want to use the hottub. :-)\n
\nOpen invite; invite any friends. ', 'Bud-light.jpg', NULL), 39 | (7, 'Movie Night #2 - Dani\\''s Pick', '2013-12-12', '7:00pm', 'Sean''s place', 'Movie: The Princess Bride.', 'princess_bride.jpeg', 'Public'), 40 | (8, 'Movie Night #3 - Norma\\''s Pick', '2014-01-07', '7:00pm', 'Sean''s place', 'Movie: Biutiful.
Open invite; invite friends!', 'Biutiful.jpg', 'Public'), 41 | (9, 'Movie Night #4 - Stacy\\''s Pick', '2014-02-03', '7:00pm', 'Sean''s place', 'Movie: Primer.', 'primer-film.jpg', 'Private'), 42 | (10, 'Movie Night #5 - Ian\\''s Pick', '2014-03-03', '7:00pm', 'Sean''s place', 'Movie: Dumbo (w/Lion King perhaps as a post-show if we can get a copy)', 'dumbo.jpg', 'Public'), 43 | (11, 'Public Event: Soccer Practice/Pickup', '2013-11-10', '11:30am', 'Leary Field - Portsmouth, NH
(Near South Playground)', '\\"Comments\\" field--Do you prefer Saturday or Sunday soccer?\n\n
\n
*Public Event-Feel free to forward event.', 'soccer.jpg', NULL), 44 | (12, 'Walking Dead Viewing', '2013-11-17', '9:00pm', 'Sean''s place', 'I love The Walking Dead. If you do too, come to my place and we shall watch it together. ', 'hr_the_walking_dead.jpg', 'Private'), 45 | (13, 'Hottub Party', '2013-11-22', '9:00pm', 'Sean''s place', 'Just a fun time to sit back, relax, drink some wine or blackberry-brandy, and soak up in the hottub. ', 'hottub.jpg', 'Public'), 46 | (14, 'Whiskey, Chess, and Politics', '2013-11-15', '7:30pm', 'Sean''s Bar Room', 'A time for drinking malt whiskey, discussing American politics, and playing many fine games of chess (maybe even Halo to follow). Men only for this one. Sign up below if you\\''ve been invited.', 'whiskey_and_chess.jpg', 'Private'), 47 | (15, 'Halo Nite!', '2013-11-16', '7:00pm', 'The Halo Cave', 'The name says it all! We will play halo. It will be a night of playing halo. It will be epic!', 'halo_4.jpg', 'Public'), 48 | (16, 'Soccer Practice/Pickup', '2013-11-17', '11:00am', 'Leary Field - Portsmouth, NH <\\br> (Near South Playground)', 'Public event. Feel free to forward to others.', 'soccer.jpg', 'Public'), 49 | (17, 'Free Ski/Snowboard Lesson', '2014-01-12', '1:00pm', 'NH', 'WHO:
\n You. (Feel free to invite others.) \n

\n\nWHAT:
\nSkiing trip to Bretton Woods!!
Newbies--January is a \\''Learn a a Snow-sport Month\\''\nFree learn-to-ski or snowboard lesson, free equipment rentals & a free beginner terrain lift ticket!!
\n

\n\nWHEN:
\n Sunday, 01/12
More details to follow after final headcount.
\n

\n\nHOW:
\nNEWBIES--If you want to take the free lesson, rental, lift:
\n(1) Sign-up at: http://www.skinh.com/ski-central/learn-to-ski-and-snowboard/NHfreeweek.aspx
\n(2) Print Voucher
(3) RSVP for Bretton Woods 603.278.3303 ASAP!
(4) Add your name on this list--so we can take a headcount

\nOLDIES
(1) Add your name on this list--so we can take a headcount
\n

\n\n\n', 'LearnSnowsport.JPG', 'Public'), 50 | (18, 'NFL Wildcard Weekend', '2014-01-04', '1:05pm', 'Casa de Ian', 'WHAT:\r\n This upcoming Saturday is the first day of the NFL playoffs and Norma and I will be hosting the 2nd annual Wildcard Weekend Party at our place.

\r\nWHAT TO BRING: \r\n I''ll be getting a keg(singular this year, last year was a mistake) and there will be snacks and probably a flatbread run during the break between games 1 and 2, but bringing food is definitely encouraged: just respond to the invite with what you are bringing so we don''t end up with 30 bags of Tostitos.

\r\nWHO: \r\n You. Let me know if I forgot to add people that you think might be interested in coming. ', 'nfl_wildcard.gif', 'Private'), 51 | (19, 'Pick-up Vball', '2014-01-24', '7:00pm', 'KCC', 'Time: 7-9pm
\nPrice: $3.00
\nWhere: http://kitterycommunitycenter.org/

\nBring a friend or two!!\n', 'Volleyball.jpg', 'Public'), 52 | (20, 'Pick-up Vball (1/31)', '2014-01-31', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball.jpg', 'Public'), 53 | (21, 'Pick-up Vball (2/21)', '2014-02-21', '7:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball.jpg', 'Public'), 54 | (22, 'Pick-up Vball (2/14)', '2014-02-14', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball_heart.jpg', 'Public'), 55 | (23, 'Pick-up Vball (2/28)', '2014-02-28', '7:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball.jpg', 'Public'), 56 | (24, 'Superbowl Party', '2014-02-02', '6:00pm', 'Sean\\''s House - 2 Alex Ct Somersworth NH 03878', 'Game is at 6:30. Arrive early for some pre-game drinking and/or video games. I\\''ll have light beer on tap, but please bring any drinks you want if you have more refined tastes. We\\''ll probably order takeout once the game starts.

Hot tub will be open at halftime (or before/after the game). In it the blackberry brandy will be served chilled.

', 'superbown_2014.jpg', 'Public'), 57 | (25, '5K--Run Before You Crawl', '2014-03-15', '10:00am', '33 Chestnut Street, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $25-5K, $20-Pub Crawl, $40-Both
\nREGISTER: http://raceroster.com/events/2014/2044/run-before-you-crawl-5k-and-pub-crawl \n', '5K_-_Run_Before_You_Crawl.jpg', 'Public'), 58 | (26, '5K--SMA ', '2014-04-12', '09:00am', '(St. Mary Academy) 222 Central Avenue, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $25
\nSITE: http://www.saintmaryacademy.org/?page_id=1128
\nSHIRTS: For the first 125 participants.\n', '5K_-_SMA.JPG', 'Public'), 59 | (27, '5M--Red''s Race For A Better Community', '2014-04-13', '10:00am', '288 Central Avenue, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $18 ($20 after 3/24)
\nSITE: http://reds-race.com/
\nSHIRTS: If you register before 3/24.', '5K_-_RedBarn2.jpg', 'Public'), 60 | (28, '5K--Moms on the Run - Mother\\''s Day', '2014-05-11', '08:30am', 'Dover High School, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $20 ($25 day-of)
\nSITE: http://www.momsontherun.org/
\nSHIRTS: For the first 300 who register', '5K_-_MothersDay.JPG', 'Public'), 61 | (29, '5K--Spirit of Recovery ', '2014-05-18', '10:00am', 'Liberty Mutual, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $25
\nSITE: http://spiritofrecovery5k.org/wordpress/', '5K_-_SpiritofRecovery.JPG', 'Public'), 62 | (30, '5K--Goodwin Community Health Father''s Day ', '2014-06-15', '09:00am', 'Margaritas, Dover, NH', ' Part of the http://www.doverraceseries.com\n
**Last year Margarita\\''s catered the after-race snacks and provided free unlimited beer!**
\n
------------------------------------------
\nCOST: $20 ($25 day-of)
\nSITE: http://goodwinch.org/fathers-day-5k-2014/', '5K_-_FathersDay.JPG', 'Public'), 63 | (31, '5K--Horne Street School', '2014-09-21', '', 'Horne Street Elementary School, 78 Horne Street, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $15 ($20 day-of)
\nSITE: http://www.ferguscullen.com/hornestreet.html', '5K_-_Horne.JPG', 'Public'), 64 | (32, '5K--Apple Harvest Day ', '2014-10-04', '09:00am', 'Downtown, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $20
\nSITE: http://www.dovernh.org/apple-harvest-day-5k-road-race', '2208_5K_-_AppleHarvest.jpg', 'Public'), 65 | (33, '5K--Trick or Trot ', '2014-10-26', '09:00am', 'Shaw\\''s Lane, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $20 ($25 day-of)
\nSITE: http://www.doversoccer.org/race/race.htm \n', '1927_5K-TrickOrTrotTemp.png', 'Public'), 66 | (34, '5K--Dover Turkey Trot ', '2014-11-27', '09:00am', 'Shaw\\''s Lane, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: tbd
\nSITE: http://www.doverturkeytrot.com/', '5K_-_Turkey_Trot.jpg', 'Public'), 67 | (35, 'Pick-up Vball (3/14)', '2014-03-14', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball.jpg', 'Public'), 68 | (36, '10K--Six03 Summerfest', '2014-07-27', '09:00am', '(Dover Ice Arena) 110 Portland Avenue, Dover, NH', ' Part of the http://www.doverraceseries.com \n
------------------------------------------
\nCOST: $30
\nSITE: http://six03summerfest10k.com/', '10K_-_Six03.JPG', 'Public'), 69 | (37, '5K--Redhook', '2014-05-25', '11:00am', 'Redhook Brewery, Portsmouth, NH', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------\n
**This race always sells out**\n
------------------------------------------
\nCOST: $25 ($30 after 04/01)
\nSITE: http://www.runnersalley.com/redhook.html
\nSHIRTS: For the first 1500 who sign up. \n
------------------------------------------
\nTEAM: LM Runaways\n
------------------------------------------
', '5K_-_Redhook.jpg', 'Public'), 70 | (38, '5K--Komen NH Race for the Cure', '2014-05-10', '', 'Strawbery Banke Museum, Portsmouth, NH', '\nCOST: tbd
\nSITE: http://www.komenvtnh.org/komen-race-for-the-cure/nh-race-welcome-page.html \n', '5K_-_Komen.JPG', 'Public'), 71 | (39, '5M--St Paddys Five Miler', '2014-03-16', '10:30am', '(Paddy’s American Grille) 27 International Drive, Portsmouth, NH', 'COST: $32.50
\r\nSITE: http://paddysfivemiler.com/
\r\nSHIRTS: For first 1000 registrants (High quality technical shirt)
\r\n--Commemorative pint glass & finisher beads
\r\n--One beer
\r\n--Catered food including sandwiches and hot soups', '5M_-_Paddys.JPG', 'Public'), 72 | (40, 'Pick-up Vball (2/7)', '2014-02-07', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\r\nPrice: $3.00
\r\n
\r\nBring a friend or two...just list them below!\r\n ', 'Volleyball.jpg', 'Public'), 73 | (41, 'Pick-up Vball (3/7)', '2014-03-07', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\nPrice: $3.00
\n
\nBring a friend or two...just list them below!\n ', 'Volleyball.jpg', 'Public'), 74 | (42, '5K--Children''s Museum of NH ', '2014-05-03', '9:00am', 'Dover, NH', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.childrens-museum.org/cmnh2010/content.aspx?id=516\n
\nSHIRTS: [visit site]\n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 75 | (43, '10K--Market Square Day ', '2014-06-14', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.proportsmouth.org/MSDRoadRace.cfm\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 76 | (44, '5K--York Days ', '2014-07-27', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://parksandrec.yorkmaine.org/\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 77 | (45, '10K--Saunders at Rye Harbor ', '2014-08-21', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.saundersatryeharbor10k.com/\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 78 | (46, '5Miler--Fox Point Sunset ', '2014-09-06', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.foxpoint5miler.org/\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 79 | (47, '5K--Great Island ', '2014-10-12', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.greatisland5k.org/\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 80 | (48, '5K--Great Bay ', '2014-10-25', '', '', ' Part of the Seacoast Series (earn a jacket--see link below)
\nhttp://www.proportsmouth.org/SRRSracedates.cfm
\n
------------------------------------------
\nCOST: [visit site]
\nSITE: http://www.greatbaystewards.org/13GB5K.cfm\n
\nSHIRTS: [visit site] \n
------------------------------------------
\nTEAM (if applicable): LM Runaways\n
------------------------------------------
', 'SRS.png', 'Public'), 81 | (49, 'Pick-up Vball (3/21) ', '2014-03-21', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\r\nPrice: $3.00
\r\n
\r\nBring a friend or two...just list them below!\r\n ', 'Volleyball.jpg', 'Public'), 82 | (50, 'Pick-up Vball (3/28) ', '2014-03-28', '07:00pm', '(KCC) http://kitterycommunitycenter.org', 'Time: 7-9pm
\r\nPrice: $3.00
\r\n
\r\nBring a friend or two...just list them below!\r\n ', 'Volleyball.jpg', 'Public'), 83 | (51, 'Movie Night #6 - Khoa''s pick', '2016-03-24', '7:30pm', 'Sean''s place', 'Movie: Upstream Color', '9868_Upstream-Color-2013-Stills.jpg', 'Public'); 84 | 85 | -- -------------------------------------------------------- 86 | 87 | -- 88 | -- Table structure for table `tblEventAttendee` 89 | -- 90 | 91 | CREATE TABLE IF NOT EXISTS `tblEventAttendee` ( 92 | `pkAttendeeID` int(11) NOT NULL auto_increment, 93 | `fldFirstName` varchar(25) default NULL, 94 | `fldLastName` varchar(35) default NULL, 95 | `fldPhone` varchar(25) default NULL, 96 | `fldWillBeLate` tinyint(4) default NULL, 97 | `fldTimeArriving` varchar(15) default NULL, 98 | `fkEventID` int(11) default NULL, 99 | `fldComments` text, 100 | `fldIPAddress` varchar(25) default NULL, 101 | PRIMARY KEY (`pkAttendeeID`) 102 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=271 ; 103 | 104 | -- 105 | -- Dumping data for table `tblEventAttendee` 106 | -- 107 | 108 | INSERT INTO `tblEventAttendee` (`pkAttendeeID`, `fldFirstName`, `fldLastName`, `fldPhone`, `fldWillBeLate`, `fldTimeArriving`, `fkEventID`, `fldComments`, `fldIPAddress`) VALUES 109 | (1, 'Patrick', 'Walker', '', 0, '', 1, '', NULL), 110 | (7, 'Laszlo', 'Bradacs', '', 0, '11:30', 1, '', NULL), 111 | (8, 'Joe', 'Bernitt', '', 0, '', 1, '', NULL), 112 | (9, 'Laura', 'Surdek', '', 0, '', 1, '', NULL), 113 | (10, 'Alex', 'Olivera', '', 0, '', 1, '', NULL), 114 | (11, 'Brian', 'Catalano', '', 0, '', 1, '', NULL), 115 | (28, 'Tim', 'Boyle', '', 0, '12:00', 1, 'If I''m not hungover I''ll be there', NULL), 116 | (13, 'Norma', 'Madrid', '', 0, '', 2, '', NULL), 117 | (14, 'Ian', 'Cole', '', 0, '', 2, '', NULL), 118 | (15, 'Patrick', 'Walker', '', 1, '08:00', 2, '', NULL), 119 | (37, 'Ian ', 'Cole', '', 0, '', 3, 'Team: LM Runaways', NULL), 120 | (38, 'Brian', 'Catalano', '', 0, '', 3, 'Team: LM Runaways', NULL), 121 | (36, 'Sean ', 'Dempsey', '', 0, '', 3, 'Team: LM Runaways', NULL), 122 | (41, 'Jing', 'Ling', '', 0, '', 3, 'Team: LM Runaways', NULL), 123 | (40, 'Cliff', 'Lum', '', 0, '', 3, 'Team: LM Runaways', NULL), 124 | (42, 'Patrick', 'Walker', '', 0, '', 3, 'Team: LM Runaways', NULL), 125 | (23, 'Gabe', 'Leake', '', 0, '', 3, '', NULL), 126 | (24, 'Kayla', 'Springer', '', 0, '', 3, '', NULL), 127 | (39, 'Laura ', 'Surdek', '', 0, '', 3, 'Team: LM Runaways', NULL), 128 | (26, 'Victor', 'Nghe', '', 0, '', 3, '', NULL), 129 | (27, 'Sean', 'Dempsey', '', 0, '', 2, 'Can''t wait!!', NULL), 130 | (29, 'Victor', 'Esquivel', '', 0, '', 1, '', NULL), 131 | (30, 'Janet', 'Wong', '', 0, '', 1, '', NULL), 132 | (31, 'Norma', 'Madrid', '', 0, '', 1, '', NULL), 133 | (32, 'Ian ', 'Cole', '', 0, '', 1, '', NULL), 134 | (33, 'Sean', 'Martell', '', 0, '', 1, '', NULL), 135 | (34, 'Amanda', 'Abbott', '', 0, '', 1, '', NULL), 136 | (35, 'Norma', 'Madrid', '', 0, '', 3, 'Team: LM Runaways', NULL), 137 | (43, 'Norma', 'Madrid', '', 0, '', 4, 'Maybe', NULL), 138 | (44, 'Sean', 'Dempsey', '', 0, '', 4, 'Maybe', NULL), 139 | (45, 'Ian', 'Cole', '', 0, '', 4, 'Maybe', NULL), 140 | (46, 'Cliff', 'Lum', '', 0, '', 4, '', NULL), 141 | (47, 'Laura', 'Surdek', '', 0, '', 4, 'Maybe', NULL), 142 | (48, 'Patrick', 'Walker', '', 0, '', 4, '', NULL), 143 | (49, 'Gabe', 'Leake', '', 0, '', 4, '', NULL), 144 | (50, 'Kayla', 'Springer', '', 0, '', 4, '', NULL), 145 | (51, 'Brian', 'Catalano', '', 0, '', 4, 'Maybe', NULL), 146 | (52, 'Victor', 'Nghe', '', 0, '', 4, 'Maybe', NULL), 147 | (53, 'Maddie', 'Yi', '', 0, '', 4, 'Maybe', NULL), 148 | (54, 'Christian', 'Diehl', '', 0, '', 1, '', NULL), 149 | (55, 'Sean', 'Dempsey', '', 0, '', 5, 'I will be making my patented and famous clamdip', NULL), 150 | (68, 'Better', 'Jeff', '', 0, '', 5, '', NULL), 151 | (57, 'Clifford', 'L', '', 0, '', 5, '', NULL), 152 | (58, 'Sean', 'Dempsey', '', 0, '', 6, 'I will get chips and dips. If people want to bring over other snacks (or cash for real food), feel free.', NULL), 153 | (59, 'Ed', 'Lee', '', 0, '', 6, '', NULL), 154 | (60, 'Jeff', 'Heim', '', 0, '08:00', 6, '', NULL), 155 | (61, 'Stephanie ', 'Landaverde', '', 0, '', 5, '', NULL), 156 | (62, 'Stephanie ', 'Landaverde ', '', 1, '08:30', 6, '', NULL), 157 | (63, 'Tim', 'Boyle', '', 0, '', 5, 'I should be there.', NULL), 158 | (64, 'PhilharMonica', 'Ummmm', '', 1, '09:30', 6, '', NULL), 159 | (65, 'Sean', 'Dempsey', '', 0, '', 7, 'I will be making clamdip again!', NULL), 160 | (66, 'Sean', 'Dempsey', '', 0, '', 8, 'I will be making my clamdip for this as well', NULL), 161 | (67, 'Sean', 'Dempsey', '', 0, '', 9, 'We had clamdip the night before; it will not be made again. i will have chips, dips, cookies, and all manners of other treats', NULL), 162 | (69, 'Norma', 'Madrid', '', 0, '', 8, 'Get ready for a super-depressing movie!', NULL), 163 | (71, 'Meklit', 'Jaleta', '', 1, '07:30', 5, '', NULL), 164 | (224, 'Sean', 'Dempsey', '', 0, '', 10, 'Clamdip will be made by yours truly', '143.115.159.53'), 165 | (73, 'Stacy', 'Kirkland', '', 0, '', 9, '', NULL), 166 | (74, 'Ben', 'Rowe', '', 0, '', 5, 'Could be late. Won''t know if I will be as Day 3 of the month is always a later night than usual.', NULL), 167 | (77, 'Damien', 'Kawakami', '', 0, '', 11, '(out of town guest)', NULL), 168 | (76, 'Ian', 'Cole', '', 0, '', 11, 'Sunday preferred.', NULL), 169 | (78, 'Norma', 'Madrid', '', 0, '', 11, 'Sunday preferred.', NULL), 170 | (79, 'Victor', 'Esquivel', '', 0, '', 11, 'Sunday, I''m a maybe', NULL), 171 | (80, 'Joe', 'Bernitt', '', 0, '', 11, 'Saturday, Sunday maybe', NULL), 172 | (81, 'Patrick', 'Walker', '', 0, '', 11, 'Sunday', NULL), 173 | (82, 'Alex', 'Olivera', '', 0, '', 11, 'Saturday preferred, Sunday okay', NULL), 174 | (83, 'Kirk', 'Remignanti ', '', 0, '', 11, 'Saturday preferred (hiking on Sunday)', NULL), 175 | (84, 'Phil', 'Sack', '', 0, '', 11, '', NULL), 176 | (85, 'Brian', 'Catalano', '', 0, '', 11, 'Either', NULL), 177 | (86, 'Sean', 'Dempsey', '', 0, '', 12, 'Feel free to invite anyone else', NULL), 178 | (87, 'Sean', 'Dempsey', '', 0, '', 13, 'Invite any friends! All are welcome', NULL), 179 | (88, 'Sean', 'Dempsey', '', 0, '', 14, 'The whiskey will flow like wine!', NULL), 180 | (89, 'Tim', 'Boyle', '', 0, '', 14, '', NULL), 181 | (90, 'phil', 'sack', '', 0, '', 12, '', NULL), 182 | (91, 'Sean', 'Dempsey', '', 0, '', 15, '', NULL), 183 | (92, 'Brian', 'Catalano', '', 0, '', 15, '', NULL), 184 | (93, 'Patrick', 'Walker', '', 0, '', 15, '', NULL), 185 | (94, 'Ben', 'Rowe', '', 0, '', 15, '', NULL), 186 | (95, 'Ted', 'Brogan', '', 0, '', 14, 'I played a little minor league ball back in the 80''s.', NULL), 187 | (96, 'Jesus', 'Quintana', '', 0, '', 13, 'Nobody fucks with the Jesus', NULL), 188 | (97, 'Sean', 'Dempsey', '', 0, '', 16, '', NULL), 189 | (98, 'Brian', 'Catalano', '', 0, '', 16, '', NULL), 190 | (99, 'Patrick', 'Walker', '', 0, '', 16, '', NULL), 191 | (100, 'Joe', 'Bernitt', '', 0, '11:00', 16, 'Might bring a friend', NULL), 192 | (101, 'Ian', 'Cole', '', 0, '', 16, '', NULL), 193 | (102, 'Zari', 'Bazarian', '', 0, '', 15, '', NULL), 194 | (103, 'Ian', 'Cole', '', 1, '08:30', 14, '', NULL), 195 | (104, '^Jeff', 'Heim', '', 0, '', 16, '', NULL), 196 | (105, 'Cesar', 'Valladares', '', 0, '', 16, '', NULL), 197 | (106, 'Tim', 'B', '', 0, '', 12, '', NULL), 198 | (107, 'Jeff', 'Heim', '', 0, '', 12, '', NULL), 199 | (108, 'Dani', 'Janis', '', 0, '', 7, '', NULL), 200 | (109, '.Norma', 'Madrid', '', 0, '', 17, 'LESSON: Yes--Skiing
\nSIGNED UP: Done.\n
\nRSVP: Yes\n', NULL), 201 | (110, '.Brian', 'Catalano', '', 0, '', 17, 'LESSON: Yes--skiing
\nSIGNED UP: Pending
\nRSVP: ', NULL), 202 | (111, '.Evan', 'Kellogg', '', 0, '', 17, 'LESSON: Yes--snowboarding
\nSIGNED UP: Pending\n
\nRSVP: ', NULL), 203 | (112, '.Janet', 'Wong', '', 0, '', 17, 'LESSON: \n
SIGNED UP: Pending\n
\nRSVP: ', NULL), 204 | (113, '.Laura', 'Surdek', '', 0, '', 17, 'LESSON: Yes--snowboarding
\nSIGNED UP: Done
\nRSVP: Done', NULL), 205 | (132, 'Norma', 'Madrid', '', 0, '07:00', 19, '', NULL), 206 | (133, 'Sean', 'Dempsey', '', 0, '', 19, 'will try to be there. will play it by ear... Can anyone spot me $3? We''re in a down economy after all...', NULL), 207 | (135, 'Patrick', 'Walker', '', 0, '', 19, '', NULL), 208 | (114, 'Patrick', 'Walker', '', 0, '', 17, 'LESSON: NO
\n**Probably just get lift ticket for where ever you guys go
\nI can drive. My car can hold 4 people with lots of room for ski stuff. ', NULL), 209 | (115, 'Erik', 'Williams', '', 0, '', 17, 'LESSON: NO
\n** May tag along for some riding
', NULL), 210 | (116, 'Ian', 'Cole', '', 0, '', 18, 'Keg', NULL), 211 | (117, 'Katie', 'Cole', '', 0, '', 18, 'Texas Caviar', NULL), 212 | (118, 'Norma', 'Madrid', '', 0, '', 18, 'Guac', NULL), 213 | (119, 'Ryan', 'Hutchins', '', 0, '03:30', 18, 'Bringing the wife. Chocolate chip cookie bars.', NULL), 214 | (120, 'Amanda', 'Hutchins', '', 0, '', 18, 'Hutch', NULL), 215 | (121, 'Steph', 'Landaverde', '', 0, '', 18, 'Sweets', NULL), 216 | (122, 'Patrick', 'Walker', '', 0, '', 18, 'something', NULL), 217 | (123, 'Stacy', 'Kirkland', '', 0, '', 18, 'Buffalo Chicken dip', NULL), 218 | (124, 'Laura', 'Surdek', '', 0, '', 18, 'Sugar cookies', NULL), 219 | (125, 'Sean', 'Dempsey', '', 0, '', 18, 'Clamdip', NULL), 220 | (126, 'Cliff', 'Lum', '', 0, '', 18, 'Veggie Platter', NULL), 221 | (127, '.Kayla', 'Springer', '', 0, '', 17, 'LESSONS: Yes--Snowboarding
\nSIGNED UP): Done
\nRSVP: Done', NULL), 222 | (134, 'Brian', 'Catalano', '', 0, '', 19, '', NULL), 223 | (128, 'Sean', 'Dempsey', '', 0, '', 17, 'LESSON: NO
\n**Will get ticket there', NULL), 224 | (129, 'Brian', 'Casey', '', 0, '', 8, 'Can''t wait! OMG I''m super excited!', NULL), 225 | (130, '.Michael', 'Surdek', '', 0, '', 17, 'LESSON: Yes--snowboarding
\nSIGNED UP: Done
\nRSVP: Done', NULL), 226 | (136, 'Erik', 'Williams', '', 0, '07:00', 19, '', NULL), 227 | (137, 'Laura', 'Surdek', '', 0, '', 19, '', NULL), 228 | (138, 'Kayla', 'Springer', '', 0, '', 19, '', NULL), 229 | (139, 'Diana', 'Schaller', '', 0, '', 19, 'RSVP might change.', NULL), 230 | (140, 'Khoa', 'Pham', '', 0, '', 19, '', NULL), 231 | (144, 'Jeff', 'Heim', '', 0, '', 19, '50-50', NULL), 232 | (145, 'Eric', 'Mahair', '', 0, '07:00', 19, '', NULL), 233 | (142, 'Miranda', 'LeBlanc', '', 0, '', 19, '', NULL), 234 | (143, 'Katie', 'Kilpeck', '', 0, '07:00', 19, '', NULL), 235 | (146, 'Norma', 'Madrid', '', 0, '', 20, '', NULL), 236 | (147, 'Patrick', 'Walker', '', 0, '', 20, '', NULL), 237 | (148, 'Brian', 'Catalano', '', 0, '', 20, '', NULL), 238 | (149, 'Norma', 'Madrid', '', 0, '', 21, '', NULL), 239 | (150, 'Norma', 'Madrid', '', 0, '', 23, '', NULL), 240 | (151, 'Laura', 'Surdek', '', 0, '', 20, '', NULL), 241 | (152, 'Kirk', 'Remignanti', '', 0, '', 20, '', NULL), 242 | (153, 'Sean', 'Dempsey', '', 0, '', 24, 'I may make clamdip. If the crowd demands it...', NULL), 243 | (154, 'Phil', '& Monica', '', 0, '', 24, 'damn right there will be clam dip...', NULL), 244 | (155, 'Kayla', 'Springer', '', 0, '', 20, '', NULL), 245 | (156, 'Clifford', 'Lum', '', 0, '', 20, '', NULL), 246 | (178, 'Norma', 'Madrid', '', 0, '', 37, 'Registered!', NULL), 247 | (158, 'Brian', 'Catalano', '', 0, '', 24, '', NULL), 248 | (159, 'Clifford', 'Lum', '', 0, '', 24, '', NULL), 249 | (160, 'Patrick', 'Walker', '', 0, '', 24, '', NULL), 250 | (161, 'Katie', 'Cole', '', 0, '', 24, '', NULL), 251 | (162, 'Laura', 'Surdek', '', 0, '', 24, 'I\\''ll bring some dessert...any preference?
(Sean says: Icecream and/or browies or cookies?)', NULL), 252 | (163, 'Kayla', 'Springer', '', 0, '', 24, '', NULL), 253 | (164, 'Sri', 'Jagannathan', '', 0, '', 20, '', NULL), 254 | (165, 'Munil', 'Gopalan', '', 0, '', 20, '', NULL), 255 | (166, 'Meklit ', '& Daniele', '', 0, '', 24, 'We will bring fruit and veggie platter.', NULL), 256 | (167, 'Stephanie', 'Landaverde', '', 0, '', 9, '', NULL), 257 | (168, 'Laura', 'Surdek', '', 0, '', 9, '', NULL), 258 | (169, 'Jessie ', 'Palmer ', '', 0, '', 24, '', NULL), 259 | (170, 'Maradie', 'Yi', '', 0, '', 24, 'Any requests for food to bring?
(Sean says: anything you want to bring is fine. Maybe guac and chips?)', NULL), 260 | (171, 'Victor', 'Nghe', '', 0, '', 24, '', NULL), 261 | (172, 'Zari', 'Bazarian', '', 0, '', 24, '', NULL), 262 | (173, 'Khoa', 'Pham', '', 0, '', 24, 'Beer. Lots of Beer.', NULL), 263 | (174, 'Miranda', 'LeBlanc', '', 0, '', 20, '', NULL), 264 | (175, 'Sasha', 'Lassonde', '', 0, '', 24, '', NULL), 265 | (176, 'Sasha', 'Lassonde', '', 0, '', 20, '', NULL), 266 | (177, 'Stacy', 'Kirkland', '', 0, '', 24, 'I''ll bring Rice Krispy Treats and Crock Pot Queso and chips', NULL), 267 | (179, 'Patrick', 'Walker', '', 0, '', 37, 'Registered', NULL), 268 | (180, 'Clifford', 'Lum', '', 0, '', 37, 'Registered', NULL), 269 | (181, 'Kayla', 'Springer', '', 0, '', 9, '', NULL), 270 | (182, 'Brian', 'Catalano', '', 0, '', 37, 'Registered', NULL), 271 | (189, 'Ian', 'Cole', '', 0, '', 25, 'Signed up.
\nRace & Pub-Crawl', NULL), 272 | (185, 'Kirk', 'Remignanti', '', 0, '', 37, 'Registered', NULL), 273 | (186, 'Ian', 'Cole', '', 0, '', 37, 'Registered', NULL), 274 | (187, 'Laura', 'Surdek', '', 0, '', 38, 'Team Name: Monty''s Minions', NULL), 275 | (188, 'Sean', 'Dempsey', '', 0, '', 25, 'i\\''m in and all signed up.
\nRace & Pub-Crawl', NULL), 276 | (190, 'Sri', 'Jagannathan', '', 0, '', 40, '', NULL), 277 | (195, 'Kayla', 'Springer', '', 0, '', 22, '', NULL), 278 | (193, 'Erik', 'W', '', 0, '', 22, 'Will come if I don''t have on-call work scheduled...', NULL), 279 | (194, 'Patrick', 'Walker', '', 0, '', 22, '', NULL), 280 | (196, 'Zari', 'Bazarian', '', 0, '07:00', 22, '', NULL), 281 | (197, 'Sasha', 'Lassonde', '', 0, '', 22, '', NULL), 282 | (198, 'Laura', 'Surdek', '', 0, '', 37, 'Registered', NULL), 283 | (200, 'Patrick', 'Walker', '', 0, '', 21, '', NULL), 284 | (201, 'Brian', 'Catalano', '', 0, '', 21, '', NULL), 285 | (202, 'Kayla', 'Springer', '', 0, '', 21, '', NULL), 286 | (203, 'Laura', 'Surdek', '', 0, '', 21, '', NULL), 287 | (204, 'Clifford', 'Lum', '', 0, '', 21, '', NULL), 288 | (209, 'Ian', 'Cole', '', 0, '', 21, '', NULL), 289 | (206, 'Matt', 'Martin', '', 0, '07:00', 21, '', NULL), 290 | (207, 'Sasha', 'Lassonde', '', 0, '', 21, '', NULL), 291 | (208, 'Miranda', 'LeBlanc', '', 0, '', 21, '', NULL), 292 | (210, 'Sean', 'Dawg', '', 0, '', 21, '', NULL), 293 | (211, 'Dan', 'Belforti', '', 1, '07:30', 21, 'My fiancee Andi Stuart may also join us.We''re 80% sure we can come but our baby comes first so only if he cooperates with grandparents', NULL), 294 | (231, 'Evan', 'Kellogg', '', 0, '', 10, '', '143.115.159.53'), 295 | (213, 'Ian', 'Cole', '', 0, '', 10, '', NULL), 296 | (215, 'Kyle', 'Pham', '', 0, '', 23, '', NULL), 297 | (216, 'Kayla', 'Springer', '', 0, '', 10, '', NULL), 298 | (217, 'Laura', 'Surdek', '', 0, '', 10, '', NULL), 299 | (218, 'Brian', 'Catalano', '', 0, '19:00', 10, '', NULL), 300 | (235, 'Sasha', 'Lassonde', '', 0, '', 41, '', '143.115.159.54'), 301 | (219, 'Kirk', 'Remignanti', '', 0, '', 23, '', NULL), 302 | (220, 'Sasha', 'Lassonde', '', 0, '', 23, '', NULL), 303 | (221, 'Big Red', 'Dog', '', 0, '', 23, '', NULL), 304 | (222, 'Norma', 'Madrid', '', 0, '', 25, 'Signed up! (2/27)
\nRace-only.', NULL), 305 | (223, 'Clifford', 'Lum', '', 0, '', 42, '', NULL), 306 | (225, 'Miranda', 'LeBlanc', '', 0, '', 23, '', '24.91.79.105'), 307 | (226, 'Ian', 'Cole', '', 0, '', 23, '', '143.115.159.53'), 308 | (227, 'Ben', 'Rowe', '', 0, '', 23, '', '143.115.159.53'), 309 | (228, 'Brian', 'Catalano', '', 0, '', 42, '', '143.115.159.54'), 310 | (229, 'Sean', 'Dempsey', '', 0, '', 23, '', '143.115.159.54'), 311 | (230, 'Brian', 'Catalano', '', 0, '', 43, 'Probably', '143.115.159.54'), 312 | (232, 'Brian', 'Catalano', '', 0, '', 41, '', '143.115.159.54'), 313 | (250, 'Stacy', 'Kirkland', '', 0, '', 51, '', '143.115.159.53'), 314 | (234, 'Janet', 'Wong', '', 0, '', 10, 'Sandy will be joining!', '143.115.159.54'), 315 | (236, 'Kyle', 'Pham', '', 1, '19:15', 10, '', '207.3.145.198'), 316 | (237, 'KHOA', 'PHAM', '', 0, '', 51, 'BRINGING THE FUN ', '172.56.23.68'), 317 | (238, 'Kayla', 'Springer', '', 0, '', 51, '', '143.115.159.54'), 318 | (239, 'Brian', 'Catalano', '', 0, '', 51, '', '143.115.159.54'), 319 | (263, 'Sean', 'Dempsey', '', 0, '', 41, '', '143.115.159.53'), 320 | (249, 'Sean', 'Dempsey', '', 0, '', 51, 'clamdip will be available again', '143.115.159.53'), 321 | (270, 'Patrick', 'Walker', '', 0, '', 41, '', '143.115.159.53'), 322 | (266, 'Zari', 'Bazarian', '', 0, '', 41, '', '143.115.159.53'), 323 | (267, 'Miranda', 'LeBlanc', '', 0, '', 41, '', '143.115.159.53'), 324 | (268, 'Laura', 'Surdek', '', 0, '', 41, '', '143.115.159.53'); 325 | 326 | -------------------------------------------------------------------------------- /examples/events/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, Helvetica, sans-serif; 3 | font-size: 11px; 4 | color: #666666; 5 | margin-left: 0px; 6 | margin-top: 0px; 7 | margin-right: 0px; 8 | margin-bottom: 0px; 9 | background-color: #f2f2f2; 10 | } 11 | a{ 12 | color:#0066CC; 13 | font-weight:bold; 14 | text-decoration:none; 15 | } 16 | a:hover{ 17 | color:#0099CC; 18 | text-decoration:underline; 19 | } 20 | A.menu{ 21 | color:#FFCC00; 22 | font-weight:bold; 23 | text-decoration:none; 24 | } 25 | a.menu:hover{ 26 | color:#718ABE; 27 | text-decoration:underline; 28 | } 29 | 30 | a.smalllink{ 31 | color:#3366CC; 32 | font-size:10px; 33 | } 34 | a.biglink{ 35 | color:#3366CC; 36 | font-weight:bold; 37 | font-size:17px; 38 | } 39 | .hand_cursor{ 40 | cursor: pointer; /* hand-shaped cursor */ 41 | cursor: hand; /* for IE 5.x */ 42 | } 43 | 44 | img.imagedropshadow { 45 | border: solid 1px #CCC; 46 | -moz-box-shadow: 1px 1px 5px #999; 47 | -webkit-box-shadow: 1px 1px 5px #999; 48 | box-shadow: 1px 1px 5px #999; 49 | 50 | /* rounded edges */ 51 | -moz-border-radius: 10px / 40px; 52 | -webkit-border-radius: 36px 12px; 53 | } 54 | 55 | .report, .alertgood { 56 | text-align: left; 57 | border-top: 1px solid #9c9; 58 | border-bottom: 1px solid #9c9; 59 | padding: 5px 5px 5px 30px; 60 | font-size: 11px; 61 | margin: 0 20px 15px 20px; 62 | color: #060; 63 | background: url("../../css/checkicon.gif") #e2f9e3 left no-repeat; 64 | } 65 | 66 | .error, .alertbad { 67 | text-align: left; 68 | font-weight: bold; 69 | border-top: 1px solid #c99; 70 | border-bottom: 1px solid #c99; 71 | padding: 5px 5px 5px 27px; 72 | font-size: 11px; 73 | margin: 0 20px 15px 20px; 74 | background: url("../../css/badicon.gif") #c00 left no-repeat; 75 | color: #fff; 76 | } 77 | 78 | .highlight { 79 | background: #eee; 80 | } 81 | 82 | p.highlight { 83 | background: #eee; 84 | border: 1px solid #ccc; 85 | padding: 10px; 86 | } 87 | 88 | div.highlight { 89 | background: #eee; 90 | border: 1px solid #ccc; 91 | padding: 10px 10px 10px 10px; margin: 0 0 1em 0; 92 | } -------------------------------------------------------------------------------- /examples/events/uploads/10K_-_Six03.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/10K_-_Six03.JPG -------------------------------------------------------------------------------- /examples/events/uploads/1927_5K-TrickOrTrotTemp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/1927_5K-TrickOrTrotTemp.png -------------------------------------------------------------------------------- /examples/events/uploads/2208_5K_-_AppleHarvest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/2208_5K_-_AppleHarvest.jpg -------------------------------------------------------------------------------- /examples/events/uploads/3381_5K-TrickOrTrotTemp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/3381_5K-TrickOrTrotTemp.png -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_AppleHarvest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_AppleHarvest.jpg -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_FathersDay.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_FathersDay.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_Horne.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_Horne.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_Komen.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_Komen.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_MothersDay.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_MothersDay.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_RedBarn2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_RedBarn2.jpg -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_Redhook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_Redhook.jpg -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_Run_Before_You_Crawl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_Run_Before_You_Crawl.jpg -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_SMA.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_SMA.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_SpiritofRecovery.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_SpiritofRecovery.JPG -------------------------------------------------------------------------------- /examples/events/uploads/5K_-_Turkey_Trot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5K_-_Turkey_Trot.jpg -------------------------------------------------------------------------------- /examples/events/uploads/5M_-_Paddys.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/5M_-_Paddys.JPG -------------------------------------------------------------------------------- /examples/events/uploads/9868_Upstream-Color-2013-Stills.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/9868_Upstream-Color-2013-Stills.jpg -------------------------------------------------------------------------------- /examples/events/uploads/Biutiful.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Biutiful.jpg -------------------------------------------------------------------------------- /examples/events/uploads/Bud-light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Bud-light.jpg -------------------------------------------------------------------------------- /examples/events/uploads/LearnSnowsport.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/LearnSnowsport.JPG -------------------------------------------------------------------------------- /examples/events/uploads/Logo-Animated-Transparent-Forever.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Logo-Animated-Transparent-Forever.gif -------------------------------------------------------------------------------- /examples/events/uploads/SRS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/SRS.png -------------------------------------------------------------------------------- /examples/events/uploads/Volleyball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Volleyball.jpg -------------------------------------------------------------------------------- /examples/events/uploads/Volleyball_green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Volleyball_green.jpg -------------------------------------------------------------------------------- /examples/events/uploads/Volleyball_heart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Volleyball_heart.jpg -------------------------------------------------------------------------------- /examples/events/uploads/Volleyball_shamrock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/Volleyball_shamrock.jpg -------------------------------------------------------------------------------- /examples/events/uploads/download.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/download.jpg -------------------------------------------------------------------------------- /examples/events/uploads/dumbo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/dumbo.jpg -------------------------------------------------------------------------------- /examples/events/uploads/halo_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/halo_4.jpg -------------------------------------------------------------------------------- /examples/events/uploads/hottub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/hottub.jpg -------------------------------------------------------------------------------- /examples/events/uploads/hr_the_walking_dead.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/hr_the_walking_dead.jpg -------------------------------------------------------------------------------- /examples/events/uploads/nfl_wildcard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/nfl_wildcard.gif -------------------------------------------------------------------------------- /examples/events/uploads/primer-film.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/primer-film.jpg -------------------------------------------------------------------------------- /examples/events/uploads/princess_bride.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/princess_bride.jpeg -------------------------------------------------------------------------------- /examples/events/uploads/soccer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/soccer.jpg -------------------------------------------------------------------------------- /examples/events/uploads/stella.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/stella.jpg -------------------------------------------------------------------------------- /examples/events/uploads/stella2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/stella2.jpg -------------------------------------------------------------------------------- /examples/events/uploads/superbown_2014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/superbown_2014.jpg -------------------------------------------------------------------------------- /examples/events/uploads/tv-question-mark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/tv-question-mark.jpg -------------------------------------------------------------------------------- /examples/events/uploads/untitled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/untitled.png -------------------------------------------------------------------------------- /examples/events/uploads/v_for_vendetta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/v_for_vendetta.png -------------------------------------------------------------------------------- /examples/events/uploads/whiskey_and_chess.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/uploads/whiskey_and_chess.jpg -------------------------------------------------------------------------------- /examples/events/youre-invited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/events/youre-invited.png -------------------------------------------------------------------------------- /examples/example.php: -------------------------------------------------------------------------------- 1 | defineRelationship("fkID", "tblDemoRelationship", "pkID", "fldName", "fldSort DESC"); //use your own table - this table (tblDemoRelationship) not included in the installation script 25 | 26 | #i don't want to visually show the primary key in the table 27 | $tblDemo->omitPrimaryKey(); 28 | 29 | #the table fields have prefixes; i want to give the heading titles something more meaningful 30 | $tblDemo->displayAs("fldField1", "Field1"); 31 | $tblDemo->displayAs("fldField2", "Field2"); 32 | $tblDemo->displayAs("fldCertainFields", "Valid Value Field"); 33 | $tblDemo->displayAs("fldLongField", "Long Field"); 34 | $tblDemo->displayAs("fldCheckbox", "Is Selected?"); 35 | 36 | #set the textarea height of the longer field (for editing/adding) 37 | #http://ajaxcrud.com/api/index.php?id=setTextareaHeight 38 | $tblDemo->setTextareaHeight('fldLongField', 150); 39 | 40 | #i could omit a field if I wanted 41 | #http://ajaxcrud.com/api/index.php?id=omitField 42 | //$tblDemo->omitField("fldField2"); 43 | 44 | #i could omit a field from being on the add form if I wanted 45 | //$tblDemo->omitAddField("fldField2"); 46 | 47 | #i could disallow editing for certain, individual fields 48 | //$tblDemo->disallowEdit('fldField2'); 49 | 50 | #i could set a field to accept file uploads (the filename is stored) if wanted 51 | //$tblDemo->setFileUpload("fldField2", "uploads/"); 52 | 53 | #i can have a field automatically populate with a certain value (eg the current timestamp) 54 | //$tblDemo->addValueOnInsert("fldField1", "NOW()"); 55 | 56 | #i can use a where field to better-filter my table 57 | //$tblDemo->addWhereClause("WHERE (fldField1 = 'test')"); 58 | 59 | #i can order my table by whatever i want 60 | //$tblDemo->addOrderBy("ORDER BY fldField1 ASC"); 61 | 62 | #i can set certain fields to only allow certain values 63 | #http://ajaxcrud.com/api/index.php?id=defineAllowableValues 64 | $allowableValues = array("Allowable Value1", "Allowable Value2", "Dropdown Value", "CRUD"); 65 | $tblDemo->defineAllowableValues("fldCertainFields", $allowableValues); 66 | 67 | //set field fldCheckbox to be a checkbox 68 | $tblDemo->defineCheckbox("fldCheckbox"); 69 | 70 | #i can disallow deleting of rows from the table 71 | #http://ajaxcrud.com/api/index.php?id=disallowDelete 72 | //$tblDemo->disallowDelete(); 73 | 74 | #i can disallow adding rows to the table 75 | #http://ajaxcrud.com/api/index.php?id=disallowAdd 76 | //$tblDemo->disallowAdd(); 77 | 78 | #i can add a button that performs some action deleting of rows for the entire table 79 | #http://ajaxcrud.com/api/index.php?id=addButtonToRow 80 | //$tblDemo->addButtonToRow("Add", "add_item.php", "all"); 81 | 82 | #set the number of rows to display (per page) 83 | $tblDemo->setLimit(30); 84 | 85 | #set a filter box at the top of the table 86 | //$tblDemo->addAjaxFilterBox('fldField1'); 87 | 88 | #if really desired, a filter box can be used for all fields 89 | $tblDemo->addAjaxFilterBoxAllFields(); 90 | 91 | #i can set the size of the filter box 92 | //$tblDemo->setAjaxFilterBoxSize('fldField1', 3); 93 | 94 | #i can format the data in cells however I want with formatFieldWithFunction 95 | #this is arguably one of the most important (visual) functions 96 | $tblDemo->formatFieldWithFunction('fldField1', 'makeBlue'); 97 | $tblDemo->formatFieldWithFunction('fldField2', 'makeBold'); 98 | 99 | //$tblDemo->modifyFieldWithClass("fldField1", "zip required"); //for testing masked input functionality 100 | //$tblDemo->modifyFieldWithClass("fldField2", "phone"); //for testing masked input functionality 101 | 102 | //$tblDemo->onAddExecuteCallBackFunction("mycallbackfunction"); //uncomment this to try out an ADD ROW callback function 103 | 104 | $tblDemo->deleteText = "delete"; 105 | 106 | ?> 107 |
108 | Total Returned Rows: insertRowsReturned();?>
109 |
110 | 111 |
112 | 113 | showTable(); 117 | 118 | #my self-defined functions used for formatFieldWithFunction 119 | function makeBold($val){ 120 | if ($val == "") return "no value"; 121 | return "$val"; 122 | } 123 | 124 | function makeBlue($val){ 125 | return "$val"; 126 | } 127 | 128 | function myCallBackFunction($array){ 129 | echo "THE ADD ROW CALLBACK FUNCTION WAS implemented"; 130 | print_r($array); 131 | } 132 | ?> -------------------------------------------------------------------------------- /examples/example.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE tblDemo( 2 | pkID INT PRIMARY KEY AUTO_INCREMENT, 3 | fldField1 VARCHAR(45), 4 | fldField2 VARCHAR(45), 5 | fldCertainFields VARCHAR(40), 6 | fldLongField TEXT, 7 | fldCheckbox TINYINT 8 | ); 9 | 10 | CREATE TABLE tblDemo2( 11 | pkID INT PRIMARY KEY AUTO_INCREMENT, 12 | fldField1 VARCHAR(45), 13 | fldField2 VARCHAR(45), 14 | fldCertainFields VARCHAR(40), 15 | fldLongField TEXT 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS `tblfriend` ( 19 | `pkFriendID` int(11) NOT NULL AUTO_INCREMENT, 20 | `fldName` varchar(25) DEFAULT NULL, 21 | `fldAddress` varchar(30) DEFAULT NULL, 22 | `fldCity` varchar(20) DEFAULT NULL, 23 | `fldState` char(2) DEFAULT NULL, 24 | `fldZip` varchar(5) DEFAULT NULL, 25 | `fldPhone` varchar(15) DEFAULT NULL, 26 | `fldEmail` varchar(35) DEFAULT NULL, 27 | `fldBestFriend` char(1) DEFAULT NULL, 28 | `fldDateMet` date DEFAULT NULL, 29 | `fldFriendRating` char(1) DEFAULT NULL, 30 | `fldOwes` double(6,2) DEFAULT NULL, 31 | `fldPicture` varchar(30) DEFAULT NULL, 32 | `fkMarriedTo` tinyint(4) DEFAULT NULL, 33 | PRIMARY KEY (`pkFriendID`) 34 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 35 | 36 | -- 37 | -- Dumping data for table `tblfriend` 38 | -- 39 | 40 | INSERT INTO `tblFriend` (`pkFriendID`, `fldName`, `fldAddress`, `fldCity`, `fldState`, `fldZip`, `fldPhone`, `fldEmail`, `fldBestFriend`, `fldDateMet`, `fldFriendRating`, `fldOwes`, `fldPicture`, `fkMarriedTo`) VALUES 41 | (1, 'Sean Dempsey', '13 Back River Road', 'Dover', 'NH', '03820', '(603) 978-8841', 'sean@loudcanvas.com', 'N', '2011-10-27', '5', 122.01, '', 1), 42 | (2, 'Justin Rigby', '22 Farmington Rd', 'Rochester', 'VT', '05401', '(802) 661-4051', 'sean@seandempsey.com', '', '2011-10-19', '1', 22.00, '', 2), 43 | (3, 'Ryan Dempsey', '', '', 'VT', '', '', 'ryan@dempsey.com', '', '2011-10-20', '', 0.00, '', 3), 44 | (4, 'Justin Beiber', '22 Mason Dr', 'Somersworth', 'IA', '32232', '(332) 223-3223', 'sean@seandempsey.com', 'Y', '0000-00-00', '4', 0.00, '', 2), 45 | (5, 'Tim Boyle', 'Jason St', 'New Boston', 'CO', '22112', '(112) 111-1111', 'sean@seandempsey.com', 'N', '2014-01-01', '2', 121.00, '', 3); 46 | 47 | 48 | CREATE TABLE IF NOT EXISTS `tblLadies` ( 49 | `pkLadyID` int(11) NOT NULL AUTO_INCREMENT, 50 | `fldName` varchar(25) DEFAULT NULL, 51 | `fldSort` int(11) DEFAULT NULL, 52 | PRIMARY KEY (`pkLadyID`) 53 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 54 | 55 | -- 56 | -- Dumping data for table `tblLadies` 57 | -- 58 | 59 | INSERT INTO `tblLadies` (`pkLadyID`, `fldName`, `fldSort`) VALUES 60 | (1, 'Emily Benson', 1), 61 | (2, 'Sharon Nelson', 2), 62 | (3, 'Kirsten Leavitt', 3); -------------------------------------------------------------------------------- /examples/example2.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | omitPrimaryKey(); 14 | $tblDemo->displayAs("fldField1", "Field1"); 15 | $tblDemo->displayAs("fldField2", "Field2"); 16 | $tblDemo->displayAs("fldCertainFields", "Pick List"); 17 | $tblDemo->displayAs("fldLongField", "Long Field"); 18 | $tblDemo->displayAs("fldCheckbox", "Is Selected?"); 19 | $tblDemo->setTextareaHeight('fldLongField', 100); 20 | 21 | $allowableValues = array("Allowable Value1", "Allowable Value2", "Dropdown Value", "CRUD"); 22 | $tblDemo->defineAllowableValues("fldCertainFields", $allowableValues); 23 | 24 | //set field fldCheckbox to be a checkbox 25 | $tblDemo->defineCheckbox("fldCheckbox", "1", "0"); 26 | 27 | $tblDemo->setLimit(5); 28 | $tblDemo->addAjaxFilterBox('fldField1'); 29 | $tblDemo->formatFieldWithFunction('fldField1', 'makeBlue'); 30 | $tblDemo->formatFieldWithFunction('fldField2', 'makeBold'); 31 | echo "

Table tblDemo

\n"; 32 | $tblDemo->showTable(); 33 | 34 | echo "


\n"; 35 | 36 | $tblDemo2 = new ajaxCRUD("Item", "tblDemo2", "pkID"); 37 | $tblDemo2->omitPrimaryKey(); 38 | $tblDemo2->displayAs("fldField1", "Field1"); 39 | $tblDemo2->displayAs("fldField2", "Field2"); 40 | $tblDemo2->displayAs("fldCertainFields", "Color"); 41 | $tblDemo2->displayAs("fldLongField", "Long Field"); 42 | 43 | $allowableValues2 = array("Green", "Blue", "Red", "Periwinkle"); 44 | $tblDemo2->defineAllowableValues("fldCertainFields", $allowableValues2); 45 | 46 | $tblDemo2->setTextareaHeight('fldLongField', 50); 47 | $tblDemo2->setLimit(20); 48 | $tblDemo2->addAjaxFilterBox('fldField1'); 49 | $tblDemo2->formatFieldWithFunction('fldField2', 'makeBlue'); 50 | $tblDemo2->formatFieldWithFunction('fldField1', 'makeBold'); 51 | echo "

Table tblDemo2

\n"; 52 | $tblDemo2->showTable(); 53 | 54 | 55 | function makeBold($val){ 56 | return "$val"; 57 | } 58 | 59 | function makeBlue($val){ 60 | return "$val"; 61 | } 62 | 63 | ?> -------------------------------------------------------------------------------- /examples/example3.php: -------------------------------------------------------------------------------- 1 | 12 | 14 | 15 | 16 | 17 | 18 | insertHeader(); ?> 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | setOrientation("vertical"); //if you want the table to arrange vertically 32 | 33 | #i can define a relationship to another table 34 | #the 1st field is the fk in the table, the 2nd is the second table, the 3rd is the pk in the second table, the 4th is field i want to retrieve as the dropdown value 35 | #http://ajaxcrud.com/api/index.php?id=defineRelationship 36 | $tblFriend->defineRelationship("fkMarriedTo", "tblLadies", "pkLadyID", "fldName", "fldSort DESC"); //last var (sorting) is optional; see reference documentation 37 | 38 | #how you want the fields to visually display in the table header 39 | $tblFriend->displayAs("pkFriendID", "ID"); 40 | $tblFriend->displayAs("fldName", "Name"); 41 | $tblFriend->displayAs("fldAddress", "Address"); 42 | $tblFriend->displayAs("fldCity", "City"); 43 | $tblFriend->displayAs("fldState", "State"); 44 | $tblFriend->displayAs("fldZip", "Zip"); 45 | $tblFriend->displayAs("fldPhone", "Phone"); 46 | $tblFriend->displayAs("fldEmail", "Email"); 47 | $tblFriend->displayAs("fldBestFriend", "Best Friend?"); 48 | $tblFriend->displayAs("fldDateMet", "Date We Met"); 49 | $tblFriend->displayAs("fldFriendRating", "Rating"); 50 | $tblFriend->displayAs("fldOwes", "Owes Me How Much?"); 51 | $tblFriend->displayAs("fldPicture", "Image"); 52 | $tblFriend->displayAs("fkMarriedTo", "Married To"); 53 | 54 | #disallow new friends to be added (removes the add button) 55 | //$tblFriend->disallowAdd(); 56 | 57 | #use if you only want to show a few of the fields (not all) 58 | //$tblFriend->showOnly("fldName, fldAddress, fldState, fldOwes"); 59 | 60 | #use if you want to rearrange the order your fields display (different from table schema) 61 | //$tblFriend->orderFields("pkFriendID, fldAddress, fldName, fldState"); 62 | 63 | #set the number of rows to display (per page) 64 | $tblFriend->setLimit(2); 65 | 66 | #set a filter box at the top of the table 67 | $tblFriend->addAjaxFilterBox('fldName', 20); 68 | $tblFriend->addAjaxFilterBox('fldDateMet'); 69 | $tblFriend->addAjaxFilterBox('fkMarriedTo'); 70 | 71 | #allow picture to be a file upload 72 | $tblFriend->setFileUpload('fldPicture','uploads/','uploads/'); 73 | //$tblFriend->disallowEdit("fldPicture"); 74 | $tblFriend->onAddExecuteCallBackFunction("myFunctionAfterAdd"); 75 | 76 | #format field output 77 | $tblFriend->formatFieldWithFunction('fldOwes', 'addDollarSign'); 78 | $tblFriend->formatFieldWithFunction('fldPicture', 'displayImage'); 79 | 80 | $tblFriend->defineCheckbox("fldBestFriend", "Y", "N"); 81 | 82 | #modify field with class 83 | $tblFriend->modifyFieldWithClass("fldDateMet", "datepicker"); 84 | $tblFriend->modifyFieldWithClass("fldZip", "zip required"); 85 | $tblFriend->modifyFieldWithClass("fldPhone", "phone required"); 86 | $tblFriend->modifyFieldWithClass("fldEmail", "email"); 87 | 88 | #set allowable values for certain fields 89 | $ratingVals = array("0","1", "2","3","4","5"); 90 | $tblFriend->defineAllowableValues("fldFriendRating", $ratingVals); 91 | 92 | $states = array( 93 | array("AL","Alabama"), 94 | array("AK","Alaska"), 95 | array("AZ","Arizona"), 96 | array("AR","Arkansas"), 97 | array("CA","California"), 98 | array("CO","Colorado"), 99 | array("CT","Connecticut"), 100 | array("DE","Delaware"), 101 | array("DC","District Of Columbia"), 102 | array("FL","Florida"), 103 | array("GA","Georgia"), 104 | array("HI","Hawaii"), 105 | array("ID","Idaho"), 106 | array("IL","Illinois"), 107 | array("IN","Indiana"), 108 | array("IA","Iowa"), 109 | array("KS","Kansas"), 110 | array("KY","Kentucky"), 111 | array("LA","Louisiana"), 112 | array("ME","Maine"), 113 | array("MD","Maryland"), 114 | array("MA","Massachusetts"), 115 | array("MI","Michigan"), 116 | array("MN","Minnesota"), 117 | array("MS","Mississippi"), 118 | array("MO","Missouri"), 119 | array("MT","Montana"), 120 | array("NE","Nebraska"), 121 | array("NV","Nevada"), 122 | array("NH","New Hampshire"), 123 | array("NJ","New Jersey"), 124 | array("NM","New Mexico"), 125 | array("NY","New York"), 126 | array("NC","North Carolina"), 127 | array("ND","North Dakota"), 128 | array("OH","Ohio"), 129 | array("OK","Oklahoma"), 130 | array("OR","Oregon"), 131 | array("PA","Pennsylvania"), 132 | array("RI","Rhode Island"), 133 | array("SC","South Carolina"), 134 | array("SD","South Dakota"), 135 | array("TN","Tennessee"), 136 | array("TX","Texas"), 137 | array("UT","Utah"), 138 | array("VT","Vermont"), 139 | array("VA","Virginia"), 140 | array("WA","Washington"), 141 | array("WV","West Virginia"), 142 | array("WI","Wisconsin"), 143 | array("WY","Wyoming") 144 | ); 145 | 146 | $tblFriend->defineAllowableValues("fldState", $states); 147 | 148 | #show CSV export button 149 | $tblFriend->showCSVExportOption(); 150 | 151 | #use if you want to move the add form to the top of the page 152 | //$tblFriend->displayAddFormTop(); 153 | 154 | #order the table by any field you want 155 | $tblFriend->addOrderBy("ORDER BY fldName"); 156 | 157 | #add a button at the bottom of the table which simply goes to another page 158 | $tblFriend->addButton("No More Friends. Take Me Home", "./"); 159 | 160 | //$tblFriend->turnOffSorting(); //turns off ajax sorting by pressing header links 161 | //$tblFriend->disableTableHeaders(); //disables table headers from displaying 162 | 163 | //$tblFriend->turnOffAjaxEditing(); //turns of ajax editing of all data 164 | 165 | #some logic if we want to add a field automatically on add 166 | $state = ""; 167 | if (isset($_REQUEST['state'])){ 168 | $state = $_REQUEST['state']; 169 | } 170 | if ($state){ 171 | $tblFriend->addWhereClause("WHERE fldState = \"$state\""); 172 | $tblFriend->omitAddField("fldState"); 173 | $tblFriend->addValueOnInsert("fldState", $state); 174 | } 175 | 176 | 177 | echo "

Example3 tests FormatFieldWithFunction, defineRelationship, Multiple Filters, and a Date Picker

\n"; 178 | 179 | $tblFriend->showTable(); 180 | 181 | echo "

Above is a table of my friends. The javascript masking and validation are in the fields 'phone' and 'zip' (required). There's a datapicker on the 'Date we Met' field.

\n"; 182 | 183 | #self-defined functions used for formatFieldWithFunction 184 | function addDollarSign($val) { 185 | return "$" . $val; 186 | } 187 | 188 | function displayImage($val){ 189 | return ""; 190 | } 191 | 192 | function myFunctionAfterAdd($array){ 193 | //print_r($array); 194 | } 195 | ?> 196 | 197 | 198 | -------------------------------------------------------------------------------- /examples/example4.php: -------------------------------------------------------------------------------- 1 | defineRelationship("fkID", "tblDemoRelationship", "pkID", "fldName", "fldSort DESC"); //use your own table - this table (tblDemoRelationship) not included in the installation script 25 | 26 | #i don't want to visually show the primary key in the table 27 | $tblDemo->omitPrimaryKey(); 28 | 29 | #the table fields have prefixes; i want to give the heading titles something more meaningful 30 | $tblDemo->displayAs("fldField1", "Field1"); 31 | $tblDemo->displayAs("fldField2", "Field2"); 32 | $tblDemo->displayAs("fldCertainFields", "Certain Fields"); 33 | $tblDemo->displayAs("fldLongField", "Long Field"); 34 | $tblDemo->displayAs("fldCheckbox", "Is Selected?"); 35 | 36 | #set the textarea height of the longer field (for editing/adding) 37 | #http://ajaxcrud.com/api/index.php?id=setTextareaHeight 38 | $tblDemo->setTextareaHeight('fldLongField', 150); 39 | 40 | #i could omit a field if I wanted 41 | #http://ajaxcrud.com/api/index.php?id=omitField 42 | //$tblDemo->omitField("fldField2"); 43 | 44 | #i could omit a field from being on the add form if I wanted 45 | //$tblDemo->omitAddField("fldField2"); 46 | 47 | #i could disallow editing for certain, individual fields 48 | //$tblDemo->disallowEdit('fldField2'); 49 | 50 | #i could set a field to accept file uploads (the filename is stored) if wanted 51 | //$tblDemo->setFileUpload("fldField2", "uploads/"); 52 | 53 | #i can have a field automatically populate with a certain value (eg the current timestamp) 54 | //$tblDemo->addValueOnInsert("fldField1", "NOW()"); 55 | 56 | #i can use a where field to better-filter my table 57 | //$tblDemo->addWhereClause("WHERE (fldField1 = 'test'"); 58 | 59 | #i can order my table by whatever i want 60 | //$tblDemo->addOrderBy("ORDER BY fldField1 ASC"); 61 | 62 | #i can set certain fields to only allow certain values 63 | #http://ajaxcrud.com/api/index.php?id=defineAllowableValues 64 | $allowableValues = array("Allowable Value 1", "Allowable Value2", "Dropdown Value", "CRUD"); 65 | $tblDemo->defineAllowableValues("fldCertainFields", $allowableValues); 66 | 67 | //set field fldCheckbox to be a checkbox 68 | $tblDemo->defineCheckbox("fldCheckbox"); 69 | 70 | #i can disallow deleting of rows from the table 71 | #http://ajaxcrud.com/api/index.php?id=disallowDelete 72 | //$tblDemo->disallowDelete(); 73 | 74 | #i can disallow adding rows to the table 75 | #http://ajaxcrud.com/api/index.php?id=disallowAdd 76 | //$tblDemo->disallowAdd(); 77 | 78 | #i can add a button that performs some action deleting of rows for the entire table 79 | #http://ajaxcrud.com/api/index.php?id=addButtonToRow 80 | //$tblDemo->addButtonToRow("Add", "add_item.php", "all"); 81 | 82 | #set the number of rows to display (per page) 83 | $tblDemo->setLimit(30); 84 | 85 | #set a filter box at the top of the table 86 | //$tblDemo->addAjaxFilterBox('fldField1'); 87 | 88 | #if really desired, a filter box can be used for all fields 89 | $tblDemo->addAjaxFilterBoxAllFields(); 90 | 91 | #i can set the size of the filter box 92 | //$tblDemo->setAjaxFilterBoxSize('fldField1', 3); 93 | 94 | #i can format the data in cells however I want with formatFieldWithFunction 95 | #this is arguably one of the most important (visual) functions 96 | $tblDemo->formatFieldWithFunction('fldField1', 'makeBlue'); 97 | $tblDemo->formatFieldWithFunction('fldField2', 'makeBold'); 98 | 99 | //$tblDemo->modifyFieldWithClass("fldField1", "zip required"); //for testing masked input functionality 100 | //$tblDemo->modifyFieldWithClass("fldField2", "phone"); //for testing masked input functionality 101 | 102 | //$tblDemo->onAddExecuteCallBackFunction("myCallBackFunctionForAdd"); //uncomment this to try out an ADD ROW callback function 103 | 104 | #implement a callback function after updating/editing a field 105 | $tblDemo->onUpdateExecuteCallBackFunction("fldField1", "myCallBackFunctionForEdit"); 106 | 107 | $tblDemo->onUpdateExecuteCallBackFunction("fldCertainFields", "myCallBackFunctionForEdit"); 108 | 109 | $tblDemo->onUpdateExecuteCallBackFunction("fldCheckbox", "myCallBackFunctionForEdit"); 110 | 111 | 112 | ?> 113 |

Example Using onUpdateExecuteCallBackFunction

114 |
115 | Total Returned Rows: insertRowsReturned();?>
116 |
117 | 118 |
119 | 120 | showTable(); 124 | 125 | #my self-defined functions used for formatFieldWithFunction 126 | function makeBold($val){ 127 | return "$val"; 128 | } 129 | 130 | function makeBlue($val){ 131 | return "$val"; 132 | } 133 | 134 | function myCallBackFunctionForAdd($array){ 135 | echo "THE ADD ROW CALLBACK FUNCTION WAS implemented"; 136 | print_r($array); 137 | } 138 | 139 | function myCallBackFunctionForEdit($array){ 140 | echo "THE EDIT ROW CALLBACK FUNCTION WAS implemented"; 141 | print_r($array); 142 | } 143 | ?> -------------------------------------------------------------------------------- /examples/includes/images/calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/calendar.gif -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_flat_55_fbec88_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_flat_55_fbec88_40x100.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_glass_75_d0e5f5_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_glass_75_d0e5f5_1x400.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_glass_85_dfeffc_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_glass_85_dfeffc_1x400.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_inset-hard_100_f5f8f9_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_inset-hard_100_f5f8f9_1x100.png -------------------------------------------------------------------------------- /examples/includes/images/ui-bg_inset-hard_100_fcfdfd_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-bg_inset-hard_100_fcfdfd_1x100.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_217bc0_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_217bc0_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_469bdd_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_469bdd_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_6da8d5_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_6da8d5_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_d8e7f3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_d8e7f3_256x240.png -------------------------------------------------------------------------------- /examples/includes/images/ui-icons_f9bd01_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/examples/includes/images/ui-icons_f9bd01_256x240.png -------------------------------------------------------------------------------- /examples/includes/jquery.ui.all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.16 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming 9 | */ 10 | @import "jquery.ui.base.css"; 11 | @import "jquery.ui.theme.css"; 12 | -------------------------------------------------------------------------------- /examples/includes/jquery.ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("jquery.ui.core.css"); 2 | @import url("jquery.ui.datepicker.css"); -------------------------------------------------------------------------------- /examples/includes/jquery.ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 1.8.16 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Theming/API 9 | */ 10 | 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { display: none; } 14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } 15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 16 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 17 | .ui-helper-clearfix { display: inline-block; } 18 | /* required comment for clearfix to work in Opera \*/ 19 | * html .ui-helper-clearfix { height:1%; } 20 | .ui-helper-clearfix { display:block; } 21 | /* end clearfix */ 22 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 23 | 24 | 25 | /* Interaction Cues 26 | ----------------------------------*/ 27 | .ui-state-disabled { cursor: default !important; } 28 | 29 | 30 | /* Icons 31 | ----------------------------------*/ 32 | 33 | /* states and images */ 34 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 35 | 36 | 37 | /* Misc visuals 38 | ----------------------------------*/ 39 | 40 | /* Overlays */ 41 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 42 | -------------------------------------------------------------------------------- /examples/includes/jquery.ui.core.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI 1.8.16 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI 9 | */ 10 | (function( $, undefined ) { 11 | 12 | // prevent duplicate loading 13 | // this is only a problem because we proxy existing functions 14 | // and we don't want to double proxy them 15 | $.ui = $.ui || {}; 16 | if ( $.ui.version ) { 17 | return; 18 | } 19 | 20 | $.extend( $.ui, { 21 | version: "1.8.16", 22 | 23 | keyCode: { 24 | ALT: 18, 25 | BACKSPACE: 8, 26 | CAPS_LOCK: 20, 27 | COMMA: 188, 28 | COMMAND: 91, 29 | COMMAND_LEFT: 91, // COMMAND 30 | COMMAND_RIGHT: 93, 31 | CONTROL: 17, 32 | DELETE: 46, 33 | DOWN: 40, 34 | END: 35, 35 | ENTER: 13, 36 | ESCAPE: 27, 37 | HOME: 36, 38 | INSERT: 45, 39 | LEFT: 37, 40 | MENU: 93, // COMMAND_RIGHT 41 | NUMPAD_ADD: 107, 42 | NUMPAD_DECIMAL: 110, 43 | NUMPAD_DIVIDE: 111, 44 | NUMPAD_ENTER: 108, 45 | NUMPAD_MULTIPLY: 106, 46 | NUMPAD_SUBTRACT: 109, 47 | PAGE_DOWN: 34, 48 | PAGE_UP: 33, 49 | PERIOD: 190, 50 | RIGHT: 39, 51 | SHIFT: 16, 52 | SPACE: 32, 53 | TAB: 9, 54 | UP: 38, 55 | WINDOWS: 91 // COMMAND 56 | } 57 | }); 58 | 59 | // plugins 60 | $.fn.extend({ 61 | propAttr: $.fn.prop || $.fn.attr, 62 | 63 | _focus: $.fn.focus, 64 | focus: function( delay, fn ) { 65 | return typeof delay === "number" ? 66 | this.each(function() { 67 | var elem = this; 68 | setTimeout(function() { 69 | $( elem ).focus(); 70 | if ( fn ) { 71 | fn.call( elem ); 72 | } 73 | }, delay ); 74 | }) : 75 | this._focus.apply( this, arguments ); 76 | }, 77 | 78 | scrollParent: function() { 79 | var scrollParent; 80 | if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { 81 | scrollParent = this.parents().filter(function() { 82 | return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 83 | }).eq(0); 84 | } else { 85 | scrollParent = this.parents().filter(function() { 86 | return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 87 | }).eq(0); 88 | } 89 | 90 | return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; 91 | }, 92 | 93 | zIndex: function( zIndex ) { 94 | if ( zIndex !== undefined ) { 95 | return this.css( "zIndex", zIndex ); 96 | } 97 | 98 | if ( this.length ) { 99 | var elem = $( this[ 0 ] ), position, value; 100 | while ( elem.length && elem[ 0 ] !== document ) { 101 | // Ignore z-index if position is set to a value where z-index is ignored by the browser 102 | // This makes behavior of this function consistent across browsers 103 | // WebKit always returns auto if the element is positioned 104 | position = elem.css( "position" ); 105 | if ( position === "absolute" || position === "relative" || position === "fixed" ) { 106 | // IE returns 0 when zIndex is not specified 107 | // other browsers return a string 108 | // we ignore the case of nested elements with an explicit value of 0 109 | //
110 | value = parseInt( elem.css( "zIndex" ), 10 ); 111 | if ( !isNaN( value ) && value !== 0 ) { 112 | return value; 113 | } 114 | } 115 | elem = elem.parent(); 116 | } 117 | } 118 | 119 | return 0; 120 | }, 121 | 122 | disableSelection: function() { 123 | return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + 124 | ".ui-disableSelection", function( event ) { 125 | event.preventDefault(); 126 | }); 127 | }, 128 | 129 | enableSelection: function() { 130 | return this.unbind( ".ui-disableSelection" ); 131 | } 132 | }); 133 | 134 | $.each( [ "Width", "Height" ], function( i, name ) { 135 | var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], 136 | type = name.toLowerCase(), 137 | orig = { 138 | innerWidth: $.fn.innerWidth, 139 | innerHeight: $.fn.innerHeight, 140 | outerWidth: $.fn.outerWidth, 141 | outerHeight: $.fn.outerHeight 142 | }; 143 | 144 | function reduce( elem, size, border, margin ) { 145 | $.each( side, function() { 146 | size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; 147 | if ( border ) { 148 | size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; 149 | } 150 | if ( margin ) { 151 | size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; 152 | } 153 | }); 154 | return size; 155 | } 156 | 157 | $.fn[ "inner" + name ] = function( size ) { 158 | if ( size === undefined ) { 159 | return orig[ "inner" + name ].call( this ); 160 | } 161 | 162 | return this.each(function() { 163 | $( this ).css( type, reduce( this, size ) + "px" ); 164 | }); 165 | }; 166 | 167 | $.fn[ "outer" + name] = function( size, margin ) { 168 | if ( typeof size !== "number" ) { 169 | return orig[ "outer" + name ].call( this, size ); 170 | } 171 | 172 | return this.each(function() { 173 | $( this).css( type, reduce( this, size, true, margin ) + "px" ); 174 | }); 175 | }; 176 | }); 177 | 178 | // selectors 179 | function focusable( element, isTabIndexNotNaN ) { 180 | var nodeName = element.nodeName.toLowerCase(); 181 | if ( "area" === nodeName ) { 182 | var map = element.parentNode, 183 | mapName = map.name, 184 | img; 185 | if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 186 | return false; 187 | } 188 | img = $( "img[usemap=#" + mapName + "]" )[0]; 189 | return !!img && visible( img ); 190 | } 191 | return ( /input|select|textarea|button|object/.test( nodeName ) 192 | ? !element.disabled 193 | : "a" == nodeName 194 | ? element.href || isTabIndexNotNaN 195 | : isTabIndexNotNaN) 196 | // the element and all of its ancestors must be visible 197 | && visible( element ); 198 | } 199 | 200 | function visible( element ) { 201 | return !$( element ).parents().andSelf().filter(function() { 202 | return $.curCSS( this, "visibility" ) === "hidden" || 203 | $.expr.filters.hidden( this ); 204 | }).length; 205 | } 206 | 207 | $.extend( $.expr[ ":" ], { 208 | data: function( elem, i, match ) { 209 | return !!$.data( elem, match[ 3 ] ); 210 | }, 211 | 212 | focusable: function( element ) { 213 | return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); 214 | }, 215 | 216 | tabbable: function( element ) { 217 | var tabIndex = $.attr( element, "tabindex" ), 218 | isTabIndexNaN = isNaN( tabIndex ); 219 | return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); 220 | } 221 | }); 222 | 223 | // support 224 | $(function() { 225 | var body = document.body, 226 | div = body.appendChild( div = document.createElement( "div" ) ); 227 | 228 | $.extend( div.style, { 229 | minHeight: "100px", 230 | height: "auto", 231 | padding: 0, 232 | borderWidth: 0 233 | }); 234 | 235 | $.support.minHeight = div.offsetHeight === 100; 236 | $.support.selectstart = "onselectstart" in div; 237 | 238 | // set display to none to avoid a layout bug in IE 239 | // http://dev.jquery.com/ticket/4014 240 | body.removeChild( div ).style.display = "none"; 241 | }); 242 | 243 | 244 | 245 | 246 | 247 | // deprecated 248 | $.extend( $.ui, { 249 | // $.ui.plugin is deprecated. Use the proxy pattern instead. 250 | plugin: { 251 | add: function( module, option, set ) { 252 | var proto = $.ui[ module ].prototype; 253 | for ( var i in set ) { 254 | proto.plugins[ i ] = proto.plugins[ i ] || []; 255 | proto.plugins[ i ].push( [ option, set[ i ] ] ); 256 | } 257 | }, 258 | call: function( instance, name, args ) { 259 | var set = instance.plugins[ name ]; 260 | if ( !set || !instance.element[ 0 ].parentNode ) { 261 | return; 262 | } 263 | 264 | for ( var i = 0; i < set.length; i++ ) { 265 | if ( instance.options[ set[ i ][ 0 ] ] ) { 266 | set[ i ][ 1 ].apply( instance.element, args ); 267 | } 268 | } 269 | } 270 | }, 271 | 272 | // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() 273 | contains: function( a, b ) { 274 | return document.compareDocumentPosition ? 275 | a.compareDocumentPosition( b ) & 16 : 276 | a !== b && a.contains( b ); 277 | }, 278 | 279 | // only used by resizable 280 | hasScroll: function( el, a ) { 281 | 282 | //If overflow is hidden, the element might have extra content, but the user wants to hide it 283 | if ( $( el ).css( "overflow" ) === "hidden") { 284 | return false; 285 | } 286 | 287 | var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", 288 | has = false; 289 | 290 | if ( el[ scroll ] > 0 ) { 291 | return true; 292 | } 293 | 294 | // TODO: determine which cases actually cause this to happen 295 | // if the element doesn't have the scroll set, see if it's possible to 296 | // set the scroll 297 | el[ scroll ] = 1; 298 | has = ( el[ scroll ] > 0 ); 299 | el[ scroll ] = 0; 300 | return has; 301 | }, 302 | 303 | // these are odd functions, fix the API or move into individual plugins 304 | isOverAxis: function( x, reference, size ) { 305 | //Determines when x coordinate is over "b" element axis 306 | return ( x > reference ) && ( x < ( reference + size ) ); 307 | }, 308 | isOver: function( y, x, top, left, height, width ) { 309 | //Determines when x, y coordinates is over "b" element 310 | return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); 311 | } 312 | }); 313 | 314 | })( jQuery ); 315 | -------------------------------------------------------------------------------- /examples/includes/jquery.ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI Datepicker 1.8.16 3 | * 4 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * http://jquery.org/license 7 | * 8 | * http://docs.jquery.com/UI/Datepicker#theming 9 | */ 10 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } 11 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 12 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 13 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 14 | .ui-datepicker .ui-datepicker-prev { left:2px; } 15 | .ui-datepicker .ui-datepicker-next { right:2px; } 16 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 17 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 18 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 19 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 20 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 21 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 22 | .ui-datepicker select.ui-datepicker-month, 23 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 24 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 25 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 26 | .ui-datepicker td { border: 0; padding: 1px; } 27 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 28 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 29 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 30 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 31 | 32 | /* with multiple calendars */ 33 | .ui-datepicker.ui-datepicker-multi { width:auto; } 34 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 35 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 36 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 37 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 38 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 39 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 40 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 41 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 42 | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } 43 | 44 | /* RTL support */ 45 | .ui-datepicker-rtl { direction: rtl; } 46 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 47 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 48 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 49 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 50 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 51 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 52 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 53 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 54 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 55 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 56 | 57 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 58 | .ui-datepicker-cover { 59 | display: none; /*sorry for IE5*/ 60 | display/**/: block; /*sorry for IE5*/ 61 | position: absolute; /*must have*/ 62 | z-index: -1; /*must have*/ 63 | filter: mask(); /*must have*/ 64 | top: -4px; /*must have*/ 65 | left: -4px; /*must have*/ 66 | width: 200px; /*must have*/ 67 | height: 200px; /*must have*/ 68 | } -------------------------------------------------------------------------------- /examples/includes/jquery.ui.theme.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | * jQuery UI CSS Framework 1.8.16 5 | * 6 | * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) 7 | * Dual licensed under the MIT or GPL Version 2 licenses. 8 | * http://jquery.org/license 9 | * 10 | * http://docs.jquery.com/UI/Theming/API 11 | * 12 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px 13 | */ 14 | 15 | 16 | /* Component containers 17 | ----------------------------------*/ 18 | .ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } 19 | .ui-widget .ui-widget { font-size: 1em; } 20 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } 21 | .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } 22 | .ui-widget-content a { color: #222222; } 23 | .ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } 24 | .ui-widget-header a { color: #ffffff; } 25 | 26 | /* Interaction states 27 | ----------------------------------*/ 28 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; } 29 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; } 30 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; } 31 | .ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; } 32 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; } 33 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; } 34 | .ui-widget :active { outline: none; } 35 | 36 | /* Interaction Cues 37 | ----------------------------------*/ 38 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; } 39 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } 40 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } 41 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } 42 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } 43 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } 44 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 45 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 46 | 47 | /* Icons 48 | ----------------------------------*/ 49 | 50 | /* states and images */ 51 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); } 52 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); } 53 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } 54 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); } 55 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); } 56 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); } 57 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } 58 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } 59 | 60 | /* positioning */ 61 | .ui-icon-carat-1-n { background-position: 0 0; } 62 | .ui-icon-carat-1-ne { background-position: -16px 0; } 63 | .ui-icon-carat-1-e { background-position: -32px 0; } 64 | .ui-icon-carat-1-se { background-position: -48px 0; } 65 | .ui-icon-carat-1-s { background-position: -64px 0; } 66 | .ui-icon-carat-1-sw { background-position: -80px 0; } 67 | .ui-icon-carat-1-w { background-position: -96px 0; } 68 | .ui-icon-carat-1-nw { background-position: -112px 0; } 69 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 70 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 71 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 72 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 73 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 74 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 75 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 76 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 77 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 78 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 79 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 80 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 81 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 82 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 83 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 84 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 85 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 86 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 87 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 88 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 89 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 90 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 91 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 92 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 93 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 94 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 95 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 96 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 97 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 98 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 99 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 100 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 101 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 102 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 103 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 104 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 105 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 106 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 107 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 108 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 109 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 110 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 111 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 112 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 113 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 114 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 115 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 116 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 117 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 118 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 119 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 120 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 121 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 122 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 123 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 124 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 125 | .ui-icon-arrow-4 { background-position: 0 -80px; } 126 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 127 | .ui-icon-extlink { background-position: -32px -80px; } 128 | .ui-icon-newwin { background-position: -48px -80px; } 129 | .ui-icon-refresh { background-position: -64px -80px; } 130 | .ui-icon-shuffle { background-position: -80px -80px; } 131 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 132 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 133 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 134 | .ui-icon-folder-open { background-position: -16px -96px; } 135 | .ui-icon-document { background-position: -32px -96px; } 136 | .ui-icon-document-b { background-position: -48px -96px; } 137 | .ui-icon-note { background-position: -64px -96px; } 138 | .ui-icon-mail-closed { background-position: -80px -96px; } 139 | .ui-icon-mail-open { background-position: -96px -96px; } 140 | .ui-icon-suitcase { background-position: -112px -96px; } 141 | .ui-icon-comment { background-position: -128px -96px; } 142 | .ui-icon-person { background-position: -144px -96px; } 143 | .ui-icon-print { background-position: -160px -96px; } 144 | .ui-icon-trash { background-position: -176px -96px; } 145 | .ui-icon-locked { background-position: -192px -96px; } 146 | .ui-icon-unlocked { background-position: -208px -96px; } 147 | .ui-icon-bookmark { background-position: -224px -96px; } 148 | .ui-icon-tag { background-position: -240px -96px; } 149 | .ui-icon-home { background-position: 0 -112px; } 150 | .ui-icon-flag { background-position: -16px -112px; } 151 | .ui-icon-calendar { background-position: -32px -112px; } 152 | .ui-icon-cart { background-position: -48px -112px; } 153 | .ui-icon-pencil { background-position: -64px -112px; } 154 | .ui-icon-clock { background-position: -80px -112px; } 155 | .ui-icon-disk { background-position: -96px -112px; } 156 | .ui-icon-calculator { background-position: -112px -112px; } 157 | .ui-icon-zoomin { background-position: -128px -112px; } 158 | .ui-icon-zoomout { background-position: -144px -112px; } 159 | .ui-icon-search { background-position: -160px -112px; } 160 | .ui-icon-wrench { background-position: -176px -112px; } 161 | .ui-icon-gear { background-position: -192px -112px; } 162 | .ui-icon-heart { background-position: -208px -112px; } 163 | .ui-icon-star { background-position: -224px -112px; } 164 | .ui-icon-link { background-position: -240px -112px; } 165 | .ui-icon-cancel { background-position: 0 -128px; } 166 | .ui-icon-plus { background-position: -16px -128px; } 167 | .ui-icon-plusthick { background-position: -32px -128px; } 168 | .ui-icon-minus { background-position: -48px -128px; } 169 | .ui-icon-minusthick { background-position: -64px -128px; } 170 | .ui-icon-close { background-position: -80px -128px; } 171 | .ui-icon-closethick { background-position: -96px -128px; } 172 | .ui-icon-key { background-position: -112px -128px; } 173 | .ui-icon-lightbulb { background-position: -128px -128px; } 174 | .ui-icon-scissors { background-position: -144px -128px; } 175 | .ui-icon-clipboard { background-position: -160px -128px; } 176 | .ui-icon-copy { background-position: -176px -128px; } 177 | .ui-icon-contact { background-position: -192px -128px; } 178 | .ui-icon-image { background-position: -208px -128px; } 179 | .ui-icon-video { background-position: -224px -128px; } 180 | .ui-icon-script { background-position: -240px -128px; } 181 | .ui-icon-alert { background-position: 0 -144px; } 182 | .ui-icon-info { background-position: -16px -144px; } 183 | .ui-icon-notice { background-position: -32px -144px; } 184 | .ui-icon-help { background-position: -48px -144px; } 185 | .ui-icon-check { background-position: -64px -144px; } 186 | .ui-icon-bullet { background-position: -80px -144px; } 187 | .ui-icon-radio-off { background-position: -96px -144px; } 188 | .ui-icon-radio-on { background-position: -112px -144px; } 189 | .ui-icon-pin-w { background-position: -128px -144px; } 190 | .ui-icon-pin-s { background-position: -144px -144px; } 191 | .ui-icon-play { background-position: 0 -160px; } 192 | .ui-icon-pause { background-position: -16px -160px; } 193 | .ui-icon-seek-next { background-position: -32px -160px; } 194 | .ui-icon-seek-prev { background-position: -48px -160px; } 195 | .ui-icon-seek-end { background-position: -64px -160px; } 196 | .ui-icon-seek-start { background-position: -80px -160px; } 197 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 198 | .ui-icon-seek-first { background-position: -80px -160px; } 199 | .ui-icon-stop { background-position: -96px -160px; } 200 | .ui-icon-eject { background-position: -112px -160px; } 201 | .ui-icon-volume-off { background-position: -128px -160px; } 202 | .ui-icon-volume-on { background-position: -144px -160px; } 203 | .ui-icon-power { background-position: 0 -176px; } 204 | .ui-icon-signal-diag { background-position: -16px -176px; } 205 | .ui-icon-signal { background-position: -32px -176px; } 206 | .ui-icon-battery-0 { background-position: -48px -176px; } 207 | .ui-icon-battery-1 { background-position: -64px -176px; } 208 | .ui-icon-battery-2 { background-position: -80px -176px; } 209 | .ui-icon-battery-3 { background-position: -96px -176px; } 210 | .ui-icon-circle-plus { background-position: 0 -192px; } 211 | .ui-icon-circle-minus { background-position: -16px -192px; } 212 | .ui-icon-circle-close { background-position: -32px -192px; } 213 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 214 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 215 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 216 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 217 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 218 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 219 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 220 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 221 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 222 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 223 | .ui-icon-circle-check { background-position: -208px -192px; } 224 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 225 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 226 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 227 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 228 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 229 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 230 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 231 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 232 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 233 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 234 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 235 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 236 | 237 | 238 | /* Misc visuals 239 | ----------------------------------*/ 240 | 241 | /* Corner radius */ 242 | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; } 243 | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; } 244 | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } 245 | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } 246 | 247 | /* Overlays */ 248 | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } 249 | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } -------------------------------------------------------------------------------- /examples/includes/readme.txt: -------------------------------------------------------------------------------- 1 | this whole folder (/examples/includes) is OPTIONAL to the class 2 | 3 | it is being included only in support of /examples/example3.php which uses a jquery calendar widget 4 | 5 | feel free to delete this directory if you don't want/need to use the calendar widget -------------------------------------------------------------------------------- /examples/install.php: -------------------------------------------------------------------------------- 1 | tblDemo CREATED\n"; 9 | 10 | qr("CREATE TABLE tblDemo2(pkID INT PRIMARY KEY AUTO_INCREMENT,fldField1 VARCHAR(45),fldField2 VARCHAR(45),fldCertainFields VARCHAR(40),fldLongField TEXT);"); 11 | $report_msg[] = "TABLE tblDemo2 CREATED\n"; 12 | 13 | qr("CREATE TABLE tblFriend (pkFriendID int(11) PRIMARY KEY AUTO_INCREMENT, fldName varchar(25),fldAddress varchar(30),fldCity varchar(20),fldState char(2),fldZip varchar(5),fldPhone varchar(15),fldEmail varchar(35),fldBestFriend char(1),fldDateMet date,fldFriendRating char(1),fldOwes double(6,2),fldPicture varchar(30), fkMarriedTo TINYINT);"); 14 | qr("CREATE TABLE tblLadies (pkLadyID int(11) PRIMARY KEY AUTO_INCREMENT, fldName varchar(25), fldSort INT)"); 15 | $report_msg[] = "TABLE tblFriend CREATED\n"; 16 | $report_msg[] = "TABLE tblLadies CREATED\n"; 17 | 18 | //populate tblDemo and tblDemo2 19 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Adam\", \"Smith\", \"CRUD\", \"First ajaxCRUD Test. A founding father.\")"); 20 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Justin\", \"Beiber\", \"CRUD\", \"Second ajaxCRUD Test. A man who should be deported. \")"); 21 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Sean\", \"Dempsey\", \"CRUD\", \"Third ajaxCRUD Test. A man without a cause.\")"); 22 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Justin\", \"Rigby\", \"Allowable Value1\", \"Fourth ajaxCRUD Test. A man with a plan. \")"); 23 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Glenn\", \"Beck\", \"Allowable Value2\", \"Fifth ajaxCRUD Test. Brilliant, crazy, eccentric, or just plain mad? \")"); 24 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Ron\", \"Paul\", \"Allowable Value2\", \"Sixth ajaxCRUD Test. Should have been president. \")"); 25 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Ayn\", \"Rand\", \"Allowable Value2\", \"Seventh ajaxCRUD Test.\")"); 26 | $success = qr("INSERT INTO tblDemo (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Conan\", \"O'Brien\", \"Dropdown Value\", \"Eighth ajaxCRUD Test. A great man of power and excellence. \")"); 27 | 28 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Jack\", \"Black\", \"Blue\", \"First ajaxCRUD Test. A comedian/actor. OR is it actor/comedian? \")"); 29 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Ryan Dempsey\", \"Twiddle\", \"Blue\", \"Third ajaxCRUD Test. A great band in rural VT. Check 'em out\")"); 30 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Jefferson\", \"Airplane\", \"Red\", \"Fourth ajaxCRUD Test. He is more airplane than man. \")"); 31 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Correct this\", \"Splling Mistake\", \"Green\", \"Fifth ajaxCRUD Test. See if you can spot the mistake! \")"); 32 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Chuck\", \"Mangione\", \"Periwinkle\", \"Sixth ajaxCRUD Test. A soulful trumpet, indeed. \")"); 33 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Chuck\", \"Woolery\", \"Periwinkle\", \"Seventh ajaxCRUD Test. Wollery is a large and powerful man.\")"); 34 | $success = qr("INSERT INTO tblDemo2 (fldField1, fldField2, fldCertainFields, fldLongField) VALUES (\"Emma\", \"Watson\", \"Blue\", \"Eighth ajaxCRUD Test. Too hot for words.\")"); 35 | 36 | //populate tblFriend 37 | $success = qr("INSERT INTO `tblFriend` (`pkFriendID`, `fldName`, `fldAddress`, `fldCity`, `fldState`, `fldZip`, `fldPhone`, `fldEmail`, `fldBestFriend`, `fldDateMet`, `fldFriendRating`, `fldOwes`, `fldPicture`, `fkMarriedTo`) VALUES(1, 'Sean Dempsey', '13 Back River Road', 'Dover', 'NH', '03820', '(603) 978-8841', 'sean@loudcanvas.com', 'N', '2011-10-27', '5', 122.01, '', 1),(2, 'Justin Rigby', '22 Farmington Rd', 'Rochester', 'VT', '05401', '(802) 661-4051', 'sean@seandempsey.com', '', '2011-10-19', '1', 22.00, '', 2),(3, 'Ryan Dempsey', '', '', 'VT', '', '', 'ryan@dempsey.com', '', '2011-10-20', '', 0.00, '',3);"); 38 | 39 | //populate tblLadies 40 | $success = qr("INSERT INTO tblLadies (fldName, fldSort) VALUES ('Jackie Benson', 1)"); 41 | $success = qr("INSERT INTO tblLadies (fldName, fldSort) VALUES ('Sharon Nelson', 2)"); 42 | $success = qr("INSERT INTO tblLadies (fldName, fldSort) VALUES ('Kirsten Dunst', 3)"); 43 | $success = qr("INSERT INTO tblLadies (fldName, fldSort) VALUES ('Emma Watson', 4)"); 44 | $success = qr("INSERT INTO tblLadies (fldName, fldSort) VALUES ('Shirley Temple', 5)"); 45 | 46 | if ($success){ 47 | $report_msg[] = "Example rows entered into demo tables.\n"; 48 | } 49 | 50 | echo_msg_box(); 51 | 52 | echo "

Try out a basic demo

\n"; 53 | echo "

Try out a demo with two ajaxCRUD tables.

\n"; 54 | echo "

Try out a demo with validation, masking, file upload, pk/fk relationship, and csv export enabled.

\n"; 55 | 56 | ?> -------------------------------------------------------------------------------- /examples/readme.txt: -------------------------------------------------------------------------------- 1 | FULL DOCUMENTATION HERE: 2 | http://www.ajaxcrud.com/api/ 3 | 4 | Any questions or issues? -- support forum and reference material featured on the website www.ajaxcrud.com 5 | 6 | 7 | USING THESE EXAMPLE SCRIPTS: 8 | 9 | 1) To install this class you must first manually CREATE a database. This is done (locally) by going 10 | into your mySQL terminal window and using the SQL "CREATE DATABASE [database_name]". 11 | 12 | If you are using an online host, you'll have to go into its control panel (eg C-panel) and create a database. 13 | 14 | 2) Make sure a database user has complete access to the database in question (SELECT, UPDATE, CREATE, DELETE) 15 | 16 | 3) Edit the file "preheader.php" and fill in your database information 17 | 18 | 4) Navigate to the file "/examples/install.php" 19 | 20 | 5) Navigate to the file "/examples/example.php" to test out the class!! 21 | 22 | 23 | 24 | 25 | 26 | ~Loud Canvas Media Staff 27 | www.loudcanvas.com 28 | 29 | 30 | NB: Make sure you include any "header" info (e.g. any HTML, echo statement,s etc) AFTER you 31 | include the ajaxCRUD class. -------------------------------------------------------------------------------- /examples/uploads/readme.txt: -------------------------------------------------------------------------------- 1 | If you use ajaxCRUD to upload files, this folder should have its permissions (chmod) set to 777 2 | so it is writable. Otherwise you will get errors like this: 3 | 4 | Warning: move_uploaded_file(uploads/9825_04-600x480.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/ajaxcrud/public_html/latest_release/ajaxCRUD.class.php on line 1142 5 | 6 | Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpqTBRRB' to 'uploads/9825_04-600x480.jpg' in /home/ajaxcrud/public_html/latest_release/ajaxCRUD.class.php on line 1142 -------------------------------------------------------------------------------- /examples/where_clause_test.php: -------------------------------------------------------------------------------- 1 | Current WHERE Clauses in SESSION

\n"; 8 | 9 | if (is_array($_SESSION['ajaxcrud_where_clause']) && isset($_SESSION['ajaxcrud_where_clause'])){ 10 | $countWhereClauses = count($_SESSION['ajaxcrud_where_clause']); 11 | echo "

Number of WHERE Clauses in session: $countWhereClauses

"; 12 | if ($countWhereClauses > 0){ 13 | foreach ($_SESSION['ajaxcrud_where_clause'] as $table => $whereClause){ 14 | echo "  Table: $table | WHERE Clause: $whereClause
"; 15 | } 16 | }//if any where clauses exist 17 | }//if any where clauses are 18 | else{ 19 | echo "

No WHERE clauses set by any ajaxCRUD table instances (yet); try going into an example and typing in a filter box; then come back and refresh this page.

\n"; 20 | } 21 | ?> 22 |


23 | 24 |

What the hell is the point of this?
This variable is really just used for advanced/special use cases; read doumentation here: http://ajaxcrud.com/api/index.php?id=ajaxcrud_where_clause

-------------------------------------------------------------------------------- /js/javascript_functions.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iceman101184/ajaxcrud/871c45a8932ccfcb2716e06709355ea7b3013433/js/javascript_functions.js -------------------------------------------------------------------------------- /js/jquery.maskedinput.js: -------------------------------------------------------------------------------- 1 | /* 2 | Masked Input plugin for jQuery 3 | Copyright (c) 2007-2013 Josh Bush (digitalbush.com) 4 | Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 5 | Version: 1.3.1 6 | */ 7 | (function($) { 8 | function getPasteEvent() { 9 | var el = document.createElement('input'), 10 | name = 'onpaste'; 11 | el.setAttribute(name, ''); 12 | return (typeof el[name] === 'function')?'paste':'input'; 13 | } 14 | 15 | var pasteEventName = getPasteEvent() + ".mask", 16 | ua = navigator.userAgent, 17 | iPhone = /iphone/i.test(ua), 18 | android=/android/i.test(ua), 19 | caretTimeoutId; 20 | 21 | $.mask = { 22 | //Predefined character definitions 23 | definitions: { 24 | '9': "[0-9]", 25 | 'a': "[A-Za-z]", 26 | '*': "[A-Za-z0-9]" 27 | }, 28 | dataName: "rawMaskFn", 29 | placeholder: '_', 30 | }; 31 | 32 | $.fn.extend({ 33 | //Helper Function for Caret positioning 34 | caret: function(begin, end) { 35 | var range; 36 | 37 | if (this.length === 0 || this.is(":hidden")) { 38 | return; 39 | } 40 | 41 | if (typeof begin == 'number') { 42 | end = (typeof end === 'number') ? end : begin; 43 | return this.each(function() { 44 | if (this.setSelectionRange) { 45 | this.setSelectionRange(begin, end); 46 | } else if (this.createTextRange) { 47 | range = this.createTextRange(); 48 | range.collapse(true); 49 | range.moveEnd('character', end); 50 | range.moveStart('character', begin); 51 | range.select(); 52 | } 53 | }); 54 | } else { 55 | if (this[0].setSelectionRange) { 56 | begin = this[0].selectionStart; 57 | end = this[0].selectionEnd; 58 | } else if (document.selection && document.selection.createRange) { 59 | range = document.selection.createRange(); 60 | begin = 0 - range.duplicate().moveStart('character', -100000); 61 | end = begin + range.text.length; 62 | } 63 | return { begin: begin, end: end }; 64 | } 65 | }, 66 | unmask: function() { 67 | return this.trigger("unmask"); 68 | }, 69 | mask: function(mask, settings) { 70 | var input, 71 | defs, 72 | tests, 73 | partialPosition, 74 | firstNonMaskPos, 75 | len; 76 | 77 | if (!mask && this.length > 0) { 78 | input = $(this[0]); 79 | return input.data($.mask.dataName)(); 80 | } 81 | settings = $.extend({ 82 | placeholder: $.mask.placeholder, // Load default placeholder 83 | completed: null 84 | }, settings); 85 | 86 | 87 | defs = $.mask.definitions; 88 | tests = []; 89 | partialPosition = len = mask.length; 90 | firstNonMaskPos = null; 91 | 92 | $.each(mask.split(""), function(i, c) { 93 | if (c == '?') { 94 | len--; 95 | partialPosition = i; 96 | } else if (defs[c]) { 97 | tests.push(new RegExp(defs[c])); 98 | if (firstNonMaskPos === null) { 99 | firstNonMaskPos = tests.length - 1; 100 | } 101 | } else { 102 | tests.push(null); 103 | } 104 | }); 105 | 106 | return this.trigger("unmask").each(function() { 107 | var input = $(this), 108 | buffer = $.map( 109 | mask.split(""), 110 | function(c, i) { 111 | if (c != '?') { 112 | return defs[c] ? settings.placeholder : c; 113 | } 114 | }), 115 | focusText = input.val(); 116 | 117 | function seekNext(pos) { 118 | while (++pos < len && !tests[pos]); 119 | return pos; 120 | } 121 | 122 | function seekPrev(pos) { 123 | while (--pos >= 0 && !tests[pos]); 124 | return pos; 125 | } 126 | 127 | function shiftL(begin,end) { 128 | var i, 129 | j; 130 | 131 | if (begin<0) { 132 | return; 133 | } 134 | 135 | for (i = begin, j = seekNext(end); i < len; i++) { 136 | if (tests[i]) { 137 | if (j < len && tests[i].test(buffer[j])) { 138 | buffer[i] = buffer[j]; 139 | buffer[j] = settings.placeholder; 140 | } else { 141 | break; 142 | } 143 | 144 | j = seekNext(j); 145 | } 146 | } 147 | writeBuffer(); 148 | input.caret(Math.max(firstNonMaskPos, begin)); 149 | } 150 | 151 | function shiftR(pos) { 152 | var i, 153 | c, 154 | j, 155 | t; 156 | 157 | for (i = pos, c = settings.placeholder; i < len; i++) { 158 | if (tests[i]) { 159 | j = seekNext(i); 160 | t = buffer[i]; 161 | buffer[i] = c; 162 | if (j < len && tests[j].test(t)) { 163 | c = t; 164 | } else { 165 | break; 166 | } 167 | } 168 | } 169 | } 170 | 171 | function keydownEvent(e) { 172 | var k = e.which, 173 | pos, 174 | begin, 175 | end; 176 | 177 | //backspace, delete, and escape get special treatment 178 | if (k === 8 || k === 46 || (iPhone && k === 127)) { 179 | pos = input.caret(); 180 | begin = pos.begin; 181 | end = pos.end; 182 | 183 | if (end - begin === 0) { 184 | begin=k!==46?seekPrev(begin):(end=seekNext(begin-1)); 185 | end=k===46?seekNext(end):end; 186 | } 187 | clearBuffer(begin, end); 188 | shiftL(begin, end - 1); 189 | 190 | e.preventDefault(); 191 | } else if (k == 27) {//escape 192 | input.val(focusText); 193 | input.caret(0, checkVal()); 194 | e.preventDefault(); 195 | } 196 | } 197 | 198 | function keypressEvent(e) { 199 | var k = e.which, 200 | pos = input.caret(), 201 | p, 202 | c, 203 | next; 204 | 205 | if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore 206 | return; 207 | } else if (k) { 208 | if (pos.end - pos.begin !== 0){ 209 | clearBuffer(pos.begin, pos.end); 210 | shiftL(pos.begin, pos.end-1); 211 | } 212 | 213 | p = seekNext(pos.begin - 1); 214 | if (p < len) { 215 | c = String.fromCharCode(k); 216 | if (tests[p].test(c)) { 217 | shiftR(p); 218 | 219 | buffer[p] = c; 220 | writeBuffer(); 221 | next = seekNext(p); 222 | 223 | if(android){ 224 | setTimeout($.proxy($.fn.caret,input,next),0); 225 | }else{ 226 | input.caret(next); 227 | } 228 | 229 | if (settings.completed && next >= len) { 230 | settings.completed.call(input); 231 | } 232 | } 233 | } 234 | e.preventDefault(); 235 | } 236 | } 237 | 238 | function clearBuffer(start, end) { 239 | var i; 240 | for (i = start; i < end && i < len; i++) { 241 | if (tests[i]) { 242 | buffer[i] = settings.placeholder; 243 | } 244 | } 245 | } 246 | 247 | function writeBuffer() { input.val(buffer.join('')); } 248 | 249 | function checkVal(allow) { 250 | //try to place characters where they belong 251 | var test = input.val(), 252 | lastMatch = -1, 253 | i, 254 | c; 255 | 256 | for (i = 0, pos = 0; i < len; i++) { 257 | if (tests[i]) { 258 | buffer[i] = settings.placeholder; 259 | while (pos++ < test.length) { 260 | c = test.charAt(pos - 1); 261 | if (tests[i].test(c)) { 262 | buffer[i] = c; 263 | lastMatch = i; 264 | break; 265 | } 266 | } 267 | if (pos > test.length) { 268 | break; 269 | } 270 | } else if (buffer[i] === test.charAt(pos) && i !== partialPosition) { 271 | pos++; 272 | lastMatch = i; 273 | } 274 | } 275 | if (allow) { 276 | writeBuffer(); 277 | } else if (lastMatch + 1 < partialPosition) { 278 | input.val(""); 279 | clearBuffer(0, len); 280 | } else { 281 | writeBuffer(); 282 | input.val(input.val().substring(0, lastMatch + 1)); 283 | } 284 | return (partialPosition ? i : firstNonMaskPos); 285 | } 286 | 287 | input.data($.mask.dataName,function(){ 288 | return $.map(buffer, function(c, i) { 289 | return tests[i]&&c!=settings.placeholder ? c : null; 290 | }).join(''); 291 | }); 292 | 293 | if (!input.attr("readonly")) 294 | input 295 | .one("unmask", function() { 296 | input 297 | .unbind(".mask") 298 | .removeData($.mask.dataName); 299 | }) 300 | .bind("focus.mask", function() { 301 | clearTimeout(caretTimeoutId); 302 | var pos, 303 | moveCaret; 304 | 305 | focusText = input.val(); 306 | pos = checkVal(); 307 | 308 | caretTimeoutId = setTimeout(function(){ 309 | writeBuffer(); 310 | if (pos == mask.length) { 311 | input.caret(0, pos); 312 | } else { 313 | input.caret(pos); 314 | } 315 | }, 10); 316 | }) 317 | .bind("blur.mask", function() { 318 | checkVal(); 319 | if (input.val() != focusText) 320 | input.change(); 321 | }) 322 | .bind("keydown.mask", keydownEvent) 323 | .bind("keypress.mask", keypressEvent) 324 | .bind(pasteEventName, function() { 325 | setTimeout(function() { 326 | var pos=checkVal(true); 327 | input.caret(pos); 328 | if (settings.completed && pos == input.val().length) 329 | settings.completed.call(input); 330 | }, 0); 331 | }); 332 | checkVal(); //Perform initial check for existing values 333 | }); 334 | } 335 | }); 336 | 337 | 338 | })(jQuery); -------------------------------------------------------------------------------- /js/jquery.validate.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery validation plug-in 1.7 3 | * 4 | * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ 5 | * http://docs.jquery.com/Plugins/Validation 6 | * 7 | * Copyright (c) 2006 - 2008 Jörn Zaefferer 8 | * 9 | * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $ 10 | * 11 | * Dual licensed under the MIT and GPL licenses: 12 | * http://www.opensource.org/licenses/mit-license.php 13 | * http://www.gnu.org/licenses/gpl.html 14 | */ 15 | (function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&¶ms.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id 16 | +", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;iWarning: No message defined for "+element.name+"");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages;}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery); -------------------------------------------------------------------------------- /js/validation.js: -------------------------------------------------------------------------------- 1 | 2 | /* ajaxCRUD validation javascript (optional) */ 3 | 4 | $(document).ready(function(){ 5 | doValidation(); 6 | }); 7 | 8 | function doValidation(){ 9 | 10 | // mask some fields with desired input mask 11 | // use "modifyFieldWithClass" to set a css class on the fields you need to mask (e.g. phone, zip) 12 | $("input.phone").mask("(999) 999-9999"); 13 | $("input.zip").mask("99999"); 14 | 15 | //add any other validation entries here 16 | $("input.pincode").mask("999999"); // Indian Pincode 17 | 18 | //put a date picker on a field (comment this out if you do not use calendars) 19 | try{ 20 | $( ".datepicker" ).datepicker({ 21 | dateFormat: 'yy-mm-dd', 22 | showOn: "button", 23 | buttonImage: "calendar.gif", 24 | buttonImageOnly: true, 25 | onClose: function(){ 26 | this.focus(); 27 | //$(this).submit(); 28 | } 29 | }); 30 | } 31 | catch(err){ 32 | //no fields have a datepicker on them 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /preheader.php: -------------------------------------------------------------------------------- 1 | set_charset("utf8"); 41 | } 42 | else{ 43 | /* 44 | use this connection if your hosting config does NOT support mysqli 45 | this code was for mySQL connections; was replaced in v8.6 with mysqli 46 | */ 47 | 48 | $db = @mysql_connect($MYSQL_HOST,$MYSQL_LOGIN,$MYSQL_PASS); 49 | 50 | if(!$db){ 51 | echo('Unable to authenticate user.
Error: ' . mysql_error() . ""); 52 | exit; 53 | } 54 | $connect = @mysql_select_db($MYSQL_DB); 55 | if (!$connect){ 56 | echo('Unable to connect to db
Error: ' . mysql_error() . ""); 57 | exit; 58 | } 59 | mysql_query("SET NAMES 'utf8'"); 60 | //mysql_query("SET character_set_results = 'utf8_general_ci', character_set_client = 'utf8_general_ci', character_set_connection = 'utf8_general_ci', character_set_database = 'utf8_general_ci', character_set_server = 'utf8_general_ci'", $db); 61 | } 62 | 63 | 64 | # what follows are custom database handling functions - required for the ajaxCRUD class 65 | # ...but these also may be helpful in your application(s) :-) 66 | if (!function_exists('q')) { 67 | function q($q, $debug = 0){ 68 | global $mysqliConn, $useMySQLi; 69 | 70 | if ($useMySQLi){ 71 | if (!($r = $mysqliConn->query($q))) { 72 | $errorMsg = "Mysql Error in preheader.php q(). The query was: " . $q . " and the possible mysqli error follows:" . $mysqliConn->error; 73 | //logError($errorMsg); 74 | exit("

$errorMsg

"); 75 | } 76 | } 77 | else{ 78 | //mysql connection; was replaced in v8.6 with mysqli 79 | $r = mysql_query($q); 80 | if(mysql_error()){ 81 | echo mysql_error(); 82 | echo "$q
"; 83 | } 84 | } 85 | 86 | if($debug == 1){ 87 | echo "
$q
"; 88 | } 89 | 90 | if(stristr(substr($q,0,8),"delete") || stristr(substr($q,0,8),"insert") || stristr(substr($q,0,8),"update")){ 91 | if ($useMySQLi){ 92 | $affectedRows = $mysqliConn->affected_rows; 93 | } 94 | else{ 95 | $affectedRows = mysql_affected_rows(); 96 | } 97 | if ($affectedRows > 0){ 98 | return true; 99 | } 100 | return false; 101 | } 102 | 103 | 104 | if ($useMySQLi){ 105 | $numRows = $r->num_rows; 106 | } 107 | else{ 108 | $numRows = mysql_num_rows($r); 109 | } 110 | if ($numRows > 1){ 111 | if ($useMySQLi){ 112 | while ($row = $r->fetch_array()){ 113 | $results[] = $row; 114 | } 115 | } 116 | else{ 117 | while($row = mysql_fetch_array($r)){ 118 | $results[] = $row; 119 | } 120 | } 121 | } 122 | else if ($numRows == 1){ 123 | $results = array(); 124 | if ($useMySQLi){ 125 | $results[] = $r->fetch_array(); 126 | } 127 | else{ 128 | $results[] = mysql_fetch_array($r); 129 | } 130 | } 131 | else{ 132 | $results = array(); 133 | } 134 | 135 | return $results; 136 | } 137 | } 138 | 139 | if (!function_exists('q1')) { 140 | function q1($q, $debug = 0){ 141 | global $mysqliConn, $useMySQLi; 142 | 143 | if ($useMySQLi){ 144 | if (!($r = $mysqliConn->query($q))) { 145 | $errorMsg = "Mysql Error in preheader.php q1(). The query was: " . $q . " and the possible mysqli error follows:" . $mysqliConn->error; 146 | //logError($errorMsg); 147 | exit($errorMsg); 148 | } 149 | } 150 | else{ 151 | $r = mysql_query($q); 152 | if(mysql_error()){ 153 | echo mysql_error(); 154 | echo "
$q
"; 155 | } 156 | } 157 | 158 | if($debug == 1){ 159 | echo "
$q
"; 160 | } 161 | 162 | if ($useMySQLi && isset($r)){ 163 | $row = $r->fetch_array(); 164 | } 165 | else{ 166 | $row = @mysql_fetch_array($r); 167 | } 168 | 169 | if(count($row) == 2){ 170 | return $row[0]; 171 | } 172 | 173 | return $row; 174 | } 175 | } 176 | 177 | if (!function_exists('qr')) { 178 | function qr($q, $debug = 0){ 179 | global $mysqliConn, $useMySQLi; 180 | 181 | if ($useMySQLi){ 182 | if (!($r = $mysqliConn->query($q))) { 183 | $errorMsg = "Mysql Error in preheader.php qr(). The query was: " . $q . " and the possible mysqli error follows:" . $mysqliConn->error; 184 | exit("

$errorMsg

"); 185 | } 186 | } 187 | else{ 188 | $r = mysql_query($q); 189 | if(mysql_error()){ 190 | echo mysql_error(); 191 | echo "
$q
"; 192 | } 193 | } 194 | 195 | if($debug == 1){ 196 | echo "
$q
"; 197 | } 198 | 199 | if(stristr(substr($q,0,8),"delete") || stristr(substr($q,0,8),"insert") || stristr(substr($q,0,8),"update")){ 200 | if ($useMySQLi){ 201 | $numberOfAffectedRows = $mysqliConn->affected_rows; 202 | } 203 | else{ 204 | $numberOfAffectedRows = mysql_affected_rows(); 205 | } 206 | 207 | if ($numberOfAffectedRows > 0) { 208 | return true; 209 | } 210 | return false; 211 | } 212 | 213 | if(stristr(substr($q,0,8),"create") || stristr(substr($q,0,8),"drop")){ 214 | //added for executing create table statements; e.g. the example install script /examples/install.php 215 | return true; 216 | } 217 | 218 | $results = array(); 219 | 220 | if ($useMySQLi){ 221 | $results[] = $r->fetch_array(); 222 | } 223 | else{ 224 | $results[] = mysql_fetch_array($r); 225 | } 226 | 227 | $results = $results[0]; 228 | 229 | return $results; 230 | } 231 | } 232 | ?> --------------------------------------------------------------------------------