D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
managegp2.php
back
Copy
<?php if (!$_SESSION){ session_start(); } $acc=$_SESSION['acc']; $yto=$_SESSION['yto']; if(isset($acc) && ($acc=="administratoroftheduresult2018byto")){?> <?php include("Connecter/dataconn.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" /> <?php include("head.php"); ?> <style type="text/css"> .error { color:#990000; } </style> <script src="validator/lib/jquery.js"></script> <script src="validator/dist/jquery.validate.js"></script> <script> $().ready(function() { //Disable cut copy paste $('input.gnum').bind("cut copy paste",function(e) { e.preventDefault(); }); $('input.gnum2').bind("cut copy paste",function(e) { e.preventDefault(); }); $('input.gchar').bind("cut copy paste",function(e) { e.preventDefault(); }); $('input.gchar2').bind("cut copy paste",function(e) { e.preventDefault(); }); //Disable mouse right click $('input.gnum').on("contextmenu",function(e){ return false; }); $('input.gnum2').on("contextmenu",function(e){ return false; }); $('input.gchar').on("contextmenu",function(e){ return false; }); $('input.gchar2').on("contextmenu",function(e){ return false; }); //Prevents some keys from being entered //Allows numbers, backspaces. No characters, spaces or dot $('input.gnum').keypress(function(key) { if((key.charCode < 48 || key.charCode > 57) && key.charCode != 0 && key.charCode != 8 && key.charCode != 9) return false; }); //Allows numbers, backspaces and dot. No characters, spaces or dot $('input.gnum2').keypress(function(key) { if((key.charCode < 48 || key.charCode > 57) && key.charCode != 0 && key.charCode != 8 && key.charCode != 9 && key.charCode != 46) return false; }); //Allows characters, backspaces and hyphen. No numbers $('input.gchar').keypress(function(key) { if((key.charCode < 97 || key.charCode > 122) && (key.charCode < 65 || key.charCode > 90) && (key.charCode != 45) && key.charCode != 0 && key.charCode != 8 && key.charCode != 9) return false; }); //Allows characters, backspaces, hyphen and spaces. No numbers $('input.gchar2').keypress(function(key) { if((key.charCode < 97 || key.charCode > 122) && (key.charCode < 65 || key.charCode > 90) && (key.charCode != 45) && key.charCode != 0 && key.charCode != 8 && key.charCode != 9 && key.charCode != 32) return false; }); }); </script> <script src="jay/jquery-2.2.4.min.js"></script> <script src='jay/bootbox.min.js'></script> <link rel="stylesheet" href="jay/bootstrap.min.css"> <script src="jay/bootstrap.min.js"></script> <script> $(document).ready(function(){ $('.etom').blur(function(event){ var el = this; var dto = this.id; dto = "#" + dto; var dfrom = this.title; var splitid = dfrom.split("_"); var pos = splitid[1]; var itsfrom = "#from" + pos; dpos = parseInt(pos) + 1; var nextfrom = "#from" + dpos; var nextto = "#to" + dpos; if( $(dto).val()<=0 || $(dto).val()>=100 || $(dto).val()<=$(itsfrom).val() ){ $(dto).val(''); } else { $(nextfrom).val($(dto).val()); } if( $(dto).val()>=$(nextto).val() ){ if($(nextto).val()!=100){ $(nextto).val(''); } } }); $("#NewApply").submit(function(event){ var vname = 0; $('.etom').each(function(i, obj) { var el = this; var dto = "#to" + i; var itsfrom = "#from" + i; j = parseInt(i) + 1; var nextto = "#to" + j; var nextfrom = "#from" + j; if( $(dto).val()<0 || $(dto).val()>100 || parseInt($(dto).val()) <= parseInt($(itsfrom).val()) ){ vname=1; $(dto).val(''); } if( parseInt($(dto).val()) >= parseInt($(nextto).val()) ){ vname=1; if($(nextto).val()!=100){ $(nextto).val(''); } } if($(dto).val()==''){ vname=1; $(dto).css("background-color","#fcc3c5"); } if($(itsfrom).val()==''){ vname=1; $(itsfrom).css("background-color","#fcc3c5"); } }); //alert(vname) if(vname==1){ event.preventDefault(); bootbox.alert("Invalid Entry!"); } else { } }); }); </script> </head> <body> <?php include("top.php"); ?> <?php include("dtable0.php"); ?> <?php include("nav.php"); ?> <?php include("dtable1.php"); ?> <?php include("topcontainer.php"); ?> <!--Content Goes Here--> <div class="headingbiggest">Editing Grade Point (GP)</div> <div class="headingbigger">Please, fill the form accurately</div> <hr /> <?php if (isset($_POST['applystage1'])){ $hgp=$_POST['hgp']; ?> <form class="form-horizontal" role="form" id="NewApply" name="NewApply" method="post" action="managegp3.php"> <div style="width:80%; text-align:center; margin:0px auto;"> <table class="table table-striped"> <thead> <tr> <th>GP</th> <th>From</th> <th>To</th> </tr> </thead> <tbody> <?php for($i=0;$i<=$hgp;$i++){ ?> <tr> <td><input type="text" class="form-control gnum" name="gp<?php echo($i); ?>" value="<?php echo($i); ?>" required readonly size="1"></td> <td><input type="text" class="form-control gnum" id="from<?php echo($i); ?>" name="from<?php echo($i); ?>" value="<?php if($i==0){ echo($i); } ?>" required readonly size="1"></td> <td><input type="text" class="form-control gnum etom" id="to<?php echo($i); ?>" name="to<?php echo($i); ?>" value="<?php if($i==$hgp){ echo('100'); } ?>" required size="1" <?php if($i==$hgp){ echo('readonly'); } ?> title="pos_<?php echo($i); ?>"></td> </tr> <?php } ?> </tbody> </table> </div> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary" name="applystage2" id="applystage2" value="<?php echo($hgp); ?>"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> Proceed</button> </div> </div> </form> <?php } ?> <!--Content Ends Here--> <?php include("bottomcontainer.php"); ?> <?php include("dtable2.php"); ?> <?php include("side.php"); ?> <?php include("dtable3.php"); ?> <?php include("foot.php"); ?> </body> </html> <?php } else { include("ddadmin.php"); }?>