Jump to content

geekisthenewsexy

Members
  • Posts

    105
  • Joined

  • Last visited

    Never

Everything posted by geekisthenewsexy

  1. hey there. sorry for the delay.. well uhm, you may have misinterpreted me i know people here don't do that. but i was kinda hoping you have maybe just one line of that script..anyway, i googled for plugins about that matter but i came up short. i have checked out flexigrid but the example given was using it with json (i don't know that) and i am having trouble adapting it with php..so i figured maybe experts here can help... :-\ btw here's the script.js: var TINY={}; function T$(i){return document.getElementById(i)} function T$$(e,p){return p.getElementsByTagName(e)} TINY.table=function(){ function sorter(n,t,p){this.n=n; this.id=t; this.p=p; if(this.p.init){this.init()}} sorter.prototype.init=function(){ this.set(); var t=this.t, i=d=0; t.h=T$$('tr',t)[0]; t.l=t.r.length; t.w=t.r[0].cells.length; t.a=[]; t.c=[]; this.p.is=this.p.size; if(this.p.colddid){ d=T$(this.p.colddid); var o=document.createElement('option'); o.value=-1; o.innerHTML='All Columns'; d.appendChild(o) } for(i;i<t.w;i++){ var c=t.h.cells[i]; t.c[i]={}; if(c.className!='nosort'){ c.className=this.p.headclass; c.onclick=new Function(this.n+'.sort('+i+')'); c.onmousedown=function(){return false}; } if(this.p.columns){ var l=this.p.columns.length, x=0; for(x;x<l;x++){ if(this.p.columns[x].index==i){ var g=this.p.columns[x]; t.c[i].format=g.format==null?1:g.format; t.c[i].decimals=g.decimals==null?2:g.decimals } } } if(d){ var o=document.createElement('option'); o.value=i; o.innerHTML=T$$('h3',c)[0].innerHTML; d.appendChild(o) } } this.reset() }; sorter.prototype.reset=function(){ var t=this.t; t.t=t.l; for(var i=0;i<t.l;i++){t.a[i]={}; t.a[i].s=1} if(this.p.sortcolumn!=undefined){ this.sort(this.p.sortcolumn,1,this.p.is) }else{ if(this.p.paginate){this.size()} this.alt(); this.sethover() } this.calc() }; sorter.prototype.sort=function(x,f,z){ var t=this.t; t.y=x; var x=t.h.cells[t.y], i=0, n=document.createElement('tbody'); for(i;i<t.l;i++){ t.a[i].o=i; var v=t.r[i].cells[t.y]; t.r[i].style.display=''; while(v.hasChildNodes()){v=v.firstChild} t.a[i].v=v.nodeValue?v.nodeValue:'' } for(i=0;i<t.w;i++){var c=t.h.cells[i]; if(c.className!='nosort'){c.className=this.p.headclass}} if(t.p==t.y&&!f){t.a.reverse(); x.className=t.d?this.p.ascclass:this.p.descclass; t.d=t.d?0:1} else{t.p=t.y; f&&this.p.sortdir==-1?t.a.sort(cp).reverse():t.a.sort(cp); t.d=0; x.className=this.p.ascclass} for(i=0;i<t.l;i++){var r=t.r[t.a[i].o].cloneNode(true); n.appendChild(r)} t.replaceChild(n,t.b); this.set(); this.alt(); if(this.p.paginate){this.size(z)} this.sethover() }; //part to insert highlight script. prblem: where to?// sorter.prototype.sethover=function(){ if(this.p.hoverid){ for(var i=0;i<this.t.l;i++){ var r=this.t.r[i]; r.setAttribute('onmouseover',this.n+'.hover('+i+',1)'); r.setAttribute('onmouseout',this.n+'.hover('+i+',0)') } } }; sorter.prototype.calc=function(){ if(this.p.sum||this.p.avg){ var t=this.t, i=x=0, f,r; if(!T$$('tfoot',t)[0]){ f=document.createElement('tfoot'); t.appendChild(f) }else{ f=T$$('tfoot',t)[0]; while(f.hasChildNodes()){f.removeChild(f.firstChild)} } if(this.p.sum){ r=this.newrow(f); for(i;i<t.w;i++){ var j=r.cells[i]; if(this.p.sum.exists(i)){ var s=0, m=t.c[i].format||''; for(x=0;x<this.t.l;x++){ if(t.a[x].s){s+=parseFloat(t.r[x].cells[i].innerHTML.replace(/(\$|\,)/g,''))} } s=decimals(s,t.c[i].decimals?t.c[i].decimals:2); s=isNaN(s)?'n/a':m=='$'?s=s.currency(t.c[i].decimals):s+m; r.cells[i].innerHTML=s }else{r.cells[i].innerHTML=' '} } } if(this.p.avg){ r=this.newrow(f); for(i=0;i<t.w;i++){ var j=r.cells[i]; if(this.p.avg.exists(i)){ var s=c=0, m=t.c[i].format||''; for(x=0;x<this.t.l;x++){ if(t.a[x].s){s+=parseFloat(t.r[x].cells[i].innerHTML.replace(/(\$|\,)/g,'')); c++} } s=decimals(s/c,t.c[i].decimals?t.c[i].decimals:2); s=isNaN(s)?'n/a':m=='$'?s=s.currency(t.c[i].decimals):s+m; j.innerHTML=s }else{j.innerHTML=' '} } } } }; sorter.prototype.newrow=function(p){ var r=document.createElement('tr'), i=0; p.appendChild(r); for(i;i<this.t.w;i++){r.appendChild(document.createElement('td'))} return r }; sorter.prototype.alt=function(){ var t=this.t, i=x=0; for(i;i<t.l;i++){ var r=t.r[i]; if(t.a[i].s){ r.className=x%2==0?this.p.evenclass:this.p.oddclass; var cells=T$$('td',r); for(var z=0;z<t.w;z++){cells[z].className=t.y==z?x%2==0?this.p.evenselclass:this.p.oddselclass:''} x++ } if(!t.a[i].s){r.style.display='none'} } }; sorter.prototype.page=function(s){ var t=this.t, i=x=0, l=s+parseInt(this.p.size); if(this.p.totalrecid){T$(this.p.totalrecid).innerHTML=t.t} if(this.p.currentid){T$(this.p.currentid).innerHTML=this.g} if(this.p.startingrecid){ var b=((this.g-1)*this.p.size)+1, m=b+(this.p.size-1); m=m<t.l?m:t.t; m=m<t.t?m:t.t; T$(this.p.startingrecid).innerHTML=t.t==0?0:b;; T$(this.p.endingrecid).innerHTML=m } for(i;i<t.l;i++){var r=t.r[i]; if(t.a[i].s){r.style.display=x>=s&&x<l?'':'none'; x++}else{r.style.display='none'}} }; sorter.prototype.move=function(d,m){ this.goto(d==1?(m?this.d:this.g+1):(m?1:this.g-1)) }; sorter.prototype.goto=function(s){ if(s<=this.d&&s>0){this.g=s; this.page((s-1)*this.p.size)} }; sorter.prototype.size=function(s){ var t=this.t; if(s){this.p.size=s} this.g=1; this.d=Math.ceil(this.t.t/this.p.size); if(this.p.navid){T$(this.p.navid).style.display=this.d<2?'none':'block'} this.page(0); if(this.p.totalid){T$(this.p.totalid).innerHTML=t.t==0?1:this.d} if(this.p.pageddid){ var d=T$(this.p.pageddid), l=this.d+1; d.setAttribute('onchange',this.n+'.goto(this.value)'); while(d.hasChildNodes()){d.removeChild(d.firstChild)} for(var i=1;i<=this.d;i++){ var o=document.createElement('option'); o.value=i; o.innerHTML=i; d.appendChild(o) } } }; sorter.prototype.showall=function(){ this.size(this.t.t) }; sorter.prototype.search=function(f){ var i=x=n=0, k=-1, q=T$(f).value.toLowerCase(); if(this.p.colddid){k=T$(this.p.colddid).value} var s=(k==-1)?0:k, e=(k==-1)?this.t.w:parseInt(s)+1; for(i;i<this.t.l;i++){ var r=this.t.r[i], v; if(q==''){ v=1 }else{ for(x=s;x<e;x++){ var b=r.cells[x].innerHTML.toLowerCase(); if(b.indexOf(q)==-1){v=0}else{v=1; break} } } if(v){n++} this.t.a[i].s=v } this.t.t=n; if(this.p.paginate){this.size()} this.calc(); this.alt() }; sorter.prototype.hover=function(i,d){ this.t.r[i].id=d?this.p.hoverid:'' }; sorter.prototype.set=function(){ var t=T$(this.id); t.b=T$$('tbody',t)[0]; t.r=t.b.rows; this.t=t }; Array.prototype.exists=function(v){ for(var i=0;i<this.length;i++){if(this[i]==v){return 1}} return 0 }; Number.prototype.currency=function(c){ var n=this, d=n.toFixed(c).split('.'); d[0]=d[0].split('').reverse().join('').replace(/(\d{3})(?=\d)/g,'$1,').split('').reverse().join(''); return '$'+d.join('.') }; function decimals(n,d){return Math.round(n*Math.pow(10,d))/Math.pow(10,d)}; function cp(f,c){ var g,h; f=g=f.v.toLowerCase(); c=h=c.v.toLowerCase(); var i=parseFloat(f.replace(/(\$|\,)/g,'')), n=parseFloat(c.replace(/(\$|\,)/g,'')); if(!isNaN(i)&&!isNaN(n)){g=i,h=n} i=Date.parse(f); n=Date.parse(c); if(!isNaN(i)&&!isNaN(n)){g=i; h=n} return g>h?1:(g<h?-1:0) }; return{sorter:sorter} }();
  2. hi all. I've found some neat javascript based table here http://www.scriptiny.com/2009/03/table-sorter/ I am using this with PHP to display records from the database. Now my problem is, I want to be able to resize table columns by dragging the bar between the columns in the header. But I don't know how to achieve this and what script to use and where to put it. I'm afraid I'd mess up the output..Can someone help?
  3. ..sigh..i just like to know if it's possible if i use the method i'm used to? and, the codes below are i think more simple for me because i'm used to it.. anyway,my remaining problem there is getting the value from _add_tsubject (this is a pop-up window when i click on a link on the parent page),the value of 'teacher_id' and 'name' thru the url..but as of now, i only get the value of <a href="_do_addtsubject.php?id='.$row['id'].'&subj_id='.$row['subj_id'].'&code='.$row['subj_code'].'&desc='.$row['subj_desc'].'&lect='.$row['lecture'].'&lab='.$row['laboratory'].'&units='.$row['units'].'">[Add]</a> ..if there's a way of getting the 'teacher_id' and 'name' from _add_tsubject by using the method below and combining it with url from '_do_addtsubject' then i just use that kind of method....
  4. .....anyone??.. :'( please tell me if it's not clear...
  5. thanks for the response requinix. i'm kind of new to javascript as well as ajax so i'm kind of lost..can you show me an example of that?or is there another way to do it with less hassle?
  6. hi all. i am so lost here guys,i need your help. basically, i have 3 pages here. _add_tsubject, _query_subject, and _do_addtsubject. _add_tsubject here contains a livesearch javascript that searches for subjects which i query in _query_subject. the result of that is displayed in _add_tsubject. i am using get method for that and for the url. now, my problem is how to pass or should i say combine the url from _add_tsubject with the url inside the <a href> in _query_subject?or is it possible??i'm sorry if it sounds confusing. but if it's confusing you please have a look at the code.. _add_tsubject <?php include("dbconnection_wmsuipil.php"); $id = $_GET['item']; $t_id = $_GET['t_id']; $lname = $_GET['lname']; $fname = $_GET['fname']; $result= mysql_query("SELECT * FROM tblSetSY")or die(mysql_error()); while($row = mysql_fetch_array($result)) { $setYear=$row['SchoolYear']; $setSem=$row['Sem']; } ?> <!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>Adding subject to teacher..</title> <link rel="stylesheet" href="style.css"/> <link rel="stylesheet" href="validator_style/screen.css"/> </head> <body> <div style="margin-right:30px; padding:10px;" align="right"><a href="#" onclick="window.location.reload()">Reload</a> | <a href="#" onclick="window.close()">Close</a></div> <form name="form" id="cmxform_sched" class="cmxform" method="post" action="_do_addtsubject.php"> <fieldset> <p> <label for="t_id">Teacher ID: </label> <input type="hidden" name="school_year1" value="<?php echo $setYear;?>"/> <input type="hidden" name="sem1" value="<?php echo $setSem;?>"/> <input type="hidden" name="id" value="<?php echo $id;?>" size="15"/> <input type="text" name="t_id" value="<?php echo $t_id;?>" size="15"/> </p> <p> <label for="name">Name: </label> <input type="text" name="name" value="<?php echo $fname.' '.$lname;?>" size="25"/> </p> <p><i>*Add subjects to be handled...</i></p> <p><label for="keyword">Enter Subject ID: </label> <input type="text" name="sid" id="sid" size="15" onkeyup="showResult(this.value)" /> </p> <div id="livesearch" align="center"><b>->Subject info will be listed here<-</b></div> </table> </fieldset> </form> <script type="text/javascript"> function showResult(str) { if (str.length==0) { document.getElementById("livesearch").innerHTML=""; document.getElementById("livesearch").style.border="0px"; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("livesearch").innerHTML=xmlhttp.responseText; document.getElementById("livesearch").style.border="1px solid #A5ACB2"; } } xmlhttp.open("GET","_query_subject.php?q="+str,true); xmlhttp.send(); } </script> </body> </html> _query_subject (i get an error on the _POST here..) <?php include("dbconnection_wmsuipil.php"); $t_id=$_POST['t_id']; $name=$_POST['name']; $sy=$_POST['school_year1']; $sem=$_POST['sem1']; $q=$_GET['q']; $sql="SELECT * FROM admin_subject WHERE subj_id like '%".$q."%'"; echo "<table border='1'> <tr> <th>#ID</th> <th>Subject ID</th> <th>Subject Code</th> <th>Description</th> <th>Lect</th> <th>Lab</th> <th>Units</th> </tr>"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $OutLine = array('id'=>'','subj_id'=>'','subj_code'=>'','subj_desc'=>'','lecture'=>'','laboratory'=>'','units'=>''); $OutLine['id'] = $row['id']; $OutLine['subj_id'] = $row['subj_id']; $OutLine['subj_code'] = $row['subj_code']; $OutLine['subj_desc'] = $row['subj_desc']; $OutLine['lecture'] = $row['lecture']; $OutLine['laboratory'] = $row['laboratory']; $OutLine['units'] = $row['units']; $countTsubj=0; if($row>$countTsubj) { echo "<tr>"; echo "<td>".implode('<td/>',$OutLine); echo '<td><a href="_do_addtsubject.php?id='.$row['id'].'&subj_id='.$row['subj_id'].'&code='.$row['subj_code'].'&desc='.$row['subj_desc'].'&lect='.$row['lecture'].'&lab='.$row['laboratory'].'&units='.$row['units'].'">[Add]</a></td>'; echo "</tr>"; } } echo "</table>"; ?> _do_addtsubject <?php include("dbconnection_wmsuipil.php"); $t_id=$_POST['t_id']; $name=$_POST['name']; $sy=$_POST['school_year1']; $sem=$_POST['sem1']; $id=$_GET['id']; $subj_id=$_GET['subj_id']; $code=$_GET['code']; $desc=$_GET['desc']; $lect=$_GET['lect']; $lab=$_GET['lab']; $units=$_GET['units']; echo $t_id; echo $name; echo $sy; echo $sem; echo $id; echo $subj_id; echo $code; echo $desc; echo $lect; echo $lab; echo $units; ?> there guys..i hope you can help me..the last page is where plan to echo the url once it's combined..please please help..
  7. Hi guys. i've tried the code and it worked well but i have a bit of a problem. on the second dropdown which is 'yearlevel', the value that's being saved is always 0..the other dropdowns are okay. i don't know where i've gone wrong. please take look at the code.. <?php include("dbconnection_wmsuipil.php"); $subjvalue=$_POST['mainCat']; $subjdata=explode("-", $subjvalue); $subjid=$subjdata[0]; $subjname=$subjdata[1]; ///for first dropdown $cvalue=$_POST['catId']; $cdata=explode("-", $cvalue); $cid=$cdata[0]; $cname=$cdata[1]; ///for second dropdown (yearlevel) $yval=$_POST['subcatId']; $ydata=explode("-", $yval); $yid=$ydata[0]; $yname=$ydata[1]; ///third dropdown $bvalue=$_POST['subcat2Id']; $bdata=explode("-", $bvalue); $bid=$bdata[0]; $bname=$bdata[1]; $sql=mysql_query("INSERT INTO stud_records (teacher_id, teacher_name,subj_id, prospectuscode, subj_code, course_desc, unit, day, time, time2,course, yearlevel,block,room, Sem, school_year) VALUES ('$_POST[t_id]','$_POST[name]','$subjname','$_POST[pname]','$_POST[code]','$_POST[desc]','$_POST[units]','$_POST[days]','$_POST[time1]','$_POST[time2]','$name','$yname','$name3','$_POST[subcat3Id]','$_POST[sem1]','$_POST[school_year1]')")or die (mysql_error()); echo "1 record added"; ?> this is b.php: <?php include("dbconnection_wmsuipil.php"); @$catId=intval($_GET['catId']); if ($catId!=0) { $query=mysql_query("SELECT DISTINCT year, y_id FROM admin_year where c_id='$catId'")or die (mysql_error()); } else { $query=mysql_query("SELECT DISTINCT year, y_id FROM admin_year order by year")or die (mysql_error()); } ?> <select name="subcatId" onchange="get_subcat2(this.value)"> <option>Select one</option> <?php while($row=mysql_fetch_array($query)) { echo "<option value='$row[y_id]-$row[year]'>$row[year]</option>"; } ?> </select> [/code]
  8. thanks dragon_sa, but can you show me how to do that?
  9. okay,here's the full code..should i post the javascript too? <table cellpadding="5px" cellspacing="4px;" style="margin-left:1px;"> <tr> <td><label for="course">Course: </label></td> <td><div id="first_drop_down"> <select name="catId" onChange="get_subcat(this.value);get_subcat2(this.value);get_subcat3(this.value)"> <option>Select one</option> <?php $query=mysql_query("SELECT DISTINCT c_id, c_name FROM admin_course"); while($row=mysql_fetch_array($query)) { echo "<option value='$row[c_id]'>$row[c_name]</option>"; } ?> </select> </div> </td> </tr> <tr> <td><label for="course">Year: </label></td> <td> <div id="subcat_div"> <?php include('b.php');?> </div> </td> </tr> <tr> <td><label for="course">Block: </label></td> <td> <div id="subcat2_div"> <?php include('c.php');?> </div> </td> </tr> <tr> <td><label for="course">Room: </label></td> <td> <div id="subcat3_div"> <?php include('d.php');?> </div> </td> </tr> </table>
  10. sorry guys if it's a bit confusing.. nope, afraid i can't dragon..because if i did that, it will ruin the dynamic dropdown thing..
  11. Hi guys. I am having a hard time finding a solution for this, is it possible to get not the value of a dropdown (oh what's it called??? ) but what is in between of the <option> tag?like, <select name="catID"> <option value=$row['c_id']>$row['c_name']</option> and save it to the database??cuz I'm using a dynamic dropdown which bases the content of another dropdown by the id of the previous. And so, if i save it to the database, instead of for example "BSA" is saved, the id of "BSA" which is "1" is saved..any ideas guys?
  12. hi all. i was wondering what this error means i am using jquery validator for an "add subject form". i don't know if the error is caused by me removing something inside the script..here take a look please <script type="text/javascript"> $.validator.setDefaults({}); $(document).ready(function() { // validate signup form on keyup and submit $("#signupForm").validate({ rules: { subj_id:"required", code:"required", desc:"required", lect:"required", lab:"required", units:"required" }, messages: { subj_id: "Please provide the Subject ID", code: "Please provide the Subject Code", desc: "Please enter a description", lect: "Please enter number of lectures", lab: "Please enter lab hours", units: "Please enter number of units" } }); }); </script> as you can see in line 2, $.validator.setDefaults({}); seems to be empty. well it wasn't, i removed the submitHandler: function() { alert("submitted!"); } inside 'cause after i click "ok" on the alert prompt, my form won't get submitted to "_do_add.php". so i removed it and after that, it submits. but i get the error in FF like i mentioned above. is this harmless or what?
  13. hi all. i have here a form which is shown when via toggled div. the entire form/page is also fetched via iframe by the main page. my problem is, when i'm on the main page and i click on a link to fetch the external page that contains the form, and on the fetched page when i click on the link to show the form,it won't show. it doesn't seem to work in FF when i click on a link to show it. it's fine in IE but not in FF..how come?here, please take a look at the entire code of the fetched page that contains the form: <?php include("dbconnection_wmsuipil.php"); ?> <!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"/> <link rel="stylesheet" href="style.css"/> <link rel="stylesheet" href="js/style.css"/> </head> <body> <div id="sy_twrapper"> <div id="formtable">+ <a href="javascript: animatedcollapse.toggle('viewform');">Options</a> | <a href="javascript: window.location.reload();">Refresh</a> <br /> <br /> <div id="viewform" class="faq-ans"> <ul class="tabs"> <li class="active"><a href="#tab_sy_form" title="">Add schoolyear</a></li> <li class=""><a href="#tab_set_sy" title="Set schoolyear and semester">Set</a></li> </ul> <div class="tab_container"> <div style="display: none;" id="tab_sy_form" class="tab_content"> <h2><tr> <td><div align="center" class="note"><b>Note: Please fill in all required fields (*).</b></div></td> </tr></h2> <!--Start of add sy form--> <div class="form"> <form name="form_sy" method="post" action="_admin_adsy.php"> Add Schoolyear <i>*<b>from:</b></i> <input type="text" name="sy_from" size="10"/> <i>*<b>to:</b></i> <input type="text" name="sy_to" size="10"/> <input type="Submit" name="Submit" value=" Add schoolyear "/> <input type="reset" value="Clear fields"/> </form> <!--End--> </div> </div> <div style="display: none;" id="tab_set_sy" class="tab_content"> <!--Start of add sy form--> <iframe src ="_tab_set_sy.php" width="100%"> <p>Sorry for the inconvenience but your browser doesn't support iframes.</p> </iframe> <!--End--> </div> </div> </div> <div id="sy_theader"> <div class="query"> <select id="columns" onchange="sorter.search('query')"></select> <input type="text" id="query" name="query" onkeyup="sorter.search('query')" value="Search" onclick="this.value=''"/> </div> <span class="num_records"> <div>Records <span id="startrecord"></span>-<span id="endrecord"></span> of <span id="totalrecords"></span></div> <div><a href="javascript:sorter.reset()">Reset</a></div> </span> </div> <table cellpadding="0" cellspacing="0" border="0" id="table" class="sy_table"> <thead> <tr> <th><h3>SY_ID</h3></th> <th><h3>Schoolyear</h3></th> <th class="nosort"><h3></h3></th> </tr> </thead> <tbody> <?php $sql=mysql_query("SELECT * FROM admin_sy ORDER BY school_year ASC")or die(mysql_error()); $OutLine = array('id'=>'','school_year'=>''); while($row=mysql_fetch_array($sql)) { $OutLine['id'] = $row['id']; $OutLine['school_year'] = $row['school_year']; $countsy=0; if($row>$countsy) { echo "<td>".implode('<td/>',$OutLine); echo '<td align="center"><a href="#" onClick="window.open(\'_admin_edit_sy.php?id='.$row['id'].'&schoolyear='.$row['school_year'].'\',\'Edit\',\'width=350, height=300, menubar=yes\');return false;"><img src="images/edit.png" title="Edit schoolyear" width="16" height="16" border="0"></a> <a href="_admin_del_sy.php?id='.$row['id'].'&schoolyear='.$row['school_year'].'" title="Delete" onClick="return confirm(\'You are about to delete schoolyear '.$row['school_year'].'! You cannot undo this operation! Delete?\');return false;"><img src="images/del.png" width="16" height="16" border="0"></a></td>'; echo "</tr>"; } else { echo "<tr>"; echo "<td>No schoolyear has been added yet.</td>"; echo "</tr>"; } } ?> </tbody> </table> <div id="tablefooter"> <div id="tablenav"> <div> <img src="images/first.gif" width="16" height="16" title="First Page" onclick="sorter.move(-1,true)" /> <img src="images/previous.gif" width="16" height="16" title="First Page" onclick="sorter.move(-1)" /> <img src="images/next.gif" width="16" height="16" title="First Page" onclick="sorter.move(1)" /> <img src="images/last.gif" width="16" height="16" title="Last Page" onclick="sorter.move(1,true)" /> </div> <div> <select id="pagedropdown"></select> </div> <div> <a href="javascript:sorter.showall()">View all</a> </div> </div> <div id="tablelocation"> <div> <select onchange="sorter.size(this.value)"> <option value="5">5</option> <option value="10" selected="selected">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <span>Entries Per Page</span> </div> <div class="page">Page <span id="currentpage"></span>of <span id="totalpages"></span></div> </div> </div> <p> <center><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a></center> </p> </div> </div> <script type="text/javascript" src="script.js"></script> <script type="text/javascript"> var sorter = new TINY.table.sorter('sorter','table',{ headclass:'head', ascclass:'asc', descclass:'desc', evenclass:'evenrow', oddclass:'oddrow', evenselclass:'evenselected', oddselclass:'oddselected', paginate:true, size:5, colddid:'columns', currentid:'currentpage', totalid:'totalpages', startingrecid:'startrecord', endingrecid:'endrecord', totalrecid:'totalrecords', hoverid:'selectedrow', pageddid:'pagedropdown', navid:'tablenav', sortcolumn:1, sortdir:1, init:true }); </script> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/animatedcollapse.js"></script> <script type="text/javascript">//^--Do not separate these two// animatedcollapse.addDiv('viewform', 'fade=1') animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted //$: Access to jQuery //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID //state: "block" or "none", depending on state } animatedcollapse.init() </script> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </script> </body> </html> anyone please help??
  14. hi all. yes, how do you that?? when it's also inside a toggled div?? help... here's the whole code of the page that will be fetched: <?php include("dbconnection_wmsuipil.php"); ?> <!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"/> <link rel="stylesheet" href="style.css"/> <link rel="stylesheet" href="js/style.css"/> </head> <body> <div id="sy_twrapper"> <div id="formtable">+ <a href="javascript: animatedcollapse.toggle('viewform');">Options</a> | <a href="javascript: window.location.reload();">Refresh</a> <br /> <br /> <div id="viewform" class="faq-ans"> <ul class="tabs"> <li class="active"><a href="#tab_sy_form" title="">Add schoolyear</a></li> <li class=""><a href="#tab_set_sy" title="Set schoolyear and semester">Set</a></li> </ul> <div class="tab_container"> <div style="display: none;" id="tab_sy_form" class="tab_content"> <h2><tr> <td><div align="center" class="note"><b>Note: Please fill in all required fields (*).</b></div></td> </tr></h2> <!--Start of add sy form--> <div class="form"> <form name="form_sy" method="post" action="_admin_adsy.php"> Add Schoolyear <i>*<b>from:</b></i> <input type="text" name="sy_from" size="10"/> <i>*<b>to:</b></i> <input type="text" name="sy_to" size="10"/> <input type="Submit" name="Submit" value=" Add schoolyear "/> <input type="reset" value="Clear fields"/> </form> <!--End--> </div> </div> <div style="display: none;" id="tab_set_sy" class="tab_content"> <!--Start of add sy form--> <iframe src ="_tab_set_sy.php" width="100%"> <p>Sorry for the inconvenience but your browser doesn't support iframes.</p> </iframe> <!--End--> </div> </div> </div> <div id="sy_theader"> <div class="query"> <select id="columns" onchange="sorter.search('query')"></select> <input type="text" id="query" name="query" onkeyup="sorter.search('query')" value="Search" onclick="this.value=''"/> </div> <span class="num_records"> <div>Records <span id="startrecord"></span>-<span id="endrecord"></span> of <span id="totalrecords"></span></div> <div><a href="javascript:sorter.reset()">Reset</a></div> </span> </div> <table cellpadding="0" cellspacing="0" border="0" id="table" class="sy_table"> <thead> <tr> <th><h3>SY_ID</h3></th> <th><h3>Schoolyear</h3></th> <th class="nosort"><h3></h3></th> </tr> </thead> <tbody> <?php $sql=mysql_query("SELECT * FROM admin_sy ORDER BY school_year ASC")or die(mysql_error()); $OutLine = array('id'=>'','school_year'=>''); while($row=mysql_fetch_array($sql)) { $OutLine['id'] = $row['id']; $OutLine['school_year'] = $row['school_year']; $countsy=0; if($row>$countsy) { echo "<td>".implode('<td/>',$OutLine); echo '<td align="center"><a href="#" onClick="window.open(\'_admin_edit_sy.php?id='.$row['id'].'&schoolyear='.$row['school_year'].'\',\'Edit\',\'width=350, height=300, menubar=yes\');return false;"><img src="images/edit.png" title="Edit schoolyear" width="16" height="16" border="0"></a> <a href="_admin_del_sy.php?id='.$row['id'].'&schoolyear='.$row['school_year'].'" title="Delete" onClick="return confirm(\'You are about to delete schoolyear '.$row['school_year'].'! You cannot undo this operation! Delete?\');return false;"><img src="images/del.png" width="16" height="16" border="0"></a></td>'; echo "</tr>"; } else { echo "<tr>"; echo "<td>No schoolyear has been added yet.</td>"; echo "</tr>"; } } ?> </tbody> </table> <div id="tablefooter"> <div id="tablenav"> <div> <img src="images/first.gif" width="16" height="16" title="First Page" onclick="sorter.move(-1,true)" /> <img src="images/previous.gif" width="16" height="16" title="First Page" onclick="sorter.move(-1)" /> <img src="images/next.gif" width="16" height="16" title="First Page" onclick="sorter.move(1)" /> <img src="images/last.gif" width="16" height="16" title="Last Page" onclick="sorter.move(1,true)" /> </div> <div> <select id="pagedropdown"></select> </div> <div> <a href="javascript:sorter.showall()">View all</a> </div> </div> <div id="tablelocation"> <div> <select onchange="sorter.size(this.value)"> <option value="5">5</option> <option value="10" selected="selected">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <span>Entries Per Page</span> </div> <div class="page">Page <span id="currentpage"></span>of <span id="totalpages"></span></div> </div> </div> <p> <center><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a></center> </p> </div> </div> <script type="text/javascript" src="script.js"></script> <script type="text/javascript"> var sorter = new TINY.table.sorter('sorter','table',{ headclass:'head', ascclass:'asc', descclass:'desc', evenclass:'evenrow', oddclass:'oddrow', evenselclass:'evenselected', oddselclass:'oddselected', paginate:true, size:5, colddid:'columns', currentid:'currentpage', totalid:'totalpages', startingrecid:'startrecord', endingrecid:'endrecord', totalrecid:'totalrecords', hoverid:'selectedrow', pageddid:'pagedropdown', navid:'tablenav', sortcolumn:1, sortdir:1, init:true }); </script> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/animatedcollapse.js"></script> <script type="text/javascript">//^--Do not separate these two// animatedcollapse.addDiv('viewform', 'fade=1') animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted //$: Access to jQuery //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID //state: "block" or "none", depending on state } animatedcollapse.init() </script> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </script> </body> </html> as you can see, i've posted the whole code..so please anyone??
  15. thanks for the reply thorpe. okay, this is the form on the main page w/c is fetched via iframe: <form class="cmxform" id="signupForm" method="get" action=""> <fieldset> <p> <label for="subj_id">ID: </label> <input type="text" id="subj_id" name="subj_id" size="10"/> <span id="msgbox" style="display:none"> <?php include('subject_check.php');?> </span> </p> <p> <label for="code">Code: </label> <input id="code" name="code" size="10"/> </p> <p> <label for="desc">Description: </label> <input id="desc" name="desc" size="30"/> </p> <p> <label for="lect">Lecture: </label> <input id="lect" name="lect" size="15"/> </p> <p> <label for="lab">Lab: </label> <input id="lab" name="lab" size="15"/> </p> <p> <label for="units">Units: </label> <input id="units" name="units" size="15"/> </p> <p> <input type="submit" class="submit" value="Submit"/> <input type="Reset" name="reset" value="Reset fields"/> </p> </fieldset> </form> this the jscript code on the main page: <script type="text/javascript"> $.validator.setDefaults({ submitHandler: function() { alert("submitted!"); } }); $().ready(function() { // validate the comment form when it is submitted // validate signup form on keyup and submit $("#signupForm").validate({ rules: { subj_id: "required", code: "required", desc: { required: true }, lect: { required: true }, lab: { required: true }, units: { required: true, units: true } }, messages: { subj_id: "Please provide the Subject ID", code: "Please provide the Subject Code", desc: { required: "Please enter a description", }, lect: { required: "Please enter lecture", }, lab: { required: "Please enter lab hours", }, units: "Please enter number of units", } }); }); </script> please, i will show you the css codes>> css (as you can see, i have removed core.css here because it conflicts with the style of my table w/c is included in the main page): /********************************** Use: Main Screen Import ***********************************/ @import "reset.css"; @import "cmxformTemplate.css"; @import "cmxform.css"; css for "reset.css": /********************************** Use: Reset Styles for all browsers ***********************************/ body, p, blockquote { margin: 0; padding: 0; } a img, iframe { border: none; } /* Headers ------------------------------*/ h1, h2, h3, h4, h5, h6 { margin: 0; padding: 0; font-size: 100%; } /* Lists ------------------------------*/ ul, ol, dl, li, dt, dd { margin: 0; padding: 0; } /* Links ------------------------------*/ a, a:link {} a:visited {} a:hover {} a:active {} /* Forms ------------------------------*/ form, fieldset { margin: 0; padding: 0; } fieldset { border: 1px solid #000; } legend { padding: 0; color: #000; } input, textarea, select { margin: 0; padding: 1px; font-size: 100%; font-family: inherit; } select { padding: 0; } css for cmxFormTemplate: /********************************** Use: cmxform template ***********************************/ form.cmxform fieldset { margin-bottom: 10px; } form.cmxform label { display: inline-block; line-height: 1.8; vertical-align: top; cursor: default; margin-left:10px; } form.cmxform fieldset p { list-style: none; padding: 5px; margin: 0; } form.cmxform fieldset fieldset { border: none; margin: 5px 0 0; } form.cmxform fieldset fieldset label { display: block; width: auto; } form.cmxform label { width: 100px; } /* Width of labels */ form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */ form.cmxform label.error { margin-left: 103px; width: 220px; } form.cmxform .submit { margin-left: 103px; } /*\*//*/ form.cmxform legend { display: inline-block; } /* IE Mac legend fix */ css for cmxform.css /********************************** Name: cmxform Styles ***********************************/ form.cmxform { width: 370px; font-size: 1.0em; color: #333; } form.cmxform label { color: #333; } form.cmxform fieldset{ border: 1px solid #C6D5E1; background-color: #ECF2F6; } form.cmxform fieldset p, form.cmxform fieldset fieldset { padding: 5px 5px 7px; } form.cmxform label.error, label.error { /* remove the next line when you have trouble in IE6 with labels in list */ color: red; font-style: italic; } input { border: 1px solid black; } input.error { border: 1px dotted red; } form.cmxform .gray * { color: gray; }
  16. hi all. i am currently working on form and i am using jquery.validation.js.. i have placed this form inside an iframe so it will be fetched when i click a tab. my problem is, i did a little editing, removed some unnecessary css code. it works fine in FF but when i tried it on IE 7, the validation messages (error messages) that supposed to show up in the form doesn't seem to show..little help please?
  17. hi, thought i'd include the html.. this is the div i wanted to expand to the right <div style="margin-right: 230px;" id="content"> <ul class="tabs"> <a class="menuitem submenuheader" href="#sy"> schoolyear</a> </ul> <div id="sy" class="submenu"> <iframe src ="_admin_sy.php" border="0"> <p>Your browser does not support iframes.</p> </iframe> </div> <p /> <ul class="tabs"> <a class="menuitem submenuheader" href="#cbr"> course | block | room</a> </ul> <div id="cbr" class="submenu"> <iframe src ="TinyTableV3/index.php" border="0"> <p>Your browser does not support iframes.</p> </iframe> </div> </div> and this is the other div i want to hide when i click on "Hide" <div id="sidebar" class="side"> <a id="animation2" style="opacity: 1;" class="trigger" href="#"></a> <div style="opacity: 1; right: 0px;" class="slide"> <ul> <li><h3><a href="#" class="house">Dashboard</a></h3> <ul> <li><a href="#" class="admin">My profile</a></li> <li><a href="#" class="report_seo">Account settings</a></li> <li><a href="#" class="logout">Logout</a></li> </ul> </li> <li><h3><a href="#" class="folder_table">Orders</a></h3> <ul> <li><a href="#" class="addorder">New order</a></li> <li><a href="#" class="shipping">Shipments</a></li> <li><a href="#" class="invoices">Invoices</a></li> </ul> </li> <li><h3><a href="#" class="manage">Manage</a></h3> <ul> <li><a href="#" class="manage_page">Pages</a></li> <li><a href="#" class="cart">Products</a></li> <li><a href="#" class="folder">Product categories</a></li> <li><a href="#" class="promotions">Promotions</a></li> </ul> </li> <li><h3><a href="#" class="user">Users</a></h3> <ul> <li><a href="#" class="useradd">Add user</a></li> <li><a href="#" class="group">User groups</a></li> <li><a href="#" class="search">Find user</a></li> <li><a href="#" class="online">Users online</a></li> </ul> </li> </ul> </div> </div> ..help..anyone?? :'(
  18. hi guys. how do you expand or maximize a certain div while sort of hiding another div (in this case, a control panel) all in one click of a button or link? :-\
  19. hi guys, i hope you can help me on this. I have a link called "Set" which is located on "home.php" (first tab). Now, when i click this link, it should take me to "settings.php" (which is the second tab) and trigger open this fetched div content via iframe <div style="display: none;" id="tab_set_sy" class="tab_content"> <iframe src ="_tab_set_sy.php" width="100%"> <p>Sorry for the inconvenience but your browser doesn't support iframes.</p> </iframe> </div> which is inside <div id="sy" class="submenu"> <iframe src ="_admin_sy.php" width="99%" height="400" border="0"> <p>Your browser does not support iframes.</p> </iframe> </div> the purpose of this is to no longer click the link "schoolyear" (<ul class="tabs"><a class="menuitem submenuheader" href="#sy"> schoolyear</a></ul>) to toggle open the fetched content above which is <div id="tab_set_sy">. I am using the jquery accordion here guys. here.. <script type="text/javascript" src="js/ddaccordion.js"></script> <script type="text/javascript"> ddaccordion.init({ headerclass: "submenuheader", //Shared CSS class name of headers group contentclass: "submenu", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover" mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["prefix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } }) </script> anyone got ideas?
  20. thanks for the response. but how will i able to do that? do you have like an example i can work my code with? :-\
  21. Hi there. As the subject goes, when I click on a certain tab, I'd be happy if it would just "stay put" even when I click the refresh/reload button. The fetched contents are fine, it doesn't go back to the default content of the default tab when the page reloads. Only the tabs go back.. I'm using jquery here for the tabs as well as ajax to fetch contents into a div when a tab is selected. I'm a freshman to jquery and ajax so I'm clueless as of now. Please take a look at the code I'm working.. <script type="text/javascript"> $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("current").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("current"); //Remove any "active" class $(this).addClass("current"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </script> Please, do you have suggestions or ideas what or where I can put a code to make it work?? I'd be so glad if you guys can help me. :-\
  22. yes, i know that. i tried placing $setsy=$row['SchoolYear']; if($setsy==$sy) { $sql=mysql_query("UPDATE admin_sy SET school_year='$sy' WHERE id='$id'") or die(mysql_error()); $sql=mysql_query("UPDATE tblSetSY SET SchoolYear='$sy' WHERE id='$id'") or die(mysql_error()); } else{ $sql=mysql_query("UPDATE admin_sy SET school_year='$sy' WHERE id='$id'") or die(mysql_error()); } inside, but i won't get any updates..so there..i didn't have errors with it though..
  23. hi guys, i'm trying to update 2 tables here and if possible in one go. but i'm kinda stuck 'cause only one table gets updated..please have a look at my code (i bet think there are errors in it).. i'm using php and mysql <?php include("dbconnection_wmsuipil.php"); $id = $_POST['id']; $sy = $_POST['sy']; $check=mysql_query("SELECT SchoolYear FROM tblsetsy WHERE SchoolYear='$sy'")or die (mysql_error()); while($row = mysql_fetch_array($check)) { } $setsy=$row['SchoolYear']; if($setsy==$sy) { $sql=mysql_query("UPDATE admin_sy SET school_year='$sy' WHERE id='$id'") or die(mysql_error()); $sql=mysql_query("UPDATE tblSetSY SET SchoolYear='$sy' WHERE id='$id'") or die(mysql_error()); } else{ $sql=mysql_query("UPDATE admin_sy SET school_year='$sy' WHERE id='$id'") or die(mysql_error()); } ?> ..hope you guys can help.please inform me if it's not clear..
×
×
  • 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.