Esempio n. 1
0
 public function __construct()
 {
     parent::__construct();
     /* if(!$this->session->userdata("username_".sys_id()))
        redirect(site_url('users/login'));*/
     $this->hospcode = $this->session->userdata('hospcode');
     $this->cup_code = $this->session->userdata('cup_code');
     $this->provcode = $this->session->userdata('provcode');
     $this->amp_code = $this->session->userdata('amp_code');
     $this->user_level = $this->session->userdata('user_level');
     $this->year = $this->session->userdata('year');
     $this->area = area();
     /* if($this->user_level == '0')
        redirect(site_url('admin'));*/
     $this->load->model('Patient_model', 'patient');
     $this->load->model('Basic_model', 'basic');
     $this->load->model('Reports_model', 'reports');
     $this->patient->hospcode = $this->hospcode;
     $this->patient->cup_code = $this->cup_code;
     $this->patient->provid = $this->provcode;
     $this->patient->year = $this->year;
 }
Esempio n. 2
0
function insert($data)
{
    global $dbCom;
    $temp = $dbCom->get("cb_combusiness", array('cid'), array('comname' => $data['Name'], 'LIMIT' => 1));
    if (!empty($temp['cid'])) {
        //数据存在不采集
        //根据注册号 判断是否有重复
        if (!empty($data['No']) && (strlen($data['No']) == 13 || strlen($data['No']) == 15)) {
            $temp = $dbCom->get("cb_combusiness", array('cid'), array('regno' => $data['No'], 'LIMIT' => 1));
            if (is_array($temp) && !empty($temp) && $temp['cid'] > 0) {
                $update = array('comname' => $data['Name'], 'uniqueno' => unique($data['Name'], $data['No']), 'scope' => $data['Scope'], 'state' => $data['Status'], 'comtype' => $data['EconKind'], 'regcapital' => regcap($data['RegistCapi']), 'address' => $data['Address'], 'businessstart' => strtotime($data['TermStart']), 'businessend' => strtotime($data['TeamEnd']), 'checkdate' => strtotime($data['CheckDate']), 'regagency' => $data['BelongOrg'], 'legal' => $data['OperName'], 'startdate' => strtotime($data['StartDate']), 'enddate' => strtotime($data['EndDate']), 'cate1' => 0, 'cate2' => 0, 'uptime' => strtotime($data['UpdatedDate']), 'areaid' => getAreaId($data['No']), 'RegistCapi' => $data['RegistCapi']);
                $update = area($update, $data);
                $dbCom->update("cb_combusiness", $update, array('cid' => $temp['cid']));
            }
        }
        return $temp['cid'];
    }
    //写入主表
    $insert = array('comname' => $data['Name'], 'regno' => $data['No'], 'uniqueno' => unique($data['Name'], $data['No']), 'scope' => $data['Scope'], 'state' => $data['Status'], 'comtype' => $data['EconKind'], 'regcapital' => regcap($data['RegistCapi']), 'address' => $data['Address'], 'businessstart' => strtotime($data['TermStart']), 'businessend' => strtotime($data['TeamEnd']), 'checkdate' => strtotime($data['CheckDate']), 'regagency' => $data['BelongOrg'], 'legal' => $data['OperName'], 'startdate' => strtotime($data['StartDate']), 'enddate' => strtotime($data['EndDate']), 'cate1' => 0, 'cate2' => 0, 'uptime' => strtotime($data['UpdatedDate']), 'areaid' => getAreaId($data['No']), 'RegistCapi' => $data['RegistCapi']);
    //bug处理
    empty($insert['scope']) && ($insert['scope'] = '无');
    empty($insert['regno']) && ($insert['regno'] = '0');
    //    empty($insert['comtype']) && $insert['comtype'] = '无';
    //    empty($insert['state']) && $insert['state'] = '无';
    //    empty($insert['regcapital']) && $insert['regcapital'] = 0;
    //    empty($insert['address']) && $insert['address'] = '无';
    empty($insert['regagency']) && ($insert['regagency'] = '无');
    //    empty($insert['legal']) && $insert['legal'] = '无';
    //省 市 区处理
    $insert = area($insert, $data);
    $cid = $dbCom->insert('cb_combusiness', $insert);
    if ($cid <= 0) {
        print_r($dbCom->error());
        die;
        return;
    }
    //分公司
    if (is_array($data['Branches']) && !empty($data['Branches'])) {
        $insert = array();
        foreach ($data['Branches'] as $value) {
            $insert[] = array('cid' => $cid, 'regno' => $value['RegNo'], 'comname' => $value['Name']);
        }
        if (is_array($insert) && !empty($insert)) {
            $dbCom->insert('cb_branch', $insert);
        }
    }
    //联系人
    if (isset($data['ContactInfo']) && $data['ContactInfo'] && !empty($data['ContactInfo'])) {
        $insert = array('cid' => $cid, 'WebSite' => isset($data['ContactInfo']['WebSite']) ? json_encode($data['ContactInfo']['WebSite'], JSON_UNESCAPED_UNICODE) : json_encode(array()), 'PhoneNumber' => isset($data['ContactInfo']['PhoneNumber']) ? $data['ContactInfo']['PhoneNumber'] : '', 'Email' => isset($data['ContactInfo']['Email']) ? $data['ContactInfo']['Email'] : array());
        if (is_array($insert) && !empty($insert)) {
            $dbCom->insert('cb_com_contact', $insert);
        }
    }
    //变更记录
    if (is_array($data['ChangeRecords']) && !empty($data['ChangeRecords'])) {
        $insert = array();
        foreach ($data['ChangeRecords'] as $value) {
            $insert[] = array('cid' => $cid, 'infoname' => $value['ProjectName'], 'oldvalue' => $value['BeforeContent'], 'newvalue' => $value['AfterContent'], 'uptime' => strtotime($value['ChangeDate']));
        }
        if (is_array($insert) && !empty($insert)) {
            $dbCom->insert('cb_changelog', $insert);
        }
    }
    //主要员工
    if (is_array($data['Employees']) && !empty($data['Employees'])) {
        $insert = array();
        foreach ($data['Employees'] as $value) {
            $insert[] = array('cid' => $cid, 'name' => $value['Name'], 'job' => $value['Job'], 'certno' => isset($value['CerNo']) && !empty($value['CerNo']) ? $value['CerNo'] : '无');
        }
        if (is_array($insert) && !empty($insert)) {
            $dbCom->insert('cb_employee', $insert);
        }
    }
    //合伙人
    if (is_array($data['Partners']) && !empty($data['Partners'])) {
        $insert = array();
        foreach ($data['Partners'] as $value) {
            $insert[] = array('cid' => $cid, 'stockholder' => $value['StockName'], 'stocktype' => $value['StockType'], 'stockpercent' => $value['StockPercent'], 'identifyname' => $value['IdentifyType'], 'identifyno' => $value['IdentifyNo'], 'shouldcapi' => $value['ShouldCapi'], 'shoulddate' => is_string($value['ShoudDate']) ? strtotime($value['ShoudDate']) : '', 'shouldtype' => $value['InvestType'], 'realtype' => $value['InvestType'], 'realcapi' => $value['RealCapi'], 'realdate' => is_string($value['CapiDate']) ? strtotime($value['CapiDate']) : '');
            if (!is_string($value['ShoudDate']) || !is_string($value['CapiDate'])) {
                //                print_r($value);
            }
        }
        if (is_array($insert) && !empty($insert)) {
            $dbCom->insert('cb_partner', $insert);
        }
    }
    return $cid;
}
Esempio n. 3
0
<html lang = "en">
	<head>
		<title>Circle Functions</title>
	</head>
	
	<body>
		<?php 
$r = 5;
$h = 3;
$k = -2;
include "circle.php";
echo "Area :  " . area() . "<br />";
echo "Perimieter: " . perimeter(10) . "<br /><hr />";
list($myArea, $myPerim) = both();
echo "Both: area = " . $myArea . " and perimeter= " . $myPerim . "<br /><hr />";
$h = 3;
$k = -2;
echo "Circle with center ({$h}, {$k}): The piont (-2,-2) is " . point(-2, -2) . "<br />";
echo "Circle with center (3,-2) : The point (1,-1) is " . point(1, -1) . "<br />";
?>
		
	</body>
</html>
Esempio n. 4
0
     $form->addHtml("<fieldset>\n");
     $form->addHtml('<div class="block-header">Specifics</div>');
     $form->addHtml('<div id="' . $formName . '">');
     $feature_form = $form->makeField('select', 'status', 'Status', '', '', db_enum("link_client_to_feature", "status", "array"));
     $feature_form .= $form->makeField('select', 'featureId', 'Feature', '', '', db_lookup("feature", "feature", "array", "", "fea_title"));
     $feature_form .= $form->makeField("button", $formName, "", "Add", array('class' => 'button', 'onClick' => 'javascript:addFeature();'));
     $form->addHtml($fea_table);
     $form->addHtml($form->addLabel('Add Feature', 'Add Feature', $feature_form));
     $form->addSeperator();
     $form->addHtml('<p class="appInfo">Only enter special requirements below if they aren\'t listed in the options above.</p>');
     $form->addData(${$formName}, $_POST);
     $form->addHtml(renderNotes('client_req', $cli_id, array('viewform' => 7, 'label' => 'Special Requirements')));
     $form->addHtml($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')));
     $form->addHtml("</div>\n");
     $form->addHtml("</fieldset>\n");
     $areas = area(explode("|", $areas));
     $formName = 'form6';
     $form->addHtml("<fieldset>\n");
     $form->addHtml('<div class="block-header">Areas</div>');
     $form->addHtml('<div id="' . $formName . '" style="margin-left:10px">');
     $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch1\');" style="margin-left:5px;"><strong>Camberwell Branch</strong></a>');
     $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[1] . '</tr></table>');
     $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch2\');" style="margin-left:5px;"><strong>Sydenham Branch</strong></a>');
     $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[2] . '</tr></table>');
     $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
     $form->addHtml("</div>\n");
     $form->addHtml("</fieldset>\n");
 }
 /////////////////////////////////////////////////////////////////////////////////
 $formName = 'form8';
 $form->addHtml("<fieldset>\n");
Esempio n. 5
0
 /**
  * This is a function to create a dashboard type message box
  *
  * @param String $title Main title of the message box
  * @param String $linkTitle Title of the link
  * @param String $url The url/href of the link
  * @param String $number value for the amount of comments or etc..
  * @param type $panelClass Class for the panel to determine the color or style
  * @param type $glyphClass Class for the glyph to determine which glyph and size
  * @return $html return
  */
 function bootStrapMessageBox($title, $linkTitle = "Click Here", $url = "#", $number = "", $panelClass = "panel panel-primary", $glyphClass = "fa fa-comments fa-5x")
 {
     $html = "";
     $html .= div(["class" => "row"], div(["class" => $panelClass], div(["class" => "panel-heading"], div(["class" => "row"], div(["class" => "col-xs-3"], i(["class" => $glyphClass])), div(["class" => "col-xs-9 text-right"], div(["class" => "huge"], $number), div($title)))), area(["href" => $url], div(["class" => "panel-footer"], span(["class" => "pull-left"], $linkTitle), span(["class" => "pull-right"], i(["class" => "fa fa-arrow-circle-right"])), div(["class" => "clearfix"])))));
     return $html;
 }
Esempio n. 6
0
<!DOCTYPE html>
  <head>
    <meta charset="utf-8">
    <title>第一个PHP程序</title>
  </head>
  <body>
    <?php 
define("PI", 3.14);
function area($r)
{
    $areaa = $r * $r * PI;
    return $areaa;
}
//如果不判断isset($_REQUEST['radius']的话,就会先报错,因为在用户没输入时,这里的radius的值为undefined
if (isset($_REQUEST['radius'])) {
    $r = $_POST["radius"];
    echo "你输入的圆的半径为:" . $r . "<br/>该圆的面积为:" . area($r);
}
?>
    
    <form action="" method="post">
    <label for="radius"><h3>圆的半径:</h3></label>
      <input type="text" name="radius" id="radius"/>
      <input type="submit" id="submit"/>
      <input type="reset"/>
    </form>
  </body>
</html>
Esempio n. 7
0
<?php

include_once 'area-function.inc.php';
$area = area(3, 5);
include 'output.html.php';
    </head>
    <body>
        <?php 
// put your code here
$list = array('eggs', 'chicken', 'beef');
$person = array("firstname" => 'Gabriel', "lastname" => 'Forti');
/*
foreach ($person as $key => $value) {
    echo 'key = ' . $key . ' value = ' .$value;
}
*/
function area($width, $height)
{
    return $width * $height;
}
$myarea = area(5, 10);
echo $myarea;
?>
        
        
        <?php 
foreach ($person as $key => $value) {
    ?>
            <p>key = <?php 
    echo $key;
    ?>
 value = <?php 
    echo $value;
    ?>
 <p>        
         <?php 
 /**
  * ComputeRatio
  *
  * Determines the ratio of two colors to be blended
  *
  * @access	private
  * @param	int		$x	x-coordinate for the pixel
  * @param	int		$y	y-coordinate for the pixel
  * @param	int		$r	radius of the arc
  * @return	int		value for color ratio (0 <= r <= 1)
  */
 private function computeRatio($x, $y, $r)
 {
     if (!$this->antialias) {
         return 1;
     }
     $x_a = min($x + 1, loc($y, $r));
     $x_b = max($x, loc($y + 1, $r));
     return area($x_a, $r) - area($x_b, $r) + $x_b - $x - $y * ($x_a - $x_b);
 }
Esempio n. 10
0
         }
     }
 }
 if ($_GET["cli_area"]) {
     $cli_area = $_GET["cli_area"];
 }
 if (!$_GET["action"]) {
     $form = new Form();
     $form->addForm("", "get", $PHP_SELF);
     $form->addHtml("<div id=\"standard_form\">\n");
     $form->addField("hidden", "action", "", "update");
     $form->addField("hidden", "stage", "", "2");
     $form->addField("hidden", "cli_id", "", $cli_id);
     $form->addField("hidden", "app_id", "", $app_id);
     /////////////////////////////////////////////////////////////////////////////////
     $areas = area(explode("|", $cli_area));
     $form->addHtml("<fieldset>\n");
     $form->addHtml('<div class="block-header">Areas</div>');
     //$form->addHtml($form->addLabel('East Dulwich','<table><tr>'.$render[1].'</tr></table>'));
     $form->addHtml('<div id="Areas" style="margin-left:10px">');
     $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch1\');" style="margin-left:5px;"><strong>Camberwell Branch</strong></a>');
     $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[1] . '</tr></table>');
     $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch2\');" style="margin-left:5px;"><strong>Sydenham Branch</strong></a>');
     $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[2] . '</tr></table>');
     $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
     $form->addHtml("</div>\n");
     $form->addHtml("</fieldset>\n");
     $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => urldecode($searchLink)), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
     $navbar = navbar2($navbar_array);
     $page->setTitle("Client > Add");
     $page->addStyleSheet(getDefaultCss());
Esempio n. 11
0
en PHP, pero nos ayuda a entender el concepto y asi poder aplicarlo 
en otros lenguajes mas estrictos.
*/
function area(classPoligono $obj)
{
    $obj->calculo();
}
/*
Creamos los objetos necesarios
*/
$cuadrado = new classCuadrado();
$rectangulo = new classRectangulo();
$triangulo = new classTriangulo();
/*
Ejecutamos la funcion encargada 
de realizar la llamada polimorfica
*/
area($cuadrado);
area($rectangulo);
area($triangulo);
?>









Esempio n. 12
0
function both()
{
    global $r;
    return array(area($r), perimeter($r));
}
			<p><input type="submit" value="CALCULATE" name="calc" /></p>

		</form>




<?php 
if (isset($_POST['calc'])) {
    $length = $_POST['length'];
    $width = $_POST['width'];
    echo "length:" . $length . "<br><br>";
    echo "width:" . $width . "<br><br>";
    function perimeter($length, $width)
    {
        return 2 * ($length + $width);
    }
    $perimeter = perimeter($length, $width);
    echo "perimeter:" . $perimeter . "<br>", "<br>";
    function area($length, $width)
    {
        return $length * $width;
    }
    $area = area($length, $width);
    echo "area:" . $area;
}
?>



	</body>
Esempio n. 14
0
 /*Llamando a la funcion constructora dependiendo del tipo de respuesta*/
 switch ($tipo_respuesta) {
     case 'FOTO':
         foto($id_pregunta, $modo);
         break;
     case 'DIBUJO':
         dibujo($id_pregunta, $modo);
         break;
     case 'TITULO':
         titulo($id_pregunta, $enunciado, $modo);
         break;
     case 'TEXTO':
         texto($id_pregunta, $enunciado, $modo);
         break;
     case 'AREA':
         area($id_pregunta, $enunciado, $modo);
         break;
     case 'MULTIPLE':
         /*Seleccionamos las alternativas de la seleccion multiple*/
         $statement = $conn->prepare("SELECT IdPregunta, ValorAlternativa, Tipo FROM SeleccionMultiple WHERE IdPregunta =:id");
         $statement->bindParam(':id', $id_pregunta);
         $statement->execute();
         /*Arreglo para guardar las opciones*/
         $opciones = array();
         while ($row = $statement->fetch()) {
             /*print $row['IdPregunta']."<br>";													
               print $row['ValorAlternativa']."<br>";		
               print $row['Tipo']."<br>";	*/
             $tipo_multiple = $row['Tipo'];
             array_push($opciones, $row['ValorAlternativa']);
         }
Esempio n. 15
0
 $form->addForm("", "GET", $PHP_SELF);
 $form->addHtml("<div id=\"standard_form\">\n");
 $form->addField("hidden", "stage", "", "1");
 $form->addField("hidden", "action", "", "advanced_search");
 $buttons = $form->makeField("submit", "", "", "Search", array('class' => 'submit'));
 $buttons .= $form->makeField("button", "", "", "Reset", array('class' => 'button', 'onClick' => 'javascript:location.href=\'' . $PHP_SELF . '\';'));
 $formName = 'form1';
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Property Search</div>');
 $form->addHtml('<div id="' . $formName . '">');
 $form->addData($formData1, $_GET);
 $form->addHtml($form->addDiv($buttons));
 $form->addHtml("</div>\n");
 $form->addHtml("</fieldset>\n");
 $formName = 'area';
 $areas = area($_GET["cli_area"], "cli_", 4);
 //,$_SESSION["auth"]["default_scope"]
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Areas</div>');
 $form->addHtml('<div id="' . $formName . '" style="display:none" style="margin-left:10px">');
 $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch1\');" style="margin-left:5px;"><strong>Camberwell Branch</strong></a> <!--<span style="font-size:10px;color:#999999">(in brackets: Available &amp; Under Offer ' . $_SESSION["auth"]["default_scope"] . ')</span>-->');
 $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[1] . '</tr></table>');
 $form->addHtml('<a href="javascript:checkToggle(document.forms[0], \'branch2\');" style="margin-left:5px;"><strong>Sydenham Branch</strong></a> <!--<span style="font-size:10px;color:#999999">(in brackets: Available &amp; Under Offer ' . $_SESSION["auth"]["default_scope"] . ')</span>-->');
 $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:5px"><tr>' . $areas[2] . '</tr></table>');
 $form->addHtml($form->addDiv($buttons));
 $form->addHtml("</div>\n");
 $form->addHtml("</fieldset>\n");
 $formName = 'other';
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Other</div>');
 $form->addHtml('<div id="' . $formName . '">');
         }
         $cli_id = db_query($db_data, "UPDATE", "client", "cli_id", $cli_id);
         header("Location:?stage=3&cli_id={$cli_id}");
         exit;
     }
     break;
     ###########################################################
     # stage 3 - areas
     ###########################################################
 ###########################################################
 # stage 3 - areas
 ###########################################################
 case 3:
     # build data arrays
     $formData1 = array();
     $areas = area($_GET["cli_area"]);
     if (!$_GET["action"]) {
         $form = new Form();
         $form->addForm("", "get", $PHP_SELF);
         $form->addHtml("<div id=\"standard_form\">\n");
         $form->addField("hidden", "action", "", "update");
         $form->addField("hidden", "stage", "", "3");
         $form->addField("hidden", "cli_id", "", $cli_id);
         /////////////////////////////////////////////////////////////////////////////////
         $form->addHtml("<fieldset>\n");
         $form->addHtml('<div class="block-header">Areas</div>');
         //$form->addHtml($form->addLabel('East Dulwich','<table><tr>'.$render[1].'</tr></table>'));
         $form->addHtml('&nbsp;<a href="javascript:checkToggle(document.forms[0], \'branch1\');"><strong>Camberwell Branch</strong></a>');
         $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0"><tr>' . $areas[1] . '</tr></table>');
         $form->addHtml('&nbsp;<a href="javascript:checkToggle(document.forms[0], \'branch2\');"><strong>Sydenham Branch</strong></a>');
         $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0"><tr>' . $areas[2] . '</tr></table>');
Esempio n. 17
0
 protected function goods_export($goods_list = array())
 {
     //print_r($goods_list);exit;
     $goods_list = $goods_list;
     $data = array();
     foreach ($goods_list as $k => $goods_info) {
         $data[$k][order] = $goods_info['order'];
         $data[$k][area] = area($goods_info['area']);
         $data[$k][building] = building($goods_info['area'], $goods_info['building']);
         $data[$k][location] = $goods_info['location'];
         $data[$k][good] = $goods_info['good'];
         $data[$k][description] = $goods_info['description'];
         $data[$k][user] = $goods_info['user'];
         $data[$k][time] = date('Y/m/d H:i:s', $goods_info['time']);
         $data[$k][dotime] = date('Y/m/d H:i:s', $goods_info['dotime']);
         $data[$k][donetime] = date('Y/m/d H:i:s', $goods_info['donetime']);
         $data[$k][canceltime] = date('Y/m/d H:i:s', $goods_info['canceltime']);
         $data[$k][status] = status($goods_info['status']);
         $data[$k][emerg] = $goods_info['emerg'];
         $data[$k][doctor] = $goods_info['doctor'];
         $data[$k][repairer] = $goods_info['repairer'];
     }
     //print_r($goods_list);
     //print_r($data);exit;
     foreach ($data as $field => $v) {
         if ($field == 'order') {
             $headArr[] = '工单号';
         }
         if ($field == 'area') {
             $headArr[] = '区域';
         }
         if ($field == 'building') {
             $headArr[] = '楼栋';
         }
         if ($field == 'location') {
             $headArr[] = '地点';
         }
         if ($field == 'good') {
             $headArr[] = '物品';
         }
         if ($field == 'description') {
             $headArr[] = '描述';
         }
         if ($field == 'user') {
             $headArr[] = '用户';
         }
         if ($field == 'time') {
             $headArr[] = '报修时间';
         }
         if ($field == 'dotime') {
             $headArr[] = '确认时间';
         }
         if ($field == 'donetime') {
             $headArr[] = '完成时间';
         }
         if ($field == 'canceltime') {
             $headArr[] = '取消时间';
         }
         if ($field == 'status') {
             $headArr[] = '状态';
         }
         if ($field == 'emerg') {
             $headArr[] = '紧急';
         }
         if ($field == 'doctor') {
             $headArr[] = '管理员';
         }
         if ($field == 'repairer') {
             $headArr[] = '维修人员';
         }
     }
     $filename = "goods_list";
     $this->getExcel($filename, $headArr, $data);
 }
Esempio n. 18
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> 
<title>Exercise 5-2</title>
</head>
<body>
 	<?php 
function area($length, $width)
{
    if (is_int($length) && is_int($width)) {
        $area = $length * $width;
        return "A rectangle with length {$length} and width {$width} has area {$area}.";
    }
}
echo area(5, 2) . "<br/>";
echo area(3, 10) . "<br/>";
echo area(4, 23) . "<br/>";
?>
 </body>
 </html>
Esempio n. 19
0
<?php

$config = readconfig();
header1();
foreach ($config as $code => $data) {
    area($code, $data["x"], $data["y"], $data["dx"], $data["dy"]);
}
header2();
foreach ($config as $code => $data) {
    showlink($code, $data["name"], $data["location"], $data["url"]);
}
header3();
function header1()
{
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>New South Wales Trails Map</title>
    <style type="text/css">
	body {
	    padding: 0;
	    margin: 0;
	}
	#map ul {
	    padding: 0;
	    margin: 0;
	}

	#map {
	   margin:0;
Esempio n. 20
0
</head>
<body>
 	<?php 
function area($length, $width)
{
    if (is_integer($length) && is_integer($width)) {
        return $length * $width;
    } else {
        return 0;
    }
}
if (!isset($_POST['submit'])) {
    echo "Enter length and width:<br/>";
    ?>
			<form action="<?php 
    htmlspecialchars($_SERVER['PHP_SELF']);
    ?>
" method="POST">
				Length: <input type="text" name="length" />
				Width: <input type="text" name="width" />
				<input type="submit" name="submit" value="Submit"/>	
			</form>
 		<?php 
} else {
    $length = (int) $_POST['length'];
    $width = (int) $_POST['width'];
    echo "A rectangle with length {$length} and width {$width} has area " . area($length, $width) . ".";
}
?>
 </body>
 </html>
Esempio n. 21
0
<?php

require 'libs/IPoligono.php';
require 'libs/Cuadrado.php';
require 'libs/Rectangulo.php';
function area(IPoligono $obj)
{
    $obj->calcular();
}
$cuadrado = new Cuadrado();
$rectangulo = new Rectangulo();
area($cuadrado);
area($rectangulo);