Jump to content

dbnet

New Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by dbnet

  1. Please help me with this:

    with this code i have only fetched out the subjects and i need to fetch out value for the following too from the database

    1. GRADE

    2. Contious Assessment:

    3. Exam Scores:

    4. Exam Scores

    5. Weighted Average:

    6. Last Term Cummulative:

    7. Cumulative  (c+d)/2:

    8. Comment:

    but now i can only get the foreach work for subject alone..

     

     

    $l=mysql_query("SELECT * FROM result WHERE school_id='$id' AND student_reg_id='$st'") or die (mysql_error());

     

    if (mysql_num_rows($l) > 0)

    {

    while ($row = mysql_fetch_array($l))

    {//

    $pwrlist[$row['ajax_result_id']]=$row['subject'];

    //$

    }

    $numpwr = count($pwrlist);

    $thresh = 3;

    $maxcols = 18;

    $cols = min($maxcols, (ceil(count($pwrlist)/$thresh)));

    $percol = ceil(count($pwrlist)/$cols);

    $powerchk = '';

    $i = 0;

    foreach ($pwrlist as $id => $pwr)

    {

    if (($i>0) && ($i%$percol == 0))

    {

    $powerchk .= "</td>\n<td valign='top'>";//echo "<br>";

    }

     

     

    $powerchk .= " <table width='280px' class='hovertable'>

     

                    <tr>

                      <td width='251px' height='34' align='left' valign='middle' bgcolor='#D6DFEB'><span class='style19'><font size=2px>$pwr</font></span></td>

                      <td width='19px' align='left' valign='middle' bgcolor='#D6DFEB'><span class='style1'>GRADE:</span></td>

                      <td width='20px' align='left' valign='middle' bgcolor='#FFFFFF'><span class='style13'>B3</span></td>

                    </tr>

                    <tr>

                      <td height='34' colspan='3' align='left' valign='top' bgcolor='#FFFFFF'><span class='style20'>» (a) Contious Assessment: 80<br />

                        » (b) Exam Scores: 90<br />

                        » © Weighted Average: 168<br />

                        » (d) Last Term Cummulative: 78<br />

                        » (e) Cumulative  (c+d)/2: 123 </span></td>

                    </tr>

                    <tr>

                      <td height='20' colspan='3' align='left' valign='top' bgcolor='#FFFFFF'><span class='style17'>Comment: His is a responsible boy</span></td>

                    </tr>

                </table><br>\n";

    $i++;

    }

     

    }

  2. Please any kind hearted person should help me out, the code below is what i use to upload file...it worked locally but online it refused to move uploaded files into the destination folder. Please help me.

     

     

    function findexts ($filename)

    {

    $filename = strtolower($filename) ;

    $exts = split("[/\\.]", $filename) ;

    $n = count($exts)-1;

    $exts = $exts[$n]; return

    $exts;

    }

     

     

    $s=rand(1000000000,9999999999);

    $_SESSION['slot_id']=$s;

    if(isset($_POST['upload'])){

    $uploaded=check_input(trim($_FILES['uploaded']));

    if($_FILES['uploaded']['name']==""){

    $msg="Upload Image Please";

    header("Location:index.php?msg=$msg");

    exit();

    }

    $ext = findexts ($_FILES['uploaded']['name']) ;//  exit;

    //$ran = rand () ;

    //echo $id;exit;

    $ran = $_SESSION['slot_id'];

    $ran2 =$ran."."; //<img src="passport/1267290864.jpg" />

    $target = 'passport/image/'."/";

     

    //if ($_FILES['uploaded']['type'] != "image/jpg"){

    if ($ext != "jpg") {

    $msg="Invalide Image Type; Upload jgp only";

    header("location:index.php?msg=$msg");

    exit();

    }

     

    $limit="100200";

    if($_FILES['uploaded']['size']>$limit){

    $msg="Image too big. Image must not exceed 100kb";

    header("location:index.php?msg=$msg");

    exit();

    }

    $mm=$ran2.$ext;

    $targt = $target . $mm;

    // move_uploaded_file($_FILES['uploaded']['tmp_name'], $targt);

     

     

    $ct=$_FILES['uploaded']['tmp_name'];

    //$destination='passport/image/'."/".$_FILES['uploaded']['name']; exit; echo

    move_uploaded_file($ct,$targt)or die("Image Size is Too Big");

     

      $_SESSION['mcm']=$mm;

    header("location:index.php");

    exit();

    }

  3. wildteen88 i thank u very much for ur quick response. I know i could do it that way if i write the php code in the same page where am having the form but i dont want to write it that way. please is there any other way?

    once again thank you for ur help

  4. To those of kind hearts to respond to my qtn here. i dont want my users to retype a long form over again because they made mistake at first. please i need a php code that retain fields data.

    thank you in anticipation for your help

×
×
  • 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.