本文整理汇总了PHP中addDataIntoTable函数的典型用法代码示例。如果您正苦于以下问题:PHP addDataIntoTable函数的具体用法?PHP addDataIntoTable怎么用?PHP addDataIntoTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addDataIntoTable函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
if ($_POST['machine_maint_date'] == "") {
$machine_maint_date = date("Y-m-d");
} else {
$machine_maint_date = getDateFormate($_POST['machine_maint_date']);
}
$department_id = $_POST['department_id'];
$machine_id = $_POST['machine_id'];
$details = addslashes($_POST['details']);
if ($department_id == '0' || $machine_id == '0') {
$Message = "Error While Adding Or Updating.";
echo "<script>alert('Department or Machine or Machine Not Selected.Please Select It!!!');location.href='elec_add_machine_maint.php?Message={$Message}';</script>";
} else {
if ($PageKeyValue == "") {
$tableName = "elec_machine_maint";
$tableData = array("''", "'{$machine_maint_date}'", "'{$department_id}'", "'{$machine_id}'", "'{$details}'", "now()");
addDataIntoTable($tableName, $tableData);
//print_r($tableData);
$Message = "{$PageFor} Inserted";
redirect("{$Page}?Message={$Message}");
} else {
if ($mode == "edit") {
$tableName = "elec_machine_maint";
$tableColumns = array("machine_maint_id", "machine_maint_date", "department_id", "machine_id", "details");
$tableData = array("'{$PageKeyValue}'", "'{$machine_maint_date}'", "'{$department_id}'", "'{$machine_id}'", "'{$details}'");
updateDataIntoTable($tableName, $tableColumns, $tableData);
$Message = "{$PageFor} Updated";
redirect("elec_list_machine_maint.php?Message={$Message}");
}
}
}
}
示例2: max
$department_id=$_POST['department_id'][$i];
$uom_id=$_POST['uom_id'][$i];
$remarks=$_POST['remarks'][$i];
$quantity=$_POST['quantity'][$i];
$pend_qty=$_POST['quantity'][$i];
$rate=$_POST['rate'][$i];
if($RGP_trans_id!="")
{
$tableData=array("'$RGP_trans_id'","'$PageKeyValue'","'$department_id'","'$item_name'","'$uom_id'","'$remarks'","'$quantity'","'$pend_qty'","'$rate'");
//print_r($tableData);echo "<br />";
updateDataIntoTable("ms_RGP_transaction",$tableColumns,$tableData);
}
else
{
$tableData=array("''","'$PageKeyValue'","'$department_id'","'$item_name'","'$uom_id'","'$remarks'","'$quantity'","'$pend_qty'","'$rate'","now()");
addDataIntoTable("ms_RGP_transaction",$tableData);
}
}
}
$Message = "$PageFor Updated";
redirect("store_list_RGP.php?Message=$Message");
}
}
}
}
if(isset($_GET["RGP_id"])){
$RGP_id = $_GET["RGP_id"];
}else{
$sql="select max(RGP_id) as RGP_id from ms_RGP_master";
$res=mysql_query($sql);
示例3:
$NRGP_qty=$_POST['NRGP_qty'][$i];
$remain_qty=$_POST['remain_qty'][$i];
$rate=$_POST['rate'][$i];
////////////////Item Update ////////////
$res_S=mysql_query("select * from ms_item_master where item_id='".$item_id."'");
$row_S=mysql_fetch_array($res_S);
$total=0;
$total=(float)$row_S['closing_stock']-(float)$NRGP_qty;
$sql_U="update ms_item_master set closing_stock='".$total."' where item_id='".$item_id."'";
mysql_query($sql_U);
/////////GRN Update //////
$sql_U="update ms_GRN_transaction set NRGP_qty='".$remain_qty."' where GRN_transaction_id='".$GRN_trans_id."'";
mysql_query($sql_U);
/////////////////////End Updates //////////
$tableData=array("''","'$insert_id'","'$GRN_trans_id'","'$item_id'","'$remarks'","'$NRGP_qty'","'$rate'","now()");
addDataIntoTable("ms_NRGP_GRN_transaction",$tableData);
}
}
$Message = "$PageFor Inserted";
redirect("$Page?Message=$Message");
}
}
else
{
if($mode == "edit")
{
$tableName="ms_NRGP_master";
$tableColumns=array("$PageKey","NRGP_date","supplier_id","ref_quot_no","ref_quot_date","despatch_through","special_instr");
$tableData=array("'$PageKeyValue'","'$NRGP_date'","'$supplier_id'","'$ref_quot_no'","'$ref_quot_date'","'$despatch_through'","'$special_instr'");
if(updateDataIntoTable($tableName,$tableColumns,$tableData))
{
示例4:
$indent_trans_id=$_POST['indent_trans_id'][$i];
$item_id=$_POST['item_id'][$i];
$po_qty=$_POST['po_qty'][$i];
$pend_qty=$_POST['pend_qty'][$i];
$rate=$_POST['rate'][$i];
$disc_perc=$_POST['disc_perc'][$i];
$duty_perc=$_POST['duty_perc'][$i];
$ecess_perc=$_POST['ecess_perc'][$i];
$vat_perc=$_POST['vat_perc'][$i];
$net_rate=$_POST['net_rate'][$i];
//////////////Update Quantity ///////////////
$sql_upd="update ms_indent_transaction set pend_qty=$pend_qty where indent_transaction_id=$indent_trans_id";
mysql_query($sql_upd);
////////////////////////////////////////////
$tableData=array("''","'$order_id'","'$indent_trans_id'","'$item_id'","'$po_qty'","'$po_qty'","'$rate'","'$disc_perc'","'$duty_perc'","'$ecess_perc'","'$vat_perc'","'$net_rate'","now()");
if(addDataIntoTable("ms_order_transaction",$tableData))
$Message = "$PageFor Inserted";
}
redirect("$Page?Message=$Message");
}
}
else
{
if($mode == "edit")
{
$tableName="ms_order_master";
$tableColumns=array("order_id","order_date","po_type_id","supplier_id","indent_id","tc_billing_address","tc_delivery_address","tc_payment_terms","tc_delivery","tc_delivery_date","tc_errection","tc_freight","tc_excise_and_taxes","tc_p_and_f","tc_remarks","gross_amt_total","disc_amt_total","duty_amt_total","vat_amt_total","ecess_amt_total","pf_after_before_amount","round_off_amount","total_amount","net_amount ");
$tableData=array("'$PageKeyValue'","'$order_date'","'$po_type_select'","'$supplier_id'","'$indent_id'","'$tc_billing_address'","'$tc_delivery_address'","'$tc_payment_terms'","'$tc_delivery'","'$tc_delivery_date'","'$tc_errection'","'$tc_freight'","'$tc_excise_and_taxes'","'$tc_p_and_f'","'$tc_remarks'","'$cal_gross_amt'","'$cal_disc_amt'","'$cal_duty_amount'","'$cal_vat_amt'","'$cal_ecess_amt'","'$cal_pack_fowd_amt'","'$cal_round_off'","'$cal_total_amt'","'$cal_net_amt'");
//print_r($tableData);echo "<br />";
if(updateDataIntoTable($tableName,$tableColumns,$tableData))
示例5: date
$sch_date= date("Y-m-d", mktime(0, 0, 0,$da[1] ,$da[2]+$duration , $da[0]));
$tableName="maint_machine_transaction";
if($machine_transaction_id=="")
{
$tableData=array("''","'$PageKeyValue'","'$service_id'","'$maint_date'","'$sch_date'","now()");
//print_r($tableData);
addDataIntoTable($tableName,$tableData);
$machine_tr_id=mysql_insert_id();
$res_j=mysql_query("select max(job_code) as job_code from maint_job");
$row_j=mysql_fetch_array($res_j);
$jc=$row_j['job_code']+1;
//echo $jc." : ".$service_id." : ".$PageKeyValue." : ".$sch_date." : ".$maint_date."<br>";;
$tableDataJob=array("''","'$jc'","'$service_id'","'$PageKeyValue'","'P'","'$sch_date'","'$maint_date'","''","''","now()");
addDataIntoTable("maint_job",$tableDataJob);
}
else
{
//$machine_transaction_id.'<br />';
$tableData=array("''","'$PageKeyValue'","'$service_id'","'$maint_date'","'$sch_date'","now()");
//print_r($tableData);
$tableColumns=array("machine_transaction_id","machine_id","service_id","maint_date","schedule_date");
$tableData=array("'$machine_transaction_id'","'$machine_code'","'$service_id'","'$maint_date'","'$sch_date'");
updateDataIntoTable($tableName,$tableColumns,$tableData);
$job_id=$_POST['job_id'][$i];
$tableColumns=array("job_id","service_id","machine_id","schedule_date","maint_date");
//echo $jc." : ".$service_id." : ".$PageKeyValue." : ".$sch_date." : ".$maint_date."<br>";;
$tableDataJob=array("'$job_id'","'$service_id'","'$machine_code'","'$sch_date'","'$maint_date'");