protected function getConstants() { $collect = []; $data = $this->reflection->getConstants(); foreach ($data as $key => $value) { $collect[] = Constant::factory(compact('key', 'value')); } return $collect; }
/** * Constructor. */ private function __construct() { try { try { $actual_link = "{$_SERVER['REQUEST_URI']}"; $arr = explode('/', $actual_link); if ('business' == $arr[2]) { require_once "Constant.php"; } else { require_once "Constant.php"; } } catch (Exception $e) { } $this->connection = Constant::createConnectionForDB(); $this->connection->exec("SET CHARACTER SET utf8"); } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die; } }
<div class="row carousel-holder"> <div class="col-md-12"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <?php foreach ($banner as $key => $value) { echo '<li data-target="#carousel-example-generic" data-slide-to="' . $key . '" class="' . ($key === 0 ? "active" : "") . '"></li>'; } ?> </ol> <div class="carousel-inner"> <?php foreach ($banner as $key => $value) { echo '<div class="item ' . ($key === 0 ? "active" : "") . '">'; echo '<img class="slide-image" src="' . base_url(Constant::getUploadBannerPath() . $value["link"]) . '">'; echo '</div>'; } ?> </div> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div>
public static function findOverlappingOfTwoLines($line1, $line2, &$overlap1, &$overlap2) { $isLine1Reversed = FALSE; // Check same line or not if (!Lines::isTwoPiecesOnSameLine($line1, $line2)) { return FALSE; } // Check same directions or not if (!Lines::areTwoVectorHaveSameDirection($line1, $line2)) { $line1->reverse(); $isLine1Reversed = TRUE; } // Points $point1 = $line1->point1; $point2 = $line1->point2; // Line 1 $point3 = $line2->point1; $point4 = $line2->point2; // Line 2 // Calculate line coordinates from point1 $x1 = 0; $x2 = Points::twoPointsDistance($point1, $point2); $x3 = Points::twoPointsDistance($point1, $point3); $x4 = Points::twoPointsDistance($point1, $point4); // Set sign to coordinates if (!Lines::areTwoVectorHaveSameDirection($line1, new \Classes\Utils\AbstractInstance\Line($point1, $point3))) { $x3 *= -1; } // Set sign to coordinates if (!Lines::areTwoVectorHaveSameDirection($line1, new \Classes\Utils\AbstractInstance\Line($point1, $point4))) { $x4 *= -1; } // Overlapping length $length = min($x2, $x4) - max($x1, $x3); // Check if therу is overlapping if ($length <= 0) { return FALSE; } // Create coordinate array $arrayToSort = array(0 => array('point' => 1, 'value' => $x1), 1 => array('point' => 2, 'value' => $x2), 2 => array('point' => 3, 'value' => $x3), 3 => array('point' => 4, 'value' => $x4)); $sortedArray = Constant::sortArrayByIndex($arrayToSort, 'value'); // Check variant of overlapping // 1-3-2-4 if ($sortedArray[0]['point'] == 1 && $sortedArray[1]['point'] == 3 && $sortedArray[2]['point'] == 2 && $sortedArray[3]['point'] == 4) { $overlap1 = array($x3, $x2); $overlap2 = array(0, $x2 - $x3); } // 3-1-4-2 if ($sortedArray[0]['point'] == 3 && $sortedArray[1]['point'] == 1 && $sortedArray[2]['point'] == 4 && $sortedArray[3]['point'] == 2) { $overlap1 = array(0, $x4); $overlap2 = array($x1 - $x3, $x4 - $x3); } // 1-3-4-2 if ($sortedArray[0]['point'] == 1 && $sortedArray[1]['point'] == 3 && $sortedArray[2]['point'] == 4 && $sortedArray[3]['point'] == 2) { $overlap1 = array($x3, $x4); $overlap2 = array(0, $x4 - $x3); } // 3-1-2-4 if ($sortedArray[0]['point'] == 3 && $sortedArray[1]['point'] == 1 && $sortedArray[2]['point'] == 2 && $sortedArray[3]['point'] == 4) { $overlap1 = array(0, $x2); $overlap2 = array($x1 - $x3, $x2 - $x3); } // Reverse overlapping of line1 if ($isLine1Reversed) { // $x2 = Length(line1) $begin = $x2 - $overlap1[1]; $end = $x2 - $overlap1[0]; $overlap1[0] = $begin; $overlap1[1] = $end; } return TRUE; }
<div class="well accordion"> <h4>Tour Destinations</h4> <div id="accordion"> <?php foreach ($group_category as $key => $value) { echo "<h3" . (isset($groupCategoryId) && $groupCategoryId == $key ? " class='expand' " : "") . ">"; // echo "<h3>"; if ($value->icon) { echo "<img src='" . base_url(Constant::getUploadIconPath() . $value->icon) . "' /> "; } echo $value->name . "</h3>"; echo '<div class="list-group">'; foreach ($value->arr as $arr) { echo '<a href="' . base_url($arr["link"]) . '" class="list-group-item">' . $arr["name"] . '</a>'; // <span class="badge">12</span> } echo '</div>'; } ?> </div> </div> <?php foreach ($sidebarBoxs as $key => $value) { ?> <div class="well accordion"> <h4><?php echo $value["page_h_header"]; ?>
{product_itinerary} </div> </div> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 product-detail"> {product_details} </div> </div> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <p> <a href="<?php echo base_url(Constant::getUploadProductPdfPath("/{product_pdf_link}")); ?> " target="_blank"> <img src="<?php echo base_url(Constant::getImagePath("download_btn.png")); ?> " alt="download_pdf" border="0"> </a> </p> </div> </div> </div> </div> </div> </div> </div> </div>
</div> </div> <div class="row" id="content"> <?php foreach ($products as $key => $product) { ?> <div class="col-sm-6 col-lg-6 col-md-6"> <a href="<?php echo base_url("product/index/" . $product["category_id"] . "/" . $product["id"]); ?> "> <div class="thumbnail"> <img src="<?php echo base_url(Constant::getUploadProductBannerPath() . $product["product_banner_link"]); ?> " alt=""> <hr/> <div class="caption"> <!--<h4 class="pull-right"><?php echo number_format($product["product_price"], 0, '.', ','); ?> บาท</h4>--> <h5 class="header"> <?php echo $product["product_header"]; ?> </h5>
<?php /** * This code is Jamhuri special and it enables you to access buygoods functionality * from any system build on top of php. * @author Derrick Rono <*****@*****.**> */ require_once 'config/Constant.php'; require_once 'lib/MpesaAPI.php'; $Password = Constant::generateHash(); $mpesaclient = new MpesaAPI(); $mpesaclient->processCheckOutRequest($Password, MERCHANT_ID, "1232434", "123454", "60", "254713038301", "http://google.com");
<!-- Populating the List --> <?php if (count($duty_places)) { ?> <?php foreach ($duty_places as $j => $duty_place) { ?> <tr> <td align="left"><?php echo $duty_place->getTitle(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($duty_place->getStatus()); ?> </td> <td align="center"><?php echo $duty_place->getUpdatedAt('d-M-Y'); ?> <td align="right"> <?php echo link_to(' ', 'DutyPlace/edit?id=' . Utility::EncryptQueryString($duty_place->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'DutyPlace/delete?id=' . Utility::EncryptQueryString($duty_place->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr>
/** * Visit a node with kind `\ast\AST_CLASS_CONST_DECL` * * @param Node $node * A node to parse * * @return Context * A new or an unchanged context resulting from * parsing the node */ public function visitClassConstDecl(Node $node) : Context { $clazz = $this->getContextClass(); foreach ($node->children ?? [] as $child_node) { $constant = new Constant($this->context->withLineNumberStart($child_node->lineno ?? 0)->withLineNumberEnd($child_node->endLineno ?? 0), $child_node->children['name'], new UnionType(), $child_node->flags ?? 0); $constant->setFutureUnionType(new FutureUnionType($this->code_base, $this->context, $child_node->children['value'])); $clazz->addConstant($this->code_base, $constant); } return $this->context; }
?> <?php foreach ($designations as $j => $designation) { ?> <tr> <td align="left"><?php echo $designation->getTitle(); ?> </td> <td align="left"> <?php echo $designation->getDepartment(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($designation->getStatus()); ?> </td> <td align="center"><?php echo $designation->getUpdatedAt('d-M-Y'); ?> <td align="right" class="edit"> <?php echo link_to(' ', 'Designation/edit?id=' . Utility::EncryptQueryString($designation->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'Designation/delete?id=' . Utility::EncryptQueryString($designation->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr>
<!-- Populating the List --> <?php if (count($wards)) { ?> <?php foreach ($wards as $j => $ward) { ?> <tr> <td align="left"><?php echo $ward->getTitle(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($ward->getStatus()); ?> </td> <td align="right"> <?php echo link_to(' ', 'Ward/edit?id=' . Utility::EncryptQueryString($ward->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'Ward/delete?id=' . Utility::EncryptQueryString($ward->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr> <?php }
<td>Work Experience:(in Years)</td> <td> <?php //echo $employee->getExperienceYear(); ?> </td> <td>Employment Date:</td> <td> <?php echo $employee->getEmploymentDate('d-M-Y'); ?> </td> </tr> <tr class="datagrid"> <td>Local Resident:</td> <td> <?php echo Constant::GetBooleanWord($employee->getLocalResident()); ?> </td> <td colspan="2"> </td> </tr> <tr> <td colspan="4" height="40"> </td> </tr> <tr class="datagrid"> <th colspan="4">System Authentication Information</th> </tr>
<!-- Populating the List --> <?php if (count($dosages)) { ?> <?php foreach ($dosages as $j => $dosage) { ?> <tr> <td align="left"><?php echo $dosage->getTitle(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($dosage->getStatus()); ?> </td> <td align="right"> <?php echo link_to(' ', 'Dosage/edit?id=' . Utility::EncryptQueryString($dosage->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'Dosage/delete?id=' . Utility::EncryptQueryString($dosage->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr> <?php
/** * @covers Classes\Utils\Math\Lines::findOverlappingOfTwoLines */ public function testFindOverlappingOfTwoLines_9() { $p1 = new \Classes\Utils\AbstractInstance\Point(3, 3, 3); $p2 = new \Classes\Utils\AbstractInstance\Point(5, 5, 5); $p3 = new \Classes\Utils\AbstractInstance\Point(10, 10, 10); $p4 = new \Classes\Utils\AbstractInstance\Point(0, 0, 0); $line1 = new \Classes\Utils\AbstractInstance\Line($p1, $p2); $line2 = new \Classes\Utils\AbstractInstance\Line($p3, $p4); $overlap1 = array(); $overlap2 = array(); $this->assertEquals(Lines::findOverlappingOfTwoLines($line1, $line2, $overlap1, $overlap2), TRUE); $this->assertEquals(Constant::isNumbersEqual($overlap1[0], 0), TRUE); $this->assertEquals(Constant::isNumbersEqual($overlap1[1], 2 * sqrt(3)), TRUE); $this->assertEquals(Constant::isNumbersEqual($overlap2[0], 5 * sqrt(3)), TRUE); $this->assertEquals(Constant::isNumbersEqual($overlap2[1], 7 * sqrt(3)), TRUE); }
/** * Returns the first ServerNode object matching the given TSDNS hostname. Like the * TeamSpeak 3 Client, this method will start looking for a TSDNS server on the second-level * domain including a fallback to the third-level domain of the specified $tsdns parameter. * * @param string $tsdns * * @throws ServerQueryException * @return ServerNode */ public function serverGetByTSDNS($tsdns) { $parts = Uri::getFQDNParts($tsdns); $query = String::factory(array_shift($parts)); while ($part = array_shift($parts)) { $query->prepend($part); try { $port = Constant::factory("tsdns://" . $query . "/?timeout=3")->resolve($tsdns)->section(":", 1); return $this->serverGetByPort($port == "" ? 9987 : $port); } catch (TransportException $e) { /* skip "Connection timed out" and "Connection refused" */ if ($e->getCode() != 10060 && $e->getCode() != 10061) { throw $e; } } } throw new ServerQueryException("invalid serverID", 0x400); }
<hr/> <img class="img-responsive" src="<?php echo base_url(Constant::getUploadGalleryPath("/" . $group_gallery["gallery_link"])); ?> " alt=""> </a> </div> <?php } } ?> <?php if (isset($gallerys)) { foreach ($gallerys as $gallery) { $pathImg = base_url(Constant::getUploadGalleryPath("/" . $gallery["gallery_link"])); ?> <div class="col-lg-4 col-md-4 col-xs-6 disabled"> <!-- <a class="thumbnail-group-gallery" href="#"> <img class="img-responsive" src="<?php echo $pathImg; ?> " alt=""> </a>--> <a class="thumbnail-group-gallery group1" href="<?php echo $pathImg; ?> " > <img class="img-responsive" src="<?php
/** * @expectedException DomainException */ public function testShrinkOnlyAcceptsElementsOfTheDomainAsParameters() { $generator = new Constant(5); $generator->shrink(10); }
function getProductByCategoryId($categoryId, $lang, $productId = null, $page = 0) { $limitValue = Constant::getLimitValue(); return $this->dbProductByCategoryId($categoryId, $lang, $productId)->limit($limitValue, $limitValue * $page)->get()->result_array(); }
/** * @dataProvider validationProvider */ public function testValidation($value, $options, $result) { $validator = new Constant($options); $this->assertEquals($result, $validator->validate($value)); }
<!--<td align="left"><?php //echo $visit->getEmployeeRelatedByWardDocId(); ?> </td>--> <td align="left"><?php echo Constant::GetVisitStatusTitle($visit->getStatus()); ?> </td> <td align="left"><?php echo $visit->getFee(); ?> </td> <td align="right" class="edit"> <?php $visit_status = Constant::GetVisitStatusTitle($visit->getStatus()); $fee_status = Constant::GetVisitStatusTitle($visit->getFeePaid()); if ($visit_status == Constant::VISIT_DONE_TITLE && $fee_status == Constant::VISIT_FEE_NOT_PAID_TITLE) { echo link_to('Pay Fee', 'FrontDesk/payVisitFee?visit=' . Utility::EncryptQueryString($visit->getId()), array('confirm' => 'Confirm Fee Payment!')); } elseif ($visit_status == Constant::VISIT_DONE_TITLE && $fee_status == Constant::VISIT_FEE_PAID_TITLE) { echo 'Fee Paid'; } else { echo ''; } ?> <?php echo link_to(' ', 'FrontDesk/visitEdit?visit=' . Utility::EncryptQueryString($visit->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php //echo link_to(' ','FrontDesk/deletevisit?id='.Utility::EncryptQueryString($visit->getId()), array('confirm'=>'Are you sure you want to Delete this?', 'title'=>'Delete', 'class' => 'delete')); ?> </td>
?> <tr> <td align="left"><?php echo $bed->getBed(); ?> </td> <td align="left"> <?php echo $bed->getWard(); ?> </td> <td align="left"> <?php echo $bed->getPrice(); ?> </td> <td align="center"><?php echo Constant::GetWardBedStatusTitle($bed->getStatus()); ?> </td> <td align="right" class="edit"> <?php echo link_to(' ', 'WardBed/edit?id=' . Utility::EncryptQueryString($bed->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'WardBed/delete?id=' . Utility::EncryptQueryString($bed->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr> <?php } ?>
public function group() { try { $crud = $this->getCrud(); $crud->set_table('group_category'); $crud->set_subject('Group'); $crud->columns('icon', 'name', 'name_eng', 'show'); $crud->field_type('show', 'true_false'); $crud->set_field_upload('icon', Constant::getUploadIconPath()); $crud->callback_after_upload(array($this, 'callback_after_upload')); $output = $crud->render(); $this->output($output); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Constant name is expected. * @dataProvider evaluateBadValueDataProvider */ public function testEvaluateBadValue($value) { $this->object->evaluate($value); }
public function __construct($value) { parent::__construct(M_E); }
public function ajaxError($status, $message = null) { if ($message === null) { $message = Constant::getAjaxMessage($status); } $this->ajaxReturn($status, array(), $message); }
<!-- Populating the List --> <?php if (count($departments)) { ?> <?php foreach ($departments as $j => $department) { ?> <tr> <td align="left"><?php echo $department->getTitle(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($department->getStatus()); ?> </td> <td align="center"><?php echo $department->getUpdatedAt('d-M-Y'); ?> <td align="right"> <?php echo link_to(' ', 'Department/edit?id=' . Utility::EncryptQueryString($department->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'Department/delete?id=' . Utility::EncryptQueryString($department->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr>
public static function isPointOnLine($point, $line) { $dx = $line->point1->x - $line->point2->x; $dy = $line->point1->y - $line->point2->y; $dz = $line->point1->z - $line->point2->z; // Create array of p $p = array(); if (!Constant::isNumbersEqual($dx, 0)) { $p[] = ($point->x - $line->point2->x) / $dx; } else { // X coordinate of all point must be same if (!Constant::isNumbersEqual($point->x, $line->point1->x)) { return 0; } } if (!Constant::isNumbersEqual($dy, 0)) { $p[] = ($point->y - $line->point2->y) / $dy; } else { // Y coordinate of all point must be same if (!Constant::isNumbersEqual($point->y, $line->point1->y)) { return 0; } } if (!Constant::isNumbersEqual($dz, 0)) { $p[] = ($point->z - $line->point2->z) / $dz; } else { // Z coordinate of all point must be same if (!Constant::isNumbersEqual($point->z, $line->point1->z)) { return 0; } } // CASE 4 if (count($p) == 0) { return 4; } // All members in p array must be same $isEqual = TRUE; if (count($p) > 1) { for ($i = 1; $i < count($p); $i++) { if (!Constant::isNumbersEqual($p[$i], $p[0])) { $isEqual = FALSE; } } } // CASE 0 if (!$isEqual) { return 0; } // CASE 2 if (Constant::isNumbersEqual($p[0], 0) || Constant::isNumbersEqual($p[0], 1)) { return 2; } // CASE 3 if ($p[0] > 0 && $p[0] < 1) { return 3; } // CASE 1 return 1; }
public function jsonReturn($code, $msg = '', $data = null) { if ($msg === '') { $msg = Constant::getMessage($code); } Yii::app()->request->setIsAjaxRequest(true); header('Content-Type: application/json'); echo json_encode(array('code' => $code, 'msg' => $msg, 'data' => $data)); Yii::app()->end(); }
?> <?php foreach ($lab_tests as $j => $lab_test) { ?> <tr> <td align="left"><?php echo $lab_test->getTitle(); ?> </td> <td align="left"><?php echo $lab_test->getPrice(); ?> </td> <td align="center"><?php echo Constant::GetRecordStatusTitle($lab_test->getStatus()); ?> </td> <td align="center"><?php echo $lab_test->getUpdatedAt('d-M-Y'); ?> <td align="right"> <?php echo link_to(' ', 'LabTest/edit?id=' . Utility::EncryptQueryString($lab_test->getId()), array('title' => 'Edit', 'class' => 'edit')); ?> <?php echo link_to(' ', 'LabTest/delete?id=' . Utility::EncryptQueryString($lab_test->getId()), array('confirm' => 'Are you sure you want to Delete this?', 'title' => 'Delete', 'class' => 'delete')); ?> </td> </tr>