$G_filename = $_POST["filename"];
 $handle = fopen("../../../temp/" . $G_filename . ".csv", "wb");
 $result = mysql_query("SELECT * FROM groups");
 //fwrite ($handle, 0);
 while ($row = mysql_fetch_array($result)) {
     $G_id = $row["id"];
     fwrite($handle, $row["name"] . ",第一志愿\r\n");
     $resultx = mysql_query("SELECT * FROM users WHERE belong1 = {$G_id}");
     while ($rowx = mysql_fetch_array($resultx)) {
         fwrite($handle, $rowx["id"] . "," . $rowx["name"] . "," . GetGenderName($rowx["gender"]) . "\r\n");
     }
     fwrite($handle, "\r\n");
     fwrite($handle, $row["name"] . ",第二志愿\r\n");
     $resultx = mysql_query("SELECT * FROM users WHERE belong2 = {$G_id}");
     while ($rowx = mysql_fetch_array($resultx)) {
         fwrite($handle, $rowx["id"] . "," . $rowx["name"] . "," . GetGenderName($rowx["gender"]) . "\r\n");
     }
     fwrite($handle, "\r\n");
 }
 fclose($handle);
 //sleep(3000);
 header("Content-Type: application/download");
 header("Content-Type: text/csv;");
 header('Content-Disposition: attachment; filename="' . $G_filename . '.csv"');
 //header ("Content-Encoding: gb2132");
 $ans = "../../../temp/" . $G_filename . ".csv";
 //$anstemp = "../../../temp/"."temp".".csv";
 //exec("iconv -f UTF8 -t gb2312 " . $ans . " > ../../../temp/temp.csv");
 //exec("rm " . $ans);
 //exec("mv " . $anstemp . " " . $ans);
 readfile($ans);
Exemplo n.º 2
0
									<span class="tagList">
										<a class="tagLink tagType1">第一志愿</a>
									</span>
								</div>
							</div>
							</td>
							
							<td class="list-td lc4"><?php 
    echo GetGradeClass($row["id"]);
    ?>
</td><td class="list-td lc5"><?php 
    echo GetNumber($row["id"]);
    ?>
</td>
							<td class="list-td lc6"><?php 
    echo GetGenderName($row["gender"]);
    ?>
</td>
						</tr>
					<?php 
}
?>
				
				</tbody>
		</table>

		<div class="block-more enabled">总共<?php 
echo $member_count;
?>
个第一志愿申请者</a></div>
		
Exemplo n.º 3
0
<div class="widget-node block">
	<div class="block-content">
		<div class="colorize">
			<?php 
if (isset($_SESSION["UName"]) && $_SESSION["UName"]) {
    ?>
					<h2 class="colorize-h2">用户信息</h2>
					
					<div class="colorize-content">
						<div class="title"><strong>我的关键字</strong></div>
						<div class="list">
							我叫<?php 
    echo $_SESSION["UName"];
    ?>
,是个<?php 
    echo GetGenderName(GetGenderByName($_SESSION["UName"]));
    ?>
生,来自<?php 
    echo GetGrade(GetIDByName($_SESSION["UName"]));
    ?>
届的<?php 
    echo GetClass(GetIDByName($_SESSION["UName"]));
    ?>
班,我的学号是<?php 
    echo GetNumber(GetIDByName($_SESSION["UName"]));
    ?>
号。
						</div>

						<div class="title"><strong>我能干什么</strong></div>
						<div class="list">