本文整理汇总了PHP中db::InsertData方法的典型用法代码示例。如果您正苦于以下问题:PHP db::InsertData方法的具体用法?PHP db::InsertData怎么用?PHP db::InsertData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db
的用法示例。
在下文中一共展示了db::InsertData方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
if (isset($_POST["opt"]) and $_POST["opt"] == 1) {
if (isset($_POST["rec_id"]) and $_POST["rec_id"] != "") {
foreach ($_POST['rec_id'] as $cid) {
$recTxt .= trim($cid) . ",";
}
//$array["rec_id"] = substr( $recTxt , 0 , - (strlen( $recTxt - 1)) ) ;
$array["rec_id"] = rtrim($recTxt, ',');
}
} else {
if (isset($_POST["opt"]) and $_POST["opt"] == 0) {
$array["rec_id"] = "all";
}
}
//echo ($array["rec_id"]); exit;
if (isset($_GET['action']) && $_GET['action'] == 'add') {
$array["status"] = 1;
$objDb->InsertData("job_voucher_code", $array);
$vid = mysql_insert_id();
$msg = "&msg=add&vid=" . $vid;
}
if (isset($_GET['action']) && $_GET['action'] == 'edit') {
if (isset($_POST['code_id']) && $_POST['code_id'] != "") {
$vid = $_POST['code_id'];
$objDb->UpdateData("job_voucher_code", $array, "code_id", $vid);
$msg = "&msg=edit&vid=" . $vid;
}
}
header("location:code_add.php?action=edit" . $msg);
?>
示例2: add_language_page_name
function add_language_page_name($data)
{
$obj_Db = new db();
$lang_sql = "select * from job_language";
$lang_result = $obj_Db->ExecuteQuery($lang_sql);
$lang_numrows = mysql_num_rows($lang_result);
if ($lang_numrows > 0) {
while ($rowsobj = mysql_fetch_object($lang_result)) {
$handle = @fopen("../../langues/" . $rowsobj->language_name . "/PAGE_" . $data['name'] . "_" . $rowsobj->language_shortname . ".php", 'w+');
@fwrite($handle, "<?php \n");
fclose($handle);
}
$obj_Db = new db();
if ($obj_Db->InsertData('job_language_page', $data)) {
return TRUE;
} else {
return FALSE;
}
}
}
示例3: sprintf
$msg .= "</td>\n\t\t\t\t<td width='16%' class='table_head' ";
if ($rsInvoice->invoice_type == 1) {
$msg .= "style='display:none;'";
}
$msg .= ">Rate Per Position</td>\n\t\t\t\t<td class='table_head'>Amount</td>\n\t\t\t\t\n\t\t\t </tr> ";
$i = 1;
$td_class = 'table_row';
$msg .= "\n\t\t\t <tr>\n\t\t\t\t<td width='11%' class=" . $td_class . ">" . sprintf('%05d', $rsInvoice->invoice_id) . "</td>\n\t\t\t\t<td width='11%' class=" . $td_class . ">" . getDateValue($rsInvoice->invoice_date) . "</td>\n\t\t\t\t<td width='21%' class=" . $td_class . ">";
if ($rsInvoice->invoice_type == 1) {
$msg .= $rsInvoice->plan_name;
} else {
if ($rsInvoice->invoice_type == 2) {
$msg .= $rsInvoice->shortlisted_jobseekers;
}
}
$msg .= " </td>\n\t\t\t\t\n\t\t\t\t<td class='" . $td_class . "' ";
if ($rsInvoice->invoice_type == 1) {
$msg .= "style='display:none;'";
}
$msg .= ">" . $rsInvoice->shortlist_rate_per_position . "</td>\n\t\t\t\t<td width='12%' class='" . $td_class . "'>N\$\n\t\t\t\t\t" . number_format($rsInvoice->rate, 2) . "</td>\n\t\t\t\t\n\t\t\t </tr>\n\t\t\t</table>";
}
$msg .= "</html>";
$msg .= "<br><br>Regards, <br>NamRecruit";
$from = "NamRecruit <info@namrecruit.com>";
$headers = "From: {$from}\nContent-Type: text/html; charset=iso-8859-1";
@mail($emailto, $subject, $msg, $headers);
//end of mail
$objDb->InsertData("job_rec_payments", $arr);
if ($_GET["plan"] != "") {
header("location:subscribe_success.php?plan=" . $_GET["plan"]);
}
示例4: mail
$array["rec_status"] = 0;
$_SESSION["status"] = 0;
} else {
if ($_POST["comp_type"] == "1") {
$array["rec_status"] = 1;
$_SESSION["status"] = 1;
$email = "NamRecruit <info@namrecruit.com>";
$emailto = $array['rec_email'];
$subject = "Registration Successful with NamRecruit.";
$msg = "Dear, " . $_POST["rec_name"] . "<br><br>";
$msg .= "Thank you for registering with NamRecruit. <br><br>";
$msg .= "Use following information to login namrecruit.com.<br>";
$msg .= "Username : " . $_POST["rec_email"];
$msg .= "<br>Password : " . $_POST["rec_password"];
$msg .= "<br><br>Regards, <br>NamRecruit.";
mail($emailto, $subject, $msg, "From: {$email}\nContent-Type: text/html; charset=iso-8859-1");
}
}
$array["rec_IP"] = $_SERVER['REMOTE_ADDR'];
$objDb->InsertData("job_recruiter", $array);
$rec_id = mysql_insert_id();
$arr_update['rec_uid'] = "JR-" . ($rec_id + 1000);
$objDb->UpdateData("job_recruiter", $arr_update, "rec_id", $rec_id);
/*$_SESSION["rec_plan"] = 0;
$_SESSION["ses_rec_id"] = mysql_insert_id();
$_SESSION["rec_name"] = $array['rec_name'];
*/
header("location:rec_register_success.php?rec_id=" . $rec_id);
?>
示例5: basename
$array["telephone"] = $_POST["telephone"];
}
if (isset($_POST["street_address"])) {
$array["street_address"] = $_POST["street_address"];
}
if (isset($_POST["location"])) {
$array["location"] = $_POST["location"];
}
if (isset($_POST["desc_partnership"])) {
$array["desc_partnership"] = $_POST["desc_partnership"];
}
$target_path = "";
$target_path = "../../upload_logo/";
$base_name = "";
if ($_FILES["logo"]["name"] != "") {
$base_name = basename($_FILES["logo"]["name"]);
//$base_name_arr = explode(".",$base_name);
//$base_ext = end($base_name_arr);
// $base_name = $_POST['banner_image'] . "_" . $_POST['rec_phone'] . "." . $base_ext;
$target_path = $target_path . $base_name;
if (move_uploaded_file($_FILES["logo"]["tmp_name"], $target_path)) {
if ($_FILES["logo"]["name"] != "") {
$array["logo"] = $base_name;
}
}
}
//$array["status"] =1;
$objDb->InsertData("job_partner", $array);
header("location:partner_list.php?msg=add");
?>
示例6: header
<?php
session_start();
if (!isset($_SESSION["user_id"])) {
header("location: ../index.php");
exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
if (isset($_POST["title"])) {
$array["title"] = $_POST["title"];
}
if (isset($_POST["msg"])) {
$array["msg"] = addslashes($_POST["msg"]);
}
$objDb->InsertData("job_cover_letters", $array);
header("location:letter_list.php?msg=add");
?>
示例7: split
$exts = split("[/\\.]", $filename);
$n = count($exts) - 1;
$exts = $exts[$n];
return $exts;
}
$array["vt_status"] = 1;
$target_path = "";
$target_path = "../../tutorials/";
$base_name = "";
if ($_FILES["videotutorial"]["name"] != "") {
$base_name = basename($_FILES["videotutorial"]["name"]);
$random = rand(9999, 999999);
$base_name = $random . "-" . $base_name;
$target_path .= $base_name;
if (move_uploaded_file($_FILES["videotutorial"]["tmp_name"], $target_path)) {
define('PATH_SITE', substr(__FILE__, 0, -8));
$src = $target_path;
//echo findexts($src);$target_path6 = "../upvideo/";
$dest = str_replace(findexts($target_path), "flv", $target_path);
echo "src: {$src}\n\t\t\t\t\tdest: {$dest}\n\t\t\t\t\t";
$command = escapeshellcmd("f:/wamp/www/jobportal/ffmpeg.exe -i {$src} {$dest}");
$output = shell_exec($command);
unlink($src);
$array["vt_path"] = str_replace(findexts($base_name), "flv", $base_name);
}
}
//$array["status"] =1;
$objDb->InsertData("job_vtutorials", $array);
header("location:tutorial_list.php?msg=add");
?>
示例8: recruiter_preview
//.........这里部分代码省略.........
$array["rec_city"] = $_POST["other_rec_city"];
} else {
$array["rec_city"] = $_POST["rec_city"];
}
//$array["rec_state"] = $_POST["rec_state"];
//$array["rec_country"] = $_POST["rec_country"];
$array["business_street"] = $_POST["business_street"];
$array["business_street_num"] = $_POST["business_street_num"];
$array["business_suburb"] = $_POST["business_suburb"];
$array["business_city"] = $_POST["business_city"];
$array["business_country"] = $_POST["business_country"];
$array["postal_po_box"] = $_POST["postal_po_box"];
$array["postal_private_bag"] = $_POST["postal_private_bag"];
$array["postal_post_code"] = $_POST["postal_post_code"];
$array["postal_city"] = $_POST["postal_city"];
$array["postal_country"] = $_POST["postal_country"];
if (isset($_POST["postal_region"]) and $_POST["postal_region"] == 16) {
$array["postal_region"] = $_POST["other_region"];
} else {
if (isset($_POST["postal_region"])) {
$array["postal_region"] = $_POST["postal_region"];
} else {
$array["postal_region"] = $_POST["postal_region1"];
}
}
$array["rec_phone"] = $_POST["rec_phone"];
$array["rec_mobile"] = $_POST["rec_mobile"];
$array["rec_fax"] = $_POST["rec_fax"];
$array["rec_email"] = $_POST["rec_email"];
$array["rec_web"] = $_POST["rec_web"];
if (isset($_POST["chkLogo"])) {
$array["comp_logo"] = "";
} else {
$array["comp_logo"] = $comp_logo;
}
if (isset($_POST["rec_hidename"])) {
$array["rec_hidename"] = $_POST["rec_hidename"];
}
if (isset($_POST["rec_hideaddress"])) {
$array["rec_hideaddress"] = $_POST["rec_hideaddress"];
}
if (isset($_POST["rec_hideemail"])) {
$array["rec_hideemail"] = $_POST["rec_hideemail"];
}
if (isset($_POST["rec_hidecity"])) {
$array["rec_hidecity"] = $_POST["rec_hidecity"];
}
if (isset($_POST["rec_hidetelno"])) {
$array["rec_hidetelno"] = $_POST["rec_hidetelno"];
}
if (isset($_POST["rec_password"])) {
$array["rec_password"] = $_POST["rec_password"];
}
//Where did you hear about NamRecruit?
$heared = "";
if (isset($_POST["email"])) {
$heared .= $_POST["email"] . ",";
}
if (isset($_POST["google"])) {
$heared .= $_POST["google"] . ",";
}
if (isset($_POST["anothersearchengine"])) {
$heared .= $_POST["anothersearchengine"] . ",";
}
if (isset($_POST["friend"])) {
$heared .= $_POST["friend"] . ",";
}
if (isset($_POST["tv"])) {
$heared .= $_POST["tv"] . ",";
}
if (isset($_POST["radio"])) {
$heared .= $_POST["radio"] . ",";
}
if (isset($_POST["newspaper"])) {
$heared .= $_POST["newspaper"] . ",";
}
if (isset($_POST["magazine"])) {
$heared .= $_POST["magazine"] . ",";
}
if (isset($_POST["banner"])) {
$heared .= $_POST["banner"] . ",";
}
if (isset($_POST["other"])) {
$heared .= $_POST["other"] . ",";
}
if (strlen($heared) > 0) {
$heared = substr($heared, 0, strlen($heared) - 1);
}
$array["rec_heared"] = $heared;
if (isset($_POST["rec_terms"])) {
$array["rec_terms"] = $_POST["rec_terms"];
}
$array["rec_status"] = 1;
$array["rec_IP"] = $_SERVER['REMOTE_ADDR'];
$objDb->InsertData("job_recruiter_temp", $array);
$arr_update['rec_uid'] = "JR-" . (mysql_insert_id() + 1000);
$objDb->UpdateData("job_recruiter_temp", $arr_update, "rec_id", mysql_insert_id());
echo "<script language='javavscript' type='text/javascript'>window.open('recruiter_preview.php','RegistrationPreview','width=700,height=650,menubar=no,status=yes,location=yes,toolbar=no,scrollbars=yes');</script>";
}
}
示例9: header
<?php
session_start();
if (!isset($_SESSION["user_id"])) {
header("location: ../index.php");
exit;
}
require_once "../../classes/db_class.php";
$objDb = new db();
$array = array();
if (isset($_POST["title"])) {
$array["title"] = $_POST["title"];
}
if (isset($_POST["url"])) {
$array["url"] = $_POST["url"];
}
if (isset($_POST["desc1"])) {
$array["desc1"] = $_POST["desc1"];
}
$array["status"] = 1;
$objDb->InsertData("job_top_sites", $array);
header("location:advert_list.php?msg=add");
?>
示例10:
$resultPlan = $objDb->ExecuteQuery($sqlPlan);
$rsPlan = mysql_fetch_object($resultPlan);
$sql_vat = "select * from job_vat where vat_status=1";
$result_vat = $objDb->ExecuteQuery($sql_vat);
if ($rs_vat = mysql_fetch_object($result_vat)) {
$vat = $rs_vat->vat;
} else {
$vat = 0;
}
$arr['plan_name'] = $rsPlan->plan_name;
$arr['unlimited_job_ads'] = $rsPlan->unlimited_job_ads;
$arr['system_shortlisting'] = $rsPlan->system_shortlisting;
$arr['regret_function'] = $rsPlan->regret_function;
$arr['client_talent'] = $rsPlan->client_talent;
$arr['full_access_jobseekers'] = $rsPlan->full_access_jobseekers;
$arr['client_logo'] = $rsPlan->client_logo;
$arr['intercompany_ad'] = $rsPlan->intercompany_ad;
$arr['rate'] = $rsPlan->rate + $_POST[$dd] * $rsPlan->rate_per_job + ($rsPlan->rate + $_POST[$dd] * $rsPlan->rate_per_job) * ($vat / 100);
$arr['positions'] = $rsPlan->positions + $_POST[$dd];
$arr['additional_rate'] = $_POST[$dd] * $rsPlan->rate_per_position;
$arr['additional_position'] = $_POST[$dd];
$arr['vat'] = ($rsPlan->rate + $_POST[$dd] * $rsPlan->rate_per_job) * ($vat / 100);
$arr['rate_per_position'] = $rsPlan->rate_per_position;
$arr['number_job'] = $rsPlan->number_job;
$arr['additional_job_rate'] = $_POST[$dd] * $rsPlan->rate_per_job;
$arr['additional_job'] = $_POST[$dd];
$arr['rate_per_job'] = $rsPlan->rate_per_job;
$arr['rate_per_position'] = $rsPlan->rate_per_position;
//print_r($arr);exit;
$objDb->InsertData("job_rec_invoices", $arr);
header("location:plan_invoice.php?invoice_id=" . mysql_insert_id() . "&plan=" . $_GET['plan']);
示例11:
if (isset($_POST["full_access_jobseekers"])) {
$array["full_access_jobseekers"] = $_POST["full_access_jobseekers"];
}
if (isset($_POST["client_logo"])) {
$array["client_logo"] = $_POST["client_logo"];
}
if (isset($_POST["intercompany_ad"])) {
$array["intercompany_ad"] = $_POST["intercompany_ad"];
}
if (isset($_POST["subscription"])) {
if ($_POST["subscription"] == "paid") {
if (isset($_POST["rate"])) {
$array["rate"] = $_POST["rate"];
}
if (isset($_POST["positions"])) {
$array["positions"] = $_POST["positions"];
}
} else {
$array["positions"] = 0;
$array["rate"] = 0;
}
}
if (isset($_POST["rate_per_position"])) {
$array["rate_per_job"] = $_POST["rate_per_position"];
}
$array["plan_status"] = 1;
$array["type"] = "emp";
$objDb->InsertData("job_rec_payment_plans", $array);
header("location:plan_list.php?msg=add");
?>
示例12: header
} else {
if (isset($_GET["oid"]) && $_GET["oid"] != "") {
header("location:option_add.php?msg=fail&action=" . $_GET["action"] . "&cid=" . $_POST["category_id"] . "&option=" . $_POST["option_name"] . "&oid=" . $_GET["oid"]);
} else {
header("location:option_add.php?msg=fail&action=" . $_GET["action"] . "&cid=" . $_POST["category_id"] . "&option=" . $_POST["option_name"]);
}
}
} else {
if (isset($_GET["action"]) && $_GET["action"] == "add") {
if (isset($_POST["category_id"])) {
$array["category_id"] = $_POST["category_id"];
}
if (isset($_POST["option_name"])) {
$array["option_name"] = $_POST["option_name"];
}
$objDb->InsertData("job_options", $array);
GenerateXML();
if (isset($_GET["cat_id"]) && $_GET["cat_id"] != "") {
header("location:option_add.php?cat_id=" . $_GET["cat_id"] . "&msg=add&action=" . $_GET["action"]);
} else {
header("location:option_add.php?msg=add&action=" . $_GET["action"]);
}
} else {
if (isset($_GET["action"]) && $_GET["action"] == "edit") {
if (isset($_POST["category_id"])) {
$array["category_id"] = $_POST["category_id"];
}
if (isset($_POST["option_name"])) {
$array["option_name"] = $_POST["option_name"];
}
$objDb->UpdateData("job_options", $array, "option_id", $_GET["oid"]);
示例13: header
$array1["field_row"] = (int) $_GET["rows"] + 1;
//print_r($array);exit;
$objDb->InsertData("job_grade_level", $array);
for ($i = 1; $i <= $_GET['columns']; $i++) {
$array1["field_column"] = $i;
$objDb->InsertData("job_grade_level", $array1);
}
header("location:gradelevel_add.php?addact=row");
exit;
}
if (isset($_GET['add']) and $_GET['add'] == "col") {
$objDb = new db();
$array = array();
$array1 = array();
$array["field_value"] = "new grade";
$array["field_row"] = 0;
$array["field_column"] = (int) $_GET['columns'] + 1;
$array1["field_value"] = "null";
//$array1["field_row"] = (int)$_GET["rows"];
$array1["field_column"] = (int) $_GET['columns'] + 1;
$objDb->InsertData("job_grade_level", $array);
for ($i = 1; $i <= $_GET['rows']; $i++) {
$array1["field_row"] = $i;
$objDb->InsertData("job_grade_level", $array1);
}
header("location:gradelevel_add.php?addact=col");
exit;
}
header("location:gradelevel_add.php");
?>
示例14: basename
$base_name = basename($_FILES["banner_image"]["name"]);
//$base_name_arr = explode(".",$base_name);
//$base_ext = end($base_name_arr);
// $base_name = $_POST['banner_image'] . "_" . $_POST['rec_phone'] . "." . $base_ext;
$target_path = $target_path . $base_name;
if (move_uploaded_file($_FILES["banner_image"]["tmp_name"], $target_path)) {
$imgInfo = getimagesize($target_path);
//print_r($imgInfo);exit;
if ($imgInfo[0] > 520 || $imgInfo[1] > 80) {
//echo $imgInfo[0]." ".$imgInfo[1];exit;
$title = $_POST['title'];
$url = $_POST['url'];
echo '<body onload="document.frm1.submit()">
<form name="frm1" action="banner_add.php?msg=err" method="post">
<input type="hidden" name="banner_title" value="' . $title . '" >
<input type="hidden" name="banner_url" value="' . $url . '" >
</form>
</body>';
exit;
}
// $imgInfo = getimagesize($target_path);
if ($_FILES["banner_image"]["name"] != "") {
$array["banner_image"] = $base_name;
}
}
}
$array["banner_status"] = 1;
$objDb->InsertData("job_banner", $array);
header("location:banner_list.php?msg=add");
?>