Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #3K
~6K People Reached
About Me

Humble and focused

Favorite Tags
Member Avatar for mogaka

## Stored Procedure ## -- Procedure name: billing_to_invoice_update BEGIN UPDATE accounts.0_debtor_trans SET ov_amount=ov_amount+fee-oldfee WHERE trans_no=encounter AND branch_code=pid; UPDATE accounts.0_debtor_trans_details SET unit_price=fee/units,quantity=units,qty_done=units WHERE debtor_trans_no=encounter AND stock_id=CONCAT(code_type,'/',code); -- gl updates UPDATE accounts.0_gl_trans SET amount=ROUND((-1)*fee) WHERE account=code_type AND memo_=CONCAT(code_type,'/',code) AND last_service_encounter=encounter; UPDATE accounts.0_gl_trans SET amount=ROUND(fee) WHERE account=1100 AND memo_=CONCAT(code_type,'/',code) AND last_service_encounter=encounter; END BEGIN …

Member Avatar for SQLpower
0
129
Member Avatar for mogaka

CASE WHEN ((SELECT COUNT(id) FROM users) > 0) THEN BEGIN INSERT INTO users(username,password) VALUES('Moshe','Ahuva'); END ELSE BEGIN INSERT INTO users(username,password) VALUES('Zvi','Idan'); END END My aim is to save with a condition. but it fails and says: "Check the manual that correponds to the right syntax near ELSE BEGIN ....". please …

Member Avatar for pritaeas
0
86
Member Avatar for mogaka

SELECT code_type,code,encounter,pid,provider_id,date,CONCAT('code_tye',':','code') INTO @code_type,@code,@encounter,@pid,@povider_id,@date,@standard_code FROM billing FOR EACH ROW BEGIN SELECT procedure_type_id INTO @type_id FROM procedure_type WHERE standard_code='@standard_code' FOR EACH ROW BEGIN INSERT INTO procedure_order(procedure_type_id,date_ordered,provider_id,date_collected,order_priority,order_status ,patient_instructions,patient_id,encounter_id) VALUES('@type_id','@date','@provider_id','@date','high','pending','complaints','@pid','@encounter') END END #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for …

Member Avatar for pritaeas
0
211
Member Avatar for mogaka

$res=mysql_query("SELECT code_type,code,date,provider_id FROM billing WHERE encounter='$encounter' AND pid='$pid'"); while($row=mysql_fetch_array($res)){ $code_type=$row['code_type']; $code=$row['code']; $date=$row['date']; $provider=$row['provider_id']; $standard_code=$code_type.":".$code; $res1=mysql_query("SELECT procedure_type_id FROM procedure_type WHERE standard_code='$standard_code'"); while($row1=mysql_fetch_array($res1)){ $procedure_type_id=$row1['procedure_type_id']; mysql_query("INSERT INTO procedure_order(procedure_type_id,date_ordered,provider_id,date_collected,order_priority,order_status ,patient_instructions,patient_id,encounter_id) VALUES('$procedure_type_id','$date','$provider','$date','high','pending','$complaints','$pid','$encounter_id')") or die(mysql_error()); } } The above query saves(inserts) more than once in the database. what can be the cause especially in the while …

Member Avatar for Webville312
0
109
Member Avatar for mogaka

function addUsers($params) { $fnameval = $params->getParam(0); $fname = $fnameval->scalarval(); $mnameval = $params->getParam(1); $mname = $mnameval->scalarval(); $lnameval = $params->getParam(2); $lname = $lnameval->scalarval(); if(mysql_query("INSERT INTO users(fname,mname,lname) VALUES('$fname','$mname','$lname')")){ $mess="data and synced successfully";} else{ $mess="data saved but not synced as required";} $response = array('response' => new xmlrpcval($mess, 'string')); return new xmlrpcresp(new xmlrpcval($response, 'struct')); } …

Member Avatar for mogaka
0
482
Member Avatar for mogaka

I have data that is inserted into a table A. I want that before 'insert' to table A, I should capture Specific data from the array and insert it into table B. Can somebody show me how to do that ?

Member Avatar for cereal
0
91
Member Avatar for mogaka

update drugs,drug_sales SET drugs.b_price=(SUM(drug_sales.fee)/SUM(drug_sales.quantity)) WHERE drugs.drug_id=drug_sales.drug_id AND drug_sales.pid=0 update drugs,drug_sales SET drugs.b_price=SUM(drug_sales.fee)/SUM(drug_sales.quantity) in drugs.drug_id=drug_sales.drug_id AND drug_sales.pid=0 The intention of the above 2 queries is to update a table called drugs based on computational results of table called drug_sales. The two queries fails and the error is: "#1111 - Invalid use …

Member Avatar for pritaeas
0
354
Member Avatar for mogaka

I have a list of columns of table that holds boolean values. consider a,b,c,d,e,f,g,h as column names with **YES** or **NO** values. I want to query and list column names whose value is YES. can some write a mysql query that can list the columns. if a column has an …

Member Avatar for ajbest
0
164
Member Avatar for mogaka

$query = "SELECT encounter,amount1,amount2,posted1,posted2 FROM payments WHERE pid='$patient_id'"; $res = mysql_query($query); $max =25; $num_rows=mysql_num_rows($res); $x_count=0; while($row=sqlFetchArray($res)){ $encounter_id=$row['encounter']; //$method=$row['method']; $amount1=floatval($row['amount1']); $amount2=floatval($row['amount2']); $posted1=floatval($row['posted1']); $posted2=floatval($row['posted2']); $total_amount_paid=floatval($amount1+$amount2+$posted1+$posted2); for($x_count=0;$x_count<$num_rows;$x_count++){ //$encounter_id[$x_count]=$encounter_id; $query = "SELECT date,SUM(fee) AS totalcharges FROM billing WHERE pid='$patient_id' AND encounter=$encounter_id"; $res = mysql_query($query); while($row=sqlFetchArray($res)){ $date_fee=$row['date']; $total_charges=floatval($row['totalcharges']); $balance=floatval($total_charges-$total_amount_paid); $pdf->SetFillColor(254,254,254); $pdf->Ln(); $pdf->SetX(10); $pdf->Cell(50,4,$date_fee,1,0,'L',1); $pdf->Cell(40,4,$encounter_id,1,0,'L',1); $pdf->Cell(40,4,$total_charges,1,0,'L',1); …

Member Avatar for mogaka
0
139
Member Avatar for mogaka

<?php echo "<center><a href='report.php?date_range=$date_range&patient_id=$patient_id&proce_name=$proc_name> <img src='pdf.jpg' alt='Print Lab Resutl' width='32' height='32'>Print Report</a><center> </p></center>";?> I want to submit some the above parameters to the server side script for processing. However, I do dont receive the sent parameters on the server script. can somebody identify and rectify where the error is .I …

Member Avatar for IIM
0
87
Member Avatar for mogaka

I am looking for a universal system that can replicate/Synronize database schemas and changed data for mysql,sql server,Oracle or atleast mysql and postgresql. Our company has different branches each with its own local data but any changes in a local database is supposed to be replicated to the central database. …

Member Avatar for mogaka
0
120
Member Avatar for mogaka

First time click: ![Screenshot-110](/attachments/small/3/Screenshot-110.png "align-right") Second Round Mouse click: ![Screenshot11](/attachments/small/3/Screenshot11.png "align-left") The above images shows screen short of a popup that is shown by clicking on a link from a html table i created using Jquery DataTables plugin and data from mysql database. in essense, when i click the linkable …

Member Avatar for LastMitch
0
156
Member Avatar for mogaka

Consider the following code: while($row=mysql_fetch_assoc($result)){ echo '<tr> '; echo '<td><a href="#?id='.$row['id'].'" class="dep_link"><img src="images/icn_edit.png" title="Edit"></a>&nbsp;<a href="#"><img src="images/icn_trash.png" title="Trash"></a></td>'; In my php form, i have created a jquery dialog link such that when the user clicks the 'icn_edit.png' image , a new iframe is loaded with fields for update. i want to …

Member Avatar for adam.adamski.96155
0
105
Member Avatar for mogaka

<?php require_once('mail.inc.php'); $con = mysql_connect("localhost","root","12345"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("billtest",$con); $today=strtotime(date("Y-m-d")); $query1="SELECT * FROM ab_transactions_paypal WHERE status=0 AND expiry_date>$today"; $result=mysql_query($query1); if(mysql_num_rows($result)>0){ $count=mysql_num_rows($result); for($j=0;$j<$count;$j++){ $row=mysql_fetch_array($result); $token_id=$row['token_id']; $account_id=$row['account_id']; $sku=$row["sku"]; $inv_id=$row['invoice_id']; $bill_amt=$row['amount']; $cust_email=$row['cust_email']; $url="https://ssl.3gsecure.net/api/payment/checktoken.asp?TransactionToken=$token_id"; $httpRequest_OBJ = new httpRequest($url, HTTP_METH_POST); $result = $httpRequest_OBJ->send(); $mine=$httpRequest_OBJ->getResponseBody(); echo $httpRequest_OBJ->getResponseBody(); $s = …

Member Avatar for pritaeas
0
94
Member Avatar for mogaka

I want to iterate through html table and display the values. for instance, column keys are fname,lname,mkt,positions. if for instance there are 10 rows,how can i access them and send them to php script ?

Member Avatar for Szabi Zsoldos
0
146
Member Avatar for mogaka

function name_loop(){ var names_array = []; $('.name_class').each(function(index){ names_array[index] = $.trim($(this).val()); }); return names_array; } the problem with the above code is that it returns only the first element and not the specified array. can someone solve it for me

Member Avatar for JJenZz
0
107
Member Avatar for mogaka

consider code below: //Consider the php part(process.php) <table border="1"> <thead> <tr> <th>Name</th> <th>Language</th> </tr> </thead> <tbody> <?php foreach($_POST['names'] as $k=>$v){ ?> <tr> <td><?php echo $v; ?></td> <td><?php echo $_POST['languages'][$k]; ?></td> </tr> <?php } ?> </tbody> </table> //html part**``** <HTML> <HEAD> <TITLE> Add/Remove dynamic rows in HTML table </TITLE> <script type="text/javascript" …

Member Avatar for Squidge
0
102
Member Avatar for mogaka

i have the following query: 1.$query="SELECT * FROM ab_service WHERE account_id=$account_id AND sku='".$sku."'"; 2.$query="SELECT * FROM ab_service WHERE account_id=$account_id AND sku='$sku'"; none of the above seems to work.the problem is with $sku var because when i dont put it as the condition, i get results.what is the problem ? the …

Member Avatar for seslie
0
62
Member Avatar for mogaka

how can i submit form values to server without refreshing page i.e using ajax.consider fname,lnm,gnd,dpk as sample form fields to illustrate this.

Member Avatar for diafol
0
59
Member Avatar for mogaka

I am trying to process an array to get variable name and its value. below is the code. $s = explode("&",$mine); foreach($s as $k=>$v){ $v=explode("=",$v); for($i=0;$i<count($v);$i++){ $a[$v[$i]]=$v[$i+1]; } print_r($a); } The prolem is that the array repeats itself in output. as shown(look at it keenly): Array ( [APIresult] => 000;APIresultexplnation …

Member Avatar for diafol
0
129
Member Avatar for mogaka

i have created a php application where am using a barcode scanner to load item name and prices from database. the problem is that once the barcode reader finishes reading the barcode, the details are loaded and it tabs to the next field. this means that the user has to …

Member Avatar for Troy III
0
114
Member Avatar for mogaka

i have created a php application where am using **a barcode scanner to load item name and prices from database**. the problem is that **once the barcode reader finishes reading the barcode, the details are loaded and it tabs to the next field. this means that the user has to …

Member Avatar for Biiim
0
89
Member Avatar for mogaka

hi you all, I am creating an application which requres generation of random keys cosisting of 4 numbers(0-9). However, i realized that at some point,the random numbers repeats themselves. how can i avoid this repetition.the numbers form the primary key of a column in sql database table.

Member Avatar for adam_k
0
73
Member Avatar for mogaka

i can create an asp.net application but i don't know how to compile it to run. can somebody help me on how to make it run because at the moment, it runs on visual studio alone. how can i make it run in an environment without vb.net IDE?

Member Avatar for kvprajapati
0
53
Member Avatar for mogaka

Hi brothers,i am creating an application that i want to load a pre-designed crystal report from database records and print it in pdf format and send it as e-mail attachment. I know how to send it as an attachment but i don't know how to print it in pdf automatically …

Member Avatar for mogaka
0
124
Member Avatar for mogaka

i am creating an invoice creation project where every client has a certain date for payment per month. how do i put the system to update next payment date e.g if client x is supposed to pay on 6th every month and has paid for april,the system should automatically update …

Member Avatar for adam_k
0
71
Member Avatar for mogaka

i have developed a system which needs to process funds transfer using means of mobile phone sms(short message sent). my problem is that i don't know how to intergrate the application with the sms gateway. suppose sms has been sent through the gateway,what will trigger the system to respond since …

Member Avatar for adam_k
0
82
Member Avatar for Xcelled194

Hi guys, I'm writing a program that needs to log on to a remote computer to preform a task. I have the user name and account, but I need a way to logon as that user on the remote machine. Edit: All I need to do is copy a file …

Member Avatar for Xcelled194
0
140
Member Avatar for mogaka

I have developed a system which should be accessed remotely. the system reads sql credentials from a notepad file to authenticate to the remote sql server. however, when trying to connect, the system says: "request for odbc permission failed". but if i put the application on the client machine together …

Member Avatar for adam_k
0
92
Member Avatar for mogaka

I have developed a system which should be accessed remotely. the system reads sql credentials from a notepad file to authenticate to the remote sql server. however, when trying to connect, the system says: "request for odbc permission failed". but if i put the application on the client machine together …

0
41