本文整理汇总了PHP中returnstate函数的典型用法代码示例。如果您正苦于以下问题:PHP returnstate函数的具体用法?PHP returnstate怎么用?PHP returnstate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了returnstate函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_query
mysql_query("ROLLBACK", $dbh);
return 0;
}
$State = 2;
$sql = "SELECT\n\t\t\t\t\tCONCAT('" . $InvoiceNumberType . "-', '" . $Date . "', RIGHT(CONCAT('000', COUNT(1) + 1), 3)) AS InvoiceNumber\n\t\t\t\tFROM \n\t\t\t\t\ttransaction_invoicenumber\n\t\t\t\tWHERE\n\t\t\t\t\tInvoiceDate = '" . $SelectedDate . "'\n\t\t\t\t\tAND InvoiceNumberType = '" . $InvoiceNumberType . "'";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($InvoiceNumber, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
$row = mysql_fetch_array($result);
$InvoiceNumber = $row['InvoiceNumber'];
$State = 3;
$sql = "INSERT INTO transaction_invoicenumber\n\t\t\t\t(\n\t\t\t\t\tInvoiceNumberType,\n\t\t\t\t\tInvoiceDate,\n\t\t\t\t\tInvoiceNumber,\n\t\t\t\t\tDeleteFlag,\n\t\t\t\t\tCreatedDate,\n\t\t\t\t\tCreatedBy\n\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t'BO',\n\t\t\t\t\t'" . $SelectedDate . "',\n\t\t\t\t\t'" . $InvoiceNumber . "',\n\t\t\t\t\t0,\n\t\t\t\t\tNOW(),\n\t\t\t\t\t'" . $_SESSION['UserLogin'] . "'\n\t\t\t\t)";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($InvoiceNumber, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
echo returnstate($InvoiceNumber, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
function returnstate($InvoiceNumber, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("InvoiceNumber" => $InvoiceNumber, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例2: basename
$file = basename($RequestPath);
$RequestPath = str_replace($file, "", $RequestPath);
//include "../../GetPermission.php";
include "../../DBConfig.php";
$BookingID = mysql_real_escape_string($_POST['ID']);
mysql_query("START TRANSACTION", $dbh);
mysql_query("SET autocommit=0", $dbh);
$DetailsID = "";
$Message = "Pembatalan Berhasil!";
$MessageDetail = "";
$FailedFlag = 0;
//echo $DetailID;
$State = 2;
$sql = "UPDATE transaction_booking\n\t\t\t\tSET\n\t\t\t\t\tIsCancelled = 1,\n\t\t\t\t\tModifiedBy = '" . $_SESSION['UserLogin'] . "'\n\t\t\t\tWHERE\n\t\t\t\t\tBookingID = {$BookingID}";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($BookingID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
echo returnstate($BookingID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("COMMIT", $dbh);
return 0;
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("ID" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例3: returnstate
echo returnstate($Id, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
for ($j = 1; $j <= $RecordNew; $j++) {
if ($_POST['hdnDetailID' . $j] == "0") {
$State = 4;
$sql = "INSERT INTO transaksi_rinciasisten\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tDetailID,\n\t\t\t\t\t\t\tTransaksiID,\n\t\t\t\t\t\t\tJobdeskID,\n\t\t\t\t\t\t\tJumlah,\n\t\t\t\t\t\t\tHarga,\n\t\t\t\t\t\t\tCreatedDate,\n\t\t\t\t\t\t\tCreatedBy\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t" . $Id . ",\n\t\t\t\t\t\t\t" . $_POST['ddlJobdesk' . $j] . ",\n\t\t\t\t\t\t\t" . $_POST['txtJumlah' . $j] . ",\n\t\t\t\t\t\t\t" . str_replace(",", "", $_POST['txtHarga' . $j]) . ",\n\t\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t\t'" . $_SESSION['Username'] . "'\n\t\t\t\t\t\t)";
} else {
$State = 5;
$sql = "UPDATE \n\t\t\t\t\t\t\ttransaksi_rinciasisten\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tJobdeskID = '" . $_POST['ddlJobdesk' . $j] . "',\n\t\t\t\t\t\t\tJumlah = " . $_POST['txtJumlah' . $j] . ",\n\t\t\t\t\t\t\tHarga = " . str_replace(",", "", $_POST['txtHarga' . $j]) . ",\n\t\t\t\t\t\t\tModifiedBy = '" . $_SESSION['Username'] . "'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tDetailID = " . $_POST['hdnDetailID' . $j];
}
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($Id, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
}
echo returnstate($Id, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("COMMIT", $dbh);
return 0;
}
}
function returnstate($Id, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("Id" => $Id, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例4: basename
if (isset($_POST['hdnSupplierID'])) {
$RequestPath = "{$_SERVER['REQUEST_URI']}";
$file = basename($RequestPath);
$RequestPath = str_replace($file, "", $RequestPath);
include "../../GetPermission.php";
$SupplierID = mysql_real_escape_string($_POST['hdnSupplierID']);
$Telephone = mysql_real_escape_string($_POST['txtTelephone']);
$SupplierName = mysql_real_escape_string($_POST['txtSupplierName']);
$Address = mysql_real_escape_string($_POST['txtAddress']);
$City = mysql_real_escape_string($_POST['txtCity']);
$hdnIsEdit = mysql_real_escape_string($_POST['hdnIsEdit']);
$Message = "Data gagal dimasukkan, cek koneksi internet dan coba lagi!";
$MessageDetail = "";
$FailedFlag = 0;
$State = 1;
$sql = "CALL spInsSupplier(" . $SupplierID . ", '" . $SupplierName . "', '" . $Address . "', '" . $City . "', '" . $Telephone . "', " . $hdnIsEdit . ", '" . $_SESSION['UserLogin'] . "')";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
$row = mysql_fetch_array($result);
echo returnstate($row['ID'], $row['Message'], $row['MessageDetail'], $row['FailedFlag'], $row['State']);
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("Id" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例5: basename
<?php
if (isset($_POST['hdnLicenseExtensionID'])) {
$RequestPath = "{$_SERVER['REQUEST_URI']}";
$file = basename($RequestPath);
$RequestPath = str_replace($file, "", $RequestPath);
include "../../GetPermission.php";
$LicenseExtensionID = mysql_real_escape_string($_POST['hdnLicenseExtensionID']);
$ExtensionDate = explode('-', mysql_real_escape_string($_POST['txtExtensionDate']));
$ExtensionDate = "{$ExtensionDate['2']}-{$ExtensionDate['1']}-{$ExtensionDate['0']}";
$ExtensionCost = str_replace(",", "", $_POST['txtExtensionCost']);
$Message = "Data berhasil disimpan";
$MessageDetail = "";
$FailedFlag = 0;
$State = 1;
$sql = "UPDATE transaction_licenseextension\n\t\t\t\tSET\n\t\t\t\t\tExtensionDate = '" . $ExtensionDate . "',\n\t\t\t\t\tExtensionCost = " . $ExtensionCost . ",\n\t\t\t\t\tIsExtended = 1,\n\t\t\t\t\tModifiedBy = '" . $_SESSION['UserLogin'] . "'\n\t\t\t\tWHERE\n\t\t\t\t\tLicenseExtensionID = {$LicenseExtensionID}";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($LicenseExtensionID, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
echo returnstate($LicenseExtensionID, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("Id" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例6: basename
if (isset($_POST['hdnId'])) {
$RequestPath = "{$_SERVER['REQUEST_URI']}";
$file = basename($RequestPath);
$RequestPath = str_replace($file, "", $RequestPath);
include "../../GetPermission.php";
$Id = $_POST['hdnId'];
$Nama = $_POST['txtNama'];
$Alamat = $_POST['txtAlamat'];
$Telepon = $_POST['txtTelepon'];
$hdnIsEdit = $_POST['hdnIsEdit'];
$Message = "Data gagal dimasukkan, cek koneksi internet dan coba lagi!";
$MessageDetail = "";
$FailedFlag = 0;
$State = 1;
if ($cek == 0) {
$Content = "Anda Tidak Memiliki Akses Untuk Menu Ini!";
} else {
$sql = "CALL spInsSupervisor(" . $Id . ", '" . $Nama . "', '" . $Alamat . "','" . $Telepon . "', " . $hdnIsEdit . ", '" . $_SESSION['Username'] . "')";
if (!($result = mysql_query($sql, $dbh))) {
echo mysql_error();
return 0;
}
$row = mysql_fetch_row($result);
echo returnstate($row[0], $row[1], $row[2], $row[3], $row[4]);
}
}
function returnstate($Id, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("Id" => $Id, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例7: mysql_error
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($MedicationID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
$RowNumber = 1;
while ($row = mysql_fetch_array($result)) {
$MedicationDetails .= "<tr>";
$MedicationDetails .= "<td align='center' style='width: 36px;' >{$RowNumber}</td>";
$MedicationDetails .= "<td align='left' style='width: 200px;' >" . $row['ExaminationName'] . "</td>";
$MedicationDetails .= "<td align='right' style='width: 80px;' >" . $row['Quantity'] . "</td>";
$MedicationDetails .= "<td align='right' style='width: 100px;' >" . number_format($row['Price'], 2, ".", ",") . "</td>";
$MedicationDetails .= "<td align='right' style='width: 125px;' >" . number_format($row['Total'], 2, ".", ",") . "</td>";
$MedicationDetails .= "<td align='left' style='width: 210px;' >" . $row['Remarks'] . "</td>";
$MedicationDetails .= '<td align="center" style="vertical-align:middle;width: 60px;">
<i style="cursor:pointer;" class="fa fa-edit" onclick="EditData(' . $MedicationID . ', ' . $row['MedicationDetailsID'] . ', ' . $row['Quantity'] . ', \'' . number_format($row['Price'], 2, ".", ",") . '\', \'' . $row['Remarks'] . '\', \'' . $row['ExaminationName'] . '\');" acronym title="Ubah Data"></i>
<i class="fa fa-close btnDelete" onclick="DeleteExamination(' . $MedicationID . ', ' . $row['MedicationDetailsID'] . ', \'' . $row['ExaminationName'] . '\');" style="cursor:pointer;" acronym title="Hapus Data" onclick="DeleteRow(this.getAttribute(\'row\'))"></i>
</td>';
$MedicationDetails .= "</tr>";
$RowNumber++;
}
echo returnstate($MedicationID, $Message, $MessageDetail, $MedicationDetails, $FailedFlag, $State);
return 0;
}
function returnstate($ID, $Message, $MessageDetail, $MedicationDetails, $FailedFlag, $State)
{
$data = array("ID" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "MedicationDetails" => $MedicationDetails, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例8: mysql_real_escape_string
$PatientNumber = mysql_real_escape_string($_POST['PatientNumber']);
$State = 1;
$Message = "ID pasien belum terdaftar, silahkan lengkapi form!";
$MessageDetail = "";
$FailedFlag = 0;
$State = 1;
$PatientName = "";
$IsExists = 0;
$sql = "SELECT\n\t\t\t\t\tPatientName,\n\t\t\t\t\tPatientID\n\t\t\t\tFROM\n\t\t\t\t\tmaster_patient\n\t\t\t\tWHERE\n\t\t\t\t\tTRIM(PatientNumber) = TRIM('" . $PatientNumber . "')";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State, $IsExists, $PatientName);
return 0;
}
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$PatientName = $row['PatientName'];
$ID = $row['PatientID'];
$Message = "Pasien sudah terdaftar.";
$IsExists = 1;
}
echo returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State, $IsExists, $PatientName);
return 0;
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State, $IsExists, $PatientName)
{
$data = array("ID" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State, "IsExists" => $IsExists, "PatientName" => $PatientName);
return json_encode($data);
}
示例9: mysql_error
} else {
$State = 3;
$sql = "INSERT INTO transaction_medication\n\t\t\t\t\t(\n\t\t\t\t\t\tPatientID,\n\t\t\t\t\t\tOrderNumber,\n\t\t\t\t\t\tTransactionDate,\n\t\t\t\t\t\tIsDone,\n\t\t\t\t\t\tIsCancelled,\n\t\t\t\t\t\tCreatedDate,\n\t\t\t\t\t\tCreatedBy\n\t\t\t\t\t)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\t" . $PatientID . ",\n\t\t\t\t\t\t'" . $OrderNumber . "',\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t'" . $_SESSION['UserLogin'] . "'\n\t\t\t\t\t)";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State, $OrderNumber);
mysql_query("ROLLBACK", $dbh);
return 0;
}
$State = 4;
$sql = "INSERT INTO transaction_invoicenumber\n\t\t\t\t\t(\n\t\t\t\t\t\tTransactionDate,\n\t\t\t\t\t\tOrderNumber,\n\t\t\t\t\t\tCreatedDate,\n\t\t\t\t\t\tCreatedBy\n\t\t\t\t\t)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t'" . $OrderNumber . "',\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t'" . $_SESSION['UserLogin'] . "'\n\t\t\t\t\t)";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State, $OrderNumber);
mysql_query("ROLLBACK", $dbh);
return 0;
}
}
echo returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State, $OrderNumber);
mysql_query("COMMIT", $dbh);
return 0;
}
function returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State, $OrderNumber)
{
$data = array("ID" => $PatientID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State, "OrderNumber" => $OrderNumber);
return json_encode($data);
}
示例10: mysql_error
return 0;
}
$State = 2;
$sql = "INSERT INTO transaction_checkout\r\n\t\t\t\t(\r\n\t\t\t\t\tTransactionDate,\r\n\t\t\t\t\tCheckInID,\r\n\t\t\t\t\tCreatedDate,\r\n\t\t\t\t\tCreatedBy\r\n\t\t\t\t)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(\r\n\t\t\t\t\tNOW(),\r\n\t\t\t\t\t" . $CheckInID . ",\r\n\t\t\t\t\tNOW(),\r\n\t\t\t\t\t'" . $_SESSION['UserLogin'] . "'\r\n\t\t\t\t)";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($CheckInID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
$State = 3;
$sql = "UPDATE\r\n\t\t\t\t\tmaster_room\r\n\t\t\t\tSET\r\n\t\t\t\t\tStatusID = 1\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tRoomID = {$RoomID}";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($CheckInID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("ROLLBACK", $dbh);
return 0;
}
echo returnstate($CheckInID, $Message, $MessageDetail, $FailedFlag, $State);
mysql_query("COMMIT", $dbh);
return 0;
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("ID" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}
示例11: basename
<?php
if (isset($_POST['ddlPatient'])) {
$RequestPath = "{$_SERVER['REQUEST_URI']}";
$file = basename($RequestPath);
$RequestPath = str_replace($file, "", $RequestPath);
include "../../GetPermission.php";
$PatientID = mysql_real_escape_string($_POST['ddlPatient']);
$Message = "Data Berhasil Disimpan";
$MessageDetail = "";
$FailedFlag = 0;
$State = 1;
$Date = explode(', ', mysql_real_escape_string($_POST['txtNextSchedule']));
$ScheduledDate = explode('-', $Date[1]);
$ScheduledDate = "{$ScheduledDate['2']}-{$ScheduledDate['1']}-{$ScheduledDate['0']}";
$sql = "INSERT INTO transaction_checkschedule\n\t\t\t\t(\n\t\t\t\t\tPatientID,\n\t\t\t\t\tScheduledDate,\n\t\t\t\t\tCreatedDate,\n\t\t\t\t\tCreatedBy\n\t\t\t\t)\n\t\t\t\tSELECT\n\t\t\t\t\t" . $PatientID . ",\n\t\t\t\t\t'" . $ScheduledDate . "',\n\t\t\t\t\tNOW(),\n\t\t\t\t\t'" . $_SESSION['UserLogin'] . "'\n\t\t\t\tFROM\n\t\t\t\t\ttbl_temp\n\t\t\t\tWHERE\n\t\t\t\t\tNOT EXISTS\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\ttransaction_checkschedule CS\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tCS.PatientID = " . $PatientID . "\n\t\t\t\t\t\t\tAND CS.ScheduledDate = '" . $ScheduledDate . "'\n\t\t\t\t\t)";
if (!($result = mysql_query($sql, $dbh))) {
$Message = "Terjadi Kesalahan Sistem";
$MessageDetail = mysql_error();
$FailedFlag = 1;
echo returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State);
return 0;
}
echo returnstate($PatientID, $Message, $MessageDetail, $FailedFlag, $State);
}
function returnstate($ID, $Message, $MessageDetail, $FailedFlag, $State)
{
$data = array("ID" => $ID, "Message" => $Message, "MessageDetail" => $MessageDetail, "FailedFlag" => $FailedFlag, "State" => $State);
return json_encode($data);
}