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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php

 
echo '<h1><a href="view-code-maricopa-az-inmates.php">VIEW SOURCE CODE</a></h1>';

include 
'connectsqldb.php';

    
set_time_limit(0);
    
ignore_user_abort(1);
    
ini_set("allow_url_fopen""On");
 
 
 
    
$url 'https://www.mcso.org/mugshot';
      
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$url);
     
curl_setopt($chCURLOPT_RETURNTRANSFER1);
          
$datas1 str_replace ('""','"',curl_exec($ch));
   
curl_close($ch);

    
$sd explode ('href="/Mugshot/GetMugshotDetails?bookingNumber=',$datas1);
 unset(
$sd[0]);
 foreach (
$sd as $snom)
 
//$a = array('T335005','T335002','T335007','T335006','T335008');
 //foreach ($a as $snom)
 
{
     
$sbookingnumber explode ('"',$snom);
     
$bookingnumber $sbookingnumber[0];
     
     
         
$query1 mysql_query("SELECT `BookingNumber` FROM Arizona_Maricopa_Details WHERE BookingNumber='$bookingnumber' ");
if(
mysql_num_rows($query1) > 0){
    echo 
"this user already exists in the database!";
}
Else {    
     
      echo 
'<hr>bookingnumber='.$bookingnumber.'<hr>';
     
    
// $bookingnumber = $b;
    
echo $url2 'https://www.mcso.org/Mugshot/GetMugshotDetails?bookingNumber='.$bookingnumber;
    
$ch2 curl_init();
    
curl_setopt($ch2CURLOPT_URL$url2);
    
curl_setopt($ch2CURLOPT_RETURNTRANSFER1);
         
$datas12 str_replace ('""','"',curl_exec($ch2));
    
curl_close($ch2);
     
         
$sn explode ('&nbsp;'$datas12);
    
$sn1 explode ('</h4>'$sn[1]); 
$namesvar strip_tags($sn1[0]);
$secondname preg_split('/\s+/'$namesvar);
$firstname trim($secondname [1]);
if (!empty(
$secondname [3])) 
{
$middlename $secondname [2];$lastname=$secondname[3];}
ELSE 
{
$middlename '';
$lastname $secondname [2];}
 
$firstname str_replace(array("\t""\r""\n"" "), "",$firstname); 
$lastname str_replace(array("\t""\r""\n"" "), "",$lastname); 
$middlename str_replace(array("\t""\r""\n"" "), "",$middlename); 
$fullname $lastname.', '.$firstname.' '.$middlename;

echo 
'first='.$firstname.'<hr>';
echo 
'middle='.$middlename.'<hr>';
echo 
'last='.$lastname.'<hr>';
 

 
 
$demo strip_tags($datas12,'<br><div><pre><style><li><ul><ol><h1><h2><h3><h4><label><p><table><tbody><td><hr><tr><th><strong><span>');
 
//echo $demo;

 
 
$setimg explode ('src="https://www.mcso.org/Images/Mugshots',$datas12);
$ssss explode ('"',$setimg[1]);
$externalmugurl 'https://www.mcso.org/Images/Mugshots'.$ssss[0];
echo 
'<img src="'.$externalmugurl.'"><hr>';    
echo 
'externalmugurl='.$externalmugurl.'<hr>';    

    
$internalmugurl 'https://mugshotcity.com/mugshots/arizona/maricopa/'.$lastname."-".$bookingnumber.'.jpg';
echo 
'internalmugurl='.$internalmugurl.'<hr>';

     
$totalbond 0
echo 
'<hr>totalbond='.$totalbond.'<hr>';
echo 
'<h2>URL Created</h2><hr>';
echo 
'https://www.bailbondsearch.com/arizona/maricopa-inmate-'.$lastname.'/'.$bookingnumber;


echo 
'<hr>';

    

$sql 'INSERT INTO Arizona_Maricopa_Details'.
       
'( BookingNumber, FullName, LastName, FirstName, MiddleName, DemoTable, TotalBond, ExternalIMG, InternalIMG  )'.
   
'VALUES ( "'.mysql_real_escape_string($bookingnumber).'", "'.mysql_real_escape_string($fullname).'", "'.mysql_real_escape_string($lastname).'", "'.mysql_real_escape_string($firstname).'", "'.mysql_real_escape_string($middlename).'", "'.mysql_real_escape_string($demo).'", "'.mysql_real_escape_string($totalbond).'", "'.mysql_real_escape_string($externalmugurl).'", "'.mysql_real_escape_string($internalmugurl).'" )';
//echo '<P><HR>  SQL  '.$sql.'<HR>';
unset($totalbond);
$retval mysql_query$sql );
if(! 
$retval )
{
  die(
'Could not enter data: ' mysql_error());
}
echo 
'Entered data successfully<br><hr>';

 
$jpgext ".jpg";
$imagefile $lastname."-".$bookingnumber.$jpgext;
$imagetowrite '/home/mugshotcity/public_html'.'/mugshots/arizona/maricopa/'.$imagefile;
    if (
file_exists($imagetowrite)) {
 echo 
'The file ' $imagetowrite ' exists';
  echo 
'<br>';
    } 
    else {
echo 
"*********DOWNLOADING**************";
 echo 
'<br>';
 
copy($externalmugurl$imagetowrite);
echo 
$imagetowrite 'has been downloaded';
  echo 
'<br>';
  echo 
"*********DOWNLOADING**************";
}

}    
 

echo 
'<hr><br>';


 }
mysql_close();
    
    

 
?>