do
(
fnum=$(printf "%05d\n" "$num")
- echo "INSERT INTO emails (email) values ('z-popusr$fnum');";
+ echo "INSERT INTO emails (email) values ('z-popusr$fnum@example.com');";
)
done
// database table.
//
//==============================================================
-function sql_getnumrec($dbsql,$table)
+function sql_getnumrec($dbsql,$select,$table)
{
$OPEP="gessql.php:sql_getnumrec";
$recnum=NULL;
if ($dbsql!=NULL) {
- $stmt=$dbsql->Select("Select count(*) from $table");
+ $stmt=$dbsql->Select("Select count(*) from $table $select");
$recnum=$stmt->fetchColumn();
}
return $recnum;
return $stmt->fetchAll();
}
+//==============================================================
+//
+// Function to return the number of record within email
+// table according a select.
+//
+//==============================================================
+function sql_getnumemail($dbsql,$username)
+
+{
+$OPEP="gessql.php:sql_getnumemail";
+
+$select=NULL;
+if ($username!=NULL)
+ $select="where email like '%$username%'";
+return sql_getnumrec($dbsql,$select,"emails");
+}
?>
function body($logname)
{
+$OPEP="lvlusr.php:body";
+
global $isadmin;
global $logname;
$offset=0;
$username="";
$dbsql=sql_connect();
-$numrec=sql_getnumrec($dbsql,"emails");
if (isset($_POST['username']))
- $username=($_POST['username']);
-rou_alert(0,"Post jmpdbg=<$username>");
+ $username=trim(($_POST['username']));
if (isset($_POST['limit']))
$limit=intval($_POST['limit']);
if (isset($_POST['offset']))
$offset=intval($_POST['offset']);
+$numrec=sql_getnumemail($dbsql,$username);
if (isset($_POST['scanner'])) {
$scanner=$_POST['scanner'];
switch ($scanner) {
$offset=$numrec-$limit;
break;
case "gonext" :
+
$offset+=$limit;
if ($offset>($numrec-$limit))
$offset=$numrec-$limit;
break;
}
}
-$line="";
$emails=sql_getemaillist($dbsql,$username,$limit,$offset);
+$line="";
$count=$offset;
foreach($emails as $email) {
$bgcolor="white";