function createMeasure($x, $y, $theLayer, $themeasure, $npadata, $theFeature)
{
    global $pdf, $json, $bgdata, $targetLayer, $featureUniverse;
    //, $substrYear, $yearSuffix;
    // // //this block wordwraps
    // $pdf->SetTextColor(0,0,45);
    // $pdf->SetFont('Arial','B',10);
    // $pdf->Ln(5);
    // $pdf->Cell(0.3);$pdf->Write(0.2,WordWrap("themeasure = ".$npadata[$themeasure.$theDate], 75));
    // //value and title
    $pdf->SetTextColor(10, 0, 128);
    $pdf->SetY($y);
    $pdf->SetX($x);
    $pdf->Link($x, $y, 3.5, 0.22, 'http://compass.durhamnc.gov/index.html#/' . $theLayer . '/' . $themeasure . '/' . $theFeature);
    //.$substrYear.'/'.$theLayer.'/'.$themeasure.'/'.$theFeature);
    $pdf->SetFont('Arial', 'BU', 12);
    $pdf->MultiCell(3.5, 0.22, utf8_decode($json[$themeasure]['title']), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $npadata[$json[$themeasure]['field']] . " " . utf8_decode($json[$themeasure]['title']), 0, "L");
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Ln(0.07000000000000001);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->MultiCell(3.5, 0.15, $targetLayer . " Value: " . prettyData($npadata[$themeasure], $themeasure), 0, "L");
    //.$yearSuffix], $themeasure), 0, "L");
    $pdf->Ln(0.04);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->MultiCell(3.5, 0.15, $featureUniverse . " Average: " . getCountyAverage($themeasure), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $npadata[$json[$themeasure]['field']] . " " . utf8_decode($json[$themeasure]['title']), 0, "L");
    // what it is
    $pdf->Ln(0.15);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "What is this Indicator?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure]['description'])), 0, "L");
    // // why it's important
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "Why is this Important?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure]['importance'])), 0, "L");
    // about the data
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "About the Data");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure]['tech_notes'])) . "\n\n" . utf8_decode(strip_tags($json[$themeasure]['source'])), 0, "L");
}
function createMeasure($x, $y, $theLayer, $themeasure, $theID)
{
    global $pdf, $json, $npadata, $bgdata;
    // value and title
    $pdf->SetTextColor(0, 0, 0);
    $pdf->SetY($y);
    $pdf->SetX($x);
    $pdf->Link($x, $y, 3.5, 0.15, 'http://durham-compass.durhamnc.gov/compass/app/index.html#/' . $theLayer . '/' . $themeasure . '/' . $theID);
    $pdf->SetFont('Arial', 'B', 12);
    $pdf->MultiCell(3.5, 0.15, prettyData($npadata[$json[$themeasure]["field"]], $themeasure) . " " . utf8_decode($json[$themeasure][title]), 0, "L");
    // what it is
    $pdf->Ln(0.15);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->Write(0, "What is this Indicator?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 9);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure][description])), 0, "L");
    // why it's important
    $pdf->Ln(0.15);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->Write(0, "Why is this Important?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 9);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure][importance])), 0, "L");
    // about the data
    $pdf->Ln(0.15);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->Write(0, "About the Data");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 9);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$themeasure][tech_notes])) . "\n\n" . utf8_decode(strip_tags($json[$themeasure][source])), 0, "L");
}
示例#3
0
function createMeasure($x, $y, $theLayer, $themeasure, $featuredata, $theFeature)
{
    global $pdf, $json, $bgdata, $targetLayer, $featureUniverse, $substrYear, $yearSuffix;
    // // //this block wordwraps
    // $pdf->SetTextColor(0,0,45);
    // $pdf->SetFont('Arial','B',10);
    // $pdf->Ln(5);
    // $pdf->Cell(0.3);$pdf->Write(0.2,WordWrap("themeasure = ".$featuredata[$themeasure.$theDate], 75));
    // //this block wordwraps
    // $pdf->SetTextColor(0,0,45);
    // $pdf->SetFont('Arial','B',10);
    // $pdf->Ln(5);
    // $pdf->Cell(0.3);$pdf->Write(0.2,WordWrap("theOID = ".implode(" ",$featuredata), 75));
    $measureRoot = substr($themeasure, 0, -3);
    $thisMeasure = $measureRoot . $yearSuffix;
    // //value and title
    $pdf->SetTextColor(10, 0, 128);
    $pdf->SetY($y);
    $pdf->SetX($x);
    $pdf->Link($x, $y, 3.5, 0.22, 'http://compass.durhamnc.gov/#/' . $substrYear . '/' . $theLayer . '/' . $measureRoot . '/' . $theFeature);
    $pdf->SetFont('Arial', 'BU', 12);
    $pdf->MultiCell(3.5, 0.22, utf8_decode($json[$thisMeasure]['title']), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $featuredata[$json[$themeasure]['field']] . " " . utf8_decode($json[$themeasure]['title']), 0, "L");
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Ln(0.07000000000000001);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    // $keys = array('red', 'green', 'blue');
    // $values = array('car', 'bike', 'truck');
    // $finalArray = array();
    // $finalArray = array_combine($keys, $values);
    // $red = 'POP_14';
    //TODO - fix this
    $pdf->MultiCell(3.5, 0.15, $targetLayer . " Value: " . prettyData($featuredata, $thisMeasure), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $targetLayer." Value: ".);//prettyData($featuredata[$themeasure.$yearSuffix], $themeasure), 0, "L");
    //TODO - fix this too
    $pdf->Ln(0.04);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 10);
    $pdf->MultiCell(3.5, 0.15, $featureUniverse . " Average: " . getCountyAverage($featuredata, $thisMeasure), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $featureUniverse." Average: ".getCountyAverage($themeasure), 0, "L");
    // $pdf->MultiCell(3.5, 0.15, $featuredata[$json[$themeasure]['field']] . " " . utf8_decode($json[$themeasure]['title']), 0, "L");
    // // what it is
    $pdf->Ln(0.15);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "What is this Indicator?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$thisMeasure]['description'])), 0, "L");
    // // why it's important
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "Why is this Important?");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$thisMeasure]['importance'])), 0, "L");
    // about the data
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', 'B', 9);
    $pdf->Write(0, "About the Data");
    $pdf->Ln(0.1);
    $pdf->SetX($x);
    $pdf->SetFont('Arial', '', 8);
    $pdf->MultiCell(3.5, 0.15, utf8_decode(strip_tags($json[$thisMeasure]['tech_notes'])) . "\n\n" . utf8_decode(strip_tags($json[$thisMeasure]['source'])), 0, "L");
}