Jump to content

Search the Community

Showing results for tags 'exportingtocsv'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. <?php <?php if(isset($_REQUEST['testid'])) { /************************** Step 3 - Case 2 *************************/ // Displays the Existing Test Results in detail, If any. $result=executeQuery("select t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as todate,sub.subname,IFNULL((select sum(marks) from question where testid=".$_REQUEST['testid']."),0) as maxmarks from test as t, subject as sub where sub.subid=t.subid and t.testid=".$_REQUEST['testid'].";") ; if(mysql_num_rows($result)!=0) { $r=mysql_fetch_array($result); ?> <table class="table table-striped"> <tr> <td colspan="2"><h3 style="color:#0000cc;text-align:center;">Test Summary</h3></td> </tr> <tr> <td colspan="2" ><hr style="color:#ff0000;border-width:4px;"/></td> </tr> <tr> <td>Test Name</td> <td><?php echo htmlspecialchars_decode($r['testname'],ENT_QUOTES); ?></td> </tr> <tr> <td>Subject Name</td> <td><?php echo htmlspecialchars_decode($r['subname'],ENT_QUOTES); ?></td> </tr> <tr> <td>Validity</td> <td><?php echo $r['fromdate']." To ".$r['todate']; ?></td> </tr> <tr> <td>Max. Points</td> <td><?php echo $r['maxmarks']; ?></td> </tr> <tr><td colspan="2"><hr style="color:#ff0000;border-width:2px;"/></td></tr> <tr> <td colspan="2"><h3 style="color:#0000cc;text-align:center;">Attempted Students</h3></td> </tr> <tr> <td colspan="2" ><hr style="color:#ff0000;border-width:4px;"/></td> </tr> </table> <form name="getcvs" action="try.php" method="POST"> <?php $result1=executeQuery("select s.stdname,s.stdlastname,s.emailid,IFNULL((select sum(q.marks) from studentquestion as sq,question as q where q.qnid=sq.qnid and sq.testid=".$_REQUEST['testid']." and sq.stdid=st.stdid and sq.stdanswer=q.correctanswer),0) as om from studenttest as st, student as s where s.stdid=st.stdid and st.testid=".$_REQUEST['testid'].";" ); if(mysql_num_rows($result1)==0) { ?> <center><div class="alert alert-success">No student attempted this test.</div> </center> <?php } else { ?> <table class="table table-striped"> <tr> <th>Student Name</th> <th>Email-ID</th> <th>Obtained Points</th> <th>Result(%)</th> </tr> <?php while($r1=mysql_fetch_array($result1)) { ?> <tr> <td><input type="text" value="<?php echo htmlspecialchars_decode($r1['stdname'],ENT_QUOTES);?> <?php echo htmlspecialchars_decode($r1['stdlastname'],ENT_QUOTES); ?>" name="std"</td> <td><input type="text" value="<?php echo htmlspecialchars_decode($r1['emailid'],ENT_QUOTES); ?>" name="em"/></td> <td><input type="text" value="<?php echo $r1['om']; ?>" name="om"/></td> <td><input type="text" value="<?php echo ($r1['om']/$r['maxmarks']*100)." %"; ?>" name="mm"/></td> </tr> </form> <?php } } } else { ?> <center> <div class="alert alert-success">Something went wrong. Please logout and Try again.</div></center> <?php } ?> </table> <input type="submit" name="submit" value="Download Excell File" class="btn btn-success" /> </form> <?php } else { /************************** Step 3 - Case 2 *************************/ // Defualt Mode: Displays the Existing Test Results, If any. $result=executeQuery("select t.testid,t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as todate,sub.subname,(select count(stdid) from studenttest where testid=t.testid) as attemptedstudents from test as t, subject as sub where sub.subid=t.subid and t.tcid=".$_SESSION['tcid'].";"); if(mysql_num_rows($result)==0) { ?> <center> <div class="alert alert-success">There is no examination yet.</div> </center> <?php } else { $i=0; ?> <table class="table table-striped"> <tr> <th>Test Name</th> <th>Validity</th> <th>Subject Name</th> <th>Attempted Students</th> <th>Details</th> </tr> <?php while($r=mysql_fetch_array($result)) { $i=$i+1; if($i%2==0) { echo "<tr class=\"alt\">"; } else { echo "<tr>";} echo "<td>".htmlspecialchars_decode($r['testname'],ENT_QUOTES)."</td><td>".$r['fromdate']." To ".$r['todate']." PM </td>" ."<td>".htmlspecialchars_decode($r['subname'],ENT_QUOTES)."</td><td>".$r['attemptedstudents']."</td>" ."<td class=\"tddata\"><a title=\"Details\" href=\"rsltmng.php?testid=".$r['testid']."\"><img src=\"../images/detail.png\" height=\"30\" width=\"40\" alt=\"Details\" /></a></td></tr>"; } ?> </table> <?php } } closedb(); } ?> I NEED TO EXPORT STUDENTNAME,LASTNAME EMAILID , OBTAINED POINTS ['om'] and maxmarks ['maxmarks'] Can you please give me a script to export those ? PLEASE
×
×
  • 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.