-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.UidGenerator.php
More file actions
80 lines (74 loc) · 2.2 KB
/
class.UidGenerator.php
File metadata and controls
80 lines (74 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
class UidGenerator
{
public function uid_gen_testimonial()
{
//$pid_check=1;
//$count=0;
//while($pid_check) //profile id checking in database
//{
global $pid;
$min=1000;//$max=50000;
$my_pid=rand(1,1000);
$milliseconds = round(microtime(true) * 1000);
$pid=$my_pid.$milliseconds;
// $fetch_pid=mysql_query("select testimonial_id from testimonial where testimonial_id='$pid'");
// $fetch_row=mysql_num_rows($fetch_pid);
//
// if($fetch_row)
// {
// $pid_check=1;
// $count++;
// if($count>$max)
// {
// //echo "Profile id limit out of range";
// echo "Something went wrong contact admin";
// exit;
// }
// }
//
// else
// {
// $pid_check=0;
//
// }
//}
return $pid;
}
public function uid_gen_contact()
{
//$pid_check=1;
//$count=0;
//while($pid_check) //profile id checking in database
//{
global $pid;
$min=1000;//$max=50000;
$my_pid=rand(1,1000);
$milliseconds = round(microtime(true) * 1000);
$pid=$my_pid.$milliseconds;
// $fetch_pid=mysql_query("select contact_id from contact where contact_id='$pid'");
// $fetch_row=mysql_num_rows($fetch_pid);
//
// if($fetch_row)
// {
// $pid_check=1;
// $count++;
// if($count>$max)
// {
// //echo "Profile id limit out of range";
// echo "Something went wrong contact admin";
// exit;
// }
// }
//
// else
// {
// $pid_check=0;
//
// }
//
// }
return $pid;
}
}
?>