当前位置: 首页>>代码示例>>PHP>>正文


PHP Intval函数代码示例

本文整理汇总了PHP中Intval函数的典型用法代码示例。如果您正苦于以下问题:PHP Intval函数的具体用法?PHP Intval怎么用?PHP Intval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Intval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_next_practice_id

 public function get_next_practice_id()
 {
     $result = -1;
     if ($query = $this->db->query("SELECT MAX(practiceid) AS `prid` FROM `am_practice`;")) {
         if ($query->num_rows() > 0) {
             if ($row = $query->result()) {
                 $result = $row[0]->prid;
             }
         }
         $query->free_result();
     }
     if ($result == "" || $result == -1) {
         $result = "AMPR-A00001";
     } else {
         if (Intval(substr($result, 6)) == 99999) {
             if (ord(substr($result, 5, 1)) == 'z') {
                 $result = -1;
             } else {
                 $val = char(ord(substr($result, 5, 1)) + 1);
                 $result = "AMPR-" . $val . "00001";
             }
         } else {
             $val = Intval(substr($result, 6)) + 1;
             $result = substr($result, 0, 6) . ($val < 10000 ? $val < 1000 ? $val < 100 ? $val < 10 ? "0000" . $val : "000" . $val : "00" . $val : "0" . $val : $val);
         }
     }
     return $result;
 }
开发者ID:renjith4ss,项目名称:audmetrics,代码行数:28,代码来源:Practice_db_model.php

示例2: CheckFields

 public static function CheckFields(&$arFields, $ID = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     $arMsg = array();
     if ($ID > 0) {
         unset($arFields["ID"]);
     }
     global $DB;
     if (($ID === false || is_set($arFields, "TASK_ID")) && strlen($arFields["TASK_ID"]) <= 0) {
         $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_ID"));
     } elseif (is_set($arFields, "TASK_ID")) {
         $arTaskID = CControllerTask::GetTaskArray();
         if (!isset($arTaskID[$arFields['TASK_ID']])) {
             $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_BAD_ID"));
         }
     }
     if (($ID === false || is_set($arFields, "CONTROLLER_MEMBER_ID")) && Intval($arFields["CONTROLLER_MEMBER_ID"]) <= 0) {
         $arMsg[] = array("id" => "CONTROLLER_MEMBER_ID", "text" => GetMessage("CTRLR_TASK_ERR_CLIENTID"));
     }
     if (isset($arFields["INIT_EXECUTE"])) {
         $arFields["INIT_CRC"] = crc32($arFields["INIT_EXECUTE"]);
     }
     if (count($arMsg) <= 0 && $ID === false) {
         $strSql = "\n\t\t\t\tSELECT INIT_EXECUTE\n\t\t\t\tFROM b_controller_task\n\t\t\t\tWHERE CONTROLLER_MEMBER_ID='" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "'\n\t\t\t\tAND TASK_ID='" . $DB->ForSQL($arFields["TASK_ID"], 255) . "'\n\t\t\t\tAND DATE_EXECUTE IS NULL\n\t\t\t";
         $dbr = $DB->Query($strSql);
         while ($ar = $dbr->Fetch()) {
             if (intval($ar["INIT_EXECUTE"]) == intval($arFields["INIT_EXECUTE"])) {
                 $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_ALREADY") . " [" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "].");
                 break;
             }
         }
     }
     $APPLICATION->ResetException();
     if ($ID === false) {
         foreach (GetModuleEvents("controller", "OnBeforeTaskAdd", true) as $arEvent) {
             $bEventRes = ExecuteModuleEventEx($arEvent, array($arFields));
             if ($bEventRes === false) {
                 if ($err = $APPLICATION->GetException()) {
                     $arMsg[] = array("id" => "ID", "text" => $err->GetString() . " [" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "].");
                 } else {
                     $arMsg[] = array("id" => "ID", "text" => "Unknown error." . " [" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "].");
                 }
                 break;
             }
         }
     }
     if (count($arMsg) > 0) {
         $e = new CAdminException($arMsg);
         $APPLICATION->ThrowException($e);
         return false;
     }
     if ($ID === false && !is_set($arFields, "DATE_CREATE")) {
         $arFields["~DATE_CREATE"] = $DB->CurrentTimeFunction();
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:57,代码来源:controllertask.php

示例3: CheckFields

 function CheckFields(&$arFields, $ID = false)
 {
     $arErrMsg = array();
     if ($ID > 0) {
         unset($arFields["ID"]);
     }
     global $DB;
     if (($ID === false || is_set($arFields, "TASK_ID")) && strlen($arFields["TASK_ID"]) <= 0) {
         $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_ID"));
     } elseif (is_set($arFields, "TASK_ID")) {
         $arTaskID = CControllerTask::GetTaskArray();
         if (!isset($arTaskID[$arFields['TASK_ID']])) {
             $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_BAD_ID"));
         }
     }
     if (($ID === false || is_set($arFields, "CONTROLLER_MEMBER_ID")) && Intval($arFields["CONTROLLER_MEMBER_ID"]) <= 0) {
         $arMsg[] = array("id" => "CONTROLLER_MEMBER_ID", "text" => GetMessage("CTRLR_TASK_ERR_CLIENTID"));
     }
     if (isset($arFields["INIT_EXECUTE"])) {
         $arFields["INIT_CRC"] = crc32($arFields["INIT_EXECUTE"]);
     }
     if (count($arMsg) <= 0 && $ID === false) {
         $strSql = "\n\t\t\t\tSELECT INIT_EXECUTE\n\t\t\t\tFROM b_controller_task\n\t\t\t\tWHERE CONTROLLER_MEMBER_ID='" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "'\n\t\t\t\tAND TASK_ID='" . $DB->ForSQL($arFields["TASK_ID"], 255) . "'\n\t\t\t\tAND DATE_EXECUTE IS NULL\n\t\t\t";
         $dbr = $DB->Query($strSql);
         while ($ar = $dbr->Fetch()) {
             if (intval($ar["INIT_EXECUTE"]) == intval($arFields["INIT_EXECUTE"])) {
                 $arMsg[] = array("id" => "TASK_ID", "text" => GetMessage("CTRLR_TASK_ERR_ALREADY") . " [" . IntVal($arFields["CONTROLLER_MEMBER_ID"]) . "].");
                 break;
             }
         }
     }
     if (count($arMsg) > 0) {
         $e = new CAdminException($arMsg);
         $GLOBALS["APPLICATION"]->ThrowException($e);
         return false;
     }
     if ($ID === false && !is_set($arFields, "DATE_CREATE")) {
         $arFields["~DATE_CREATE"] = $DB->CurrentTimeFunction();
     }
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:41,代码来源:controllertask.php

示例4: quickaddtocartform_add

 function quickaddtocartform_add($data, $form)
 {
     $shoppingCart = ShoppingCart::singleton();
     $buyableID = intval($data["BuyableID"]);
     $buyableClassName = Convert::raw2sql($data["BuyableClassName"]);
     $version = Intval($data["Version"]);
     $quantity = floatval($data["Quantity"]);
     $status = "bad";
     $message = _t("AddToCartPage.ERRORPRODUCTNOTADDED", "ERROR: Product Not Added - make sure to find a product first.");
     if (class_exists($buyableClassName) && EcommerceDBConfig::is_buyable($buyableClassName)) {
         $buyable = $buyableClassName::get()->byID($buyableID);
         if ($buyable) {
             $shoppingCart->addBuyable($buyable, $quantity);
             $status = "good";
             $message = _t("AddToCartPage.ADDED", "Added");
         }
     }
     if (Director::is_ajax()) {
         return $shoppingCart->setMessageAndReturn($message, $status, $form);
     } else {
         $form->setMessage($message, $status);
         $this->redirectBack();
     }
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce-quick-add,代码行数:24,代码来源:AddToCartPage.php

示例5: get_next_id

 public function get_next_id($practice, $practiceprefix)
 {
     $result = -1;
     if ($query = $this->db->query("SELECT MAX(deviceid) AS `did` FROM `" . $practice . "_device`;")) {
         if ($query->num_rows() > 0) {
             if ($row = $query->result()) {
                 $result = $row[0]->did;
             }
         }
         $query->free_result();
     }
     if ($result == "" || $result == -1) {
         if ($practice == "am") {
             $result = "AMD-A001";
         } else {
             $result = $practiceprefix . "D-A001";
         }
     } else {
         if (Intval(substr($result, 5)) == 999) {
             if (ord(substr($result, 4, 1)) == 'Z') {
                 $result = -1;
             } else {
                 $val = char(ord(substr($result, 4, 1)) + 1);
                 $result = substr($result, 0, 4) . $val . "001";
             }
         } else {
             $val = Intval(substr($result, 5)) + 1;
             $result = substr($result, 0, 5) . ($val < 100 ? $val < 10 ? "00" . $val : "0" . $val : $val);
         }
     }
     return $result;
 }
开发者ID:renjith4ss,项目名称:audmetrics,代码行数:32,代码来源:Device_model.php

示例6: Delete

 function Delete($ID)
 {
     /**
      * @global CMain $APPLICATION
      * @global CDatabase $DB
      */
     global $APPLICATION;
     $ID = Intval($ID);
     foreach (GetModuleEvents("main", "OnBeforeEventMessageDelete", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             $err = GetMessage("MAIN_BEFORE_DEL_ERR") . ' ' . $arEvent['TO_NAME'];
             if ($ex = $APPLICATION->GetException()) {
                 $err .= ': ' . $ex->GetString();
             }
             $APPLICATION->throwException($err);
             return false;
         }
     }
     @set_time_limit(600);
     //check module event for OnDelete
     foreach (GetModuleEvents("main", "OnEventMessageDelete", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID));
     }
     Mail\Internal\EventMessageSiteTable::delete($ID);
     $result = Mail\Internal\EventMessageTable::delete($ID);
     if ($result->isSuccess()) {
         $res = new CDBResultEventMultiResult();
         $res->affectedRowsCount = 1;
     } else {
         $res = false;
     }
     return $res;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:event.php

示例7: ShowError

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("blog")) {
    ShowError(GetMessage("BLOG_MODULE_NOT_INSTALL"));
    return;
}
$arParams["ID"] = IntVal($arParams["ID"]);
$arParams["BLOG_URL"] = preg_replace("/[^a-zA-Z0-9_-]/is", "", Trim($arParams["BLOG_URL"]));
$arParams["TB_LENGTH"] = Intval($arParams["TB_LENGTH"]);
if ($arParams["CACHE_TYPE"] == "Y" || $arParams["CACHE_TYPE"] == "A" && COption::GetOptionString("main", "component_cache_on", "Y") == "Y") {
    $arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]);
} else {
    $arParams["CACHE_TIME"] = 0;
}
if (strLen($arParams["BLOG_VAR"]) <= 0) {
    $arParams["BLOG_VAR"] = "blog";
}
if (strLen($arParams["PAGE_VAR"]) <= 0) {
    $arParams["PAGE_VAR"] = "page";
}
if (strLen($arParams["POST_VAR"]) <= 0) {
    $arParams["POST_VAR"] = "id";
}
$arParams["PATH_TO_TRACKBACK"] = trim($arParams["PATH_TO_TRACKBACK"]);
if (strlen($arParams["PATH_TO_TRACKBACK"]) <= 0) {
    $arParams["PATH_TO_TRACKBACK"] = htmlspecialcharsbx($APPLICATION->GetCurPage() . "?" . $arParams["PAGE_VAR"] . "=trackback&" . $arParams["BLOG_VAR"] . "=#blog#" . "&" . $arParams["POST_VAR"] . "=#post_id#");
}
$arParams["DATE_TIME_FORMAT"] = trim(empty($arParams["DATE_TIME_FORMAT"]) ? $DB->DateFormatToPHP(CSite::GetDateFormat("FULL")) : $arParams["DATE_TIME_FORMAT"]);
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例8: frontendFunctions

 /**
  * Conjunto de funciones para ordenar y filtrar en relación de la URL
  * 
  * @author Jonathan Sandoval        <jonathan_s_pisis@hotmail.com>
  * @return Array(Distribuidor)      Conjunto de Distribuidores despueś de analizar la URL
  */
 static function frontendFunctions()
 {
     // Obtención de los datos de la URL
     $url = ControladorBaseDatos::getRestoURL();
     $attribArray = array("ID", "Direccion", "Nombre");
     //Revisa si se desea eliminar un Distribuidor
     if (strripos($url, "?action=delete&distribuidor_id=") !== false) {
         $id_distribuidor = Intval(substr($url, strlen("?action=delete&distribuidor_id=")));
         /* Validación del tipo de Distribuidor
          */
         if (self::eliminarDistribuidor($id_distribuidor) == false) {
             $error = ControladorBaseDatos::getLastError();
             if ($error != "") {
                 $error = substr($error, strpos($error, '`herremex`.`') + strlen('`herremex`.`'));
                 $error = substr($error, strpos($error, '`herremex`.`') + strlen('`herremex`.`'));
                 $error = substr($error, 0, strpos($error, '`'));
                 echo "<script>\n                                alert('La tabla \\'{$error}\\' está ocupando al distribuidor');\n                              </script>";
             }
         }
     }
     $distribuidores = self::obtenerDistribuidores();
     // Revisa si desea buscar por nombre
     if (strpos($url, "?keyword=") !== false) {
         $to_search = substr($url, strlen("?keyword="));
         $to_search = substr($to_search, 0, strpos($to_search, '&'));
         if ($to_search !== "") {
             //Filtra en relación de todo su nombre
             $distribuidores = self::obtenerDistribuidorNombreoID($to_search, $to_search);
         }
     }
     // Si desea buscar de modo avanzado
     if (strpos($url, "?keyword_id=") !== false) {
         $myurl = $url;
         $distribuidorTemp = array();
         $distribuidores = array();
         $keywArray = array("?keyword_id=", "keyword_direccion=", "keyword_nombre=");
         //Rescara los valores de cada kwyword y los agrega a un objeto Distribuidor
         foreach ($keywArray as $key => $keyword) {
             $myurl = substr($myurl, stripos($myurl, $keyword));
             $distribuidorTemp[$attribArray["{$key}"]] = substr($myurl, stripos($myurl, $keyword) + strlen($keyword), stripos($myurl, "&") - strlen($keyword));
         }
         //Filtra en relación de los datos del objeto obtenido
         $distribuidores = self::filtrarDistribuidores(self::array_Distribuidor($distribuidorTemp));
     }
     //Retorna el conjunto de Distribuidores después de las operaciones
     return $distribuidores;
 }
开发者ID:jonatalamantes,项目名称:Herremex,代码行数:53,代码来源:ControladorDistribuidor.php

示例9: evalua

 function evalua($valor)
 {
     if ($valor == 0) {
         return 'cero';
     }
     $decimales = 0;
     $letras = '';
     while ($valor != 0) {
         // Validamos si supera los 100 millones
         if ($valor >= 1000000000) {
             return 'L&iacute;mite de aplicaci&oacute;n exedido.';
         }
         //Centenas de Millón
         if ($valor < 1000000000 and $valor >= 100000000) {
             if (intval($valor / 100000000) == 1 and $valor - intval($valor / 100000000) * 100000000 < 1000000) {
                 $letras .= (string) 'cien millones ';
             } else {
                 $letras .= $this->centenas(intval($valor / 100000000));
                 if (intval($valor / 100000000) != 1 and intval($valor / 100000000) != 5 and intval($valor / 100000000) != 7 and intval($valor / 100000000) != 9) {
                     $letras .= (string) 'ciento ';
                 } else {
                     $letras .= (string) ' ';
                 }
             }
             $valor = $valor - Intval($valor / 100000000) * 100000000;
         }
         //Decenas de Millón
         if ($valor < 100000000 and $valor >= 10000000) {
             if (intval($valor / 1000000) < 16) {
                 $tempo = $this->decenas(intval($valor / 1000000));
                 $letras .= (string) $tempo;
                 $letras .= (string) ' millones ';
                 $valor = $valor - intval($valor / 1000000) * 1000000;
             } else {
                 $letras .= $this->decenas(intval($valor / 10000000) * 10);
                 $valor = $valor - intval($valor / 10000000) * 10000000;
                 if ($valor > 1000000) {
                     $letras .= $letras . ' y ';
                 }
             }
         }
         //Unidades de Millon
         if ($valor < 10000000 and $valor >= 1000000) {
             $tempo = intval($valor / 1000000);
             if ($tempo == 1) {
                 $letras .= (string) ' un mill&oacute;n ';
             } else {
                 $tempo = unidades(intval($valor / 1000000));
                 $letras .= (string) $tempo;
                 $letras .= (string) " millones ";
             }
             $valor = $valor - intval($valor / 1000000) * 1000000;
         }
         //Centenas de Millar
         if ($valor < 1000000 and $valor >= 100000) {
             $tempo = intval($valor / 100000);
             $tempo2 = $valor - $tempo * 100000;
             if ($tempo == 1 and $tempo2 < 1000) {
                 $letras .= (string) 'cien mil ';
             } else {
                 $tempo = $this->centenas(intval($valor / 100000));
                 $letras .= (string) $tempo;
                 $tempo = intval($valor / 100000);
                 if ($tempo != 1 and $tempo != 5 and $tempo != 7 and $tempo != 9) {
                     $letras .= (string) 'ciento ';
                 } else {
                     $letras .= (string) ' ';
                 }
             }
             $valor = $valor - intval($valor / 100000) * 100000;
         }
         //Decenas de Millar
         if ($valor < 100000 and $valor >= 10000) {
             $tempo = intval($valor / 1000);
             if ($tempo < 16) {
                 $tempo = $this->decenas(intval($valor / 1000));
                 $letras .= (string) $tempo;
                 $letras .= (string) ' mil ';
                 $valor = $valor - intval($valor / 1000) * 1000;
             } else {
                 $tempo = $this->decenas(intval($valor / 10000) * 10);
                 $letras .= (string) $tempo;
                 $valor = $valor - intval($valor / 10000) * 10000;
                 if ($valor > 1000) {
                     $letras .= (string) ' y ';
                 } else {
                     $letras .= (string) ' mil ';
                 }
             }
         }
         //Unidades de Millar
         if ($valor < 10000 and $valor >= 1000) {
             $tempo = intval($valor / 1000);
             if ($tempo == 1) {
                 $letras .= (string) '';
             } else {
                 $tempo = $this->unidades(intval($valor / 1000));
                 $letras .= (string) $tempo;
             }
             $letras .= (string) ' mil ';
//.........这里部分代码省略.........
开发者ID:LuisHY15,项目名称:barcode,代码行数:101,代码来源:numerosALetras.class.php

示例10: Delete

	function Delete($ID)
	{
		global $DB;
		$ID = Intval($ID);
		$strSql = "DELETE FROM b_mail_filter_cond WHERE ID=".$ID;
		return $DB->Query($strSql, true);
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:7,代码来源:mail.php

示例11: frontendFunctions

 /**
  * Conjunto de funciones para ordenar y filtrar en relación de la URL
  * 
  * @author Jonathan Sandoval    <jonathan_s_pisis@hotmail.com>
  * @return Array(Empleado)      Conjunto de Empleados despueś de analizar la URL
  */
 static function frontendFunctions()
 {
     // Obtención de los datos de la URL
     $url = ControladorBaseDatos::getRestoURL();
     $attribArray = array("ID", "CURP", "Nombre", "Segundo_Nombre", "Apellido_Paterno", "Apellido_Materno", "Turno", "Tipo_Empleado", "Calle", "Colonia", "NoCasa_Ext", "NoCasa_Int", "Ciudad", "Password");
     //Revisa si se desea eliminar un Empleado
     if (strripos($url, "?action=delete&empleado_id=") !== false) {
         $id_empleado = Intval(substr($url, strlen("?action=delete&empleado_id=")));
         /* Validación del tipo de Empleado
          */
         if (self::eliminarEmpleado($id_empleado) == false) {
             $error = ControladorBaseDatos::getLastError();
             if ($error != "") {
                 $error = substr($error, strpos($error, '`herremex`.`') + strlen('`herremex`.`'));
                 $error = substr($error, strpos($error, '`herremex`.`') + strlen('`herremex`.`'));
                 $error = substr($error, 0, strpos($error, '`'));
                 echo "<script>\n                                alert('La tabla \\'{$error}\\' está ocupando al empleado');\n                              </script>";
             }
         }
     }
     $empleados = self::obtenerEmpleados();
     // Revisa si desea buscar por nombre
     if (strpos($url, "?keyword=") !== false) {
         $to_search = substr($url, strlen("?keyword="));
         $to_search = substr($to_search, 0, strpos($to_search, '&'));
         if ($to_search !== "") {
             //Filtra en relación de todo su nombre
             $empleados = self::obtenerEmpleadoNombres($to_search, $to_search, $to_search, $to_search);
         }
     }
     // Si desea buscar de modo avanzado
     if (strpos($url, "?keyword_id=") !== false) {
         $myurl = $url;
         $empleadoTemp = array();
         $empleados = array();
         $keywArray = array("?keyword_id=", "keyword_curp=", "keyword_primer_nombre=", "keyword_segundo_nombre=", "keyword_apellido_paterno=", "keyword_apellido_materno=", "keyword_turno=", "keyword_tipo=", "keyword_calle=", "keyword_colonia=", "keyword_ext=", "keyword_Int=", "keyword_ciudad=");
         //Rescara los valores de cada kwyword y los agrega a un objeto Empleado
         foreach ($keywArray as $key => $keyword) {
             $myurl = substr($myurl, stripos($myurl, $keyword));
             $empleadoTemp[$attribArray["{$key}"]] = substr($myurl, stripos($myurl, $keyword) + strlen($keyword), stripos($myurl, "&") - strlen($keyword));
         }
         //Filtra en relación de los datos del objeto obtenido
         $empleados = self::filtrarEmpleados(self::array_Empleado($empleadoTemp));
     }
     //Retorna el conjunto de Empleados después de las operaciones
     return $empleados;
 }
开发者ID:jonatalamantes,项目名称:Herremex,代码行数:53,代码来源:ControladorEmpleado.php

示例12: clear

 /**
  * Clears the cart contents completely by removing the orderID from session, and
  * thus creating a new cart on next request.
  * @return Boolean
  */
 public function clear()
 {
     //we keep this here so that a flush can be added...
     set_time_limit(1200);
     self::$singletoncart = null;
     $this->order = null;
     $this->messages = array();
     foreach (self::$session_variable_names as $name) {
         $sessionVariableName = $this->sessionVariableName($name);
         Session::set($sessionVariableName, null);
         Session::clear($sessionVariableName);
         Session::save();
     }
     $memberID = Intval(Member::currentUserID());
     if ($memberID) {
         $orders = Order::get()->filter(array("MemberID" => $memberID));
         if ($orders && $orders->count()) {
             foreach ($orders as $order) {
                 if (!$order->IsSubmitted()) {
                     $order->delete();
                 }
             }
         }
     }
     return true;
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:31,代码来源:ShoppingCart.php

示例13: Trim

$arParams["PATH_TO_PAYMENT"] = Trim($arParams["PATH_TO_PAYMENT"]);
if (strlen($arParams["PATH_TO_PAYMENT"]) <= 0) {
    $arParams["PATH_TO_PAYMENT"] = "payment.php";
}
$arParams["PATH_TO_AUTH"] = Trim($arParams["PATH_TO_AUTH"]);
if (strlen($arParams["PATH_TO_AUTH"]) <= 0) {
    $arParams["PATH_TO_AUTH"] = "/auth/";
}
$arParams["PAY_FROM_ACCOUNT"] = $arParams["PAY_FROM_ACCOUNT"] == "N" ? "N" : "Y";
$arParams["COUNT_DELIVERY_TAX"] = $arParams["COUNT_DELIVERY_TAX"] == "Y" ? "Y" : "N";
$arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"] = $arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"] == "Y" ? "Y" : "N";
$arParams["ONLY_FULL_PAY_FROM_ACCOUNT"] = $arParams["ONLY_FULL_PAY_FROM_ACCOUNT"] == "Y" ? "Y" : "N";
$arParams["DELIVERY_NO_AJAX"] = $arParams["DELIVERY_NO_AJAX"] == "Y" ? "Y" : "N";
$arParams["USE_PREPAYMENT"] = $arParams["USE_PREPAYMENT"] == 'Y' ? 'Y' : 'N';
$arParams["DISPLAY_IMG_HEIGHT"] = Intval($arParams["DISPLAY_IMG_HEIGHT"]) <= 0 ? 90 : Intval($arParams["DISPLAY_IMG_HEIGHT"]);
$arParams["DISPLAY_IMG_WIDTH"] = Intval($arParams["DISPLAY_IMG_WIDTH"]) <= 0 ? 90 : Intval($arParams["DISPLAY_IMG_WIDTH"]);
$arParams["DELIVERY_TO_PAYSYSTEM"] = strlen($arParams["DELIVERY_TO_PAYSYSTEM"]) <= 0 ? "d2p" : trim($arParams["DELIVERY_TO_PAYSYSTEM"]);
$GLOBALS['CATALOG_ONETIME_COUPONS_BASKET'] = null;
$GLOBALS['CATALOG_ONETIME_COUPONS_ORDER'] = null;
$arResult = array("PERSON_TYPE" => array(), "PAY_SYSTEM" => array(), "ORDER_PROP" => array(), "DELIVERY" => array(), "TAX" => array(), "ERROR" => array(), "ORDER_PRICE" => 0, "ORDER_WEIGHT" => 0, "VATE_RATE" => 0, "VAT_SUM" => 0, "bUsingVat" => false, "BASKET_ITEMS" => array(), "BASE_LANG_CURRENCY" => CSaleLang::GetLangCurrency(SITE_ID), "WEIGHT_UNIT" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', false, SITE_ID)), "WEIGHT_KOEF" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, SITE_ID)), "TaxExempt" => array(), "DISCOUNT_PRICE" => 0, "DISCOUNT_PERCENT" => 0, "DELIVERY_PRICE" => 0, "TAX_PRICE" => 0, "PAYED_FROM_ACCOUNT_FORMATED" => false, "ORDER_TOTAL_PRICE_FORMATED" => false, "ORDER_WEIGHT_FORMATED" => false, "ORDER_PRICE_FORMATED" => false, "VAT_SUM_FORMATED" => false, "DELIVERY_SUM" => false, "DELIVERY_PROFILE_SUM" => false, "DELIVERY_PRICE_FORMATED" => false, "DISCOUNT_PERCENT_FORMATED" => false, "PAY_FROM_ACCOUNT" => false, "CURRENT_BUDGET_FORMATED" => false, "USER_ACCOUNT" => false, "DISCOUNTS" => array(), "AUTH" => array(), "HAVE_PREPAYMENT" => false, "PREPAY_PS" => array(), "PREPAY_ADIT_FIELDS" => "", "PREPAY_ORDER_PROPS" => array());
$arUserResult = array("PERSON_TYPE_ID" => false, "PAY_SYSTEM_ID" => false, "DELIVERY_ID" => false, "ORDER_PROP" => false, "DELIVERY_LOCATION" => false, "TAX_LOCATION" => false, "PAYER_NAME" => false, "USER_EMAIL" => false, "PROFILE_NAME" => false, "PAY_CURRENT_ACCOUNT" => false, "CONFIRM_ORDER" => false, "FINAL_STEP" => false, "ORDER_DESCRIPTION" => false, "PROFILE_ID" => false, "PROFILE_CHANGE" => false, "DELIVERY_LOCATION_ZIP" => false);
$arResult["AUTH"]["new_user_registration_email_confirmation"] = COption::GetOptionString("main", "new_user_registration_email_confirmation", "N") == "Y" ? "Y" : "N";
$arResult["AUTH"]["new_user_registration"] = COption::GetOptionString("main", "new_user_registration", "Y") == "Y" ? "Y" : "N";
$arParams["ALLOW_AUTO_REGISTER"] = $arParams["ALLOW_AUTO_REGISTER"] == "Y" ? "Y" : "N";
if ($arParams["ALLOW_AUTO_REGISTER"] == "Y" && ($arResult["AUTH"]["new_user_registration_email_confirmation"] == "Y" || $arResult["AUTH"]["new_user_registration"] == "N")) {
    $arParams["ALLOW_AUTO_REGISTER"] = "N";
}
$arParams["SEND_NEW_USER_NOTIFY"] = $arParams["SEND_NEW_USER_NOTIFY"] == "N" ? "N" : "Y";
$allCurrency = CSaleLang::GetLangCurrency(SITE_ID);
if (!$arParams["DELIVERY_NO_SESSION"]) {
    $arParams["DELIVERY_NO_SESSION"] = "N";
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例14: mysqli_connect

<?php

if ($_POST) {
    $con = mysqli_connect("***", "***", "***", "tickets") or die("cannot connect to database");
    $result_set = mysqli_query($con, "SELECT * FROM `closedtickets` ");
    $row = mysqli_fetch_array($result_set);
    $Id = Intval($_POST['Id']);
    $Title = $row['Title'];
    $Priority = $row['Priority'];
    $Description = $row['Description'];
    $Department = $row['Department'];
    $Email = $row['Email'];
    $Date = date("H:i:s m-d-Y");
    //Deletes original copy of selected data
    $sqll = "DELETE FROM `tickets`.`closedtickets` WHERE `closedtickets`.`Id` = '{$Id}' LIMIT 1 ";
    mysqli_query($con, $sqll);
    //reloads page
    header('location: ClosedTickets.php');
}
?>
        
开发者ID:ronnyarsenal,项目名称:Support-Site-Ticket-System,代码行数:20,代码来源:Finalize.php

示例15: Intval

Протяженность: <?php 
echo $node->content;
?>
 м.<br>
<?php 
$node = $xml->SelectNodes('/info/traffic/time');
?>
Последнее обновление: <?php 
echo $node->content;
?>

</span>
</td>
<?php 
$node = $xml->SelectNodes('/info/traffic/level');
$t = Intval($node->content);
?>
<td nowrap="yes" width="20%"><span class="traf<?php 
echo intval(($t + 1) / 2);
?>
"><?php 
echo $t;
?>
</span></td>
</tr>
</table>
<?php 
if ($arGadgetParams["SHOW_URL"] == "Y") {
    ?>
<br />
<?php 
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php


注:本文中的Intval函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。