예제 #1
0
<?php
    include_once'flier_model.php';
    $flier = new FlierModel();

    include"BoloPDF/bolo_pdf.php";
    $doc = new bolo_pdf();

    $boloID = $_GET["id"];
    echo("BoloID is " . $boloID);
    //grab BOLO data from database
    include_once('Model_Bolo.php');
    $bolo = new Model_Bolo();

    $servername = "localhost";
    $username = "******";
    $password = "";
    $dbname = "bolo_creator";
            
    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);
    
    $dataQuery = <<<SQL
        SELECT *
        FROM `wp_flierform`
        WHERE bolo_id='$boloID';
SQL;
    $boloData = $conn->query($dataQuery);
    
    $row= $boloData->fetch_assoc();

    $resultId =  $row['bolo_id'];
    //set to true to display modal
    $showModal = true;
	
	//$_SESSION['showModal'] = TRUE;
	
	$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
	//if (stripos($ua, 'android') !== false || stripos($ua, 'iphone') !== false || stripos($ua, 'ipad') !== false) {
	//	$_SESSION['isMobile'] = TRUE;
	//}
    //session_write_close();
	header("Location: http://bolo.cs.fiu.edu/bolofliercreator/?page_id=6");
	//remove PDF info after it has been displayed
    $flier->remove_pdf($selectcat, $myName, $lastName, $dob, $DLnumber, $race, $sex, $height, $weight, $haircolor, $address, $tattoos,$summary, $adtnlinfo, $newfilename, $author, $agency, $link);
    
    //set to false so another BOLO may be shown
    $showModal = false;
}
//case the user clicks on Save as PDF (the flier will be saved on a diff table only for the PDFs, completely
//independent from the regular bolos)
else{	
	$flier->submit_pdf($selectcat, $myName, $lastName, $dob, $DLnumber, $race, $sex, $height, $weight, $haircolor, $address, $tattoos, $summary, $adtnlinfo, $newfilename, $author, $agency, $link);	
	
	$result = $flier->get_bolo();
	include"BoloPDF/bolo_pdf.php";
	$doc = new bolo_pdf();
	$doc->save_pdf($result, FALSE, $author);
	
}
 //session_unset();

?>