function trocaprefixo($txt) { for ($a = 1; $a <= strlen($txt); $a++) { $p = substr($txt, $a * -1, 1); $stv = IIF($p == '*', '%', $p); $vt .= $stv; } return strrev($vt); }
function isStrTransferred($content) { $splstr = ''; $i = ''; $s = ''; $nCount = ''; $nCount = 0; for ($i = 0; $i <= len($content) - 1; $i++) { $s = mid($content, len($content) - $i, 1); if ($s == '\\') { $nCount = $nCount + 1; } else { $isStrTransferred = IIF($nCount % 2 == 1, true, false); return @$isStrTransferred; } } return @$isStrTransferred; }
/** * 注册一个新用户 * @param string $username 用户名 * @param string $password 用户密码 * @return integer 注册成功-用户信息,注册失败-错误编号 * 错误编号: * -1:手机号码不能为空 * -2:密码不能为空 * -3:手机号码已经注册 * 0:注册失败 * >0:注册成功 */ public function register(string $username, string $password) { if (empty($username)) { return -1; } if (empty($password)) { return -2; } if ($this->checkMobile($username)) { return -3; } $data['username'] = $username; $data['password'] = $password; $data['app_os'] = PUT('app_os'); $data['register_ip'] = get_client_ip(1); $data['register_time'] = NOW_TIME; $data['updated'] = NOW_TIME; return IIF($this->add($data), 0); }
function groupUrl($url1, $url2) { $urlType = ''; $i = ''; $urlType = '/'; $url1 = replace($url1, IIF($urlType == '/', '\\', '/'), $urlType); $url2 = replace($url2, IIF($urlType == '/', '\\', '/'), $urlType); $url1 = PHPTrim($url1); $url2 = PHPTrim($url2); for ($i = 0; $i <= 99; $i++) { if (right($url1, 1) == $urlType) { $url1 = mid($url1, 1, len($url1) - 1); } else { break; } } for ($i = 0; $i <= 99; $i++) { if (left($url2, 1) == $urlType) { $url2 = mid($url2, 2, -1); } else { break; } } $groupUrl = $url1 . $urlType . $url2; return @$groupUrl; }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/constants.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db_funcs.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/miscellaneous/date_utils.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/miscellaneous/general.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/miscellaneous/numbers_utils.php"; try { $valor = $_REQUEST["campo"]; $params = array(":valor" => $valor, ":id" => $_REQUEST["id"]); $sql = "UPDATE rrhh.rba_boletinesarteria\n\t\t\t\tSET ba_" . $_REQUEST["tipo"] . " = " . IIF($_REQUEST["tipo"] == "fecha", "TO_DATE(:valor, 'dd/mm/yyyy')", ":valor") . "\n\t\t WHERE ba_id = :id"; DBExecSql($conn, $sql, $params, OCI_DEFAULT); DBCommit($conn); } catch (Exception $e) { DBRollback($conn); echo "<script>alert(unescape('" . rawurlencode($e->getMessage()) . "'));</script>"; exit; } ?> <script> <? switch ($_REQUEST["tipo"]) { case "ano": $valor = "Año ".decimalToRomana($_REQUEST["campo"]); break; case "fecha": $vals = split("/", $_REQUEST["campo"]); $valor = GetDayName(date("N", strtotime($vals[2]."-".$vals[1]."-".$vals[0])))." ".$vals[0]." de ".GetMonthName($vals[1])." de ".$vals[2]; break; case "numero":
// Guardo los datos en la tabla.. $params = array(":cargo" => $_REQUEST["Cargo"], ":contrato" => nullIsEmpty($_REQUEST["RelacionLaboral"]), ":delegacion" => $_REQUEST["Delegacion"], ":edificio" => nullIfCero($_REQUEST["Edificio"]), ":ejex" => nullIsEmpty($_REQUEST["EjeX"]), ":ejey" => nullIsEmpty($_REQUEST["EjeY"]), ":fechacumple" => $_REQUEST["FechaNacimiento"], ":horarioatencion" => $_REQUEST["HorarioAtencion"], ":idsector" => IIF(($_REQUEST["Sector"] == "-1"), NULL, $_REQUEST["Sector"]), ":interno" => $_REQUEST["Interno"], ":legajo" => nullIsEmpty($_REQUEST["Legajo"]), ":legajorrhh" => nullIsEmpty($_REQUEST["LegajoRRHH"]), ":piso" => nullIsEmpty($_REQUEST["Piso"]), ":respondea" => IIF(($_REQUEST["RespondeA"] == "-1"), NULL, $_REQUEST["RespondeA"]), ":usumodif" => GetWindowsLoginName()); $sql = "UPDATE use_usuarios SET se_fechamodif = SYSDATE, se_usumodif = UPPER(:usumodif), se_interno = :interno, se_fechacumple = TO_DATE(:fechacumple, 'dd/mm/yyyy'), se_idsector = :idsector, se_cargo = :cargo, se_delegacion = :delegacion, se_legajo = :legajo, se_legajorrhh = :legajorrhh, se_contrato = :contrato, se_respondea = :respondea, se_horarioatencion = :horarioatencion,
function XY_AP_GeneralList($action, $tableName, $addSql) { $title = ''; $topNumb = ''; $nTop = ''; $isB = ''; $sql = ''; $columnName = ''; $columnEnName = ''; $aboutcontent = ''; $bodyContent = ''; $showTitle = ''; $bannerImage = ''; $smallImage = ''; $bigImage = ''; $id = ''; $defaultStr = ''; $i = ''; $j = ''; $s = ''; $c = ''; $startStr = ''; $endStr = ''; $url = ''; $noFollow = ''; //不追踪 20141222 $defaultStr = getDefaultValue($action); //获得默认内容 $modI = ''; //余循环20150112 $noFollow = aspTrim(lCase(RParam($action, 'noFollow'))); //不追踪 $lableTitle = ''; //标题标题 $target = ''; //a链接打开目标方式 $adddatetime = ''; //添加时间 $isFocus = ''; $fieldNameList = ''; //字段列表 $abcolorStr = ''; //A加粗和颜色 $atargetStr = ''; //A链接打开方式 $atitleStr = ''; //A链接的title20160407 $anofollowStr = ''; //A链接的nofollow $splFieldName = ''; $fieldName = ''; $replaceStr = ''; $k = ''; $idPage = ''; $tableName = lCase($tableName); //转小写 $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); $splFieldName = aspSplit($fieldNameList, ','); $topNumb = RParam($action, 'topNumb'); $nTop = $topNumb; if ($nTop != '') { $nTop = CInt($nTop); } else { $nTop = 999; } if ($sql == '') { if ($topNumb != '') { $topNumb = ' top ' . $topNumb . ' '; } $sql = 'Select ' . $topNumb . '* From ' . $GLOBALS['db_PREFIX'] . $tableName; } //追加sql if ($addSql != '') { $sql = getWhereAnd($sql, $addSql); } $sql = replaceGlobleVariable($sql); //替换全局变量 //检测SQL if (checkSql($sql) == false) { errorLog('出错提示:<br>action=' . $action . '<hr>sql=' . $sql . '<br>'); return ''; } $rsObj = $GLOBALS['conn']->query($sql); for ($i = 1; $i <= @mysql_num_rows($rsObj); $i++) { $rs = mysql_fetch_array($rsObj); $startStr = ''; $endStr = ''; //call echo(sql,i & "," & nTop) if ($i > $nTop) { break; } //#【PHP】$rs=mysql_fetch_array($rsObj); //给PHP用,因为在 asptophp转换不完善 $isFocus = false; //交点为假 $id = $rs['id']; //【导航】 if ($tableName == 'webcolumn') { if ($GLOBALS['isMakeHtml'] == true) { $url = getRsUrl($rs['filename'], $rs['customaurl'], '/nav' . $rs['id']); } else { $url = handleWebUrl('?act=nav&columnName=' . $rs['columnname']); //会追加gl等参数 if ($rs['customaurl'] != '') { $url = $rs['customaurl']; $url = replaceGlobleVariable($url); } } //全局栏目名称为空则为自动定位首页 追加(20160128) if ($GLOBALS['glb_columnName'] == '' && $rs['columntype'] == '首页') { $GLOBALS['glb_columnName'] = $rs['columnname']; } if ($rs['columnname'] == $GLOBALS['glb_columnName']) { $isFocus = true; } //【文章】 } else { if ($tableName == 'articledetail') { if ($GLOBALS['isMakeHtml'] == true) { $url = getRsUrl($rs['filename'], $rs['customaurl'], 'detail/detail' . $rs['id']); } else { $url = handleWebUrl('?act=detail&id=' . $rs['id']); //会追加gl等参数 if ($rs['customaurl'] != '') { $url = $rs['customaurl']; } } //评论 } else { if ($tableName == 'tablecomment') { } } } //A链接添加颜色 $abcolorStr = ''; if (inStr($fieldNameList, ',titlecolor,') > 0) { //A链接颜色 if ($rs['titlecolor'] != '') { $abcolorStr = 'color:' . $rs['titlecolor'] . ';'; } } if (inStr($fieldNameList, ',flags,') > 0) { //A链接加粗 if (inStr($rs['flags'], '|b|') > 0) { $abcolorStr = $abcolorStr . 'font-weight:bold;'; } } if ($abcolorStr != '') { $abcolorStr = ' style="' . $abcolorStr . '"'; } //打开方式2016 if (inStr($fieldNameList, ',target,') > 0) { $atargetStr = IIF($rs['target'] != '', ' target="' . $rs['target'] . '"', ''); } //A的title if (inStr($fieldNameList, ',title,') > 0) { $atitleStr = IIF($rs['title'] != '', ' title="' . $rs['title'] . '"', ''); } //A的nofollow if (inStr($fieldNameList, ',nofollow,') > 0) { $anofollowStr = IIF($rs['nofollow'] != 0, ' rel="nofollow"', ''); } //交点判断(给栏目导航用的) if ($isFocus == true) { $startStr = '[list-focus]'; $endStr = '[/list-focus]'; } else { $startStr = '[list-' . $i . ']'; $endStr = '[/list-' . $i . ']'; } //在最后时排序当前交点20160202 if ($i == $topNumb && $isFocus == false) { $startStr = '[list-end]'; $endStr = '[/list-end]'; } //例[list-mod2] [/list-mod2] 20150112 for ($modI = 6; $modI >= 2; $modI--) { if (inStr($defaultStr, $startStr) == false && $i % $modI == 0) { $startStr = '[list-mod' . $modI . ']'; $endStr = '[/list-mod' . $modI . ']'; if (inStr($defaultStr, $startStr) > 0) { break; } } } //没有则用默认 if (inStr($defaultStr, $startStr) == false) { $startStr = '[list]'; $endStr = '[/list]'; } if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2); $s = replaceValueParam($s, 'i', $i); //循环编号 $s = replaceValueParam($s, '编号', $i); //循环编号 $s = replaceValueParam($s, 'id', $rs['id']); //id编号 因为获得字段他不获得id $s = replaceValueParam($s, 'url', $url); //网址 $s = replaceValueParam($s, 'aurl', 'href="' . $url . '"'); //网址 $s = replaceValueParam($s, 'abcolor', $abcolorStr); //A链接加颜色与加粗 $s = replaceValueParam($s, 'atitle', $atitleStr); //A链接title $s = replaceValueParam($s, 'anofollow', $anofollowStr); //A链接nofollow $s = replaceValueParam($s, 'atarget', $atargetStr); //A链接打开方式 for ($k = 0; $k <= uBound($splFieldName); $k++) { if ($splFieldName[$k] != '') { $fieldName = $splFieldName[$k]; $replaceStr = $rs[$fieldName] . ''; $s = replaceValueParam($s, $fieldName, $replaceStr); } } //开始位置加Dialog内容 $startStr = '[list-' . $i . ' startdialog]'; $endStr = '[/list-' . $i . ' startdialog]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2) . $s; } //结束位置加Dialog内容 $startStr = '[list-' . $i . ' enddialog]'; $endStr = '[/list-' . $i . ' enddialog]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = $s . StrCut($defaultStr, $startStr, $endStr, 2); } //加控制 //【导航】 if ($tableName == 'webcolumn') { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=WebColumn&lableTitle=网站栏目&nPageSize=10&page=&id=' . $rs['id'] . '&n=' . getRnd(11); //【评论】 } else { if ($tableName == 'tablecomment') { $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); $url = WEB_ADMINURL . '?act=addEditHandle&actionType=TableComment&lableTitle=评论&nPageSize=10&parentid=&searchfield=bodycontent&keyword=&addsql=&page=' . $idPage . '&id=' . $rs['id'] . '&n=' . getRnd(11); //【文章】 } else { if ($tableName == 'articledetail') { $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=' . $idPage . '&parentid=' . $rs['parentid'] . '&id=' . $rs['id'] . '&n=' . getRnd(11); $s = replaceValueParam($s, 'columnurl', getColumnUrl($rs['parentid'], '')); //文章对应栏目URL 20160304 $s = replaceValueParam($s, 'columnname', getColumnName($rs['parentid'])); //文章对应栏目名称 20160304 } } } $s = handleDisplayOnlineEditDialog($url, $s, '', 'div|li|span'); //处理是否添加在线修改管理器 $c = $c . $s; } } //开始内容加Dialog内容 $startStr = '[dialog start]'; $endStr = '[/dialog start]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $c = StrCut($defaultStr, $startStr, $endStr, 2) . $c; } //结束内容加Dialog内容 $startStr = '[dialog end]'; $endStr = '[/dialog end]'; if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $c = $c . StrCut($defaultStr, $startStr, $endStr, 2); } $XY_AP_GeneralList = $c; return @$XY_AP_GeneralList; }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/constants.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db_funcs.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/miscellaneous/general.php"; $params = array(":posicion" => $_REQUEST["Seccion"]); $sql = "SELECT 1\n\t\t FROM tmp.tai_articulosintranet\n\t\tWHERE ai_posicion = :posicion"; if (!ExisteSql($sql, $params)) { // Alta.. $params = array(":cuerpo" => $_REQUEST["Cuerpo"], ":destino" => $_REQUEST["Destino"], ":id" => -1, ":link" => IIF($_REQUEST["Link"] == "-1", NULL, $_REQUEST["Link"]), ":posicion" => $_REQUEST["Seccion"], ":rutaimagen" => IIF($_REQUEST["Imagen"] == "-1", NULL, $_REQUEST["Imagen"]), ":titulo" => $_REQUEST["Titulo"], ":volanta" => $_REQUEST["Volanta"]); $sql = "INSERT INTO tmp.tai_articulosintranet (ai_id, ai_titulo, ai_volanta, ai_cuerpo, ai_rutaimagen, ai_link, ai_destino, ai_posicion)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (:id, :titulo, :volanta, SUBSTR(:cuerpo, 1, 512), :rutaimagen, :link, :destino, :posicion)"; DBExecSql($conn, $sql, $params); } else { // Modificación.. $params = array(":cuerpo" => $_REQUEST["Cuerpo"], ":destino" => $_REQUEST["Destino"], ":link" => IIF($_REQUEST["Link"] == "-1", NULL, $_REQUEST["Link"]), ":posicion" => $_REQUEST["Seccion"], ":rutaimagen" => IIF($_REQUEST["Imagen"] == "-1", NULL, $_REQUEST["Imagen"]), ":titulo" => $_REQUEST["Titulo"], ":volanta" => $_REQUEST["Volanta"]); $sql = "UPDATE tmp.tai_articulosintranet\n\t\t\t\tSET ai_titulo = :titulo,\n\t\t\t\t\t\tai_volanta = :volanta,\n\t\t\t\t\t\tai_cuerpo = SUBSTR(:cuerpo, 1, 512),\n\t\t\t\t\t\tai_rutaimagen = :rutaimagen,\n\t\t\t\t\t\tai_link = :link,\n\t\t\t\t\t\tai_destino = :destino\n\t\t WHERE ai_posicion = :posicion"; DBExecSql($conn, $sql, $params); } ?> <script> <? if ($dbError["offset"]) { ?> alert('<?php echo $dbError["message"]; ?> '); <? } else {
function checkDomainName($httpurl) { $url = getwebsite($httpurl); $url2 = $url . "/a/1/b/2/cdefg/"; return IIF(checkHttpUrlSize($url, $url2) == 1, 0, 1); }
function scanCheckDomain() { $url = ''; $nSetTime = ''; $isdomain = ''; $htmlDir = ''; $txtFilePath = ''; $nThis = ''; $nCount = ''; $startTime = ''; $nSetTime = 3; $nThis = @$_REQUEST['nThis']; if ($nThis == '') { $nThis = 0; } else { $nThis = cint($nThis); } $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webdomain where isthrough=true'); $rs = mysql_fetch_array($rsObj); $nCount = @$_REQUEST['nCount']; if ($nCount == '') { $nCount = @mysql_num_rows($rsObj); } while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { $nThis = $nThis + 1; aspEcho($nThis . '/' . $nCount, $rs['website']); doEvents(); $htmlDir = '/../网站UrlScan/域名/'; CreateDirFolder($htmlDir); $txtFilePath = $htmlDir . '/' . setFileName($rs['website']) . '.txt'; if (CheckFile($txtFilePath) == true) { $isdomain = PHPTrim(getFText($txtFilePath)); aspEcho('类型', '本地'); $nSetTime = 1; } else { $isdomain = IIF(checkDomainName($rs['website']), 1, 0); createFile($txtFilePath, $isdomain . ' '); //防止PHP版写入不进去 0 这个内容 aspEcho('类型', '网络' . $txtFilePath . '(' . CheckFile($txtFilePath) . ')=' . $isdomain); } //这样写是给转PHP时方便 connexecute('update ' . $GLOBALS['db_PREFIX'] . 'webdomain set isthrough=false,isdomain=' . $isdomain . ',updatetime=\'' . now() . '\' where id=' . $rs['id'] . ''); $startTime = @$_REQUEST['startTime']; if ($startTime == '') { $startTime = now(); } Rw(VBRunTimer($startTime) . '<hr>'); $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $startTime . '&N=' . getRnd(11), 'replace'); Rw(jsTiming($url, $nSetTime)); die; } aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebDomain&addsql=order by id desc&lableTitle=网站域名\'>OK,共(' . $nThis . ')条</a>'); }
private function SPValidation(&$advertencias, &$errores) { global $conn; try { $curs = null; $params = array(":cbajapordeuda" => "F", ":ccampanaF931" => "S", ":cdatoscompetencia" => $this->datosSolicitud["datosCompetencia"], ":cprestacionesespeciales" => $this->datosSolicitud["prestacionesEspeciales"], ":csuscribepolizarc" => $this->datosSolicitud["suscribePolizaRC"], ":naumento" => -1, ":ncantidadtrabajadores" => $this->datosSolicitud["totalTrabajadores"], ":ndescuento" => -1, ":nedadpromedio" => IIF(($this->datosSolicitud["edadPromedio"] == ""), -1, intval($this->datosSolicitud["edadPromedio"])), ":nestablecimientos" => intval($this->datosSolicitud["cantidadEstablecimientos"]), ":nidartanterior" => nullIsEmpty($this->datosSolicitud["artAnterior"]), ":nidcanal" => $this->datosUsuario["CANAL"], ":nidciiu" => nullIfCero($this->datosSolicitud["ciiu1"]), ":nidciiu2" => nullIfCero($this->datosSolicitud["ciiu2"]), ":nidciiu3" => nullIfCero($this->datosSolicitud["ciiu3"]), ":nidentidad" => $this->datosUsuario["ENTIDAD"], ":nidholding" => nullIfCero($this->datosSolicitud["holding"]), ":nidsector" => nullIfCero($this->datosSolicitud["sector"]), ":nidstatusbcra" => nullIsEmpty($this->datosSolicitud["statusBcra"]), ":nidstatussrt" => nullIsEmpty($this->datosSolicitud["statusSrt"]), ":nidvendedor" => $this->datosSolicitud["idVendedor"], ":nidzonageografica" => $this->datosSolicitud["zonaGeografica"], ":nmasasalarial" => $this->getMasaSalarialSinSac(), ":nresultadomensualtrabajador" => $this->getResultadoMensualPorTrabajador(), ":nsumaaseguradarc" => nullIfCero($this->datosSolicitud["sumaAseguradaRC"]), ":sactividadreal" => $this->datosSolicitud["actividadReal"], ":scontacto" => $this->datosSolicitud["contacto"], ":scuit" => $this->datosSolicitud["cuit"], ":semail" => $this->datosSolicitud["email"], ":speriodo" => $this->datosSolicitud["periodo"], ":srazonsocial" => $this->datosSolicitud["razonSocial"], ":susualta" => $this->datosUsuario["USUARIO"]); $sql = "BEGIN webart.get_validacion_solicitud(:data, :cbajapordeuda, :ccampanaF931, :cdatoscompetencia, :cprestacionesespeciales, :csuscribepolizarc, :naumento, :ncantidadtrabajadores, :ndescuento, :nedadpromedio, :nestablecimientos, :nidartanterior, :nidcanal, :nidciiu, :nidciiu2, :nidciiu3, :nidentidad, :nidholding, :nidsector, :nidstatusbcra, :nidstatussrt, :nidvendedor, :nidzonageografica, :nmasasalarial, :nresultadomensualtrabajador, :nsumaaseguradarc, :sactividadreal, :scontacto, :scuit, :semail, :speriodo, :srazonsocial, :susualta); END;"; $stmt = DBExecSP($conn, $curs, $sql, $params); $row = DBGetSP($curs); $this->huboErrores = ((intval($row["NUMEROERROR"]) != 0) and ($row["ADVERTENCIA"] != "A")); $this->motivoNoAutocotizacion = $row["MOTIVONOAUTOCOTIZACION"]; $this->verificaTecnica = (($row["VERIFICATECNICA"] == "S") or ($this->datosUsuario["AUTOCOTIZACION"] == 0)); // Si el query devuelve "S" o si no autocotiza, la mando a técnica.. if (trim($row["ADVERTENCIA"]) != "") { $advertencias.= "<advertencia><mensaje>".$row["ERROR"]."</mensaje></advertencia>"; } if ($this->datosSolicitud["origen"] == "W") { // Si el origen es la Web de Provincia ART.. if ($row["NUMEROERROR"] == -3) { // Si el error es -3 indica que se tienen que mostrar los datos de la campaña F931 del año 2012.. $errores.= "<error><codigo>-3</codigo>"; $errores.= "<mensaje>setCampanaF931</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -1) { // Si el error es -1 indica que se le tiene que permitir al usuario cargar un descuento.. $errores.= "<error><codigo>-1</codigo>"; $errores.= "<mensaje>mostrarDescuento</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -2) { // Si el error es -2 indica que se le tiene que permitir al usuario cargar un aumento.. $errores.= "<error><codigo>-2</codigo>"; $errores.= "<mensaje>mostrarAumento</mensaje></error>"; } elseif ($row["NUMEROERROR"] == -12) { // Si el error es -12 indica que se le tiene que permitir al usuario cargar un aumento y un descuento.. $errores.= "<error><codigo>-12</codigo>"; $errores.= "<mensaje>mostrarAumentoYDescuento</mensaje></error>"; } elseif (intval($row["NUMEROERROR"]) != "0") { if (($row["NUMEROERROR"] >= 1) and ($row["NUMEROERROR"] <= 13)) // Son los números de error de la vieja función get_validacion.. sendEmailSituacionAfiliatoria($row["NUMEROERROR"]." - ".$row["ERROR"]); $errores.= "<error><codigo>".$row["NUMEROERROR"]."</codigo>"; $errores.= "<mensaje>".$row["ERROR"]."</mensaje></error>"; } } } catch (Exception $e) { // $errores.= "<error>".$e->getMessage()."</error>"; $errores.= "<error><fecha>".date("d/m/Y")."</fecha><hora>".date("H:i:s")."</hora><mensaje>Ocurrió un error inesperado en la función SPValidation.</mensaje></error>"; } }
/** * Unsubscribe Batch of User from MailChimp lists. * * @author Ruchi Kothari * * @param string $_listID List ID to which unsubscribe users * @param array $_emails Array of user emails * @param bool $_deleteMember Delete a member on unsubscription or not * * @return array $_subscriptionResult Result from MailChimp on unsubscription * @throws SWIFT_Exception If the Class is not Loaded */ public function ListBatchUnsubscribe($_listID, $_emails, $_deleteMember = false) { if (!$this->GetIsClassLoaded()) { throw new SWIFT_Exception(SWIFT_CLASSNOTLOADED); return false; } $_sendbye = IIF($this->Settings->Get('mc_send_goodbye'), true, false); $_notify = IIF($this->Settings->Get('mc_send_notify'), true, false); $_subscriptionResult = array(); $_subscriptionResult = $this->MCAPI->listBatchUnsubscribe($_listID, $_emails, $_deleteMember, $_sendbye, $_notify); $_subscriptionResult['name'] = $this->_lists[$_listID]['name']; $_error = array(); if ($this->MCAPI->errorCode) { $_error['code'] = $this->MCAPI->errorCode; $_error['message'] = 'Failed to batch unsubscribe from ' . $this->_lists[$_listID]['name'] . '. Error Message=' . $this->MCAPI->errorMessage; $_subscriptionResult[$_listID]['errors'][] = $_error; } return $_subscriptionResult; }
function showSelectDirList($folderPath, $valueStr) { $splStr = ''; $c = ''; $fileName = ''; $sel = ''; $splStr = aspSplit(getDirFileSort($folderPath), vbCrlf()); foreach ($splStr as $key => $fileName) { if ($fileName != '') { $sel = IIF($valueStr == $fileName, ' selected', ''); $c = $c . '<option value="' . $folderPath . $fileName . '" ' . $sel . '>' . $fileName . '</option>' . vbCrlf(); } } $showSelectDirList = $c; return @$showSelectDirList; }
":new_idestablecimientotercero" => nullIfCero($_POST["establecimientoTercero"]), ":new_prestadorid" => nullIfCero($_POST["idPrestador"]), ":new_tiposiniestro" => $_POST["tipoSiniestro"], ":njw_idtrabajador" => nullIfCero($_POST["idTrabajador"]), ":sew_agente" => $_POST["agenteMaterial"], ":sew_cuit" => $_SESSION["cuit"], ":sew_descripcion" => substr($_POST["descripcionHecho"], 0, 250), ":sew_denunciante" => $_POST["denunciante"], ":sew_domicilioestable" => $_POST["calleAccidente"]." ".$_POST["numeroAccidente"]." ".$_POST["pisoAccidente"]." ".$_POST["departamentoAccidente"]." ".$_POST["codigoPostalAccidente"]." ".$_POST["localidadAccidente"]." ".$_POST["provinciaAccidente"], ":sew_establecimiento" => nullIfCero($_POST["establecimientoPropio"]), ":sew_establepropio" => IIF(($_POST["establecimientoAccidente"] == -1), 0, 1), ":sew_forma" => $_POST["formaAccidente"], ":sew_gravedad" => $_POST["gravedadPresunta"], ":sew_horasin" => IIF((($_POST["horaAccidente"] == -1) or ($_POST["minutoAccidente"] == -1)), NULL ,$_POST["horaAccidente"].":".$_POST["minutoAccidente"]), ":sew_horjornadadesde" => IIF((($_POST["horaJornadaLaboralDesde"] == -1) or ($_POST["minutoJornadaLaboralDesde"] == -1)), NULL, $_POST["horaJornadaLaboralDesde"].":".$_POST["minutoJornadaLaboralDesde"]), ":sew_horjornadahasta" => IIF((($_POST["horaJornadaLaboralHasta"] == -1) or ($_POST["minutoJornadaLaboralHasta"] == -1)), NULL, $_POST["horaJornadaLaboralHasta"].":".$_POST["minutoJornadaLaboralHasta"]), ":sew_lugarcalle" => $_POST["calleAccidente"], ":sew_lugarcpostal" => $_POST["codigoPostalAccidente"], ":sew_lugardenuncia" => $_POST["lugar"], ":sew_lugarlocalidad" => $_POST["localidadAccidente"], ":sew_lugarnro" => $_POST["numeroAccidente"], ":sew_lugarocurrencia" => nullIfCero($_POST["lugarOcurrencia"]), ":sew_lugarprovincia" => $_POST["idProvinciaAccidente"], ":sew_manohabil" => $_POST["manoHabil"], ":sew_multiple" => $_POST["siniestroMultiple"], ":sew_naturaleza" => $_POST["naturalezaLesion"], ":sew_otrolugar" => substr($_POST["lugarOcurrenciaOtros"], 0, 100), ":sew_prestadordomicilio" => $_POST["domicilioPrestador"], ":sew_prestadornombre" => $_POST["razonSocialPrestador"], ":sew_prestadortelefono" => $_POST["telefonoPrestador"], ":sew_tareaaccidente" => nullIsEmpty(substr($_POST["tareasAccidente"], 0, 100)),
/** * Renders the Issue History Tab * * @param mixed $_issuesContainer array of issues associated with current ticket * * @author Abhinav Kumar * @return boolean 'true' on success and 'false' otherwise * @throws SWIFT_Exception if class is not loaded */ public function RenderHistoryTab($_issuesContainer) { $_SWIFT = SWIFT::GetInstance(); $_JIRABridge = SWIFT_JIRABridge::GetInstance(); if (!$this->GetIsClassLoaded()) { throw new SWIFT_Exception(__CLASS__ . ' ' . SWIFT_CLASSNOTLOADED); } else { if (!is_array($_issuesContainer)) { throw new SWIFT_Exception(SWIFT_INVALIDDATA); } } $this->UserInterface->Start(get_class($this), '', SWIFT_UserInterface::MODE_INSERT, false); $_IssueHistoryTabObject = new SWIFT_UserInterfaceTab($this->UserInterface, 'history', '', 1, 'history', false, false, 4, ''); $_columnContainer = array(); // Issue ID $_columnContainer[0]['value'] = $this->Language->Get('jira_issueid'); $_columnContainer[0]['align'] = 'left'; $_columnContainer[0]['width'] = '10'; // Summary $_columnContainer[1]['value'] = $this->Language->Get('jira_summary'); $_columnContainer[1]['align'] = 'left'; $_columnContainer[1]['width'] = '100'; // Updated $_columnContainer[3]['value'] = $this->Language->Get('jira_updated'); $_columnContainer[3]['align'] = 'left'; $_columnContainer[3]['width'] = '10'; // Priority $_columnContainer[4]['value'] = $this->Language->Get('jira_priority'); $_columnContainer[4]['align'] = 'left'; $_columnContainer[4]['width'] = '10'; // Status $_columnContainer[5]['value'] = $this->Language->Get('jira_status'); $_columnContainer[5]['align'] = 'left'; $_columnContainer[5]['width'] = '10'; // Assigned To $_columnContainer[6]['value'] = $this->Language->Get('jira_assignedto'); $_columnContainer[6]['align'] = 'left'; $_columnContainer[6]['width'] = '10'; // Action $_columnContainer[7]['value'] = $this->Language->Get('jira_action'); $_columnContainer[7]['align'] = 'left'; $_columnContainer[7]['width'] = '10'; $_IssueHistoryTabObject->Row($_columnContainer, 'gridtabletitlerow'); if (empty($_issuesContainer)) { $_columnContainer = array(); $_columnContainer[0]['value'] = $this->Language->Get('jira_noissuefound'); $_columnContainer[0]['align'] = 'left'; $_columnContainer[0]['width'] = '100%'; $_IssueHistoryTabObject->Row($_columnContainer); $_renderHTML = $_IssueHistoryTabObject->GetDisplayHTML(true); $_renderHTML .= '<script language="Javascript" type="text/javascript">'; $_renderHTML .= 'ClearFunctionQueue();'; $_renderHTML .= '</script>'; echo $_renderHTML; return true; } foreach ($_issuesContainer as $_Issue) { $_columnContainer = array(); $_issueURL = $_SWIFT->Settings->Get('bj_jiraurl') . 'browse/' . $_Issue->GetKey(); // Key $_columnContainer[0]['value'] = '<a href="' . $_issueURL . '" target="_blank">' . htmlspecialchars($_Issue->GetKey()) . '</a>'; $_columnContainer[0]['align'] = 'left'; $_columnContainer[0]['width'] = '10'; // Summary $_columnContainer[1]['value'] = '<a href="' . $_issueURL . '" target="_blank">' . IIF(strlen($_Issue->GetSummary()) > 100, htmlspecialchars(substr($_Issue->GetSummary(), 0, 100)) . '...', htmlspecialchars($_Issue->GetSummary())) . '</a>'; $_columnContainer[1]['align'] = 'left'; $_columnContainer[1]['width'] = '100'; // Updated $_columnContainer[3]['value'] = htmlspecialchars(SWIFT_Date::EasyDate($_Issue->GetUpdated()) . IIF(SWIFT_Date::EasyDate($_Issue->GetUpdated()) == $this->Language->Get('edjustnow'), '', ' ago')); $_columnContainer[3]['align'] = 'left'; $_columnContainer[3]['width'] = '10'; // Priority $_columnContainer[4]['value'] = htmlspecialchars($_Issue->GetPriority()); $_columnContainer[4]['align'] = 'left'; $_columnContainer[4]['width'] = '10'; // Status $_columnContainer[5]['value'] = htmlspecialchars($_Issue->GetStatus()); $_columnContainer[5]['align'] = 'left'; $_columnContainer[5]['width'] = '10'; // Comments $_columnContainer[6]['value'] = htmlspecialchars($_Issue->GetAssignee()); $_columnContainer[6]['align'] = 'left'; $_columnContainer[6]['width'] = '10'; // Unlink $_columnContainer[7]['value'] = '<a title="' . $this->Language->Get('postJIRAComment') . '" href="#" onclick="postJIRAComment(\'' . $_Issue->GetKey() . '\')"> <img src="' . SWIFT::Get('swiftpath') . SWIFT_APPSDIRECTORY . '/jira/resources/icon-comment.gif' . '"/> </a>' . ' | ' . '<a title="' . $this->Language->Get('jira_unlinkissue') . '" href="#" onclick="unlinkJIRAIssue(\'' . $_Issue->GetKey() . '\')"> <img src="' . SWIFT::Get('swiftpath') . SWIFT_APPSDIRECTORY . '/jira/resources/edit_delete.png' . '"/> </a>'; $_columnContainer[7]['align'] = 'left'; $_columnContainer[7]['width'] = '10'; $_IssueHistoryTabObject->Row($_columnContainer, '', $_Issue->GetKey()); //Fetch the issue comments now if ($_JIRABridge) { $_commentsContainer = $_JIRABridge->FetchAllCommentsBy('issuekey', $_Issue->GetKey()); if (isset($_columnContainer) && _is_array($_commentsContainer)) { $_renderedNotes = array(); foreach ($_commentsContainer as $_JIRAComment) { $_renderedNotes[] = '<div class="notebackground"> <div class="notecontainer"> <div class="note">' . nl2br($_JIRAComment->GetRawBody(), true) . '</div> </div> <cite class="tip"> <strong> <img border="0" align="absmiddle" src="' . SWIFT::Get('themepath') . 'images/icon_user2.png"/> ' . $_JIRAComment->GetAuthor() . ' ' . htmlspecialchars(SWIFT_Date::EasyDate($_JIRAComment->GetUpdated())) . ' ago </strong><div style="float: right; padding-right: 4px;"></div> </cite> </div>'; } $_renderedNotes = implode('', $_renderedNotes); $_commentContainer[0]['value'] = '<div class="allnotes">' . $_renderedNotes . '</div>'; $_commentContainer[0]['width'] = '100'; $_commentContainer[0]['align'] = 'left'; $_commentContainer[0]['colspan'] = '7'; $_commentContainer[0]['style'] = 'background: none repeat scroll 0pt 0pt #F6F1E7; padding: 0px;'; $_IssueHistoryTabObject->Row($_commentContainer, '', $_Issue->GetKey()); } } } $_renderHTML = $_IssueHistoryTabObject->GetDisplayHTML(true); echo $_renderHTML; return true; }
function enviarEmailSituacionAfiliatoria($msgError) { global $conn; $emailTo = $_SESSION["emailAvisoArt"]; $subject = "Empresa con situación afiliatoria complicada"; $body = getFileContent($_SERVER["DOCUMENT_ROOT"]."/modules/solicitud_cotizacion/plantillas/email_situacion_afiliatoria.html"); $params = array(":id" => $_SESSION["canal"]); $sql = "SELECT ca_codigo || ' - ' || ca_descripcion FROM aca_canal WHERE ca_id = :id"; $body = str_replace("@canal@", ValorSql($sql, "", $params, 0), $body); $params = array(":id" => $_SESSION["entidad"]); $sql = "SELECT en_codbanco || ' - ' || en_nombre FROM xen_entidad WHERE en_id = :id"; $body = str_replace("@entidad@", ValorSql($sql, "", $params, 0), $body); if ($_SESSION["sucursal"] != "") { $params = array(":id" => $_SESSION["sucursal"]); $sql = "SELECT su_codsucursal || ' - ' || su_descripcion FROM asu_sucursal WHERE su_id = :id"; $body = str_replace("@sucursal@", ValorSql($sql, "", $params, 0), $body); } else $body = str_replace("@sucursal@", "", $body); $params = array(":id" => $_POST["artTmp"]); $sql = "SELECT ar_nombre FROM aar_art WHERE ar_id = :id"; $body = str_replace("@artactual@", ValorSql($sql, "", $params, 0), $body); $vendedor = ""; if (isset($_POST["codigoVendedor"])) { $params = array(":vendedor" => IIF(($_POST["codigoVendedor"] == ""), "0", $_POST["codigoVendedor"])); $sql = "SELECT ve_vendedor || ' - ' || ve_nombre FROM xve_vendedor WHERE ve_vendedor = :vendedor"; $vendedor = ValorSql($sql, "", $params, 0); } elseif ($_SESSION["vendedor"] == "") { $params = array(":identidad" => $_SESSION["entidad"]); $sql = "SELECT ve_vendedor || ' - ' || ve_nombre FROM xev_entidadvendedor, xve_vendedor WHERE ve_id = ev_idvendedor AND ev_fechabaja IS NULL AND ve_fechabaja IS NULL AND ve_vendedor = '0' AND ev_identidad = :identidad"; $vendedor = ValorSql($sql, "", $params, 0); } $body = str_replace("@codigovendedor@", $vendedor, $body); $params = array(":codigo" => $_POST["statusBcra"]); $sql = "SELECT tb_descripcion FROM ctb_tablas WHERE tb_clave = 'STBCR' AND tb_codigo = :codigo"; $body = str_replace("@statusbcra@", ValorSql($sql, "", $params, 0), $body); $params = array(":codigo" => $_POST["statusSrtTmp"]); $sql = "SELECT tb_descripcion FROM ctb_tablas WHERE tb_clave = 'STSRT' AND tb_codigo = :codigo"; $body = str_replace("@statussrt@", ValorSql($sql, "", $params, 0), $body); $body = str_replace("@cantidadestablecimientos@", $_POST["cantidadEstablecimientos"], $body); $body = str_replace("@ciiu1@", $_POST["ciiu1"], $body); $body = str_replace("@contacto@", $_POST["contacto"], $body); $body = str_replace("@cuit@", $_POST["cuit"], $body); $body = str_replace("@edadpromedio@", $_POST["edadPromedio"], $body); $body = str_replace("@email@", $_POST["email"], $body); $body = str_replace("@emailComercializador@", $_SESSION["email"], $body); $body = str_replace("@error@", $msgError, $body); $body = str_replace("@masasalarial1@", $_POST["masaSalarial1"], $body); $body = str_replace("@periodo@", $_POST["periodo"], $body); $body = str_replace("@razonsocial@", $_POST["razonSocial"], $body); $body = str_replace("@resultadomensualtrabajador@", $_POST["resultadoMensualPorTrabajador"], $body); $body = str_replace("@sector@", $_POST["sector"], $body); $body = str_replace("@sumafija@", $_POST["calculoSumaFija"], $body); $body = str_replace("@telefono@", $_POST["telefono"], $body); $body = str_replace("@trabajadores1@", $_POST["totalTrabajadores1"], $body); $body = str_replace("@usuario@", $_SESSION["usuario"], $body); $body = str_replace("@variable@", $_POST["calculoVariable"], $body); // Agrego los datos del CIIU 2.. $str = ""; if ($_POST["ciiu2"] != "") { $str.= "Cod. CIIU (2): ".$_POST["ciiu2"]."<br />"; $str.= "Cant. Trabajadores (2): ".$_POST["totalTrabajadores2"]."<br />"; $str.= "Masa Salarial (2): ".$_POST["masaSalarial2"]."<br />"; } $body = str_replace("@ciiu2@", $str, $body); // Agrego los datos del CIIU 3.. $str = ""; if ($_POST["ciiu3"] != "") { $str.= "Cod. CIIU (3): ".$_POST["ciiu3"]."<br />"; $str.= "Cant. Trabajadores (3): ".$_POST["totalTrabajadores3"]."<br />"; $str.= "Masa Salarial (3): ".$_POST["masaSalarial3"]."<br />"; } $body = str_replace("@ciiu3@", $str, $body); // Agrego los datos de la competencia.. $str = ""; switch ($_POST["rDatosCompetencia"]) { case "": $str = "Sin Dato<br />"; break; case "A": $str = "Solo pago total mensual: ".$_POST["soloPagoTotalMensual"]."<br />"; break; case "N": $str = "Formulario 931 Costo Fijo: ".$_POST["alicuotaCompetenciaSumaFija"]."<br />"; $str.= "Formulario 931 Costo Variable: ".$_POST["alicuotaCompetenciaVariable"]."<br />"; break; case "S": $str = "Alícuota Competencia Costo Fijo: ".$_POST["formulario931CostoFijo"]."<br />"; $str.= "Alícuota Competencia Costo Variable: ".$_POST["formulario931CostoVariable"]."<br />"; break; } $body = str_replace("@datoscompetencia@", $str, $body); // Agrego los datos de los establecimientos.. $str = ""; $params = array(":usualta" => $_SESSION["usuario"]); $sql = "SELECT '= ' || zg_descripcion || ', ' || cp_localidadcap || ', ' || ta_detalle || ', ' || ac_codigo || ', ' || TO_CHAR(eu_trabajadores) establecimiento FROM afi.aeu_establecimientos, afi.azg_zonasgeograficas, art.ccp_codigopostal, afi.ata_tipoactividad, cac_actividad WHERE eu_idzonageografica = zg_id(+) AND eu_idlocalidad = cp_id(+) AND eu_idtipoactividad = ta_id(+) AND eu_idactividad = ac_id(+) AND eu_idsolicitud = -1 AND eu_usualta = :usualta AND eu_usuarioweb = 'T' AND eu_fechabaja IS NULL"; $stmt = DBExecSql($conn, $sql, $params, OCI_DEFAULT); $i = 1; while ($row = DBGetQuery($stmt)) { $str.= $i.$row["ESTABLECIMIENTO"]."<br />"; $i++; } $body = str_replace("@establecimientos@", $str, $body); SendEmail($body, "Web", $subject, array($emailTo), array(), array(), "H"); }
function resetAccessData_temp() { handlePower('恢复模板数据'); //管理权限处理 $GLOBALS['conn='] = OpenConn(); $splStr = ''; $i = ''; $s = ''; $columnname = ''; $title = ''; $nCount = ''; $webdataDir = ''; $webdataDir = @$_REQUEST['webdataDir']; if ($webdataDir != '') { if (checkFolder($webdataDir) == false) { eerr('网站数据目录不存在,恢复默认数据未成功', $webdataDir); } } else { $webdataDir = '/Data/WebData/'; } aspEcho('提示', '恢复数据完成'); rw('<hr><a href=\'../index.php\' target=\'_blank\'>进入首页</a> | <a href="?" target=\'_blank\'>进入后台</a>'); $content = ''; $filePath = ''; $parentid = ''; $author = ''; $adddatetime = ''; $fileName = ''; $bodycontent = ''; $webtitle = ''; $webkeywords = ''; $webdescription = ''; $sortrank = ''; $labletitle = ''; $target = ''; $websitebottom = ''; $webTemplate = ''; $webimages = ''; $webcss = ''; $webjs = ''; $flags = ''; $websiteurl = ''; $splxx = ''; $columntype = ''; $relatedtags = ''; $npagesize = ''; $customaurl = ''; $nofollow = ''; $templatepath = ''; $isthrough = ''; $titlecolor = ''; $showreason = ''; $ncomputersearch = ''; $nmobliesearch = ''; $ncountsearch = ''; $ndegree = ''; //竞价表 $displaytitle = ''; $aboutcontent = ''; $isonhtml = ''; //单页表 $columnenname = ''; //导航表 $smallimage = ''; $bigImage = ''; $bannerimage = ''; //文章表 $httpurl = ''; $price = ''; $morepageurl = ''; $charset = ''; $thispage = ''; $countpage = ''; $bigClassName = ''; $startStr = ''; $endStr = ''; $startaddstr = ''; $endaddstr = ''; $sType = ''; $saction = ''; $fieldName = ''; $fieldcheck = ''; //网站配置 $content = GetFText($webdataDir . '/website.txt'); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } if ($content != '') { $webtitle = newGetStrCut($content, 'webtitle'); $webkeywords = newGetStrCut($content, 'webkeywords'); $webdescription = newGetStrCut($content, 'webdescription'); $websitebottom = newGetStrCut($content, 'websitebottom'); $webTemplate = newGetStrCut($content, 'webtemplate'); $webimages = newGetStrCut($content, 'webimages'); $webcss = newGetStrCut($content, 'webcss'); $webjs = newGetStrCut($content, 'webjs'); $flags = newGetStrCut($content, 'flags'); $websiteurl = newGetStrCut($content, 'websiteurl'); if (getRecordCount($GLOBALS['db_PREFIX'] . 'website', '') == 0) { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'website(webtitle) values(\'测试\')'); } connexecute('update ' . $GLOBALS['db_PREFIX'] . 'website set webtitle=\'' . $webtitle . '\',webkeywords=\'' . $webkeywords . '\',webdescription=\'' . $webdescription . '\',websitebottom=\'' . $websitebottom . '\',webtemplate=\'' . $webTemplate . '\',webimages=\'' . $webimages . '\',webcss=\'' . $webcss . '\',webjs=\'' . $webjs . '\',flags=\'' . $flags . '\',websiteurl=\'' . $websiteurl . '\''); } //导航 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'webcolumn'); $content = getDirTxtList($webdataDir . '/webcolumn/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('导航', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webtitle】') > 0) { $s = $s . vbCrlf(); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $fileName = newGetStrCut($s, 'filename'); $columnname = newGetStrCut($s, 'columnname'); $columnenname = newGetStrCut($s, 'columnenname'); $columntype = newGetStrCut($s, 'columntype'); $flags = newGetStrCut($s, 'flags'); $parentid = newGetStrCut($s, 'parentid'); $parentid = phpTrim(getColumnId($parentid)); //可根据栏目名称找到对应ID 不存在为-1 //call echo("parentid",parentid) $labletitle = newGetStrCut($s, 'labletitle'); //每页显示条数 $npagesize = newGetStrCut($s, 'npagesize'); if ($npagesize == '') { $npagesize = 10; } //默认分页数为10条 $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo(columnname,nofollow) $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'webcolumn (webtitle,webkeywords,webdescription,columnname,columnenname,columntype,sortrank,filename,customaurl,flags,parentid,labletitle,aboutcontent,bodycontent,npagesize,isonhtml,nofollow,target,smallimage,bigImage,bannerimage,templatepath) values(\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $columnname . '\',\'' . $columnenname . '\',\'' . $columntype . '\',' . $sortrank . ',\'' . $fileName . '\',\'' . $customaurl . '\',\'' . $flags . '\',' . $parentid . ',\'' . $labletitle . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $npagesize . ',' . $isonhtml . ',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\')'); } } } } //文章 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'articledetail'); $content = getDirAllFileList($webdataDir . '/articledetail/', 'txt'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('文章', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $parentid = newGetStrCut($s, 'parentid'); $parentid = getColumnId($parentid); $title = newGetStrCut($s, 'title'); $titlecolor = newGetStrCut($s, 'titlecolor'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $author = newGetStrCut($s, 'author'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $templatepath = newGetStrCut($s, 'templatepath'); $flags = newGetStrCut($s, 'flags'); $relatedtags = newGetStrCut($s, 'relatedtags'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $smallimage = newGetStrCut($s, 'smallimage'); $bigImage = newGetStrCut($s, 'bigImage'); $bannerimage = newGetStrCut($s, 'bannerimage'); $labletitle = newGetStrCut($s, 'labletitle'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //价格 $price = getDianNumb(newGetStrCut($s, 'price')); if ($price == '') { $price = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'articledetail (parentid,title,titlecolor,webtitle,webkeywords,webdescription,author,sortrank,adddatetime,filename,flags,relatedtags,aboutcontent,bodycontent,updatetime,isonhtml,customaurl,nofollow,target,smallimage,bigImage,bannerimage,templatepath,labletitle,price) values(' . $parentid . ',\'' . $title . '\',\'' . $titlecolor . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $author . '\',' . $sortrank . ',\'' . $adddatetime . '\',\'' . $fileName . '\',\'' . $flags . '\',\'' . $relatedtags . '\',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',\'' . now() . '\',' . $isonhtml . ',\'' . $customaurl . '\',' . $nofollow . ',\'' . $target . '\',\'' . $smallimage . '\',\'' . $bigImage . '\',\'' . $bannerimage . '\',\'' . $templatepath . '\',\'' . $labletitle . '\',' . $price . ')'); } } } } //单页 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'OnePage'); $content = getDirTxtList($webdataDir . '/OnePage/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('单页', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $displaytitle = newGetStrCut($s, 'displaytitle'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $adddatetime = newGetStrCut($s, 'adddatetime'); $fileName = newGetStrCut($s, 'filename'); $aboutcontent = newGetStrCut($s, 'aboutcontent'); $aboutcontent = contentTranscoding($aboutcontent); $target = newGetStrCut($s, 'target'); $templatepath = newGetStrCut($s, 'templatepath'); $bodycontent = newGetStrCut($s, 'bodycontent'); $bodycontent = contentTranscoding($bodycontent); //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'onepage (title,displaytitle,webtitle,webkeywords,webdescription,adddatetime,filename,isonhtml,aboutcontent,bodycontent,nofollow,target,templatepath) values(\'' . $title . '\',\'' . $displaytitle . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $adddatetime . '\',\'' . $fileName . '\',' . $isonhtml . ',\'' . $aboutcontent . '\',\'' . $bodycontent . '\',' . $nofollow . ',\'' . $target . '\',\'' . $templatepath . '\')'); } } } } //竞价 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'Bidding'); $content = getDirTxtList($webdataDir . '/Bidding/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('竞价', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【webkeywords】') > 0) { $s = $s . vbCrlf(); $webkeywords = newGetStrCut($s, 'webkeywords'); $showreason = newGetStrCut($s, 'showreason'); $ncomputersearch = newGetStrCut($s, 'ncomputersearch'); $nmobliesearch = newGetStrCut($s, 'nmobliesearch'); $ncountsearch = newGetStrCut($s, 'ncountsearch'); $ndegree = newGetStrCut($s, 'ndegree'); $ndegree = getNumber($ndegree); if ($ndegree == '') { $ndegree = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'Bidding (webkeywords,showreason,ncomputersearch,nmobliesearch,ndegree) values(\'' . $webkeywords . '\',\'' . $showreason . '\',' . $ncomputersearch . ',' . $nmobliesearch . ',' . $ndegree . ')'); } } } } //搜索统计 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'SearchStat'); $content = getDirTxtList($webdataDir . '/SearchStat/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('搜索统计', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $webtitle = newGetStrCut($s, 'webtitle'); $webkeywords = newGetStrCut($s, 'webkeywords'); $webdescription = newGetStrCut($s, 'webdescription'); $customaurl = newGetStrCut($s, 'customaurl'); $target = newGetStrCut($s, 'target'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } //是否启用生成html $isonhtml = newGetStrCut($s, 'isonhtml'); if ($isonhtml == '0' || lCase($isonhtml) == 'false') { $isonhtml = 0; } else { $isonhtml = 1; } //是否为nofollow $nofollow = newGetStrCut($s, 'nofollow'); if ($nofollow == '1' || lCase($nofollow) == 'true') { $nofollow = 1; } else { $nofollow = 0; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'SearchStat (title,webtitle,webkeywords,webdescription,customaurl,target,isthrough,sortrank,isonhtml,nofollow) values(\'' . $title . '\',\'' . $webtitle . '\',\'' . $webkeywords . '\',\'' . $webdescription . '\',\'' . $customaurl . '\',\'' . $target . '\',' . $isthrough . ',' . $sortrank . ',' . $isonhtml . ',' . $nofollow . ')'); } } } } $itemid = ''; $userName = ''; $ip = ''; $reply = ''; $tableName = ''; //评论 //评论 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'TableComment'); $content = getDirTxtList($webdataDir . '/TableComment/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $tableName = newGetStrCut($s, 'tablename'); $title = newGetStrCut($s, 'title'); $itemid = getArticleId(newGetStrCut($s, 'itemid')); if ($itemid == '') { $itemid = 0; } //call echo("itemID",itemID) $adddatetime = newGetStrCut($s, 'adddatetime'); $userName = newGetStrCut($s, 'username'); $ip = newGetStrCut($s, 'ip'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'TableComment (tablename,title,itemid,adddatetime,username,ip,bodycontent,reply,isthrough) values(\'' . $tableName . '\',\'' . $title . '\',' . $itemid . ',\'' . $adddatetime . '\',\'' . $userName . '\',\'' . $ip . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //友情链接 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'FriendLink'); $content = getDirTxtList($webdataDir . '/FriendLink/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('评论', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【title】') > 0) { $s = $s . vbCrlf(); $title = newGetStrCut($s, 'title'); $httpurl = newGetStrCut($s, 'httpurl'); $smallimage = newGetStrCut($s, 'smallimage'); $flags = newGetStrCut($s, 'flags'); $target = newGetStrCut($s, 'target'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '0' || lCase($sortrank) == 'false') { $sortrank = 0; } else { $sortrank = 1; } $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } //call echo("title",title) connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'FriendLink (title,httpurl,smallimage,flags,sortrank,isthrough,target) values(\'' . $title . '\',\'' . $httpurl . '\',\'' . $smallimage . '\',\'' . $flags . '\',' . $sortrank . ',' . $isthrough . ',\'' . $target . '\')'); } } } } //留言 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'GuestBook'); $content = getDirTxtList($webdataDir . '/GuestBook/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('留言', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【adddatetime】') > 0) { $s = $s . vbCrlf(); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $reply = newGetStrCut($s, 'reply'); $isthrough = newGetStrCut($s, 'isthrough'); if ($isthrough == '0' || lCase($isthrough) == 'false') { $isthrough = 0; } else { $isthrough = 1; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'GuestBook (adddatetime,bodycontent,reply,isthrough) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $reply . '\',' . $isthrough . ')'); } } } } //采集网站 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiWeb'); $content = getDirTxtList($webdataDir . '/CaiWeb/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集网站', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $httpurl = newGetStrCut($s, 'httpurl'); $morepageurl = newGetStrCut($s, 'morepageurl'); $charset = newGetStrCut($s, 'charset'); $adddatetime = newGetStrCut($s, 'adddatetime'); $bodycontent = newGetStrCut($s, 'bodycontent'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $thispage = newGetStrCut($s, 'thispage'); if ($thispage == '') { $thispage = 0; } $countpage = newGetStrCut($s, 'countpage'); if ($countpage == '') { $thispage = 0; } $columnname = newGetStrCut($s, 'columnname'); connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiWeb (adddatetime,bodycontent,httpurl,morepageurl,charset,sortrank,thispage,countpage,bigclassname,columnname) values(\'' . $adddatetime . '\',\'' . $bodycontent . '\',\'' . $httpurl . '\',\'' . $morepageurl . '\',\'' . $charset . '\',' . $sortrank . ',' . $thispage . ',' . $countpage . ',\'' . $bigClassName . '\',\'' . $columnname . '\')'); } } } } //采集配置 connexecute('delete from ' . $GLOBALS['db_PREFIX'] . 'CaiConfig'); $content = getDirTxtList($webdataDir . '/CaiConfig/'); $content = contentNameSort($content, ''); $splStr = aspSplit($content, vbCrlf()); HR(); foreach ($splStr as $key => $filePath) { $fileName = getFileName($filePath); if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) { aspEcho('采集配置', $filePath); $content = GetFText($filePath); //这样做是为了从GitHub下载时它把vbcrlf转成 chr(10) 20160409 if (inStr($content, vbCrlf()) == false) { $content = replace($content, chr(10), vbCrlf()); } $splxx = aspSplit($content, vbCrlf() . '-------------------------------'); foreach ($splxx as $key => $s) { if (inStr($s, '【bigclassname】') > 0) { $s = $s . vbCrlf(); $bigClassName = newGetStrCut($s, 'bigclassname'); $sType = newGetStrCut($s, 'stype'); $startStr = newGetStrCut($s, 'startstr'); $endStr = newGetStrCut($s, 'endstr'); $startaddstr = newGetStrCut($s, 'startaddstr'); $endaddstr = newGetStrCut($s, 'endaddstr'); $adddatetime = newGetStrCut($s, 'adddatetime'); $sortrank = newGetStrCut($s, 'sortrank'); if ($sortrank == '') { $sortrank = 0; } $saction = newGetStrCut($s, 'saction'); $isthrough = newGetStrCut($s, 'isthrough'); $isthrough = IIF($isthrough == '0' || lCase($isthrough) == 'false', 0, 1); $fieldName = newGetStrCut($s, 'fieldname'); $fieldcheck = newGetStrCut($s, 'fieldcheck'); if ($fieldcheck == '') { $fieldcheck = 0; } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'CaiConfig (adddatetime,sortrank,bigclassname,stype,startstr,endstr,startaddstr,endaddstr,saction,isthrough,fieldname,fieldcheck) values(\'' . $adddatetime . '\',' . $sortrank . ',\'' . $bigClassName . '\',\'' . $sType . '\',\'' . $startStr . '\',\'' . $endStr . '\',\'' . $startaddstr . '\',\'' . $endaddstr . '\',\'' . $saction . '\',' . $isthrough . ',\'' . $fieldName . '\',' . $fieldcheck . ')'); } } } } writeSystemLog('', '恢复默认数据' . $GLOBALS['db_PREFIX']); //系统日志 }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/constants.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/database/db_funcs.php"; require_once $_SERVER["DOCUMENT_ROOT"] . "/../Common/miscellaneous/general.php"; if ($_REQUEST["TipoOp"] == "A") { // Alta.. $params = array(":id" => -1, ":idsectordesde" => IIF($_REQUEST["SectorDesde"] == "-1", NULL, $_REQUEST["SectorDesde"]), ":idsectorhasta" => IIF($_REQUEST["SectorHasta"] == "-1", NULL, $_REQUEST["SectorHasta"]), ":idusuario" => $_REQUEST["Usuario"], ":tipomovimiento" => $_REQUEST["TipoMovimiento"], ":usualta" => GetWindowsLoginName(true)); $sql = "INSERT INTO rrhh.rhn_novedades (hn_id, hn_idusuario, hn_tipomovimiento, hn_idsectordesde, hn_idsectorhasta, hn_fechaalta, hn_usualta)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t VALUES (:id, :idusuario, :tipomovimiento, :idsectordesde, :idsectorhasta, SYSDATE, :usualta)"; DBExecSql($conn, $sql, $params); } if ($_REQUEST["TipoOp"] == "M") { // Modificación.. $params = array(":id" => $_REQUEST["id"], ":idsectordesde" => IIF($_REQUEST["SectorDesde"] == "-1", NULL, $_REQUEST["SectorDesde"]), ":idsectorhasta" => IIF($_REQUEST["SectorHasta"] == "-1", NULL, $_REQUEST["SectorHasta"]), ":tipomovimiento" => $_REQUEST["TipoMovimiento"], ":usumodif" => GetWindowsLoginName(true)); $sql = "UPDATE rrhh.rhn_novedades\n\t\t\t\tSET hn_tipomovimiento = :tipomovimiento,\n\t\t\t\t\t\thn_idsectordesde = :idsectordesde,\n\t\t\t\t\t\thn_idsectorhasta = :idsectorhasta,\n\t\t\t\t\t\thn_fechamodif = SYSDATE,\n\t\t\t\t\t\thn_usumodif = :usumodif\n\t\t WHERE hn_id = :id"; DBExecSql($conn, $sql, $params); } if ($_REQUEST["TipoOp"] == "B") { // Baja.. $params = array(":id" => $_REQUEST["id"], ":usubaja" => GetWindowsLoginName(true)); $sql = "UPDATE rrhh.rhn_novedades\n\t\t\t\tSET hn_fechabaja = SYSDATE,\n\t\t\t\t\t\thn_usubaja = :usubaja\n\t\t WHERE hn_id = :id"; DBExecSql($conn, $sql, $params); } ?> <script> <? if ($dbError["offset"]) { ?> alert('<?php echo $dbError["message"];
public function _b2($tag, $content) { $tag['type'] = IIF($tag['type'], 'submit'); return $this->btn($tag, $content, 'btn-primary'); }
function editTXT($content, $jsId) { $content = IIF($content == '', ' ', $content); $editTXT = '<span id=\'' . $jsId . '\' onClick="TestInput(\'' . $jsId . '\');" title=\'点击可编辑\'>' . $content . '</span>'; return @$editTXT; }
<?php /** * ======================================= * ################################### * SWIFT Framework * * @package SWIFT * @author Kayako Infotech Ltd. * @copyright Copyright (c) 2001-2009, Kayako Infotech Ltd. * @license http://www.kayako.com/license * @link http://www.kayako.com * @filesource * ################################### * ======================================= */ $__LANG = array('dashboard' => 'Dashboard', 'preferences' => 'Preferences', 'privatemessages' => 'Private Messages', 'timezonephp' => 'Time Zone', 'desc_timezonephp' => 'Select the time zone that you reside in. If you choose a time zone here, it will override the default time zone.', 'defaulttimezone' => '-- Use the default time zone --', 'staffdetails' => 'Staff Details', 'requiredfields' => 'Required Fields', 'staffgroup' => 'Team', 'updatedetails' => 'Update Details', 'stafffullname' => 'Full Name', 'desc_stafffullname' => 'Enter your full name. This will be publicly visible to your users and also used as the from name in all outgoing emails.', 'changepassword' => 'Change Password', 'staffpassword' => 'Reset Password', 'desc_staffpassword' => 'If you wish to change your current password, enter the new password you wish to use here.', 'staffpasswordconfirm' => 'Password (Confirm)', 'desc_staffpasswordconfirm' => 'Re-enter your new password.', 'staffemail' => 'Email', 'optionalfields' => 'Optional Fields', 'staffmobilenumber' => 'Mobile Number', 'desc_staffmobilenumber' => 'If you wish to receive SMS alerts, enter your mobile telephone number.<br/><i>Note: Enter only your telephone number without spaces, dashes or other symbols.<br/>Example: \'18005551212\'</i> ', 'staffsignature' => 'Signature', 'desc_staffsignature' => 'Enter the signature that you would like to be appended to all outoging emails.<br/><i>Example:<br/>\'John Smith<br/>My Company<br/>http://mycompany.com/\'</i>', 'timezoneoffset' => 'Time Zone', 'desc_timezoneoffset' => 'Select your Time Zone. If set, this time zone will override the default setting.', 'enabledst' => 'Enable Daylight Savings', 'desc_enabledst' => 'Select whether or not you wish to enable Daylight Savings Time.', 'passworddontmatch' => 'ERROR: Passwords do not match', 'informationupdated' => 'Information successfully updated', 'enablepmalerts' => 'Enable Private Message Email Alerts', 'enablepmjsalerts' => 'Enable Private Message JavaScript Alerts', 'desc_enablepmalerts' => 'Select whether or not you wish to receive email alerts when a private message is sent to you.', 'desc_enablepmjsalerts' => 'Select whether or not you wish to be prompted by an on-screen message when a private message is sent to you.', 'generalsettings' => 'General Settings', 'desc_staffemail' => 'Enter your personal email address here. All alerts assigned to your account will be sent to this address.' . IIF(SWIFT_Module::IsRegistered(MODULE_PARSER), ' Make sure that this address has not been associated with an email queue. If there is an already existing email queue with the same address, it may create bounce-back loops, causing performance problems.'), 'time_99' => '-- Default Time Zone Setting --', 'time_-12' => 'GMT -12:00 hours : Enitwetok, Kwajalien', 'time_-11' => 'GMT -11:00 hours : Midway Island, Samoa', 'time_-10' => 'GMT -10:00 hours : Hawaii', 'time_-9' => 'GMT -9:00 hours : Alaska', 'time_-8' => 'GMT -8:00 hours : Pacific Time (US & Canada)', 'time_-7' => 'GMT -7:00 hours : Mountain Time (US & Canada)', 'time_-6' => 'GMT -6:00 hours : Central Time (US & Canada), Mexico City', 'time_-5' => 'GMT -5:00 hours : Eastern Time (US & Canada), Bogota, Lima, Quito', 'time_-4' => 'GMT -4:00 hours : Atlantic Time (Canada), Caracas, La Paz', 'time_-3.5' => 'GMT -3:30 hours : Newfoundland', 'time_-3' => 'GMT -3:00 hours : Brazil, Buenos Aires, Georgetown, Falkland Is.', 'time_-2' => 'GMT -2:00 hours : Mid-Atlantic, Ascention Is., St Helena', 'time_-1' => 'GMT -1:00 hours : Azores, Cape Verde Islands', 'time_0' => 'GMT : Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia', 'time_1' => 'GMT +1:00 hours : Berlin, Brussels, Copenhagen, Madrid, Paris, Rome', 'time_2' => 'GMT +2:00 hours : Kaliningrad, South Africa, Warsaw', 'time_3' => 'GMT +3:00 hours : Baghdad, Riyadh, Moscow, Nairobi', 'time_3.5' => 'GMT +3:30 hours : Tehran', 'time_4' => 'GMT +4:00 hours : Abu Dhabi, Baku, Muscat, Tbilisi', 'time_4.5' => 'GMT +4:30 hours : Kabul', 'time_5' => 'GMT +5:00 hours : Ekaterinburg, Islamabad, Karachi, Tashkent', 'time_5.5' => 'GMT +5:30 hours : Bombay, Calcutta, Madras, New Delhi', 'time_6' => 'GMT +6:00 hours : Almaty, Colomba, Dhaka', 'time_7' => 'GMT +7:00 hours : Bangkok, Hanoi, Jakarta', 'time_8' => 'GMT +8:00 hours : Beijing, Hong Kong, Perth, Singapore, Taipei', 'time_9' => 'GMT +9:00 hours : Osaka, Sapporo, Seoul, Tokyo, Yakutsk', 'time_9.5' => 'GMT +9:30 hours : Adelaide, Darwin', 'time_10' => 'GMT +10:00 hours : Melbourne, Papua New Guinea, Sydney, Vladivostok', 'time_11' => 'GMT +11:00 hours : Magadan, New Caledonia, Solomon Islands', 'time_12' => 'GMT +12:00 hours : Auckland, Wellington, Fiji, Marshall Island', 'workschedule' => 'Work Schedule', 'closed' => 'Not Working', 'invalidschedule' => 'Invalid staff schedule specified', 'hourrangeerror' => 'ERROR: An interval for one of the days is incorrect', 'workscheduleconfirm' => 'Work Schedule updated successfully');
/** * 分页列表 * @param array $options 配置 */ protected function page(array $options) { $result = array(); if ($options['where']) { $this->model->where($options['where']); } $result['status'] = true; $result['count'] = $this->model->count(); $result['size'] = IIF($options['size'], 10); $result['page'] = IIF($options['page'], 1); // $result['url'] = IIF($options['url'],'#'); if ($options['rel']) { $this->model->relation($options['rel']); } if ($options['alias']) { $this->model->alias($options['alias']); } if ($options['field']) { $this->model->field($options['field']); } if ($options['orderby']) { $this->model->order($options['orderby']); } if ($options['where']) { $this->model->where($options['where']); } // file_put_contents('log.txt',$this->model->_sql()."\r\n".$this->model->buildSql()); $result['items'] = $this->model->page($result['page'], $result['size'])->select(); if (method_exists($this, $options['after_select'])) { $this->{$options}['after_select']($result['items']); } //$this->fetchSql(true) // echo $this->model->_sql(); // file_put_contents('log.txt',$value."\r\n".$this->model->_sql()."\r\n".json_encode($options['where'])); // $value = file_get_contents('log.txt'); //$result['count'] = sizeof($result['items']); $this->ajaxReturn($result); }
function getDetailList($action, $content, $actionName, $lableTitle, $fieldNameList, $nPageSize, $nPage, $addSql) { $GLOBALS['conn='] = OpenConn(); $defaultStr = ''; $i = ''; $s = ''; $c = ''; $tableName = ''; $j = ''; $splxx = ''; $sql = ''; $x = ''; $url = ''; $nCount = ''; $pageInfo = ''; $modI = ''; $startStr = ''; $endStr = ''; $fieldName = ''; //字段名称 $splFieldName = ''; //分割字段 $replaceStr = ''; //替换字符 $tableName = lCase($actionName); //表名称 $listFileName = ''; //列表文件名称 $listFileName = RParam($action, 'listFileName'); $abcolorStr = ''; //A加粗和颜色 $atargetStr = ''; //A链接打开方式 $atitleStr = ''; //A链接的title20160407 $anofollowStr = ''; //A链接的nofollow $id = ''; $idPage = ''; $id = rq('id'); checkIDSQL(@$_REQUEST['id']); if ($fieldNameList == '*') { $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); } $fieldNameList = specialStrReplace($fieldNameList); //特殊字符处理 $splFieldName = aspSplit($fieldNameList, ','); //字段分割成数组 $defaultStr = getStrCut($content, '<!--#body start#-->', '<!--#body end#-->', 2); $pageInfo = getStrCut($content, '[page]', '[/page]', 1); if ($pageInfo != '') { $content = replace($content, $pageInfo, ''); } //call eerr("pageInfo",pageInfo) $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . ' ' . $addSql; //检测SQL if (checkSql($sql) == false) { errorLog('出错提示:<br>sql=' . $sql . '<br>'); return ''; } $rsObj = $GLOBALS['conn']->query($sql); $rs = mysql_fetch_array($rsObj); $nCount = @mysql_num_rows($rsObj); //为动态翻页网址 if ($GLOBALS['isMakeHtml'] == true) { $url = ''; if (len($listFileName) > 5) { $url = mid($listFileName, 1, len($listFileName) - 5) . '[id].html'; $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); } } else { $url = getUrlAddToParam(getUrl(), '?page=[id]', 'replace'); } $content = replace($content, '[$pageInfo$]', webPageControl($nCount, $nPageSize, $nPage, $url, $pageInfo)); if (EDITORTYPE == 'asp') { $x = getRsPageNumber($rs, $nCount, $nPageSize, $nPage); //获得Rs页数 '记录总数 } else { if ($nPage != '') { $nPage = $nPage - 1; } $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' ' . $addSql . ' limit ' . $nPageSize * $nPage . ',' . $nPageSize; $rsObj = $GLOBALS['conn']->query($sql); $rs = mysql_fetch_array($rsObj); $x = @mysql_num_rows($rsObj); } //call echo("sql",sql) for ($i = 1; $i <= $x; $i++) { $rs = mysql_fetch_array($rsObj); //给PHP用,因为在 asptophp转换不完善 $startStr = '[list-' . $i . ']'; $endStr = '[/list-' . $i . ']'; //在最后时排序当前交点20160202 if ($i == $x) { $startStr = '[list-end]'; $endStr = '[/list-end]'; } //例[list-mod2] [/list-mod2] 20150112 for ($modI = 6; $modI >= 2; $modI--) { if (inStr($defaultStr, $startStr) == false && $i % $modI == 0) { $startStr = '[list-mod' . $modI . ']'; $endStr = '[/list-mod' . $modI . ']'; if (inStr($defaultStr, $startStr) > 0) { break; } } } //没有则用默认 if (inStr($defaultStr, $startStr) == false || $startStr == '') { $startStr = '[list]'; $endStr = '[/list]'; } if (inStr($defaultStr, $startStr) > 0 && inStr($defaultStr, $endStr) > 0) { $s = StrCut($defaultStr, $startStr, $endStr, 2); //s = defaultStr $s = replace($s, '[$id$]', $rs['id']); for ($j = 0; $j <= uBound($splFieldName); $j++) { if ($splFieldName[$j] != '') { $splxx = aspSplit($splFieldName[$j] . '|||', '|'); $fieldName = $splxx[0]; $replaceStr = $rs[$fieldName] . ''; $s = replaceValueParam($s, $fieldName, $replaceStr); } if ($GLOBALS['isMakeHtml'] == true) { $url = getHandleRsUrl($rs['filename'], $rs['customaurl'], '/detail/detail' . $rs['id']); } else { $url = handleWebUrl('?act=detail&id=' . $rs['id']); if ($rs['customaurl'] != '') { $url = $rs['customaurl']; } } //A链接添加颜色 $abcolorStr = ''; if (inStr($fieldNameList, ',titlecolor,') > 0) { //A链接颜色 if ($rs['titlecolor'] != '') { $abcolorStr = 'color:' . $rs['titlecolor'] . ';'; } } if (inStr($fieldNameList, ',flags,') > 0) { //A链接加粗 if (inStr($rs['flags'], '|b|') > 0) { $abcolorStr = $abcolorStr . 'font-weight:bold;'; } } if ($abcolorStr != '') { $abcolorStr = ' style="' . $abcolorStr . '"'; } //打开方式2016 if (inStr($fieldNameList, ',target,') > 0) { $atargetStr = IIF($rs['target'] != '', ' target="' . $rs['target'] . '"', ''); } //A的title if (inStr($fieldNameList, ',title,') > 0) { $atitleStr = IIF($rs['title'] != '', ' title="' . $rs['title'] . '"', ''); } //A的nofollow if (inStr($fieldNameList, ',nofollow,') > 0) { $anofollowStr = IIF($rs['nofollow'] != 0, ' rel="nofollow"', ''); } $s = replaceValueParam($s, 'url', $url); $s = replaceValueParam($s, 'abcolor', $abcolorStr); //A链接加颜色与加粗 $s = replaceValueParam($s, 'atitle', $atitleStr); //A链接title $s = replaceValueParam($s, 'anofollow', $anofollowStr); //A链接nofollow $s = replaceValueParam($s, 'atarget', $atargetStr); //A链接打开方式 } } //call echo("tableName",tableName) $idPage = getThisIdPage($GLOBALS['db_PREFIX'] . $tableName, $rs['id'], 10); //【留言】 if ($tableName == 'guestbook') { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=GuestBook&lableTitle=留言&nPageSize=10&parentid=&searchfield=bodycontent&keyword=&addsql=&page=' . $idPage . '&id=' . $rs['id'] . '&n=' . getRnd(11); //【默认显示文章】 } else { $url = WEB_ADMINURL . '?act=addEditHandle&actionType=ArticleDetail&lableTitle=分类信息&nPageSize=10&page=' . $idPage . '&parentid=' . $rs['parentid'] . '&id=' . $rs['id'] . '&n=' . getRnd(11); } $s = handleDisplayOnlineEditDialog($url, $s, '', 'div|li|span'); $c = $c . $s; } $content = replace($content, '<!--#body start#-->' . $defaultStr . '<!--#body end#-->', $c); if ($GLOBALS['isMakeHtml'] == true) { $url = ''; if (len($listFileName) > 5) { $url = mid($listFileName, 1, len($listFileName) - 5) . '[id].html'; $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); } } else { $url = getUrlAddToParam(getUrl(), '?page=[id]', 'replace'); } $getDetailList = $content; return @$getDetailList; }
function handleRParam($action, $LableStr, $typeStr) { $LalbeName = ''; $endTypeStr = ''; $isTrue = ''; $s = ''; $isTrue = false; //是否为真 $endTypeStr = IIF($typeStr != '', $typeStr, ' '); $action = vbCrlf() . ' ' . $action; //给它也加个空格,要不然在没有函数,前面就没有空格 //默认前面加空格 $LalbeName = ' ' . $LableStr; //加个空格是为了精准 //不存在 前面加点 if (inStr($action, $LalbeName . '=' . $typeStr) == false && $isTrue == false) { $LalbeName = '\'' . $LableStr; } else { $isTrue = true; } //不存在 前面加双引号 if (inStr($action, $LalbeName . '=' . $typeStr) == false && $isTrue == false) { $LalbeName = '"' . $LableStr; } else { $isTrue = true; } //不存在 前面加TAB if (inStr($action, $LalbeName . '=' . $typeStr) == false && $isTrue == false) { $LalbeName = vbTab() . $LableStr; } else { $isTrue = true; } //不存在 前面加换行 if (inStr($action, $LalbeName . '=' . $typeStr) == false && $isTrue == false) { $LalbeName = vbCrlf() . $LableStr; } else { $isTrue = true; } if (inStr($action, $LalbeName . '=' . $typeStr) > 0 && inStr($action, $endTypeStr) > 0) { $s = StrCut($action, $LalbeName . '=' . $typeStr, $endTypeStr, 2); $s = handleInModule($s, 'end'); //处理里面参数 追加于20141031 还原内容值 if ($s == '') { $s = '[#空*值_#]'; } //判断是否对参数进行动作制作 if (inStr($s, '{$') > 0 && inStr($s, '$}') > 0) { //handleRParam=HandleTemplateAction(handleRParam,true) '处理动作 //handleRParam = handleModuleReplaceArray(handleRParam)'给AddSqL处理一下动作 这是处理替换,不需要,因为在 HandleTemplateAction有替换了(20151021) } //不要这个,要不不稳定(20151022) //if handleRParam="" then //handleRParam=false //end if } $handleRParam = $s; return @$handleRParam; }
function saveAddEdit($actionName, $lableTitle, $fieldNameList) { $tableName = ''; $url = ''; $listUrl = ''; $id = ''; $addOrEdit = ''; $sql = ''; $id = @$_REQUEST['id']; $addOrEdit = IIF($id == '', '添加', '修改'); handlePower($addOrEdit . $lableTitle); //管理权限处理 $GLOBALS['conn='] = OpenConn(); $fieldNameList = ',' . specialStrReplace($fieldNameList) . ','; //特殊字符处理 自定义字段列表 $tableName = lCase($actionName); //表名称 $sql = getPostSql($id, $tableName, $fieldNameList); //call eerr("sql",sql) '调试用 //检测SQL if (checkSql($sql) == false) { errorLog('出错提示:<hr>sql=' . $sql . '<br>'); return ''; } //conn.Execute(sql) '检测SQL时已经处理了,不需要再执行了 //对网站配置单独处理,为动态运行时删除,index.html 动,静,切换20160216 if (lCase($actionName) == 'website') { if (inStr(@$_REQUEST['flags'], 'htmlrun') == false) { DeleteFile('../index.html'); } } $listUrl = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace'); $listUrl = getUrlAddToParam($listUrl, '?focusid=' . $id, 'replace'); //添加 if ($id == '') { $url = getUrlAddToParam(getThisUrl(), '?act=addEditHandle', 'replace'); $url = getUrlAddToParam($url, '?focusid=' . $id, 'replace'); Rw(getMsg1('数据添加成功,返回继续添加' . $lableTitle . '...<br><a href=\'' . $listUrl . '\'>返回' . $lableTitle . '列表</a>', $url)); } else { $url = getUrlAddToParam(getThisUrl(), '?act=addEditHandle&switchId=' . @$_POST['switchId'], 'replace'); $url = getUrlAddToParam($url, '?focusid=' . $id, 'replace'); //没有返回列表管理设置 if (inStr('|WebSite|', '|' . $actionName . '|') > 0) { Rw(getMsg1('数据修改成功', $url)); } else { Rw(getMsg1('数据修改成功,正在进入' . $lableTitle . '列表...<br><a href=\'' . $url . '\'>继续编辑</a>', $listUrl)); } } writeSystemLog($tableName, $addOrEdit . $lableTitle); //系统日志 }
public function _submit($tag) { $tag['type'] = IIF($tag['type'], 'submit'); return $this->btn($tag, $tag['text'], 'btn-primary'); }
function checkTime($DateTime) { $checkTime = IIF(isDate($DateTime) == false, false, true); return @$checkTime; }