本文整理汇总了PHP中convertData函数的典型用法代码示例。如果您正苦于以下问题:PHP convertData函数的具体用法?PHP convertData怎么用?PHP convertData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convertData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOrders
function getOrders()
{
//создаем первый/основной пустой массив
$allorders = array();
//создаем и заполняем массив данными из файла
$info_from_file = file(ORDERS_LOG);
//создаем второй массив 2го уровня вложености в первый
$orderinfo = array();
//перебираем массив с данными из файла и этими данными заполняем массив 2го уровня вложености
foreach ($info_from_file as $item) {
//каждую строку разделяем на переменные
list($n, $e, $t, $a, $c, $dt) = explode('|', $item);
//и каждую переменную вкладываем в отдельную ячейку 2го массива
$orderinfo['name'] = $n;
$orderinfo['mail'] = $e;
$orderinfo['tel'] = $t;
$orderinfo['addr'] = $a;
$orderinfo['cust'] = $c;
$orderinfo['datetime'] = $dt;
$sql = "SELECT * FROM orders WHERE datetime = '{$orderinfo['datetime']}' AND customer = '{$orderinfo['cust']}'";
$res = mysql_query($sql) or die(mysql_error());
$orderinfo['tovari_v_zakaze'] = convertData($res);
//после заполнения массива orderinfo данными покупателя из файла -
//вкладываем масиив $orderinfo в ячейку $allorders[] и идем перебирать следующую строку из файла
$allorders[] = $orderinfo;
}
return $allorders;
}
示例2: grabData
function grabData($filename)
{
$rowNumber = 0;
if (($handle = fopen($filename, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
//pp($rowNumber);
// //-----------------------------------------------------------------------convert to usable array
$convertedData = convertData($data, $rowNumber);
// //-----------------------------------------------------------------------create new file location
makePath($convertedData);
// //-----------------------------------------------------------------------if tiff convert to pdf and move to new location
convertAndCreate($convertedData);
// //-----------------------------------------------------------------------crates xml file
createXMLFile($convertedData);
//Needs file create first
//ppr($convertedData);
$rowNumber++;
}
// add 1 to row number and reepeat on next line of data
}
//Close file
fclose($handle);
}
示例3: getOrders
function getOrders()
{
if (!file_exists(ORDERS_LOG)) {
return false;
} else {
$allorders = array();
$orders = file(ORDERS_LOG);
foreach ($orders as $order) {
list($name, $mail, $tel, $address, $customer, $tm) = explode('|', $order);
$orderinfo = array();
$orderinfo['name'] = $name;
$orderinfo['tel'] = $tel;
$orderinfo['addr'] = $address;
$orderinfo['cust'] = $customer;
$orderinfo['tm'] = $tm;
$sql = "SELECT * FROM orders WHERE customer = '{$customer}'\n\t\t\t\tAND datetime = '{$orderinfo['tm']}'";
$res = mysql_query($sql) or die(mysql_error());
$orderinfo['goods'] = convertData($res);
$allorders[] = $orderinfo;
}
}
return $allorders;
}
示例4: convertData
$links = $newsDetail->news_links[0];
$rss = $newsDetail->news_rss[0];
}
} else {
// case of adding news
if ($action == "add") {
//test if name blank
if ($title == "") {
$error = $strings["blank_newsdesk_title"];
} else {
//replace quotes by html code in name and address
$title = convertData($title);
if (get_magic_quotes_gpc() != 1) {
$content = addslashes($content);
}
$author = convertData($author);
//insert into organizations and redirect to new client organization detail (last id)
$tmpquery1 = "INSERT INTO " . $tableCollab["newsdeskposts"] . "(title,author,related,content,links,rss,pdate) VALUES ('{$title}', '{$author}', '{$related}', '" . addslashes($content) . "', '{$links}', '{$rss}', NOW())";
connectSql("{$tmpquery1}");
$tmpquery = $tableCollab["newsdeskposts"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
headerFunction("../newsdesk/viewnews.php?id={$num}&msg=add&" . session_name() . "=" . session_id());
}
}
}
// htmlArea 3.0 initialization
$headBonus = "\t\n\t\t\t<script type='text/javascript'> \n\t\t\t _editor_url = '../includes/htmlarea/'; \n\t\t\t</script> \n\n\t\t\t<script type='text/javascript' src='../includes/htmlarea/htmlarea.js'></script>\n\t\t\t<script type='text/javascript' src='../includes/htmlarea/lang/{$lang}.js'></script>\n\t\t\t<script type='text/javascript' src='../includes/htmlarea/dialog.js'></script>\n\t\t\t<script type='text/javascript' src='../includes/htmlarea/popupdiv.js'></script>\n\t\t\t<script type='text/javascript' src='../includes/htmlarea/popupwin.js'></script> \n\t\t\t\n\t\t\t<style type='text/css'>@import url(../includes/htmlarea/htmlarea.css)</style>\n\n\n\t\t\t \n\t\t\t \n\t\t\t<script type='text/javascript'>\n\n\t\t\t\tHTMLArea.loadPlugin('TableOperations'); \n\t\t\t\t\n\t\t\t\tvar editor = null;\n\t\t\t\t\n\t\t\t\tfunction initEditor() {\n\t\t\t\t editor = new HTMLArea('content');\n \t\t\t editor.registerPlugin('TableOperations');\n\t\t\t\t editor.generate();\n\t\t\t\t}\n\n\t\t\t</script>\n\t\t\t";
$bodyCommand = "onload='initEditor();'";
// end
示例5: headerFunction
headerFunction("../newsdesk/viewnews.php?id={$postid}&msg=removeComment&" . session_name() . "=" . session_id());
} else {
//set value in form
$name = $commentDetail->newscom_name[0];
$comment = $commentDetail->newscom_comment[0];
}
} else {
// case of adding new post
if ($action == "add") {
//test if name blank
if ($comment == "") {
$error = $strings["blank_newsdesk_comment"];
} else {
//replace quotes by html code in name and address
$name = convertData($name);
$comment = convertData($comment);
//insert into organizations and redirect to new client organization detail (last id)
$tmpquery1 = "INSERT INTO " . $tableCollab["newsdeskcomments"] . "(name,post_id,comment) VALUES ('{$name}','{$postid}' , '" . addslashes($comment) . "')";
connectSql("{$tmpquery1}");
$tmpquery = $tableCollab["newsdeskcomments"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
headerFunction("../newsdesk/viewnews.php?id={$postid}&msg=add&" . session_name() . "=" . session_id());
}
}
}
include '../themes/' . THEME . '/header.php';
$tmpquery2 = "WHERE news.id = '{$postid}'";
$newsDetail = new request();
$newsDetail->openNewsDesk($tmpquery2);
示例6: request
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
$checkSession = true;
require_once "../includes/library.php";
$tmpquery = "WHERE sr.id = '{$id}'";
$requestDetail = new request();
$requestDetail->openSupportRequests($tmpquery);
if ($requestDetail->sr_project[0] != $_SESSION['projectSession'] || $requestDetail->sr_user[0] != $_SESSION['idSession']) {
header("Location: index.php");
exit;
}
if ($action == "add") {
$mes = convertData($mes);
$tmpquery1 = "INSERT INTO " . $tableCollab["support_posts"] . "(request_id,message,date,owner,project) VALUES('{$id}','{$mes}','{$dateheure}','" . $_SESSION['idSession'] . "','" . $requestDetail->sr_project[0] . "')";
connectSql("{$tmpquery1}");
$tmpquery = $tableCollab["support_posts"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
if ($notifications == "true") {
if ($mes != "") {
require_once "../support/noti_newpost.php";
}
}
header("Location: suprequestdetail.php?id={$id}");
exit;
}
$bouton[6] = "over";
示例7: convertData
*/
$checkSession = true;
require_once "../includes/library.php";
if ($action == "update") {
if ($logout_time < "30" && $logout_time != "0" || !is_numeric($logout_time)) {
$logout_time = "30";
}
$fn = convertData($fn);
$tit = convertData($tit);
$em = convertData($em);
$wp = convertData($wp);
$hp = convertData($hp);
$mp = convertData($mp);
$fax = convertData($fax);
$logout_time = convertData($logout_time);
$start_page = convertData($start_page);
$tmpquery = "UPDATE " . $tableCollab["members"] . " SET name='{$fn}',title='{$tit}',email_work='{$em}',phone_work='{$wp}',phone_home='{$hp}',mobile='{$mp}',fax='{$fax}',logout_time='{$logout_time}',timezone='{$tz}',last_page='{$start_page}' WHERE id = '" . $_SESSION['idSession'] . "'";
connectSql($tmpquery);
// save to the session
$_SESSION['logouttimeSession'] = $logout_time;
$_SESSION['timezoneSession'] = $tz;
$_SESSION['dateunixSession'] = date("U");
$_SESSION['nameSession'] = $fn;
// if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function for user profile changes..!!!
require_once "../mantis/user_profile.php";
}
header("Location: ../preferences/updateuser.php?msg=update");
exit;
}
示例8: convertData
// $Revision: 1.3 $
/* vim: set expandtab ts=4 sw=4 sts=4: */
/**
* $Id: docitemapproval.php,v 1.3 2004/12/22 22:16:31 madbear Exp $
*
* Copyright (c) 2003 by the NetOffice developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
$checkSession = true;
require_once "../includes/library.php";
if ($action == "update") {
$commentField = convertData($commentField);
$tmpquery1 = "UPDATE " . $tableCollab["files"] . " SET comments_approval='{$commentField}',date_approval='{$dateheure}',approver='" . $_SESSION['idSession'] . "',status='{$statusField}' WHERE id = '{$id}'";
connectSql("{$tmpquery1}");
$msg = "updateFile";
header("Location: doclists.php");
exit;
}
$tmpquery = "WHERE fil.id = '{$id}'";
$fileDetail = new request();
$fileDetail->openFiles($tmpquery);
if ($fileDetail->fil_published[0] == "1" || $fileDetail->fil_project[0] != $_SESSION['projectSession']) {
header("Location: index.php");
exit;
}
$bouton[4] = "over";
$titlePage = $strings["approval_tracking"];
示例9: PDO
$dsn = 'mysql:host=localhost;dbname=opmigrate';
$user = 'root';
$password = 'monitor5';
try {
$conn = new PDO($dsn, $user, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}
//$sqlComm = "SELECT * FROM OP WHERE numop='$op'";
$sqlComm = "select prod.codigo,prod.pacote,prod.ean,prod.validade,OP.* from OP LEFT JOIN produtos prod ON prod.produto = OP.produto where OP.numop = '{$op}'";
foreach ($conn->query($sqlComm) as $row) {
$cliente = $row['cliente'];
$codcli = $row['codcli'];
$pedido = $row['pedido'];
$emissao = convertData($row['dataemissao']);
$desc = $row['produto'];
$pedcli = $row['pedcli'];
$unidade = $row['unidade'];
$cod = $row['codigo'];
$pacote = $row['pacote'];
$ean = $row['ean'];
$numdias = $row['validade'];
switch ($unidade) {
case "1":
$grandeza = "pcs";
break;
case "2":
$grandeza = "cen";
break;
case "3":
示例10: convertData
** =============================================================================
*/
$checkSession = "true";
include_once '../includes/library.php';
if ($action == "update") {
if ($logout_time < "30" && $logout_time != "0" || !is_numeric($logout_time)) {
$logout_time = "30";
}
$fn = convertData($fn);
$tit = convertData($tit);
$em = convertData($em);
$wp = convertData($wp);
$hp = convertData($hp);
$mp = convertData($mp);
$fax = convertData($fax);
$logout_time = convertData($logout_time);
$tmpquery = "UPDATE " . $tableCollab["members"] . " SET name='{$fn}',title='{$tit}',email_work='{$em}',phone_work='{$wp}',phone_home='{$hp}',mobile='{$mp}',fax='{$fax}',logout_time='{$logout_time}',timezone='{$tz}' WHERE id = '{$idSession}'";
connectSql("{$tmpquery}");
$timezoneSession = $tz;
$logouttimeSession = $logout_time;
$dateunixSession = date("U");
$nameSession = $fn;
$_SESSION['logouttimeSession'] = $logouttimeSession;
$_SESSION['timezoneSession'] = $timezoneSession;
$_SESSION['dateunixSession'] = $dateunixSession;
$_SESSION['nameSession'] = $nameSession;
//if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function for user profile changes..!!!
include "../mantis/user_profile.php";
}
示例11: substr
if ($storedDate != "") {
$extractHour = substr("{$storedDate}", 11, 2);
$extractMinute = substr("{$storedDate}", 14, 2);
$extractYear = substr("{$storedDate}", 0, 4);
$extractMonth = substr("{$storedDate}", 5, 2);
$extractDay = substr("{$storedDate}", 8, 2);
return date("Y-m-d H:i", mktime($extractHour + $gmtUser, $extractMinute, 0, $extractMonth, $extractDay, $extractYear));
}
} else {
return $storedDate;
}
}
//update sorting table if query sort column
if (!empty($sor_cible) && $sor_cible != "" && $sor_champs != "none") {
$sor_champs = convertData($sor_champs);
$sor_cible = convertData($sor_cible);
$tmpquery = "UPDATE " . $tableCollab["sorting"] . " SET {$sor_cible}='{$sor_champs} {$sor_ordre}' WHERE member = '{$idSession}'";
connectSql("{$tmpquery}");
}
//set all sorting values for logged user
$tmpquery = "WHERE sor.member = '" . fixInt($idSession) . "'";
$sortingUser = new request();
$sortingUser->openSorting($tmpquery);
/**
* Convert insert data value in form
* @param string $data Data to convert
* @access public
**/
function convertData($data)
{
global $databaseType;
示例12: convertData
/* vim: set expandtab ts=4 sw=4 sts=4: */
/**
* $Id: createthread.php,v 1.3 2004/12/22 22:16:31 madbear Exp $
*
* Copyright (c) 2003 by the NetOffice developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
$checkSession = true;
require_once "../includes/library.php";
if ($action == "add") {
$topicField = convertData($topicField);
$messageField = convertData($messageField);
$tmpquery1 = "INSERT INTO " . $tableCollab["topics"] . "(project,owner,subject,status,last_post,posts,published) VALUES('" . $_SESSION['projectSession'] . "','" . $_SESSION['idSession'] . "','{$topicField}','1','{$dateheure}','1','0')";
connectSql("{$tmpquery1}");
$tmpquery = $tableCollab["topics"];
last_id($tmpquery);
$num = $lastId[0];
unset($lastId);
autoLinks($messageField);
$tmpquery2 = "INSERT INTO " . $tableCollab["posts"] . "(topic,member,created,message) VALUES('{$num}','" . $_SESSION['idSession'] . "','{$dateheure}','{$newText}')";
connectSql("{$tmpquery2}");
if ($notifications == "true") {
$tmpquery = "WHERE pro.id = '" . $_SESSION['projectSession'] . "'";
$projectDetail = new request();
$projectDetail->openProjects($tmpquery);
require_once "../topics/noti_newtopic.php";
}
示例13: convertData
$category = $num;
} else {
$category = $listCategories->boocat_id[0];
}
}
if ($shared == "" || $users != "") {
$shared = "0";
}
if ($home == "") {
$home = "0";
}
if ($comments == "") {
$comments = "0";
}
$name = convertData($name);
$description = convertData($description);
$tmpquery1 = "INSERT INTO " . $tableCollab["bookmarks"] . "(owner,category,name,url,description,shared,home,comments,users,created) VALUES('{$idSession}','{$category}','{$name}','{$url}','{$description}','{$shared}','{$home}','{$comments}','{$users}','{$dateheure}')";
connectSql("{$tmpquery1}");
headerFunction("../bookmarks/listbookmarks.php?view=my&msg=add&" . session_name() . "=" . session_id());
}
}
$bodyCommand = "onLoad=\"document.booForm.name.focus();\"";
include '../themes/' . THEME . '/header.php';
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../bookmarks/listbookmarks.php?view=my", $strings["bookmarks"], in));
if ($id == "") {
$blockPage->itemBreadcrumbs($strings["add_bookmark"]);
}
if ($id != "") {
$blockPage->itemBreadcrumbs($blockPage->buildLink("../bookmarks/viewbookmark.php?id=" . $bookmarkDetail->boo_id[0], $bookmarkDetail->boo_name[0], in));
示例14: convertInputData
function convertInputData($_to, $_from)
{
$_POST = convertData($_POST, $_to, $_from);
$_GET = convertData($_GET, $_to, $_from);
$_COOKIE = convertData($_COOKIE, $_to, $_from);
$_FILES = convertData($_FILES, $_to, $_from);
}
示例15: convertData
** 08/03/2005 - sql fix for MSSQL http://www.php-collab.org/community/viewtopic.php?p=6723
** 24/01/2005 - sql fix for object in query, removed paletteIcon if report is not saved
** 29/06/2004 - sql fix http://www.php-collab.org/community/viewtopic.php?t=1183
** 23/03/2004 - added new document info
** 23/03/2004 - new export to pdf by Angel
** 23/03/2004 - xhtml code
** -----------------------------------------------------------------------------
** TO-DO:
**
**
** =============================================================================
*/
$checkSession = "true";
include_once '../includes/library.php';
if ($action == "add") {
$S_SAVENAME = convertData($S_SAVENAME);
$tmpquery1 = "INSERT INTO " . $tableCollab["reports"] . "(owner,name,projects,clients,members,priorities,status,date_due_start,date_due_end,date_complete_start,date_complete_end,created) VALUES('{$idSession}','{$S_SAVENAME}','{$S_PRJSEL}','{$S_ORGSEL}','{$S_ATSEL}','{$S_PRIOSEL}','{$S_STATSEL}','{$S_SDATE}','{$S_EDATE}','{$S_SDATE2}','{$S_EDATE2}','{$dateheure}')";
connectSql("{$tmpquery1}");
headerFunction("../general/home.php?msg=addReport&" . session_name() . "=" . session_id());
}
$setTitle .= " : Report Results";
include '../themes/' . THEME . '/header.php';
if ($id == "" && $tri != "true") {
$compt1 = count($S_PRJSEL);
$S_pro = "";
for ($i = 0; $i < $compt1; $i++) {
if ($S_PRJSEL[$i] == "ALL") {
$S_pro = "ALL";
break;
}
if ($i != $compt1 - 1) {