本文整理汇总了PHP中executeSQL函数的典型用法代码示例。如果您正苦于以下问题:PHP executeSQL函数的具体用法?PHP executeSQL怎么用?PHP executeSQL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了executeSQL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateDBNo
function updateDBNo($NewNumber, $db)
{
global $SQLFile;
if (!isset($SQLFile)) {
$sql = "UPDATE config SET confvalue='" . $NewNumber . "' WHERE confname='DBUpdateNumber'";
executeSQL($sql, $db);
$_SESSION['DBUpdateNumber'] = $NewNumber;
}
}
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:9,代码来源:Z_UpgradeDatabase.php
示例2: createUser
function createUser($user, $pwd)
{
$insertSQL = "INSERT INTO user(email, passwd) VALUES(\"{$user}\", \"{$psw}\")";
$result = executeSQL($insertSQL);
if (!$result) {
echo "<script>alert('创建用户失败,请稍候再试!'); history.go(-1);</script>";
return false;
}
return true;
}
开发者ID:RainbowMango,项目名称:DecorationbusWeb,代码行数:10,代码来源:MySQLUtil.php
示例3: isAddressDefault
include "includes/function.php";
//Get the query string and complete the SQL query
$user_id = $user_info_id = "";
if (isset($_POST['person_id'])) {
$user_id = $_POST['person_id'];
}
if (isset($_POST['address_id'])) {
$user_info_id = $_POST['address_id'];
}
// Generate the query
if ($user_id != "" && $user_info_id != "") {
//if default address, update with default empty no_address
$default_address = isAddressDefault($user_info_id);
if (!$default_address) {
// Delete the customer's information
$req_delete = "DELETE FROM " . constant('_VM_TABLE_PREFIX_') . "_user_info WHERE user_id=" . $user_id . "";
echo executeSQL($req_delete);
} else {
// Update the default address
$address = "no_adress";
$zip = "no_zip";
$city = "no_city";
$country = "no_country";
$street = "no_street";
$addressUpdateQuery1 = sprintf("UPDATE " . constant('_VM_TABLE_PREFIX_') . "_user_info SET\n " . $_PERS_PARAMS_MAPPING['address'] . "=%s, \n " . $_PERS_PARAMS_MAPPING['zip'] . "=%s,\n " . $_PERS_PARAMS_MAPPING['city'] . "=%s, \n " . $_PERS_PARAMS_MAPPING['country'] . "=%s\n WHERE user_info_id=%s ", GetSQLValueString($address, "text"), GetSQLValueString($zip, "text"), GetSQLValueString($city, "text"), GetSQLValueString($country, "text"), GetSQLValueString($user_info_id, "int"));
echo executeSQL($addressUpdateQuery1);
}
} else {
echo '\\nInvalid query: No parameter given!';
}
mysql_close();
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:deleteAddress.php
示例4: ms_gc
function ms_gc($sesslt)
{
$tStamp = time() - $sesslt;
return executeSQL("DELETE FROM currentsession WHERE laccess < '{$tStamp}'");
}
开发者ID:hexerei-software,项目名称:XOX-Framework,代码行数:5,代码来源:sessions.php
示例5: executeSQL
exit;
}
if ($_POST['includedata'] == "include") {
executeSQL("insert ws_rate_" . $_POST['newtable'] . " select * from " . $_POST['source'] . " order by areacode;");
}
}
if ($_POST['action'] == "newcost") {
$resultado = mysql_query("show tables like ws_cost_'" . $_POST['newtable'] . "';");
if (mysql_num_rows($resultado) > 0) {
echo "<font size=4>Ya existe una tabla con ese nombre (" . $_POST['newtable'] . "), por favor retroceda y cambie el nombre.";
exit;
}
$resultado = mysql_query("create table ws_cost_" . $_POST['newtable'] . " like " . $_POST['source'] . ";");
if (!$resultado) {
echo "<font size=6 color='red'>Ha habido un error creando la nueva tabla, por favor dirígase al administrador del sistema";
exit;
}
if ($_POST['includedata'] == "include") {
executeSQL("insert ws_cost_" . $_POST['newtable'] . " select * from " . $_POST['source'] . " order by areacode;");
}
}
function executeSQL($sql)
{
$resultado = mysql_query($sql) or die("\n <html>\n <head>\n <meta http-equiv=\"refresh\" content=\"5; url = create_ratetable.php\" />\n </head>\n <body bgcolor=\"#1C2D67\">\n <br>\n <font face=\"Verdana\" color=\"#FF0000\" size=\"12\">\n <center>\n There was an error executing your request. <br>\n Please contact the system administrator\n </center>\n </font>\n <br>\n " . mysql_error() . "</body>");
if ($resultado) {
print "\n <html>\n <head>\n <meta http-equiv=\"refresh\" content=\"5; url = create_ratetable.php\" />\n </head>\n <body bgcolor=\"#1C2D67\">\n <br>\n <font face=\"Verdana\" color=\"White\" size=\"4\">\n <center>\n Your request has been executed successfully. <br>\n You are being redirected to the main page.\n </center>\n </font>\n <br>\n </body>";
}
}
?>
</body>
</html>
开发者ID:nbhatti,项目名称:FreeSWITCH-Billing,代码行数:31,代码来源:save_data.php
示例6: getQueryData
$userid = getQueryData('userid');
$sql = "select id from tbl_user a where a.userid= '" . $userid . "'";
$userid = executeScalar($db, $sql);
$data = getQueryData('data');
$data = json_decode($data, true);
$servicename = executeScalar($db, "select servicename from tbl_service where delete_flag=0 and id=" . correctSQL($data["service"]));
$sql = "insert into tbl_user_status (userid, serviceid, servicename, unitprice, unittype, start_date, end_date, charge, balance, payment, memo, create_id, create_date, update_id, update_date) values (" . correctSQL($userid) . "," . correctSQL($data["service"]) . "," . correctSQL($servicename) . "," . correctSQL($data["unitprice"], 1) . "," . correctSQL($data["unittype"], 1) . "," . correctSQL(substr($data["start_date"], 0, 10)) . "," . correctSQL(substr($data["end_date"], 0, 10)) . "," . correctSQL($data["charge"], 1) . "," . correctSQL($data["balance"], 1) . "," . correctSQL($data["payment"], 1) . "," . correctSQL($data["memo"]) . "," . correctSQL($login_id) . "," . "now() ," . correctSQL($login_id) . "," . "now());";
executeSQL($db, $sql);
responseData(true, null);
break;
case 'userstatus_update':
$data = getQueryData('data');
$data = json_decode($data, true);
$return = array();
$sql = "update tbl_user_status set memo=" . correctSQL($data["memo"]) . " where delete_flag=0 and id=" . correctSQL($data["id"]);
executeSQL($db, $sql);
responseData(true, null);
break;
case 'viewhistory_list':
$userid = getQueryData('userid');
$sql = "select b.name as channelname, a.start_time, a.end_time from tbl_user_history a, tbl_channel b\r\n\t\t\t\t\t\t\twhere a.userid='" . $userid . "' and a.channelid = b.id and a.delete_flag=0\r\n\t\t\t\t\t\t\torder by start_time desc limit 100";
$result = querySQL($db, $sql);
$data = array();
while ($row = mysql_fetch_assoc($result)) {
$data[] = $row;
}
responseData(true, null, $data);
break;
case 'user_csvdownload':
$sql = "\r\n\t\t\t\t\tselect \r\n\t\t\t\t\t\ta.userid,\r\n\t\t\t\t\t\ta.fullname as name,\r\n\t\t\t\t\t\ta.password,\r\n\t\t\t\t\t\tcase a.type\t when 1 then 'BOX' when 2 then 'MINI' else 'PBOX' end as type,\r\n\t\t\t\t\t\tcase substr(a.flag, 1, 1) when '1' then 'ON' else 'OFF' end as vodflag,\r\n\t\t\t\t\t\ta.tel,\r\n\t\t\t\t\t\ta.email,\r\n\t\t\t\t\t\ta.identitycard,\r\n\t\t\t\t\t\ta.address,\r\n\t\t\t\t\t\tcase a.status when 1 then 'ON' else 'OFF' end as status,\r\n\t\t\t\t\t\tcase a.money_status when 1 then 'ON' else 'OFF' end as money_status,\r\n\t\t\t\t\t\ta.memo,\r\n\t\t\t\t\t\te.meetingcount,\r\n\t\t\t\t\t\ta.macid,\r\n\t\t\t\t\t\td.servicename,\r\n\t\t\t\t\t\td.point as balance,\r\n\t\t\t\t\t\tdate_format(d.start_date, '%Y-%m-%d') as start_date,\r\n\t\t\t\t\t\td.expire_time as end_date,\r\n\t\t\t\t\t\t(case when d.expire_time is null then 0 when d.expire_time = 'free' then null else datediff(d.expire_time, now()) + 1 end) as remain_day,\r\n\t\t\t\t\t\td.payment,\r\n\t\t\t\t\t\tb.name as store_name,\r\n\t\t\t\t\t\tc.name as emp_name,\r\n\t\t\t\t\t\ta.create_id,\r\n\t\t\t\t\t\ta.create_date\r\n\t\t\t\t\tfrom tbl_user a left outer join\r\n\t\t\t\t\t\ttbl_agent_store b on a.agentstoreid=b.id left outer join\r\n\t\t\t\t\t\ttbl_agent_emp c on a.agentempid=c.id left outer join\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tselect \r\n\t\t\t\t\t\t\t\t*,\r\n\t\t\t\t\t\t\t\tfn_balance_param(serviceid, unitprice, unittype, balance, start_date) as point,\r\n\t\t\t\t\t\t\t\tfn_expiretime_param(serviceid, unitprice, unittype, end_date) as expire_time\r\n\t\t\t\t\t\t\tfrom \r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\tselect * from tbl_user_status where delete_flag=0 order by update_date desc\r\n\t\t\t\t\t\t\t) a group by userid\r\n\t\t\t\t\t\t) d on a.id=d.userid left outer join\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tselect userid, count(*) as meetingcount from tbl_user_meeting where delete_flag=0 group by userid \r\n\t\t\t\t\t\t) e on a.id=e.userid\r\n\t\t\t\t\twhere a.delete_flag=0 and a.userid != 'anonymous'\r\n\t\t\t\t";
$where = "";
开发者ID:oizhaolei,项目名称:websysadmin,代码行数:31,代码来源:temp_user_back.php
示例7: querySQL
$result = querySQL($conn, $sql);
$row = mysql_fetch_array($result);
$start_date = $row["start_date"];
$now = date("Y-m-d");
$end_date = $row["end_date"];
$days = ceil((strtotime($now) - strtotime($start_date)) / (60 * 60 * 24));
$y = intval(substr($start_date, 0, 4));
$m = intval(substr($start_date, 5, 2));
$d = intval(substr($start_date, 8, 2));
$start_date = date('Y-m-d', mktime(0, 0, 0, $m, $d + $days, $y));
$y = intval(substr($end_date, 0, 4));
$m = intval(substr($end_date, 5, 2));
$d = intval(substr($end_date, 8, 2));
$end_date = date('Y-m-d', mktime(0, 0, 0, $m, $d + $days, $y));
$sql = 'update tbl_user_status' . ' set start_date=' . correctSQL(substr($start_date, 0, 10)) . ' , end_date=' . correctSQL(substr($end_date, 0, 10)) . ' where userid=' . $uid . ' and delete_flag=0';
executeSQL($conn, $sql);
}
}
// set session data
saveLoginInfo($userid, $macid);
}
// get serviceid, expiretime
$row = getUserServiceInfo($conn, $uid);
if ($row == null) {
invalidUser();
}
if ($row["expiretime"] == null || $row["serviceid"] == null) {
expiredUser($userid);
}
$expiretime = $row["expiretime"];
$remainday = intval($row["remainday"]);
开发者ID:oizhaolei,项目名称:websysadmin,代码行数:31,代码来源:player2.php
示例8: import
/**
*
*Restaure depuis un fichier texte la base de donnees courante.
*
** @param repertoire string
* <p>Nom du repertoire dans lequel le fichier dump sera sauvagarde
* si NULL on sauvegarde dans le repertoire courant</p>
*/
function import()
{
global $modeacces, $connexion;
//desactive les cle etrangere pour pouvoir effacer les tables de la base
$sql = "SET FOREIGN_KEY_CHECKS = 0";
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
//quelques informations importantes
$ipsrv = $_SERVER['SERVER_ADDR'];
$versionPHP = getenv("SERVER_SOFTWARE");
$namesrv = $_SERVER['SERVER_NAME'];
$dbname = nomBase();
//si la base existe on supprime les tables
if ($connexion) {
$sql = "SHOW tables";
$results = tableSQL($sql);
foreach ($results as $ligne) {
//on extrait chaque valeur de la ligne courante
$nomTable = $ligne[0];
$sql = "DROP TABLE `{$nomTable}`";
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
}
} else {
//sinon on cree la base
$sql = "CREATE DATABASE `{$dbname}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
}
//on utilise la base de donnees
$sql = "USE `{$dbname}`";
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
$versionMySQL = versionMYSQL();
echo "Version : " . $versionMySQL;
//restaure la base en fonction du fichier creer par le dump (V2)
//Lit le fichier et renvoie le résultat dans un tableau
$lines = file($dbname . ".sql");
$versionBase = $lines[1];
$sql = "";
//execute toutes les requetes du fichier de dump
for ($i = 0; $i < count($lines); $i++) {
$line = $lines[$i];
if ($line[0] != '-' && $line[0] != '/' && strlen($line) > 2) {
$sql = $sql . $line;
$test = strrev($line);
$pospv = strpos($test, ";");
if ($pospv > 0 && $pospv < 5) {
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
$sql = "";
}
}
}
//reactive les cle etrangere la base
$sql = "SET FOREIGN_KEY_CHECKS = 1";
echo "SQL : {$sql}<br/>";
$result = executeSQL($sql);
$versionBase = substr($versionBase, 23 + strlen($dbname), strlen($versionBase) - 23 - strlen($dbname));
$versionBase = str_replace("à", "<br />", $versionBase);
echo "<font color=green> Version base {$dbname} <br /> {$versionBase} <br />{$namesrv}(IP : {$ipsrv})<br />{$versionPHP}<br />MySQL : {$versionMySQL}</font>";
}
开发者ID:erwanLeGuen,项目名称:PPE,代码行数:70,代码来源:AccesDonnees4.6.php
示例9: ChangeColumnDefault
<?php
/* sql script pricing end dates per Ricard
*/
ChangeColumnDefault('enddate', 'prices', 'Date', 'NOT NULL', '0000-00-00', $db);
$sql = "DESC prices enddate";
$result = DB_query($sql, $db);
if (DB_num_rows($result) > 0) {
$sql = "SELECT price FROM prices WHERE enddate='9999-12-31'";
$result = DB_query($sql, $db);
if (DB_num_rows($result) > 0) {
$response = executeSQL("UPDATE prices SET startdate='1999-01-01', enddate='0000-00-00' WHERE enddate='9999-12-31'", $db, False);
if ($response == 0) {
OutputResult(_('The enddate column in the prices table has been updated'), 'success');
} else {
OutputResult(_('The enddate column in the prices table cannot be updated'), 'error');
}
} else {
OutputResult(_('The enddate column in the prices table is already correct'), 'info');
}
} else {
$response = executeSQL("UPDATE prices SET startdate='1999-01-01', enddate='0000-00-00' WHERE enddate='9999-12-31'", $db, False);
}
UpdateDBNo(49, $db);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:24,代码来源:49.php
示例10: DB_query
<?php
/* Ensure the correct conversion factor is stored in the purchase
* order line record
*/
if (!isset($SQLFile)) {
$sql = "SELECT podetailitem,\n\t\t\titemcode,\n\t\t\tpurchorders.supplierno\n\t\tFROM purchorderdetails\n\t\tLEFT JOIN purchorders\n\t\t\tON purchorders.orderno=purchorderdetails.orderno\n\t\tWHERE conversionfactor=0";
$result = DB_query($sql, $db);
while ($myrow = DB_fetch_array($result)) {
$ConversionFactorSQL = "SELECT conversionfactor\n\t\t\t\t\t\t\tFROM purchdata\n\t\t\t\t\t\t\tWHERE supplierno='" . $myrow['supplierno'] . "'\n\t\t\t\t\t\t\t\tAND stockid='" . $myrow['itemcode'] . "'";
$ConversionFactorResult = DB_query($ConversionFactorSQL, $db);
if (DB_num_rows($ConversionFactorResult) > 0) {
$ConversionFactorRow = DB_fetch_array($ConversionFactorResult);
$ConversionFactor = $ConversionFactorRow['conversionfactor'];
} else {
$ConversionFactor = 1;
}
$UpdateSQL = "UPDATE purchorderdetails\n\t\t\t\tSET conversionfactor='" . $ConversionFactor . "'\n\t\t\t\tWHERE podetailitem='" . $myrow['podetailitem'] . "'";
$UpdateResult = executeSQL($UpdateSQL, $db);
}
OutputResult(_('Purchase order details have been correctly updated'), 'success');
}
UpdateDBNo(57, $db);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:23,代码来源:57.php
示例11: zen_db_prepare_input
<?php
include 'tiosafe_config.php';
if (postNotEmpty('address_id')) {
$address_id = zen_db_prepare_input($_POST['address_id']);
$query = 'DELETE FROM ' . TABLE_ADDRESS_BOOK . ' WHERE address_book_id = ' . $address_id;
echo executeSQL($query, $db);
} else {
echo '\\nInvalid query: the parameter address_id is required!';
}
$db->close();
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:11,代码来源:deleteAddress.php
示例12: strtolower
$username = strtolower(str_replace(" ", "_", trim($username)));
$password = md5('AzertyuioP');
// Default password
$usertype = 'Registered';
$gid = "18";
//Firstname, Lastname and Email address are required
if ($first_name != "" && $last_name != "" && $user_email != "" && $street != "" && $zip != "" && $city != "" && $country != "") {
if (!emailExists($user_email)) {
// create the users in default Jomla!1.5 users
// XXX test if username doesn't exists before adding
$personCreateQuery1 = sprintf("INSERT INTO " . constant('_JOOMLA_TABLE_PREFIX_') . "users\n (name, username, email, password, usertype, gid) \n Values (%s, %s, %s, %s, %s, %s)", GetSQLValueString($name, "text"), GetSQLValueString($username, "text"), GetSQLValueString($user_email, "text"), GetSQLValueString($password, "text"), GetSQLValueString($usertype, "text"), GetSQLValueString($gid, "int"));
//echo $personCreateQuery1;
$msg_1 = executeSQL($personCreateQuery1);
// get the id of the inserted user
$user_id = emailExists($user_email);
// If we want the user to log in the virtuemart site
$section_value = "users";
$personCreateQuery1bis = sprintf("INSERT INTO " . constant('_JOOMLA_TABLE_PREFIX_') . "core_acl_aro \n ( section_value, value, name) \n Values ( %s, %s, %s)", GetSQLValueString($section_value, "text"), GetSQLValueString($user_id, "text"), GetSQLValueString($name, "text"));
$msg_1bis = executeSQL($personCreateQuery1bis);
// Create Virtuemart user
$personCreateQuery2 = sprintf("INSERT INTO " . constant('_VM_TABLE_PREFIX_') . "_user_info \n (first_name, last_name, user_email, address_1, zip, city, country,\n address_type, address_type_name, cdate, mdate, user_id, user_info_id) \n Values ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($first_name, "text"), GetSQLValueString($last_name, "text"), GetSQLValueString($user_email, "text"), GetSQLValueString($street, "text"), GetSQLValueString($zip, "text"), GetSQLValueString($city, "text"), GetSQLValueString($country, "text"), GetSQLValueString($address_type, "text"), GetSQLValueString($address_type_name, "text"), GetSQLValueString($cdate, "text"), GetSQLValueString($mdate, "text"), GetSQLValueString($user_id, "int"), GetSQLValueString($user_info_id, "text"));
//echo $personCreateQuery2;
$msg_2 = executeSQL($personCreateQuery2);
echo $msg_2;
} else {
echo '\\nVirtueMart Error: A user with the email \'' . $user_email . '\' already exists!';
}
} else {
echo '\\nInvalid query: firstname, lastname, email are required!';
}
mysql_close();
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:createPerson.php
示例13: md5
$hash_secret = "VirtueMartIsCool";
$user_info_id = md5(uniqid($hash_secret));
$address_type = 'ST';
$address_type_name = '-default-';
$cdate = $timestamp;
// creation date
$mdate = $timestamp;
// modification date
if ($user_id != "" && $street != "" && $zip != "" && $city != "" && $country != "") {
//XXX How to idenify the default address
//$default_address_set = isDefaultAddressSet($user_id);
if (!isDefaultAddressSet($user_id)) {
// Update the person's default address
$address_type = 'BT';
$addressUpdateQuery1 = sprintf("UPDATE " . constant('_VM_TABLE_PREFIX_') . "_user_info SET\n address_1=%s, \n zip=%s,\n city=%s, \n country=%s\n WHERE user_id=%s AND address_type=%s", GetSQLValueString($street, "text"), GetSQLValueString($zip, "text"), GetSQLValueString($city, "text"), GetSQLValueString($country, "text"), GetSQLValueString($user_id, "int"), GetSQLValueString($address_type, "text"));
//echo $addressUpdateQuery1;
$msg_2 = executeSQL($addressUpdateQuery1);
echo $msg_2;
//user_id is required
} else {
// Create a new address
// Create Virtuemart user
$addressCreateQuery2 = sprintf("INSERT INTO " . constant('_VM_TABLE_PREFIX_') . "_user_info \n ( address_1, zip, city, country,\n address_type, address_type_name, cdate, mdate, user_id, user_info_id) \n Values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($street, "text"), GetSQLValueString($zip, "text"), GetSQLValueString($city, "text"), GetSQLValueString($country, "text"), GetSQLValueString($address_type, "text"), GetSQLValueString($address_type_name, "text"), GetSQLValueString($cdate, "text"), GetSQLValueString($mdate, "text"), GetSQLValueString($user_id, "int"), GetSQLValueString($user_info_id, "text"));
echo $addressCreateQuery2;
//$msg_1 = executeSQL($addressCreateQuery2);
echo $msg_1;
}
} else {
echo '\\nInvalid query: address, zip, city and country are required!';
}
mysql_close();
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:createAddress.php
示例14: getUserServiceInfo
function getUserServiceInfo($conn, $uid)
{
// update start_date for empty
executeSQL($conn, "select fn_update_startdate(" . $uid . ")");
// get serviceid, expiretime
$sql = "\n\t\t\tselect \n\t\t\t\tcase a.expiretime when 'free' then '0000-00-00' else a.expiretime end as expiretime,\n\t\t\t\tcase a.expiretime when 'free' then 0 \telse datediff(a.expiretime, now())+1 end as remainday,\n\t\t\t\tfn_serviceid(" . $uid . ") as serviceid\n\t\t\tfrom \n\t\t\t\t(select fn_expiretime(" . $uid . ") as expiretime) a\n\t\t";
$result = querySQL($conn, $sql);
$row = mysql_fetch_array($result);
return $row;
}
开发者ID:oizhaolei,项目名称:websysadmin,代码行数:10,代码来源:share.php
示例15: fputs
fputs($fp, "\nCreate Product"); // on va a la ligne
fputs($fp, $now."\n"); // on va a la ligne
fputs($fp, $product_reference." - ".$product_name." - ".$product_category); // on écrit le nom et email dans le fichier
fputs($fp, "\n\n"); // on va a la ligne
fclose($fp);*/
//Title and reference are required
if ($product_reference != "" && $product_name != "") {
// if ref doesn't exists create, reference is unique
if (!referenceExists($product_reference)) {
// Create
$productCreateQuery1 = sprintf("INSERT INTO " . constant('_VM_TABLE_PREFIX_') . "_product \n (" . $_PROD_PARAMS_MAPPING['reference'] . ", " . $_PROD_PARAMS_MAPPING['title'] . ",\n product_publish, vendor_id) \n Values (%s, %s, %s, %s)", GetSQLValueString($product_reference, "text"), GetSQLValueString($product_name, "text"), GetSQLValueString('Y', "text"), GetSQLValueString('1', "text"));
$msg_1 = executeSQL($productCreateQuery1);
$product_id = referenceExists($product_reference);
if ($product_price != "") {
$productCreateQuery2 = sprintf("INSERT INTO " . constant('_VM_TABLE_PREFIX_') . "_product_price \n (" . $_PROD_PARAMS_MAPPING['id'] . ", " . $_PROD_PARAMS_MAPPING['sale_price'] . ") \n Values (%s, %s)", GetSQLValueString($product_id, "int"), GetSQLValueString($product_price, "double"));
$msg_2 = executeSQL($productCreateQuery2);
}
/*
if($product_category !="") {
//XXX category parameter can be a list
$parent_categ_id = 0;
$product_category_list = split('/', $product_category);
//take off the erp5 base_category name
unset($product_category_list[array_search(constant('_CATEGORY_INTEGRATION_MAPPING_ID_'),$product_category_list)]);
//$product_category_list = $product_category_list
foreach($product_category_list as $categ_key => $categ_item) {
$categ_id=categoryExists($categ_item);
if(!$categ_id)
{ $productCreateQuery3 = sprintf("INSERT INTO ".constant('_VM_TABLE_PREFIX_')."_category (".$_PROD_PARAMS_MAPPING['category'].", category_publish, vendor_id) Values (%s, %s, %s)",
GetSQLValueString($categ_item, "text"),
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:createProduct.php
示例16: session_start
<?php
require "../snippets/dbConn.php";
require "../snippets/SQLTools.php";
require "../snippets/utils.php";
session_start();
$com = "SELECT DHR.serviceID, DHR.firstName, DHR.lastName, DHR.address, DHR.phoneNumber, DHR.email, DHR.computerModel, DHR.serviceRequested, DHR.extraParts, DHR.serviceProvided, DHR.serviceProvided, DHR.complete, Du1.firstName as CreatorF, Du1.lastName as CreatorL, Du2.firstName as OpenerF, Du2.lastName as OpenerL, Du3.firstName as CloserF, Du3.lastName as CloserL, Du4.firstName as DelegatedToF, Du4.lastName as DelegatedToL, DHR.delegatedToId, DHR.requestTime, DHR.openTime, DHR.closeTime\n\t\t\tFROM DOC_Hardware_Records DHR\n\t\t\t\tJoin DOC_Users Du1 on DHR.creatorId = Du1.userId\n\t\t\t\tJoin DOC_Users Du2 on DHR.openerId = Du2.userId\n\t\t\t\tJoin DOC_Users Du3 on DHR.closerId = Du3.userId \n\t\t\t\tJoin DOC_Users Du4 on DHR.delegatedToId = Du4.userId\n\t\t\tWHERE DHR.delegatedToId = :id AND DHR.complete = 1 ORDER BY DHR.requestTime DESC";
$ret = executeSQL_Safe($com, $dbConn, ":id", $_SESSION['userID']);
$getUsers = "SELECT * FROM DOC_Users";
$extraInfo = executeSQL($getUsers, $dbConn);
foreach ($ret as $row) {
drawTicket2($row, $extraInfo, $_SESSION['userID']);
}
开发者ID:SpencerBelleau,项目名称:DOC_HardwareServiceRequestDatabase,代码行数:13,代码来源:fetchDelegated.php
示例17: compteSQL
<?php
require "connectAD.php";
//recupération des variables
$trnNum = $_GET['TRNNUM'];
$lieu = $_GET['lieu'];
$hreMin = $_GET['hreMin'] . ":00.000000";
//Permet la convertion au format datetime de la BDD
$hreMax = $_GET['hreMax'] . ":00.000000";
//Permet la convertion au format datetime de la BDD
$etpFin = $_GET['etpFin'] . ":00.000000";
//Permet la convertion au format datetime de la BDD
$commentaire = $_GET['commentaire'];
if (verificationHorraire($hreMin, $hreMax, $etpFin, "ac13", $trnNum) == false) {
/*echo "<meta http-equiv='refresh' content='0;url=ac13.php?message=<font color=red>Formulaire rempli de manière incorrecte.</font>'>";*/
} else {
//recuperation du plus grand ETPID pour la tournée en question :
$sql = "select ETPID from etape where TRNNUM = " . $trnNum . "; ";
echo $sql . "<br/>";
$etpid = compteSQL($sql);
echo "etpid = {$etpid}<br />";
$etpid += 1;
echo "<br/>" . $etpid . "<br/>";
//requete de remplissage de la table etape (partie AC13, donc incomplete) :
$sql = "INSERT INTO etape(`TRNNUM`, `ETPID`, `LIEUID`, `ETPHREMIN`, `ETPHREMAX`, `ETPHREFIN`, `ETPCOMMENTAIRE`) \n\t\t\t\tVALUES ({$trnNum}, {$etpid} , {$lieu} ,' {$hreMin} ',' {$hreMax} ', ' {$etpFin} ', ' {$commentaire} ');";
$result = executeSQL($sql);
//redirection vers la page de creation de tournée :
echo "<meta http-equiv='refresh' content='0;url=ac12.php?TRNNUM=" . $trnNum . "'>";
}
开发者ID:ploufppe,项目名称:ppe,代码行数:29,代码来源:formulaire.php
示例18: constant
if (isset($_POST['email'])) {
$email = $_POST['email'];
}
// Generate the query
$req_select = "SELECT user_info_id AS id, ";
$req_select .= "company AS title, ";
$req_select .= "phone_1 AS phone, ";
$req_select .= "fax AS fax, ";
$req_select .= "user_email AS email, ";
$req_select .= "IF (address_1='no_street', '', address_1) AS street, ";
$req_select .= "IF (zip='no_zip', '', zip) AS zip, ";
$req_select .= "IF (city='no_city', '', city) AS city, ";
$req_select .= "IF (country_name='no_country', '', country_name) AS country, ";
$req_select .= "'type/organisation' AS category ";
$req_select .= "FROM " . constant('_VM_TABLE_PREFIX_') . "_user_info usr ";
$req_select .= "LEFT JOIN " . constant('_VM_TABLE_PREFIX_') . "_country ctr ";
$req_select .= "ON usr.country=ctr.country_3_code ";
$req_select .= "WHERE company is not NULL and company != '' ";
if ($organisation_id != "") {
$req_select .= "AND user_info_id = '" . $organisation_id . "' ";
}
if ($title != "") {
$req_select .= "AND company = '" . $title . "' ";
}
if ($email != "") {
$req_select .= "AND email = '" . $email . "' ";
}
$req_select .= "ORDER BY user_info_id ASC";
header('Content-type: text/xml');
echo executeSQL($req_select);
mysql_close();
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:getOrganisationList.php
示例19: DB_Query
<?php
/* Ensure that all tablse use the utf8_general_cli
* character set
*/
$sql = 'SHOW TABLES';
$result = DB_Query($sql, $db);
while ($table = DB_fetch_array($result)) {
if (CharacterSet($table[0], $db) != 'utf8_general_ci') {
$response = executeSQL('ALTER TABLE ' . $table[0] . ' CONVERT TO CHARACTER SET utf8', $db);
if ($response == 0) {
OutputResult(_('The character set of') . ' ' . $table[0] . ' ' . _('has been changed to utf8_general_ci'), 'success');
} else {
OutputResult(_('The character set of') . ' ' . $table[0] . ' ' . _('could not be changed to utf8_general_ci'), 'error');
}
} else {
OutputResult(_('The character set of') . ' ' . $table[0] . ' ' . _('is already utf8_general_ci'), 'info');
}
}
UpdateDBNo(1, $db);
开发者ID:sunilburli,项目名称:webERP-Medical,代码行数:20,代码来源:1.php
示例20: die
/**
* Returns the ID of the last inserted element in a table
* We don't use this WSR because the way the ID is retrieved is not efficient
* and we manage to retrieve directly the after the insertion of the element
* @see createPerson.php
* @see createProduct.php
*/
include_once 'database.php';
include_once 'functions.php';
include_once '../includes/configure.php';
include_once '../includes/database_tables.php';
include_once '../includes/functions/database.php';
if (!postNotEmpty('type')) {
die('Type not given');
}
tep_db_connect() or die('Unable to connect to database');
$type = $_POST['type'];
$query = "";
switch ($type) {
case 'Person':
$query = 'select max(customers_id) as id from ' . TABLE_CUSTOMERS;
break;
case 'Product':
$query = 'select max(products_id) as id from ' . TABLE_PRODUCTS;
break;
default:
die('Unknown type');
}
$xml = executeSQL($query);
header('Content-type: text/xml');
echo $xml;
开发者ID:bhuvanaurora,项目名称:erp5,代码行数:31,代码来源:getLastID.php
注:本文中的executeSQL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论