コード例 #1
0
&pl=<?php 
echo $part_finder->product_line;
?>
&make=<?php 
echo $makes[$x];
?>
&unit='><?php 
echo $part->part_number;
?>
</a></div>
				<div class='long1'><?php 
echo cp1252_to_utf8($part->description);
?>
</div>
				<div class='med'><?php 
echo cp1252_to_utf8($part->notes);
?>
</div>
				<?  
				$make = new Make($makes[$x]);
				$make_name = $make->make;
				$units =  $part->getUnitsContainingPart($makes[$x]);
				$unitsUpperBound = count($units) - 1;
				unset($unitList);
				for ($y=0; $y <= $unitsUpperBound; $y++) {
					$brief_unit = new UnitBrief($units[$y]);
					if ($y < $unitsUpperBound) {
						$unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>, ";
					} else {
						$unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>";
					}
コード例 #2
0
						&id=<?php 
echo $part->id;
?>
&pl=<?php 
echo $part_finder->product_line;
?>
&rdir=<?php 
echo urlencode($rd);
?>
'><?php 
echo $part->part_number;
?>
</a>
			</div>
			<div class='long1' style='width:380px;'><?php 
echo cp1252_to_utf8($part->description);
?>
</div>
			<div class='short'>&nbsp;</div>
			<div class='line'></div>
			<?
		}
		?>
		<div class="cleaner"></div>
		</div>
		<div class="cleaner"></div>
		<?
	} else {
		// no parts in the stack
		?>
		<div class="cleaner"></div>
コード例 #3
0
function ConvertToUTF_8($encoding, $charset, $body)
{
    $charset = strtolower($charset);
    $encoding = strtolower($encoding);
    switch ($charset) {
        case "iso-8859-1":
            $body = utf8_encode($body);
            break;
        case "iso-2022-jp":
            $body = iconv("ISO-2022-JP//TRANSLIT", "UTF-8", $body);
            break;
        case $charset == "windows-1252" || $charset == "cp-1252" || $charset == "cp 1252":
            $body = cp1252_to_utf8($body);
            break;
        case $charset == "windows-1256" || $charset == "cp-1256" || $charset == "cp 1256":
            $body = iconv("Windows-1256//TRANSLIT", "UTF-8", $body);
            break;
        case 'koi8-r':
            $body = iconv("koi8-r//TRANSLIT", "UTF-8", $body);
            break;
        case 'iso-8859-2':
            $body = iconv("iso-8859-2//TRANSLIT", "UTF-8", $body);
            break;
    }
    return $body;
}
コード例 #4
0
function tfu_text($file)
{
    if (is_writable($file)) {
        echo '&writeable=true';
    } else {
        echo '&writeable=false';
    }
    echo '&data=';
    $enc = 'UTF-8';
    $format = 'UNIX';
    $fp = fopen($file, 'rb');
    $content = fread($fp, filesize($file));
    // we replace \r with nothing
    $content_new = str_replace("\r", "", $content);
    if ($content_new != $content) {
        $format = 'DOS';
    }
    if (!tfu_seems_utf8($content_new)) {
        $content_new = cp1252_to_utf8($content_new);
        $enc = 'ANSI';
    }
    echo urlencode($content_new);
    echo '&encoding=' . $enc;
    echo '&format=' . $format;
    fclose($fp);
}
コード例 #5
0
?>
</div>
							<div class='longest'><?php 
echo cp1252_to_utf8($arr_data["unit_components.description"][$x]);
?>
</div>
							<div class='longest'><?php 
echo $arr_data["unit_components.torque_fuse_options"][$x];
?>
</div>
							<div class='longest'><?php 
echo $arr_data["unit_components.pts_series"][$x];
?>
</div>
							<div class='longest'><?php 
echo cp1252_to_utf8($arr_data["unit_components.notes"][$x]);
?>
</div>
							<div class="line"></div>
						<?}
					} else {
						// no parts in the stack
						?>
						<div class="cleaner"></div>
						<div class='long1' style='width:760px;text-align:center;font-weight:bold;font-size:16px;'><?php 
echo $part_finder->search_message;
?>
</div>
						<?
					}
					?>					
コード例 #6
0
ファイル: generate.php プロジェクト: ctcit/newsletter
     header("Content-Disposition: inline; filename={$filename}.{$random}.{$ext}");
     echo $data;
     break;
 case "htm":
 case "html":
     $data = $_GET["id"] == "" ? $data : $generator->PrepareHtml($data);
     $data = $_GET["bookmark"] == "" ? $data : '<a name="bookmark">' . $data . '</a>';
     $len = strlen($data);
     header("Content-type: text/html");
     header("Content-length: {$len}");
     header("Content-Disposition: inline; filename={$filename}.{$random}.{$ext}");
     echo $data;
     break;
 case "xml":
     if ($_GET["expand"] != "") {
         $data = cp1252_to_utf8($generator->GenerateXml($data));
         $len = strlen($data);
     }
     header("Content-type: text/xml; charset=utf-8");
     header("Content-length: {$len}");
     header("Content-Disposition: attachment; filename={$filename}.{$random}.xml");
     echo $data;
     break;
 case "odt":
     if ($_GET["expand"] != "") {
         $data = $generator->GenerateOdt($data);
         $len = strlen($data);
     }
     header("Content-type: application/odt; charset=utf-8");
     header("Content-length: {$len}");
     header("Content-Disposition: attachment; filename={$filename}.odt");
コード例 #7
0
		<?
	}
}
?>

<p><strong>Part Number:</strong>&nbsp;<?=$Part->part_number?></p>
<?if ($product_line_id == 9) {
	if (strlen($Unit_Component->arrayList["unit_components.description"][0]) > 0){?>
	<p><strong>Description:</strong>&nbsp;<?=cp1252_to_utf8($Unit_Component->arrayList["unit_components.description"][0])?></p>
	<?}
	if (strlen($Unit_Component->arrayList["unit_components.notes"][0]) > 0){?>
	<p><strong>Notes:</strong>&nbsp;<?=cp1252_to_utf8($Unit_Component->arrayList["unit_components.notes"][0])?></p>
	<?}
} else {?>
<p><!-- description1 --><?=cp1252_to_utf8($Part->description)?></p>
<p><!-- description2 --><?=cp1252_to_utf8($Part->notes)?></p>
<?}?>

<?php
// Part Summay and Instruction go here for certain PLs
if ($product_line_id == "3" || $product_line_id == 3 || $product_line_id == "12" || $product_line_id == 12 || $product_line_id == "14" || $product_line_id == 14) {?>	
<!-- Show ONLY for TS SC and TT -->
	<h4 style="text-align:center;">
	<?if (file_exists($global_announcement_directory_abs.$Part->announcement) && (strlen($Part->announcement) > 0)) {?>
	<a href="<?=$global_announcement_directory_rel.$Part->announcement?>">Part Summary</a><img src="images/spacer.jpg" width="30" height="1" alt="spacer">
	<?}?>
	<?if (file_exists($global_instructions_directory_abs.$Part->instructions) && (strlen($Part->instructions) > 0)) {?>
	<a href="<?=$global_instructions_directory_rel.$Part->instructions?>">Instructions</a><img src="images/spacer.jpg" width="30" height="1" alt="spacer">
	<?}?>
	</h4>
<?} elseif ($product_line_id == "2" || $product_line_id == 2) {?>	
コード例 #8
0
ファイル: tfu_file.php プロジェクト: jmp0207/w3studiocms
         echo "&writeable=true";
     } else {
         echo "&writeable=false";
     }
     echo "&data=";
     $enc = "UTF-8";
     $format = "UNIX";
     $fp = fopen($file, "rb");
     $content = fread($fp, filesize($file));
     // we replace \r with nothing
     $content_new = str_replace("\r", "", $content);
     if ($content_new != $content) {
         $format = "DOS";
     }
     if (!seems_utf8($content_new)) {
         $content_new = cp1252_to_utf8($content_new);
         $enc = "ANSI";
     }
     print $content_new;
     echo "&encoding=" . $enc;
     echo "&format=" . $format;
     fclose($fp);
 } else {
     if ($action == "savetext") {
         // save a textfile
         $content = urldecode($_POST['data']);
         if ($_POST['encoding'] == "ANSI") {
             $content = utf8_to_cp1252($content);
         }
         if ($_POST['format'] == "DOS") {
             $content = preg_replace('/\\r\\n|\\r|\\n/', chr(13) . chr(10), $content);