
![]() |
Здравствуйте Гость ( Вход | Регистрация ) |
|
|
|
![]() ![]() ![]() |
[x]
Дата
|
|
![]() Unregistered ![]() |
Добрый день.
Мне необходимо было сделать информационное табло, которое берёт информацию из access и демонстрирует таблицы поочерёдно. Вроде всё получилось: index.php **************************************************************************************************** ********************** <html> <head> <title>Информационная система</title> <meta http-equiv="refresh" content="3600; url=index.php" /> <meta http-equiv="content-type" content="text/html; charset=windows-1251" /> <meta http-equiv="Pragma" content="no-cache" /> <!-- Stylesheets --> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/presentationCycle.css" /> <!-- Scripts --> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script> <script type='text/javascript' src='js/jquery.cycle.all.min.js'></script> <script type='text/javascript' src='js/presentationCycle.js'></script> </head> <body> <div class="container"> <h1><p align="center">Сводная информация ремонтов РММ</p></h1> <div id="presentation_container" class="pc_container"> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №1 - техника на ремонт</p></h1> <html> <body> <?php include ("1.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc" style="left: 0px;"> <h1><p align="center">Автоколонна №1 - запчасти</p></h1> <html> <body> <?php include ("1-1.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc" style="left: 165px;"> <h1><p align="center">Автоколонна №2 - техника на ремонте</p></h1> <html> <body> <?php include ("2.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №2 - запчасти</p></h1> <html> <body> <?php include ("2-2.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №3 - техника на ремонте</p></h1> <html> <body> <?php include ("3.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №3 - запчасти</p></h1> <html> <body> <?php include ("3-3.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №4 - техника на ремонте</p></h1> <html> <body> <?php include ("4.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №4 - запчасти</p></h1> <html> <body> <?php include ("4-4.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №5 - техника на ремонте</p></h1> <html> <body> <?php include ("5.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №5 - запчасти</p></h1> <html> <body> <?php include ("5-5.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №6 - техника на ремонте</p></h1> <html> <body> <?php include ("6.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №6 - запчасти</p></h1> <html> <body> <?php include ("6-6.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №7 - техника на ремонте</p></h1> <html> <body> <?php include ("7.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №7 - запчасти</p></h1> <html> <body> <?php include ("7-7.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №8 - техника на ремонте</p></h1> <html> <body> <?php include ("8.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №8 - запчасти</p></h1> <html> <body> <?php include ("8-8.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №9 - техника на ремонте</p></h1> <html> <body> <?php include ("9.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №9 - запчасти</p></h1> <html> <body> <?php include ("9-9.php"); ?> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №10 - техника на ремонте</p></h1> <html> <body> </body> </html> </div> </div> <div class="pc_item"> <div class="desc"> <h1><p align="center">Автоколонна №10 - запчасти</p></h1> <html> <body> </body> </html> </div> </div> </div> <script type="text/javascript"> presentationCycle.init(); </script> </div> </body> </html> **************************************************************************************************** ********************** **************************************************************************************************** ********************** Подключаемый файл: 1.php <html> <head> <?php include ("adodb.inc.php"); $db = ADONewConnection('access'); $connstr = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\cars.mdb;Uid=Admin;Pwd=;"; $db->Connect($connstr) or die("Невозможно подключиться к БД MS Access"); ?> </head> <body> <table border="7" width="100%" cellpadding="1"> <tr> <th>Марка автомобиля</th> <th>Гос№</th> <th>Дата постановки</th> <th>Дата выхода</th> <th>Неисправность</th> <th>Слесарь</th> </tr> <tr> <td <td width="300" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { echo $recordSet->fields[0]. "<br><hr>"; $recordSet->MoveNext(); }; ?> </td> <td <td width="100" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { echo $recordSet->fields[1]. "<br><hr>"; $recordSet->MoveNext(); }; ?> </td> <td <td width="70" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { print $recordSet->UserDate($recordSet->fields[2],'d.m.Y')."<br><hr>"; #print $recordSet->fields[2]."<br><hr>"; $recordSet->MoveNext(); }; ?> </td> <td <td width="70" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { print $recordSet->UserDate($recordSet->fields[3],'d.m.Y')."<br><hr>"; #print $recordSet->fields[3]."<br><hr>"; $recordSet->MoveNext(); }; ?> </td> <td <td width="700" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { echo $recordSet->fields[4]. "<br><hr>"; $recordSet->MoveNext(); }; ?> </td> <td <td width="300" nowrap> <?php $recordSet = $db->Execute('select * from З_Ф1_АК1'); while (!$recordSet->EOF) { echo $recordSet->fields[5]. "<br><hr>"; $recordSet->MoveNext(); }; ?> </td> </tr> </table> </body> </html> **************************************************************************************************** ********************** В таком режиме всё прекрасно работает, но смущает форматирование ячеек. Некоторые строки очень длинные (так забивают в базу юзеры) и мне нужно их либо обрезать или переносить с соблюдением пропорций к остальным ячейкам. В этом варианте у меня всё пляшет. Второй вид подключаемого файла: 1.php **************************************************************************************************** ********************** <?php include ("adodb/adodb.inc.php"); $db = ADONewConnection('access'); $connstr = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\cars.mdb;Uid=Admin;Pwd=;"; $db->Connect($connstr) or die("Невозможно подключиться к БД MS Access"); $recordSet = $db->Execute('select * from З_Ф1_АК1'); echo "<TABLE width=\"755\" border=\"1\" bordercolor=\"#000000\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\"> <tr bgcolor=\"#0089CA\" align=\"center\" class=\"pr\"> <td width=\"300\"><font color=\"#FFFFFF\" size=\"+1\">Марка</font></td> <td width=\"100\"><font color=\"#FFFFFF\" size=\"+1\">Гос №</font></td> <td width=\"300\"><font color=\"#FFFFFF\" size=\"+1\">Неисправность</font></td> <td width=\"100\"><font color=\"#FFFFFF\" size=\"+1\">Дата постановки</font></td> <td width=\"100\"><font color=\"#FFFFFF\" size=\"+1\">Дата выхода</font></td> <td width=\"100\"><font color=\"#FFFFFF\" size=\"+1\">Слесарь</font></td> </tr>"; while (!$recordSet->EOF) { echo "<tr><td align=\"center\">".$recordSet->fields[0]."</td><td> ".$recordSet->fields[1]."</td><td align=\"center\">".$recordSet->fields[4]."</td><td align=\"center\">".$recordSet->UserDate($recordSet->fields[2],'d.m.Y')."</td><td align=\"center\">".$recordSet->UserDate($recordSet->fields[3],'d.m.Y')."</td><td align=\"center\">".$recordSet->fields[5]."</td></tr>"; $recordSet->MoveNext(); }; ?> **************************************************************************************************** ********************** Информация выходит со всеми соблюдениями пропорций, но при подключении 1.php к index.php все таблицы подключенные через include или прописаны пути выгрузки напрямую, таблицы выстраиваются в колонку. Прошу прощения за мой французский, занимаюсь подобным четыре дня. Извиняюсь,не выложил скрипты: Один jQery Второй: **************************************************************************************************** ********************** var presentationCycle = { /* * Presentation Cycle - a jQuery Cycle extension * Author: Gaya Kessler * URL: http://www.gayadesign.com * Date: 03-11-09 */ //slide options slideTimeout: 8000, containerId: "presentation_container", //cycle options cycleFx: 'scrollHorz', cycleSpeed: 600, //variables this script need itemCount: 0, currentItem: 0, itemBarWidth: 0, barContainer: "", barContainerActive: "", barContainerOverflow: "", disableAnimation: false, init: function() { presentationCycle.itemCount = $('#' + presentationCycle.containerId).children().length; presentationCycle.barContainer = $("<div></div>"); var subtrackSpace = (presentationCycle.itemCount * presentationCycle.barHeight); var totalWidth = $('#' + presentationCycle.containerId).innerWidth() - presentationCycle.barDisplacement; var fillWidth = Math.floor((totalWidth - subtrackSpace) / (presentationCycle.itemCount - 1)); presentationCycle.itemBarWidth = fillWidth; for (var i = 0; i < presentationCycle.itemCount; i++) { var item = $("<div> </div>").appendTo(presentationCycle.barContainer); var extra_bar = true; if (i == 0) { $(item).addClass("left"); $(item).css({ backgroundImage: "url(" + presentationCycle.barImgLeft + ")", height: presentationCycle.barHeight + "px", width: presentationCycle.barHeight + "px" }); } else if (i == (presentationCycle.itemCount - 1)) { $(item).css({ backgroundImage: "url(" + presentationCycle.barImgRight + ")", height: presentationCycle.barHeight + "px", width: presentationCycle.barHeight + "px" }); extra_bar = false; } else { $(item).addClass("center"); $(item).css({ backgroundImage: "url(" + presentationCycle.barImgCenter + ")", height: presentationCycle.barHeight + "px", width: presentationCycle.barHeight + "px" }); } $(item).attr('itemNr', (i + 1)); $(item).css('cursor', 'pointer'); $(item).click(function() { presentationCycle.gotoSlide($(this).attr('itemNr')); }); if (extra_bar == true) { var item = $("<div> </div>").appendTo(presentationCycle.barContainer); $(item).addClass("bar"); $(item).css({ backgroundImage: "url(" + presentationCycle.barImgBarEmpty + ")", height: presentationCycle.barHeight + "px", width: fillWidth + "px" }); } } var overflow = $("<div></div>"); $(overflow).addClass("pc_bar_container_overflow"); $(overflow).css({ overflow: "hidden", width: totalWidth + "px" }); var underflow = $("<div></div>"); $(underflow).addClass("pc_bar_container_underflow").appendTo(overflow); presentationCycle.barContainerActive = $(presentationCycle.barContainer).clone().appendTo(underflow); $(presentationCycle.barContainerActive).removeClass("pc_bar_container"); $(presentationCycle.barContainerActive).children().each(function () { $(this).css({ backgroundPosition: "right" }); if ($(this).css("background-image").match(presentationCycle.barImgBarEmpty)) { var newImg = $(this).css("background-image").replace(presentationCycle.barImgBarEmpty, presentationCycle.barImgBarFull); $(this).css("background-image", newImg); } }); $(overflow).css({ width: presentationCycle.barHeight + "px", height: presentationCycle.barHeight + "px" }); presentationCycle.barContainerOverflow = overflow; $('#' + presentationCycle.containerId).cycle({ fx: presentationCycle.cycleFx, speed: presentationCycle.cycleSpeed, timeout: presentationCycle.slideTimeout, before: function(currSlideElement, nextSlideElement) { presentationCycle.beforeSlide(currSlideElement, nextSlideElement); } }); presentationCycle.barContainer.appendTo($('#' + presentationCycle.containerId)); overflow.appendTo($('#' + presentationCycle.containerId)); var i = 0; $(".pc_bar_container_overflow .left, .pc_bar_container_overflow .center, .pc_bar_container_overflow .right").each(function () { $(this).attr('itemNr', (i + 1)); $(this).css('cursor', 'pointer'); $(this).click(function() { presentationCycle.gotoSlide($(this).attr('itemNr')); }); i++; }); }, beforeSlide: function(currSlideElement, nextSlideElement) { if (presentationCycle.currentItem == 0) { presentationCycle.currentItem = 1; } else { presentationCycle.currentItem = (presentationCycle.itemCount - ($(nextSlideElement).nextAll().length)) + 2; } presentationCycle.animateProcess(); }, animateProcess: function() { var startWidth = (presentationCycle.itemBarWidth * (presentationCycle.currentItem - 1)) + (presentationCycle.barHeight * presentationCycle.currentItem); if (presentationCycle.currentItem != presentationCycle.itemCount) { var newWidth = (presentationCycle.itemBarWidth * (presentationCycle.currentItem)) + (presentationCycle.barHeight * (presentationCycle.currentItem + 1)); } else { var newWidth = presentationCycle.barHeight; } $(presentationCycle.barContainerOverflow).css({ width: startWidth + "px" }); if (presentationCycle.disableAnimation == false) { $(presentationCycle.barContainerOverflow).stop().animate({ width: newWidth + "px" }, (presentationCycle.slideTimeout - 100)); } }, gotoSlide: function(itemNr) { $(presentationCycle.barContainerOverflow).stop(); presentationCycle.disableAnimation = true; $('#' + presentationCycle.containerId).cycle((itemNr - 1)); $('#' + presentationCycle.containerId).cycle('pause'); } } **************************************************************************************************** ********************* voha2006 Сообщения: 1 Зарегистрирован: Ср июн 12, 2013 12:29 |
|
![]() |
|
![]() ![]() Сидел он, дум великих полон - и вдаль глядел ![]() ![]() ![]() ![]() ![]() ![]() Профиль Группа: Эксперт ![]() Сообщений: 15860 Пользователь №: 4190 На форуме: Карма: 490 ![]() |
voha2006, при вводе и редактировании текста сообщений на форуме есть "волшебные" кнопки, которые помогают расставить правильные тэги. Которые позволяют раскрасить код, чтобы он был удобочитаемым. А такие "портянки", без подсветки, не интересно читать
![]() -------------------- * Хэлп по PHP
* Описалово по JavaScript * Хэлп и СУБД для PostgreSQL * Обучаю PHP, JS, вёрстке. Интерактивно и качественно. За разумные деньги. * "накапливаю умение телепатии" (С) и "гуглю за ваш счет" (С) ![]() |
![]() |
![]() ![]() ![]() |