Ejemplo n.º 1
0
    <td><?php 
echo $get_detail['nama_jurusan'];
?>
</td>
  </tr>
  <tr>
    <td>Lowongan Kerja</td>
    <td><?php 
echo $get_detail['judul_loker'];
?>
</td>
  </tr>
  <tr>
    <td>Tanggal Lowongan</td>
    <td><?php 
echo date_convert($get_detail['tgl_loker']);
?>
</td>
  </tr>
  <tr>
    <td>Jumlah Requitment</td>
    <td><?php 
echo $get_detail['jumlah_requitment'];
?>
 Orang</td>
  </tr>
  <tr>
    <td>Deskripsi Loker</td>
    <td><?php 
echo $get_detail['deskripsi_loker'];
?>
Ejemplo n.º 2
0
/**
 * Checks whether the date has a valid format for displaying
 *
 * @param date $date date to be checked
 * @return boolean true if the date can be displayed, false if not
 */
function is_valid_date($date)
{
    $date = date_convert($date, DEFAULT_DATE_FORMAT);
    return $date != '' && $date != '01.01.1970' && $date != '30.11.-0001';
}
Ejemplo n.º 3
0
function build_customer_pdf($order_id, $person_id, $client = true)
{
    $system_settings = get_settings();
    $order = order_get($order_id);
    $person = person_get($person_id);
    $contacts = contact_get_by_party($person_id, COMPANY_CONTACT);
    $affiliate = person_affiliate_get($person_id);
    // Dealing with shipments
    $shipment = shipment_get($order_id);
    if ($shipment['DESTINATION_CONTACT_MECH_ID'] == SHIPMENT_REQUISITION) {
        $delivery_address = 'In requisions files';
    } else {
        $attributes = contact_mech_get_attributes($shipment['DESTINATION_CONTACT_MECH_ID']);
        $delivery_address = contact_generate_string($attributes, '<br />');
    }
    $content = '
	<page backtop="30mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12px; font-family: Arial; margin-top: 150px;">

		<!-- Page header -->
		<page_header style="margin-left: 20px; height: 400px; margin-bottom: 40px;">
			<table style="margin-left: 15px;">
				<tr>
					<td style="width: 530px;">
						<div style="background-color: #63cdf5; padding-left: 10px;">
							<h1>Order #' . $order_id . '</h1>
						</div>
					</td>
					<td>';
    if ($client) {
        $content .= '<img style="width: 200px;" src="./themes/megamedia/img/website-logo-big.png">';
    }
    $content .= '</td></tr>
			</table>
			<div style="clear: both"></div>
		</page_header>


		<!-- Metadata -->
		<table style="margin-left: -30px;" cellspacing="10" cellspadding="0">
			<tr>
				<td style="width: 390px; vertical-align:top; border: 1px solid #fcb040; border-top: none; padding:0; padding-bottom: 10px;">
					<div style="background-color: #fcb040; width: 390px; padding-left: 10px; margin-bottom: 10px;">
						<h3 style="margin:10 0 10 0; padding: 0;">Customer</h3>
					</div>
					<div style="font-size: 15px; margin-left: 10px; width: 390px;">
						' . contact_generate_string($contacts, '<br />') . '
					</div>
				</td>';
    if ($client) {
        $content .= '<td style="width: 300px; vertical-align:top; border: 1px solid #fcb040; border-top: none; padding:0; padding-bottom: 10px;">
						<div style="background-color: #fcb040; width: 300px; padding-left: 10px; margin-bottom: 10px;">
							<h3 style="margin:10 10 10 10; padding: 0;">Megamedia DK ApS</h3>
						</div>
						<div style="font-size: 15px; margin-left: 10px; width: 300px;">
							Skøjtevej 19A <br />
							2770 Kastrup <br />
							Denmark <br />
							Tlf.: +45 70 26 26 99 <br />
							<a href="www.megamedia.dk">www.megamedia.dk</a> <br />
							Account manager: <b>' . $affiliate['AFFILIATE_NAME'] . '</b> <br />
							Telephone: <b>' . $affiliate['AFFILIATE_DESCRIPTION'] . '</b>
						</div>
					</td>';
    }
    $content .= '</tr>
			<tr>
				<td style="width: 390px; vertical-align:top; border: 1px solid #fcb040; border-top: none; padding:0; padding-bottom: 10px;">
					<div style="background-color: #fcb040; width: 390px; padding-left: 10px; margin-bottom: 10px;">
						<h3 style="margin:10 0 10 0; padding: 0;">Delivery Address</h3>
					</div>
					<div style="font-size: 15px; margin-left: 10px; width: 390px;">
						' . $delivery_address . '
					</div>
				</td>';
    if ($client) {
        $content .= '<td style="width: 300px; vertical-align:top; border: 1px solid #fcb040; border-top: none; padding:0; padding-bottom: 10px;">
						<div style="background-color: #fcb040; width: 300px; padding-left: 10px; margin-bottom: 10px;">
							<h3 style="margin:10 10 10 10; padding: 0;">Order Details</h3>
						</div>
						<div style="font-size: 15px; margin-left: 10px; width: 300px;">
							Order done by: <b>' . $person['FIRST_NAME'] . ' ' . $person['LAST_NAME'] . '</b><br />
							Order date: <b>' . date_convert($order['ORDER_DATE'], DEFAULT_DATE_FORMAT) . '</b><br />
							Your reference: <b>' . $order['EXTERNAL_ID'] . '</b><br />
							Additional order info: <b>' . $order['COMMENTS'] . '</b>
						</div>
					</td>';
    }
    $content .= '</tr>
		</table>


		<!-- Product section -->
		<div style="margin-left: -20px; width: 715px; background-color: #CB68A8; padding-left: 10px; margin-top: 20px;">
			<h3 style="margin:10 10 10 10; padding: 0;">Products</h3>
		</div>

		<table style="font-size: 15px; margin-left: -20px; width: 715px; margin-top: 10px;"border="1px" cellspacing="0" >
			<tr>
				<th style="width: 228px; padding: 5px;"><b>Product</b></th>
				<th style="width: 35px; padding: 5px;"><b>Line</b></th>
				<th style="width: 55px; padding: 5px;"><b>Motives</b></th>
				<th style="width: 55px; padding: 5px;"><b>Runs</b></th>
				<th style="width: 85px; padding: 5px;"><b>Variant</b></th>';
    if ($client) {
        $content .= '<th style="width: 95px; padding: 5px;"><b>Price</b></th>';
    }
    $content .= '</tr>';
    $Cart = new Cart();
    $Cart->fromString($order['SESSION_SERILIALIZE']);
    $product_count = $Cart->getProductsCount();
    $loop = 0;
    $total = 0;
    $total_delivery = 0;
    foreach ($Cart->getProducts() as $i => $_row) {
        $loop++;
        list($headers, $rows, $variants, $copies, $delivery) = html_offer_box($_row['PRODUCTS'], $Cart->deliveryDistributionAt($i));
        list($html, $add_to_total, $delivery) = pdf_build_offer_box($rows, $variants, $copies, $delivery, $_row['OFFER'], $_row['PRODUCTS']['MOTIVES'], false, true, $_row['PRODUCTS']['RUNS'], $_row['PRODUCTS']['VARIANT'], $client);
        $content .= $html;
        $total += $add_to_total;
        $total_delivery += $delivery;
        if ($product_count > $loop) {
            $content .= '<tr><td style="border-left: none; border-right: none;" colspan="6">&nbsp;</td></tr>';
        }
    }
    $content .= '</table>

		<!-- Grand Total -->
		<div style="clear: both; margin-top: 40px;">
			<div style="text-align: right; margin-left: -20px; width: 723px; background-color: #CB68A8; padding-right: 10px; margin-top: 20px;">
				<span style="margin:10 10 10 10; padding: 0;">All Delivery + Environment:
				<span style="color: #fff;">' . number_format($total_delivery + DELIVERY_ENVIRONMENT + $system_settings['ORDER_FEE'], 2) . ' ' . DEFAULT_CURRENCY . '</span></span>
			</div>
		</div>
		<div style="clear: both; margin-top: 40px;">
			<div style="text-align: right; margin-left: -20px; width: 723px; background-color: #CB68A8; padding-right: 10px; margin-top: 20px;">
				<h3 style="margin:10 10 10 10; padding: 0;">Grand Total:
				<span style="color: #fff;">' . number_format($total + $total_delivery + DELIVERY_ENVIRONMENT + $system_settings['ORDER_FEE'], 2) . ' ' . DEFAULT_CURRENCY . '</span></h3>
			</div>
		</div>


		<!-- Footer -->
		<page_footer>
			<table style="width: 750px;">
				<tr>
					<td class="center">Order: #' . $order_id . ' <i style=" font-size: 10px;">page [[page_cu]]/[[page_nb]]</i></td>
				</tr>
			</table>
		</page_footer>
	</page>';
    try {
        $html2pdf = new HTML2PDF('P', 'A4', 'en');
        $html2pdf->setDefaultFont('Arial');
        $html2pdf->writeHTML($content, false);
        $file_name = $client ? 'Customer-Copy-' : 'Production-Copy-';
        $prefix = $file_name . $order_id;
        $pdf_name = $prefix . '.pdf';
        $html2pdf->Output(PDFS_PATH . $pdf_name, 'F');
    } catch (HTML2PDF_exception $e) {
        echo $e;
        exit;
    }
    return PDFS_PATH . $pdf_name;
}
Ejemplo n.º 4
0
?>
</td>
			<td><?php 
echo $_order['EXTERNAL_ID'];
?>
</td>
			<td style="text-align: right;" ><?php 
echo number_format($_order['GRAND_TOTAL'], 2);
?>
&nbsp;
				<strong><?php 
echo $_order['CURRENCY_UOM'];
?>
</strong></td>
			<td><?php 
echo date_convert($_order['ORDER_DATE'], DEFAULT_DATE_FORMAT);
?>
</td>
			<td>
				<a class="btn btn-small btn-info" href="/orders/view?id=<?php 
echo $_order['ORDER_ID'];
?>
" >
					<i class="icon-eye-open icon-white"></i>
				</a>
				<!-- Check if there is something in the cart and then show an alert otherwise start a new order process -->
				<? if ($_order['STATUS_ID'] == ORDER_OFFER) { ?>
					<a class="btn btn-small btn-warning" href="/orders/cart?copy=<?php 
echo $_order['ORDER_ID'];
?>
"
<?php 
function date_convert($dt, $tz1, $df1, $tz2, $df2)
{
    $res = '';
    if (!in_array($tz1, timezone_identifiers_list())) {
        // check source timezone
        trigger_error(__FUNCTION__ . ': Invalid source timezone ' . $tz1, E_USER_ERROR);
    } elseif (!in_array($tz2, timezone_identifiers_list())) {
        // check destination timezone
        trigger_error(__FUNCTION__ . ': Invalid destination timezone ' . $tz2, E_USER_ERROR);
    } else {
        // create DateTime object
        $d = DateTime::createFromFormat($df1, $dt, new DateTimeZone($tz1));
        // check source datetime
        if ($d && DateTime::getLastErrors()["warning_count"] == 0 && DateTime::getLastErrors()["error_count"] == 0) {
            // convert timezone
            $d->setTimeZone(new DateTimeZone($tz2));
            // convert dateformat
            $res = $d->format($df2);
        } else {
            trigger_error(__FUNCTION__ . ': Invalid source datetime ' . $dt . ', ' . $df1, E_USER_ERROR);
        }
    }
    return $res;
}
echo date_convert(date('Y-m-d H:i:s'), 'Europe/Athens', 'Y-m-d H:i:s', 'Europe/Athens', 'Y-m-d H:i:s'), '<p/>';
Ejemplo n.º 6
0
  
  <fieldset class="fieldgroup group-camp-information">
  <legend>Camp Information</legend>
  <?php 
echo "<strong>" . $node->content['group_camp_information']['group']['field_camp_category']['field']['#title'] . ": </strong>" . $node->field_camp_category[0]['view'];
?>
<br />
  <?php 
echo "<strong>Ages: </strong>" . $node->field_age_from[0]['view'] . " - " . $node->field_age_to[0]['view'];
?>
  <br />
  <?php 
$sDate = $node->field_camp_date_start[0]['value'];
$fDate = $node->field_camp_date_finish[0]['value'];
$aStart = format_date(date_convert($sDate, DATE_ISO, DATE_UNIX), $type = "custom", $format = "g:i a");
$aFinish = format_date(date_convert($fDate, DATE_ISO, DATE_UNIX), $type = "custom", $format = "g:i a");
//$aStart = format_date($node->field_camp_date_start[0]['value'], $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL);
/*
	$startmonth = date("F", strtotime($node->field_camp_date_start[0]['value']));
    $finishmonth = date("F", strtotime($node->field_camp_date_finish[0]['value']));
    $starttime = date("g:i a", strtotime($node->field_camp_date_start[0]['value']));
    $finishtime = date("g:i a", strtotime($node->field_camp_date_finish[0]['value']));
*/
$startmonth = date("F", strtotime($sDate));
$finishmonth = date("F", strtotime($fDate));
$starttime = date("g:i a", strtotime($sDate));
$finishtime = date("g:i a", strtotime($fDate));
if ($startmonth == $finishmonth) {
    $campdate = date("F j", strtotime($node->field_camp_date_start[0]['value'])) . " - " . date("j", strtotime($node->field_camp_date_finish[0]['value']));
} else {
    $campdate = date("F j", strtotime($node->field_camp_date_start[0]['value'])) . " - " . date("F j", strtotime($node->field_camp_date_finish[0]['value']));