Jump to content

nerd99

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by nerd99

  1. Hi, I'm creating a site that has a fixed navigation menu using scrollTo and localscroll to move vertically through the site's content. I am trying to use Isotope to include some filterable content on a couple of the pages/panels but cannot integrate the two successfully. Does anybody have a suggestion on how to go about this? Here's the markup...I'm trying to make isotope work within the 'get music' (panel 3) and 'commissioned work' (panel 4) pages. index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <!--Framework CSS--> <link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <link rel="stylesheet" href="css/gallery.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <link rel="stylesheet" href="css/tooltip.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <link rel="stylesheet" href="css/isotope.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <!--[if IE]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection"><![endif]--> <!-- Javascript --> </head> <body> <div id="mainwrapper"> <!------------------------------------------------------ main page ------------------------------------------------------> <div id="mask"> <div id="panel"> <div id="panel-1"> <div id="wrapper"> <div id="contentcolumn"> <div class="vector-flame"> <div class="product-logo1"> </div> <div class="product-logo2"> </div> </div><!--END contentcolumn --> </div><!--END wrapper --> </div><!--END panel-1 --> <div id="leftcolumn"> <div class="logo-navigation"> <a href="#panel-1" rel="panel"><h1>Logo</h1></a> <ul id="nav"> <li class="sliding-element"><a href="#panel-2" rel="panel">about</a></li> <li class="sliding-element"><a href="#panel-3" rel="panel">get music</a></li> <li class="sliding-element"><a href="#panel-4" rel="panel">commissioned work</a></li> <li class="sliding-element"><a href="#panel-5" rel="panel">get in touch</a></li> </ul> </div> <div class="logo-navigation"> </div> </div> <div id="footer"> <div id="social" style="float:right;"> <ul> <li class="facebook"><a class="tooltip" href="http://www.facebook.com" target="_blank" title="Become a fan on Facebook">Become a fan on Facebook</a></li> <li class="twitter"><a class="tooltip" href="http://twitter.com/" target="_blank" title="Follow us on Twitter">Follow us on Twitter</a></li> </ul> </div> </div> </div> <!-- end of main page --> <!------------------------------------------------------ about page ------------------------------------------------------> <div id="panel-2"> <div id="wrapper"> <div id="contentcolumn"> <div id="content-title"> <div class="content-left"> <a href="#panel-1" rel="panel">Home</a> </div><!-- END content-left --> <div class="content-center"> <h1>about</h1> </div><!-- END content-centre --> <div class="content-right"> <a href="#panel-1" rel="panel">Up one page</a> </div><!-- END content-right --> </div><!-- END content-title --> <hr/> <div class="content"> <p>Hello world...</p> <p>Hello world...</p> <p>Hello world...</p> <p>Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world </p> </div><!-- END class content --> </div><!-- END contentcolumn --> </div><!-- END wrapper --> <div id="footer"> <a href="#top" ><img src="images/a.jpg" width="185" height="42" style="float:right;margin:1em 1em 1em 0;"></a> </div><!-- END footer --> </div><!-- END panel --> <!-- end of about page --> <!------------------------------------------------------ get music page ------------------------------------------------------> <div id="panel-3"> <div id="wrapper"> <div id="contentcolumn"> <div id="content-title"> <div class="content-left"> <a href="#panel-1" rel="panel">Home</a> </div><!-- END content-left --> <div class="content-center"> <h1>get music</h1> </div><!-- END content-centre --> <div class="content-right"> <a href="#panel-2" rel="panel">Up one page</a> </div><!-- END content-right --> </div><!-- END content-title --> <hr/> <div class="content"> <section id="options" class="clearfix"> <ul id="filters" class="option-set floated clearfix"> <li><a href="#filter" data-filter="*" class="selected">show all</a></li> <li><a href="#filter" data-filter=".shorts">short films</a></li> <li><a href="#filter" data-filter=".features">feature films</a></li> <li><a href="#filter" data-filter=".ads">commercials</a></li> <li><a href="#filter" data-filter=".tv">television</a></li> </ul> </section> <!-- END options --> <div id="container" class="clearfix"> <div class="element shorts"> <img src='images/a.jpg' width='190' height='130'> </div> <div class="element shorts ads"> <img src='images/a.jpg' width='190' height='130'> </div> <div class="element shorts ads"> <img src='images/a.jpg' width='190' height='130'> </div> <div class="element shorts"> <img src='images/a.jpg' width='190' height='130'> </div> <div class="element features"> <img src='images/a.jpg' width='190' height='130'> </div> <div class="element tv"> <img src='images/a.jpg' width='190' height='130'> </div> </div> <!-- #container --> <script type="text/javascript" src="js/jquery.isotope.min.js"></script> <script> var $container = $('#container'); // filter buttons $('#filters a').click(function(){ var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector }); return false; }); // switches selected class on buttons $('#options').find('.option-set a').click(function(){ var $this = $(this); // don't proceed if already selected if ( !$this.hasClass('selected') ) { $this.parents('.option-set').find('.selected').removeClass('selected'); $this.addClass('selected'); } }); $(function(){ $container.isotope({ itemSelector : '.element' }); }); </script> </div><!-- END class content --> </div><!-- END content-title --> </div><!-- END wrapper --> <div id="footer"> </div> </div> <!-- end of get music page --> <!------------------------------------------------------ commissioned work page ------------------------------------------------------> <div id="panel-4"> <div id="wrapper"> <div id="contentcolumn"> <div id="content-title"> <div class="content-left"> <a href="#panel-1" rel="panel">Home</a> </div><!-- END content-left --> <div class="content-center"> <h1>commissioned work</h1> </div><!-- END content-centre --> <div class="content-right"> <a href="#panel-3" rel="panel">Up one page</a> </div><!-- END content-right --> </div><!-- END content-title --> <hr/> <div class="content"> <br /> <h3>Filterable content...</h3> <p>Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world </p> </div> </div> </div> <div id="footer"> </div> </div> <!-- end of commissioned work --> <!------------------------------------------------------ contact page ------------------------------------------------------> <div id="panel-5"> <div id="wrapper"> <div id="contentcolumn"> <div id="content-title"> <div class="content-left"> <a href="#panel-1" rel="panel">Home</a> </div><!-- END content-left --> <div class="content-center"> <h1>get in touch</h1> </div><!-- END content-centre --> <div class="content-right"> <a href="#panel-4" rel="panel">Up one page</a> </div><!-- END content-right --> </div><!-- END content-title --> <hr/> <div class="content"> <br /> <h3>This is where the contact content goes...</h3> <p>Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world </p> </div> </div> </div> <div id="footer"> </div> </div> <!-- end of contact page --> </div> </div> </div> <script src="js/jquery-1.5.1.min.js"></script> <script src="js/jquery.isotope.min.js"></script> <script type="text/javascript" src="js/jquery.fancybox-1.2.1.js"></script> <script type="text/javascript" src="js/jquery.scrollTo.js"></script> <script type="text/javascript" src="js/jquery-toppage.js"></script> <script type="text/javascript" src="js/jquery.localscroll-min.js"></script> <script type="text/javascript" src="js/jquery.pngFix.pack.js"></script> <script type="text/javascript" src="js/jquery.tooltip.js"></script> <script type="text/javascript" src="js/jquery-custom.js"></script> <script type="text/javascript"> $(function(){ $('a.tooltip').aToolTip(); }); </script> <script type="text/javascript"> var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [ {string: navigator.userAgent,subString: "Chrome",identity: "Chrome"}, {string: navigator.userAgent,subString: "OmniWeb",versionSearch: "OmniWeb/",identity: "OmniWeb"}, {string: navigator.vendor,subString: "Apple",identity: "Safari",versionSearch: "Version"}, {prop: window.opera,identity: "Opera"}, {string: navigator.vendor,subString: "iCab",identity: "iCab"}, {string: navigator.vendor,subString: "KDE",identity: "Konqueror"}, {string: navigator.userAgent,subString: "Firefox",identity: "Firefox"}, {string: navigator.vendor,subString: "Camino",identity: "Camino"}, // for newer Netscapes (6+) {string: navigator.userAgent,subString: "Netscape",identity: "Netscape"}, {string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}, {string: navigator.userAgent,subString: "Gecko",identity: "Mozilla",versionSearch: "rv"}, // for older Netscapes (4-) {string: navigator.userAgent,subString: "Mozilla",identity: "Netscape",versionSearch: "Mozilla"} ], dataOS : [ {string: navigator.platform,subString: "Win",identity: "Windows"}, {string: navigator.platform,subString: "Mac",identity: "Mac"}, {string: navigator.userAgent,subString: "iPhone",identity: "iPhone/iPod"}, {string: navigator.platform,subString: "Linux",identity: "Linux"} ] }; BrowserDetect.init(); if(BrowserDetect.browser == "Explorer"){ /* this browser is IE */ if(BrowserDetect.version < 7){ /* this browser is old (IE6, or lower) */ /* change location to "old" site */ window.location="http://website.com/old/index.html"; }else{ /* this browser is new (IE7 and up) */ } } else{ /* this browser is other than IE */ } </script> <script type="text/javascript"> $(document).ready(function() { $("a.group").fancybox(); }); </script> <script type="text/javascript"> $(document).ready(function() { $('#mask').css({'height':$('#panel-1').height()}); $('#panel').width(parseInt($('#mask').width() * $('#panel div').length)); $('#panel').width($('#mask').width()); $('a[rel=panel]').click(function () { $('#mask').scrollTo($(this).attr('href'), 800); if ($(this).attr('href') == '#panel-6') { $('#mask').css({'height':$('#panel-6').height()}); } else if($(this).attr('href') == '#panel-2') { $('#mask').css({'height':$('#panel-2').height()}); } else if($(this).attr('href') == '#panel-3') { $('#mask').css({'height':$('#panel-3').height()}); } else if($(this).attr('href') == '#panel-4') { $('#mask').css({'height':$('#panel-4').height()}); } else if($(this).attr('href') == '#panel-5') { $('#mask').css({'height':$('#panel-5').height()}); } else if($(this).attr('href') == '#panel-7') { $('#mask').css({'height':$('#panel-7').height()}); } else { $('#mask').css({'height':$('#panel-1').height()}); } return false; }); }); </script> </body> </html>
  2. Hi, I'm trying to adapt the superfish navbar menu navigation to my site. I have a long, narrow div that I want this to fit into but I can't work out how to make it fit the div. I've tried increasing the padding-right of the list anchor but that causes a horizontal scroll in the browser because of the overflow and I don't want that. There is probably something really simple I'm missing. Can anybody help? superfish-navbar.css /*** adding the class sf-navbar in addition to sf-menu creates an all-horizontal nav-bar menu ***/ .sf-navbar { background: #BDD2FF; height: 2.5em; padding-bottom: 2.5em; position: relative; } .sf-navbar li { background: #AABDE6; position: static; } .sf-navbar a { border-top: none; } .sf-navbar li ul { width: 44em; /*IE6 soils itself without this*/ } .sf-navbar li li { background: #BDD2FF; position: relative; } .sf-navbar li li ul { width: 13em; } .sf-navbar li li li { width: 100%; } .sf-navbar ul li { width: auto; float: left; } .sf-navbar a, .sf-navbar a:visited { border: none; } .sf-navbar li.current { background: #BDD2FF; } .sf-navbar li:hover, .sf-navbar li.sfHover, .sf-navbar li li.current, .sf-navbar a:focus, .sf-navbar a:hover, .sf-navbar a:active { background: #BDD2FF; } .sf-navbar ul li:hover, .sf-navbar ul li.sfHover, ul.sf-navbar ul li:hover li, ul.sf-navbar ul li.sfHover li, .sf-navbar ul a:focus, .sf-navbar ul a:hover, .sf-navbar ul a:active { background: #D1DFFF; } ul.sf-navbar li li li:hover, ul.sf-navbar li li li.sfHover, .sf-navbar li li.current li.current, .sf-navbar ul li li a:focus, .sf-navbar ul li li a:hover, .sf-navbar ul li li a:active { background: #E6EEFF; } ul.sf-navbar .current ul, ul.sf-navbar ul li:hover ul, ul.sf-navbar ul li.sfHover ul { left: 0; top: 2.5em; /* match top ul list item height */ } ul.sf-navbar .current ul ul { top: -999em; } .sf-navbar li li.current > a { font-weight: bold; } /*** point all arrows down ***/ /* point right for anchors in subs */ .sf-navbar ul .sf-sub-indicator { background-position: -10px -100px; } .sf-navbar ul a > .sf-sub-indicator { background-position: 0 -100px; } /* apply hovers to modern browsers */ .sf-navbar ul a:focus > .sf-sub-indicator, .sf-navbar ul a:hover > .sf-sub-indicator, .sf-navbar ul a:active > .sf-sub-indicator, .sf-navbar ul li:hover > a > .sf-sub-indicator, .sf-navbar ul li.sfHover > a > .sf-sub-indicator { background-position: -10px -100px; /* arrow hovers for modern browsers*/ } /*** remove shadow on first submenu ***/ .sf-navbar > li > ul { background: transparent; padding: 0; -moz-border-radius-bottomleft: 0; -moz-border-radius-topright: 0; -webkit-border-top-right-radius: 0; -webkit-border-bottom-left-radius: 0; } The above css is in addition to the following... superfish.css /*** ESSENTIAL STYLES ***/ .sf-menu, .sf-menu * { margin: 0; padding: 0; list-style: none; } .sf-menu { line-height: 1.5; } .sf-menu ul { position: absolute; top: -999em; width: 10em; /* left offset of submenus need to match (see below) */ } .sf-menu ul li { width: 100%; } .sf-menu li:hover { visibility: inherit; /* fixes IE7 'sticky bug' */ } .sf-menu li { float: left; position: relative; } .sf-menu a { display: block; position: relative; } .sf-menu li:hover ul, .sf-menu li.sfHover ul { left: 0; top: 2.5em; /* match top ul list item height */ z-index: 99; } ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { top: -999em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { left: 10em; /* match ul width */ top: 0; } ul.sf-menu li li:hover li ul, ul.sf-menu li li.sfHover li ul { top: -999em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { left: 10em; /* match ul width */ top: 0; } /*** DEMO SKIN ***/ .sf-menu { float: left; margin-bottom: 1em; width:100%; } .sf-menu a { border-left: 1px solid #fff; border-top: 1px solid #CFDEFF; padding: .75em 1em; text-decoration:none; } .sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ color: #13a; } .sf-menu li { background: #BDD2FF; } .sf-menu li li { background: #AABDE6; } .sf-menu li li li { background: #9AAEDB; } .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { background: #CFDEFF; outline: 0; } /*** arrows **/ .sf-menu a.sf-with-ul { padding-right: 0em; /* CHANGE THIS FOR TOP MENU WIDTH!!!!!!!! */ min-width: 183px; /* trigger IE7 hasLayout so spans position accurately */ } .sf-sub-indicator { position: absolute; display: block; right: .75em; top: 1.05em; /* IE6 only */ width: 10px; height: 10px; text-indent: -999em; overflow: hidden; background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ } a > .sf-sub-indicator { /* give all except IE6 the correct values */ top: .8em; background-position: 0 -100px; /* use translucent arrow for modern browsers*/ } /* apply hovers to modern browsers */ a:focus > .sf-sub-indicator, a:hover > .sf-sub-indicator, a:active > .sf-sub-indicator, li:hover > a > .sf-sub-indicator, li.sfHover > a > .sf-sub-indicator { background-position: -10px -100px; /* arrow hovers for modern browsers*/ } /* point right for anchors in subs */ .sf-menu ul .sf-sub-indicator { background-position: -10px 0; } .sf-menu ul a > .sf-sub-indicator { background-position: 0 0; } /* apply hovers to modern browsers */ .sf-menu ul a:focus > .sf-sub-indicator, .sf-menu ul a:hover > .sf-sub-indicator, .sf-menu ul a:active > .sf-sub-indicator, .sf-menu ul li:hover > a > .sf-sub-indicator, .sf-menu ul li.sfHover > a > .sf-sub-indicator { background-position: -10px 0; /* arrow hovers for modern browsers*/ } /*** shadows for all but IE6 ***/ .sf-shadow ul { background: url('../images/shadow.png') no-repeat bottom right; padding: 0 8px 9px 0; -moz-border-radius-bottomleft: 17px; -moz-border-radius-topright: 17px; -webkit-border-top-right-radius: 17px; -webkit-border-bottom-left-radius: 17px; } .sf-shadow ul.sf-shadow-off { background: transparent; } The div I am trying to fit the navbar into is described in my main css file as #contentnav{ position: relative; top:10px; height: 50px; background-color:#fff; margin:10px; border: 1px solid red; } Markup is as follows: <div id="contentnav"> <ul id="sample-menu-4" class="sf-menu sf-navbar"> <li class="current"> <a class="sf-with-ul" href="#">Menu1<span class="sf-sub-indicator"> &#187;</span></a> <ul> <li><a href="#">Sub1</a></li> <li><a href="#">Sub2</a></li> <li><a href="#">Sub3</a></li> </ul> </li> <li> <a class="sf-with-ul" href="#">Menu2<span class="sf-sub-indicator"> &#187;</span></a> <ul> <li><a href="#">Sub1</a></li> <li><a href="#">Sub2</a></li> <li><a href="#">Sub3</a></li> </ul> </li> <li> <a class="sf-with-ul" href="#">Menu3<span class="sf-sub-indicator"> &#187;</span></a> <ul> <li><a href="#">Sub1</a></li> <li><a href="#">Sub2</a></li> <li><a href="#">Sub3</a></li> </ul> </li> <li><a class="sf-with-ul" href="#">Menu4="sf-sub-indicator"> &#187;</span></a> <ul> <li><a href="#">Sub1</a></li> <li><a href="#">Sub2</a></li> <li><a href="#">Sub3</a></li> </ul> </li> </ul> </div><!-- end contentnav --> Thanks
  3. Hi, I have a site that contains a content are that requires a scroll function. I want to use custom buttons/arrows that scroll the textarea when the user hovers the mouse over the buttons/arrows. I found this on a site that does exactly what I need mine to do, only problem is that the script uses iframes. var timer_id; function scroll_iframe(frm,inc,dir) { if (timer_id) clearTimeout(timer_id); if (window.frames[frm]) { if (dir == "v") window.frames[frm].scrollBy(0, inc); else window.frames[frm].scrollBy(inc, 0); timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20); } } function stopScroll() { if (timer_id) clearTimeout(timer_id); } Here is an example of a page I want to incorporate such a script. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link href="css/main2.css" rel="stylesheet" type="text/css" /> </head> <body id='index'> <div id='outerDiv'> <div id="bg"> <div id="insect"></div> <div id="header"></div> <div id='leftcontainer'> <div id="leftspacer"></div> <div id="title"><?php include('heading.php'); ?></div> <div id="definition"><?php include('cp_definition.php'); ?></div> <div id="sub_links" class='menu2'><?php include('cp_sub_links.php'); ?></div> </div> <div id='middle'> <div id="nav"><?php include('cp_links.php'); ?></div> <div id="content"> <table align="left" border="0"> <tr><td align='center' width='120' height='67'><orange class='orangelink'><a href='cp_listen_filmtv2.php'>+</a></orange></td> <td><h4><a href='cp_listen_filmtv2.php'>Add New Film/TV</a></h4></td></tr> <?php //Fetch list of films from the database $result = mysqli_query($connection,"SELECT * FROM films ORDER BY id DESC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { /* Fetching profile */ $id = $row['id']; $name = $row['name']; $img = $row['img']; $title1 = $row['title1']; $title2 = $row['title2']; $title3 = $row['title3']; $video = $row['video']; echo "<tr> <td><a href='cp_listen_filmtv3.php?film=".$video."'><img src='".$img."' width='120' height='67'></a></td> <td><h4>".$name."</h4><h3>".$title1."</h3><h3>".$title2."</h3><h3>".$title3."</h3></td> </tr>"; } ?> </table> </div><!-- END Content --> </div> <div id="tail"></div> <div id="bottom"></div> <div id="footer"><?php include('footer.php'); ?></div> </div><!-- END bg --> </div><!-- END outerDiv --> </body> </html> THIS IS THE DIV I WANT TO BE ABLE TO SCROLL (taken from the page above) <div id="content"> <table align="left" border="0"> <tr><td align='center' width='120' height='67'><orange class='orangelink'><a href='cp_listen_filmtv2.php'>+</a></orange></td> <td><h4><a href='cp_listen_filmtv2.php'>Add New Film/TV</a></h4></td></tr> <?php //Fetch list of films from the database $result = mysqli_query($connection,"SELECT * FROM films ORDER BY id DESC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { /* Fetching profile */ $id = $row['id']; $name = $row['name']; $img = $row['img']; $title1 = $row['title1']; $title2 = $row['title2']; $title3 = $row['title3']; $video = $row['video']; echo "<tr> <td><a href='cp_listen_filmtv3.php?film=".$video."'><img src='".$img."' width='120' height='67'></a></td> <td><h4>".$name."</h4><h3>".$title1."</h3><h3>".$title2."</h3><h3>".$title3."</h3></td> </tr>"; } ?> </table> </div><!-- END Content --> Is anybody able to offer a suggestion as to how I should approach and implement this? Is there a simple fix for the script I have included above? Thanks!
  4. Ok, thanks. I've sorted it out. I just need to define the totals separately then add them!
  5. Hi, I'm trying to do a very simple calculation. I have two separate tables containing invoice information. I need to add the totals from all invoices and display them. I need to add the sum of the following columns: TABLE A: amount_received TABLE B: total Here's my starting point - I have the total from TABLE A. I have tried various other things but nothing is working for me. Where do I go from here? <?php $result = mysqli_query($connection,"SELECT SUM(amount_received) FROM table A ")or die(mysqli_error($connection)); // Print out result while($row = mysqli_fetch_array($result)){ echo '<td>$'.$row['SUM(amount_received)'].'.00</td>'; }
  6. For the section of code below, is there a way to say, "first time through the query print on A2, B2,etc, then each query following add increase the number besides column name to be A3, B3, etc, then A4, B4, etc"...? $result = mysqli_query($connection,"SELECT * FROM table") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the table $var1 = $row['var1']; $var2 = $row['var2']; $var3 = $row['var3']; $var4 = $row['var4']; $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A2', $var1) ->setCellValue('B2', $var2) ->setCellValue('C2', $var3) ->setCellValue('D2', $var4); } This is for an excel spreadsheet. The code is currently printing/exporting one row only from the table. Thanks
  7. It is really only this part of the code that I am working with...thanks. // Add some data $result = mysqli_query($connection,"SELECT * FROM students ORDER BY school ASC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the tutors table $id = $row['id']; $full_name = $row['full_name']; $school = $row['school']; $year = $row['school_year']; $class = $row['class']; $contact = $row['contact']; $phone_h = $row['phone_h']; $phone_m = $row['phone_m']; $tutor_1 = $row['tutor_1']; $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', $full_name) ->setCellValue('B1', $contact) ->setCellValue('C1', $year.$class) ->setCellValue('D1', $tutor_1); }
  8. Hi, I am very new to this. Your help would be greatly appreciated. This has also been posted on the phpexcel discussion page. I would like to know how to export data from a MySql table into an excel spreadsheet. I have the knowledge to get the information from the database to the spreadsheet but how do I have the code repeat until all data is echoed onto the page? Here is what I have already. This produces only a single row of results from the database...just need to know how to get it all onto the spreadsheet! Using php logic, how would I get around this? <?php /** Error reporting */ error_reporting(E_ALL); /** PHPExcel */ require_once '../Classes/PHPExcel.php'; // Create new PHPExcel object $objPHPExcel = new PHPExcel(); require_once('../includes/connection.php'); $result = mysqli_query($connection,"SELECT * FROM students ORDER BY school ASC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the tutors table $school = $row['school']; } // Set properties $objPHPExcel->getProperties()->setCreator("Somebody") ->setLastModifiedBy("Somebody") ->setTitle($school."Student List") ->setSubject($school."Student List") ->setDescription("Student List at ".$school) ->setKeywords("Student List") ->setCategory("Student List"); // Add some data $result = mysqli_query($connection,"SELECT * FROM students ORDER BY school ASC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the tutors table $id = $row['id']; $full_name = $row['full_name']; $school = $row['school']; $year = $row['school_year']; $class = $row['class']; $contact = $row['contact']; $phone_h = $row['phone_h']; $phone_m = $row['phone_m']; $tutor_1 = $row['tutor_1']; $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', $full_name) ->setCellValue('B1', $contact) ->setCellValue('C1', $year.$class) ->setCellValue('D1', $tutor_1); } // Rename sheet $objPHPExcel->getActiveSheet()->setTitle('Simple'); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); // Redirect output to a client’s web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="01simple.xls"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); exit; ?>
  9. Hi, thanks for having a look at this. The output successfully downloads the excel file with all of the data I request...However, when downloading (or exporting) it gets stuck on the lines mentioned above and continues to export error messages. When I stop the download, I can open the excel spreadsheet - all the info I want is laid out on the page but printed below are the two error messages repeated over and over... Any ideas?
  10. Hi, I am attempting to export some table data to an excel spreadsheet. I am having trouble with the final few lines and getting the following error within the spreadsheet (which is otherwise working well). I get the same error message for the line below also (echo implode("\t", array_values($row)) . "\n". I'm at a loss. This seems like a pretty obvious and direct error message but I can't get it working properly. Can somebody please help me? Below is the code I am working with. <?php include('includes/admin_session.php'); require_once("includes/connection.php"); function cleanData(&$str) { $str = preg_replace("/\t/", "\\t", $str); $str = preg_replace("/\r?\n/", "\\n", $str); if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"'; } // file name for download $filename = "student_list_" . date('Ymd') . ".xls"; header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Type: application/vnd.ms-excel"); $flag = false; $result = mysqli_query($connection,"SELECT * FROM students ORDER BY tutor") or die(mysqli_error($connection)); while(false !== ($row = mysqli_fetch_assoc($result))) { if(!$flag) { // display field/column names as first row echo implode("\t", array_keys($row)) . "\n"; $flag = true; } array_walk($row, 'cleanData'); echo implode("\t", array_values($row)) . "\n"; } ?>
  11. Hi, I am attempting to export some table data to an excel spreadsheet. Below is the code I am working with. <?php include('includes/admin_session.php'); require_once("includes/connection.php"); function cleanData(&$str) { $str = preg_replace("/\t/", "\\t", $str); $str = preg_replace("/\r?\n/", "\\n", $str); if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"'; } // file name for download $filename = "student_list_" . date('Ymd') . ".xls"; header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Type: application/vnd.ms-excel"); $flag = false; $result = mysqli_query($connection,"SELECT * FROM students ORDER BY tutor") or die(mysqli_error($connection)); while(false !== ($row = mysqli_fetch_assoc($result))) { if(!$flag) { // display field/column names as first row echo implode("\t", array_keys($row)) . "\n"; $flag = true; } array_walk($row, 'cleanData'); echo implode("\t", array_values($row)) . "\n"; } ?> It is exporting the rows as requested and I am able to open the file in excel....however...when downloading it becomes stuck on a loop and continues to download over 20mb of nothing. As a result I am forced to stop the download. When I open my excel file, below my table data is the following error, over and over and over and over! Any help on this would be awesome
  12. nerd99

    Columns

    Is there a way to echo the results of a query as separate columns as opposed to one under the other?
  13. Hi there, I'm stuck! I am using tcpdf to create a list of timetables as a pdf. I have no trouble achieving the pdf. What I am having trouble with getting the loops to echo out as separate columns instead of rows. Here is the scenario: I have a database called 'timetables'. Each row contains information including Tutor's name, School, Lesson time, Student's name. I would like the above row to appear on the page in one column and the next row to appear in the next column in the pdf. Is this making sense? For example: Under the title 'Monday', would have Tutor 1 with times and students listed below, then directly next to that would be Tutor 2 with times and students listed below. Here is my very poor attempt to get the results. I can get the columns happening but it just prints the same tutor's name in both columns. <?php //============================================================+ // File name : example_017.php // Begin : 2008-03-04 // Last Update : 2010-05-20 // // Description : Example 017 for TCPDF class // Two independent columns with MultiCell // // Author: Nicola Asuni // // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. // Via Della Pace, 11 // 09044 Quartucciu (CA) // ITALY // www.tecnick.com // info@tecnick.com //============================================================+ /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf * @abstract TCPDF - Example: Two independent columns with MultiCell * @author Nicola Asuni * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL * @since 2008-03-04 */ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('TCPDF Example 017'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 017', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', '', 20); // add a page $pdf->AddPage(); $pdf->Write(0, 'Example of independent Multicell() columns', '', 0, 'L', true, 0, false, false, 0); $pdf->Ln(5); $pdf->SetFont('times', '', 12); require_once('../../includes/connection.php'); $result = mysqli_query($connection,"SELECT * FROM timetables WHERE school='schoolname' AND day='Wednesday' ") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the tutor_invoices table $id = $row['id']; $school = $row['school']; $day = $row['day']; } $pdf->Ln(6.6); //light blue w black text $pdf->SetFillColor(177, 223, 243); $pdf->SetTextColor(0, 0, 0, 100); // Timetable Details) $pdf->MultiCell(200, 5, $day, 1, 'C', 1, 0, 5, '', true); $pdf->Ln(7.35); $result = mysqli_query($connection,"SELECT * FROM timetables WHERE school='schoolname' AND day='Wednesday' ") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { //get all rows you want from the tutor_invoices table $tutor = $row['tutor']; } // create columns content $left_column = $tutor."\n"; $right_column = $tutor."\n"; // MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) // set color for background $pdf->SetFillColor(255, 255, 200); // set color for text $pdf->SetTextColor(0, 63, 127); // write the first column $pdf->MultiCell(80, 0, $left_column, 1, 'J', 1, 0, '', '', true, 0, false, true, 0); // set color for background $pdf->SetFillColor(215, 235, 255); // set color for text $pdf->SetTextColor(127, 31, 0); // write the second column $pdf->MultiCell(80, 0, $right_column, 1, 'J', 1, 1, '', '', true, 0, false, true, 0); // reset pointer to the last page $pdf->lastPage(); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('example_017.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ ?> Does anybody know how to achieve this?
  14. I am attempting to send an email from my website via SMTP. Knowing that my site's host supports PEAR I have used PEAR’s Mail function. Here is my code... <?php require_once "Mail.php"; $from = "Me <me@email>"; $to = "You <you@email>"; $subject = "Subject"; $body = "Insert Message Here"; $host = "hostdetails"; $username = "username"; $password = "password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?> This gave me an error saying: 'Class 'Net_SMTP' not found in /usr/local/php52/pear/Mail/smtp.php on line 210' So, using siteground as my host, I followed this tutorial - www.siteground.com/tutorials/php-mysql/pear_modules.htm and thanks to a very helpful blog entry (http://goonanism.com/blog/2010/06/08/using-pear-to-send-email-via-smtp/) I discovered that I needed to install the following packages in the following directories: pear /Mail /RFC822.php /mail.php /mock.php /null.php /sendmail.php /smtp.php /smtpmx.php /Net /SMTP.php /Socket.php /Mail.php /PEAR.php /PEAR5.php Back to the siteground tutorial, I created the php.ini file as directed. This is where I think I've gone wrong as I don't really know what I'm doing! I created a blank document and inserted the following code as directed: include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/my_cPanel_username/pear"; This file is saved in the following place: /public_html/php.ini Is this what they intended? Now, I am getting nothing. No error message, no message saying the email has been sent. The page loads fine but nothing has happened. Does anyone have any suggestions on what I could try or what the problem may be?
  15. Thanks Thorpe, much appreciated. This was my suspicion. How annoying! Can you recommend any hosting services?
  16. Hi, I'm not sure that this is the right place to post this but I was scared off by the message at the top of the mysql forum and worried that I wouldn't get a response. I have a big problem. I have spent the last 4months developing a web portal using mysqli string queries. Upon uploading it to my host (ixwebhosting.com) I am told that the server does not support mysqli, only mysql. I went through and did a 'Find & Replace' on ALL of my files as advised by ixwebhosting's help centre. Upon re-uploading the site all has gone askew. I can connect to the database but there are mysql errors everywhere. Just trying to get the index page content I have the following error: Here is the main_site_home.php <?php //Fetch the main site 'home' content from the database $result = mysql_query($connection,"SELECT * FROM main_site") or die(mysql_error($connection)); while($row = mysql_fetch_array($result)) { /* Fetching profile */ $home = $row['home']; } echo format_html("<p>$home</p>"); ?> What I really need to know is this: have I done this the correct way? Can you just 'Find & Replace' all 'mysqli' with 'mysql' or do they follow completely different commands? This is very stressful, the site is supposed to be up and running in a day with dozens of users waiting to use the site. Can somebody please help! What do I need to do to get this working?
  17. Hi, I'm developing a basic xhtml website and want to include a very simple game that is created with my graphic elements. My questions are...will this be 'flash' or another script? And can you suggest any particular people/companies to contact? Many thanks
  18. Hi All, Having some trouble with a page. I have created a dropdown menu navigation for my control panel pages. All links are working fine, just for one of them - MyStudents --> Submit Reports. I've spent hours trying to work this out so any fresh eyes would be a great help The error message I get appears to be within the linking navigation menu - i.e the page loads until the point where it has a problem (supposedly line 27 in tutor_links???) Here is the code... tutor_links.php <style media="all" type="style.css";</style> <div class="menu"> <ul> <li><a href="tutorcp" class="green">MyHome</a></li> <li><a href="tutor_details" target="_self" >MyDetails</a> <ul> <li><a href="tutor_change_password" target="_self">Change Password</a></li> <li><a href="tutor_edit_bio" target="_self">Edit Profile</a></li> </ul> </li> <li><a href="tutor_view_payments" class="green">MyPayments</a> <ul> <li><a href="tutor_invoice_new" target="_self">Create New Invoice</a></li> <li><a href="tutor_view_payments" target="_self">Outstanding</a></li> <li><a href="tutor_view_payments" target="_self">Paid</a></li> </ul> </li> <li><a href="tutor_calendar" class="green">MyCalendar</a> <ul> <li><a href="tutor_calendar" target="_self"> <?php $username = $_SESSION['username']; //Get calendar code from tutors table $result = mysqli_query($connection,"SELECT * FROM tutors WHERE username='$username'")or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { // Get all rows and assign them to variables $school = $row['school']; } echo $school; ?></a></li> </ul> <li><a href="tutor_timetable" class="green">MyTimetable</a></li> <li><a href="tutor_submit" class="green">MyStudents</a> <ul> <li><a href="tutor_submit_roll" target="_self">Submit Attendance</a></li> <li><a href="tutor_submit_report" target="_self">Submit Reports</a></li> </ul> </li> <li><?php if (!isset($_SESSION['tutor_is_logged_in'])) { echo "<li><a href='login' class='blue'>login</a></li>"; } else { echo "<li><a href='logout' class='logout'>logout</a></li>"; } ?> </li> </ul> </div> <!--- menu ---> tutor_submit_report.php <?php include('includes/tutor_session.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Tutor Control Panel</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Inschool Logo and Horizontal Line image --> <div id="logo"></div> <?php include('tutor_links.php'); ?> <!-- Main Body --> <div id="cp_bg"> <div id=cp_body> <?php require_once("includes/connection.php"); ?> <whitehead>Submit Reports</whitehead> <form action="tutor_submit_report_process.php" method="post" name="tutor_submit_report"> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>STUDENT DETAILS</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Full Name:</td> <td><select name="full_name"> <?php $username = $_SESSION['username']; $result = mysqli_query($connection,"SELECT full_name FROM students WHERE tutor_1='$username'")or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { $full_name = $row['full_name']; echo "<option>" . $full_name . "</option>"; } ?> </select></td> </tr> <tr> <td align="left" width="150">Term:</td> <td><input name="term" type="text" size="1" maxlength="1" /></td> </tr> <td>Year:</td> <td><select name="year"><option>2010</option><option>2011</option><option>2012</option></select></td> <tr> <td>Instrument:</td> <td><select name="instrument"><option>Clarinet</option><option>Flute</option><option>Trumpet</option><option>Trombone</option><option> French Horn</option><option>Baritone</option><option>Tuba</option><option>Guitar</option><option>Bass Guitar</option><option>Percussion</option><option>Piano</option><option>Voice</option></select></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>GENERAL</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Is the student punctual?</td> <td><select name="q1"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student remember their music, notebook, instrument?</td> <td><select name="q2"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left">Does the student practice enough to make steady progress?</td> <td><select name="q3"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left">Does the student make a concerted effort to improve or focus on technical skills associated with his/her instrument?</td> <td><select name="q4"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student have the correct embouchure or hold the instrument correctly?</td> <td><select name="q5"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Can the student play loudly and softly or interpret dynamic markings appropriate to his/her skill level?</td> <td><select name="q6"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Can the student articulate notes correctly?</td> <td><select name="q7"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a good understanding of Rhythm appropriate to his/her skill level?</td> <td><select name="q8"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student listen well and acknowledge directions?</td> <td><select name="q9"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate aural perception abilities appropriate to his/her skill level?</td> <td><select name="q10"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a good overall understanding of musical concepts (Pitch, Duration, Tone Colour, Texture, Structure) appropriate to his/her skill level?</td> <td><select name="q11"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Does the student demonstrate a general aptitude for music and their chosen instrument?</td> <td><select name="q12"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>SCALES / TECHNIQUE</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Scale 1 Name</td> <td><input name="scale_1" type="text" size="20" maxlength="50" /></td> <td><select name="q13"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Scale 2 Name</td> <td><input name="scale_2" type="text" size="20" maxlength="50" /></td> <td><select name="q14"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Sight Reading:</td> <td><input name="sight_reading" type="text" size="20" maxlength="50" /></td> <td><select name="q15"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>REPORTOIRE</whitehead></td></tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr> <td align="left" width="150">Reportoire 1 Name:</td> <td><input name="rep_1" type="text" size="20" maxlength="50" /></td> <td><select name="q16"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Reportoire 2 Name:</td> <td><input name="rep_2" type="text" size="20" maxlength="50" /></td> <td><select name="q17"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> <td align="left" width="150">Reportoire 3 Name:</td> <td><input name="rep_3" type="text" size="20" maxlength="50" /></td> <td><select name="q18"><option>Poor</option><option>Fair</option><option>Good</option><option>Very Good</option><option>Excellent</option></td> </tr> <tr> </table> <table width="550" border="0" width="550" cellpadding="0" align="center" class="stat"> <tr bgcolor='#80B741'><td><whitehead>COMMENTS</whitehead></td></tr> <td><textarea name="comments" cols="50" rows="8"></textarea></td></tr> </table> <p align="center"><input name="Submit" type="submit" value="Submit" /></p> </form> </div></div> </body> </html> Here is a page with the links working... tutor_submit_roll.php <?php include('includes/tutor_session.php'); ?> <?php //Log page require_once("includes/connection.php"); $ip= $_SERVER['REMOTE_ADDR']; // Get ip $user = $_SESSION['username']; $page = $user . " submit Roll"; // Page name $b = time (); // Get time from server $timezone = (date_default_timezone_set("Australia/Sydney")); // Make time Sydney time. $time = date ("Y-m-d H:i:s,$b"); // Format the date mysqli_query($connection,"INSERT INTO log (ip, username, page, time) VALUES ('$ip', '$user', '$page', '$time')") or trigger_error("SQL", E_USER_ERROR); // End Log Page ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Tutor Control Panel</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Inschool Logo and Horizontal Line image --> <div id="logo"></div> <?php include('tutor_links.php'); ?> <!-- Main Body --> <div id="cp_bg"> <div id=cp_body> <whitehead>Submit Attendance</whitehead> <p></p> <p>Please include the following abbreviations when noting reasons for absence:</p> <p>'NG' = Notice Given / 'NSN' = Not Sufficient Notice (Example, 'Week 2: NSN. Phone call received 40mins prior to lesson')</p> <p>Don't forget to attach your notes before submitting them!</p> <!-- begin roll form --> <form id="roll" name="roll" method="post" action="tutor_submit_roll_process.php"> <table width="550" border="0" cellpadding="0" class="stat" align="center"> <tr> <th width="150"><div align="center" >Student Name</div></th><th width="30"><div align="center"> </div></th><th width="30"><div align="center"> </div></th><th width="250"><div align="center">Reason for absence if known<br/>(otherwise leave as "Absent")</div></th><th><div align="center" >Attach Note</div></th></tr><tr> <?php include('includes/connection.php'); $result = mysqli_query($connection,"SELECT * FROM site_config") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { $week = $row['week']; $term = $row['term']; $year = $row['year']; } $result = mysqli_query($connection,"SELECT * FROM students WHERE tutor_1='$user'") or die(mysqli_error($connection)); $i=0; while($row = mysqli_fetch_array($result)) { $id = $row['id']; $i++; $first_name = $row['first_name']; $last_name = $row['last_name']; $school = $row['school']; echo "<td align='left'><p><strong>".$last_name . "</strong> " . $first_name ."</p></td>"; echo "<input type='hidden' name='tutor_name[$i]' value='$user' />"; echo "<input type='hidden' name='first_name[$i]' value='$first_name' />"; echo "<input type='hidden' name='last_name[$i]' value='$last_name' />"; echo "<input type='hidden' name='week[$i]' value='$week' />"; echo "<input type='hidden' name='term[$i]' value='$term' />"; echo "<input type='hidden' name='year[$i]' value='$year' />"; echo "<input type='hidden' name='school[$i]' value='$school' />"; echo "<input type='hidden' name='id[$i]' value='$id' />"; echo "<td><div align='center' width='20'>Yes <input name='attendance[$i]' type='radio' value='y' checked='checked'/></div></td>"; echo "<td><div align='center' width='20'>No <input name='attendance[$i]' type='radio' value='n' /></div></td>"; echo "<td><div align='center' width='250'><input type='text' name='note[$i]' value='Week $week: Absent' size='30' /></div></td>"; echo "<td><div align='center' width='250'><input type='checkbox' name='attached[$i]' value='1' /></div></td>"; echo "</td>"; echo "</tr>"; } ?> </table> <p> </p <p align="center"><input name="Submit" type="submit" value="Submit Roll" /></p> </form> <!-- End roll form --> </html> Many thanks
  19. Hi ignace, This did the trick. Thanks for your help
  20. Hi, Having some troubles getting my head around this! Any help would be great. What I am aiming to achieve is the following. I have an accounts homepage. When I open this page I want it to calculate which accounts should be in what category. In other words, there are 3 categories... 1) Outstanding, where paid='0' 2) Paid, where paid='1' 3) Overdue, where the current date is greater than the due date. I was thinking that it might be possible to do it this way; upon opening the accounts homepage the code... *defines $today *then gets the DATE field where paid=0 from the table (this is entered on date when invoice is created) *defines $due *THEN says if $today>$due then set paid='2' On the next page I would simply display the number of rows where paid = 0, 1, or 2. Here is the code I have so far. Is this heading in the right direction or am I barking up the wrong tree? Ideas? <?php include('includes/admin_session.php'); ?> <?php //Define date for calculating overdue accounts $b = time (); // Get time from server $timezone = (date_default_timezone_set("Australia/Sydney")); // Make time Sydney time. $today = date ("Y-m-d,$b"); // Today's date require_once("includes/connection.php"); $result = mysqli_query($connection,"SELECT * FROM invoices WHERE paid='0'") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { // Get all rows and assign them to variables $id = $row['id']; $stamp = $row['stamp']; $due = strtotime('+2 weeks', strtotime($stamp)); if($today>$due) { $result = mysqli_query($connection,"UPDATE invoices SET paid='2' WHERE id='$id' ") or die(mysqli_error($connection)); header("Location: admincp_accounts2.php"); exit; }else{ $result = mysqli_query($connection,"UPDATE invoices SET paid='0' WHERE id='$id' ") or die(mysqli_error($connection)); header("Location: admincp_accounts2.php"); } } ?>
  21. I have gained some ground with this but am now stuck with doing date comparisions. I have two date variables: $time - the current date $due = strtotime('+2 weeks', strtotime($stamp)); <--- gives me a due date 2 weeks from creating the invoice. This is being calculated from my table field 'stamp' as mentioned in the above post. How do I show the number of rows that have past the due date?
  22. Ok. That is done and working, my column 'stamp' is now set as a DATE column and in the format you mentioned. I am able to send the date to the database then view it on another page (list of invoices). How do I create a due date, say for example, 2 weeks from my DATE recorded when processing the invoice?
  23. Hi, I am quite new to the world of php so please excuse my ignorance in advance! I am creating an invoicing system to use within my site, i.e. I create the invoice, it is then displayed on a users page. My issue is regarding retrieving a TIMESTAMP from a database and manipulating it. I have successfully created the invoice and sent all the data to a table in a database - including a timestamp in a column called 'stamp'. I want to be able to manipulate the timestamp to create a due date for my invoices and therefore be able to categorize them as outstanding or overdue. Here is the page I am currently working with to view a due date... <?php include('includes/admin_session.php'); ?> <?php //Log page require_once("includes/connection.php"); $ip = $_SERVER['REMOTE_ADDR']; // Get ip $user = $_SESSION['username']; // Get ip $page = "Put page name here"; // Page name $b = time (); // Get time from server $timezone = (date_default_timezone_set("Australia/Sydney")); // Make time Sydney time. $time = date ("l dS \of F Y h:i A"); // Format the date mysqli_query($connection,"INSERT INTO log (ip, username, page, time) VALUES ('$ip', '$user', '$page', '$time')") or trigger_error("SQL", E_USER_ERROR); // End Log Page ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Admin Control Panel</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Inschool Logo and Horizontal Line image --> <div id="logo"></div> <?php include('admin_links.php'); ?> <!-- Main Body --> <div id="cp_bg"> <div id=cp_body> <?php require_once("includes/connection.php"); ?> <div id="loggedin">logged in as '<?php echo $_SESSION['username'] ?>'</div> <whitehead>Outstanding Accounts</whitehead><p></p> <p></p> <table border="0" width="550" cellpadding="0" align="left" class="stat"> <tr bgcolor='#881727'><td><whitehead>OUTSTANDING</whitehead></td></tr> <tr bgcolor='#0066CC'><td><whitehead>Name</whitehead></td><td><whitehead>Invoice #</whitehead></td><td><whitehead>Invoice Period</whitehead></td><td><whitehead>Due Date</whitehead></td><td><whitehead>Amount Due</whitehead></td><td><whitehead>Record Payment</whitehead></td></tr> <?php require_once("includes/connection.php"); $result = mysqli_query($connection,"SELECT * FROM invoices WHERE paid='0' ORDER BY id ASC") or die(mysqli_error($connection)); while($row = mysqli_fetch_array($result)) { // Get all rows and assign them to variables $id = $row['id']; $bill_to = $row['bill_to']; $term = $row['term']; $year = $row['year']; $date = $row['date']; $paid = $row['paid']; $total = $row['total']; $stamp = $row['stamp']; $method = $row['method']; $invoice_period = $row['invoice_period']; echo "<tr><td><a href='admin_view_outstanding_accounts2.php?invoice=".$id."' class='white'>".$bill_to."</a></td><td><a href='admin_view_outstanding_accounts2.php?invoice=".$id."' class='white'>".$id."</a></td><td><a href='admin_view_outstanding_accounts2.php?invoice=".$id."' class='white'>Term ".$term.", ".$year."</a></td><td><a href='admin_view_outstanding_accounts2.php?invoice=".$id."' class='white'>".$stamp."</a></td><td><a href='admin_view_outstanding_accounts2.php?invoice=".$invoice_num."' class='white'>$".$total.".00</a></td><td><a href='admin_view_outstanding_accounts2.php?invoice=".$invoice_num."' class='white'>Record Payment</a></td></tr>"; } ?> </table> </div></div> </body> </html> As it stands, you can see that I am just echoing out the data for $stamp. How do I do this?!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.