Jump to content

Skylight_lady

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by Skylight_lady

  1. Interesting !! But it's too short of the Growth amount. Ive been using the values: Balance = 20000 MonthlyAmount = 500 InterestRate = 3 Years = 4 The correct formula is as follows: Year1 = (Balance + (MonthlyAmount * 12)) * InterestRate; Year2 = (Year1 + (MonthlyAmount * 12)) * InterestRate; Year3 = (Year2 + (MonthlyAmount * 12)) * InterestRate; The end of year balance, is added to 12 months repayments and multiplied by the interest rate. However, if i used the simple maths it won't correct it. Thereforem a more complicated formula is required like the "pow"
  2. Well it's supposed to be exactly like http://www.aib.ie/personal/savings/Savings-Calculator?gclid=CMyTpKLng7QCFYRF2wodo18AFg If you roll over the last year and see the growth. Then all over the above calculation are wrong. It's only correct if i set the contribution to "0" value
  3. Hi Guys, I'm trying to get a monthly contribution added to the saving coumpound interest. The original code i have is: $IntTotal = ($balance*(pow(1+$Rate,$terms)-1)); The above code allows me to calculate the interest total without a monthly contribution added. How do i insert the monthly contribution into that? Is there another way to write this in php? Thanks
  4. Hi, Thanks for that. Is there a using that by calculating 2 figures with two sliders together? I have the following code eg: $( "#slider-range-max" ).slider({ range: "max", min: 0, max: 90000, value: 45000, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); var aaa = $("#amount").val(); var bbb = $("#amountb").val(); var ccc = $("#amountc").val(); var ddd = $("#amountd").val(); var eee = $("#amounte").val(); var fff = $("#amountf").val(); $("#total").val(+aaa + +bbb + +ccc + +ddd + +eee + +fff); } }); $( "#slider-range-max-dif" ).slider({ range: "max", min: 0, max: 30, value: 15, slide: function( event, ui ) { $( "#difference" ).val( ui.value ); var adif = $("#difference").val(); var bdif = $("#differenceb").val(); var cdif = $("#differencec").val(); var ddif = $("#differenced").val(); var edif = $("#differencee").val(); var fdif = $("#differencef").val(); $("#total_dif").val(+adif + +bdif + +cdif + +ddif + +edif + +fdif); } }); However, i can't seem to get something like this calculation to work: $("#result").val(+aaa * (+adif / 100)); and $( "#result" ).val( $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) ) * ( $( "#difference" ).val( $( "#slider-range-max-dif" ).slider( "value" ) ) / 100 ) ); With either of the codes above i'm trying to get the result from one row by dividing the adif by 100 and multiplying it by aaa. The result i seem to be getting is NaN. Whats the correct way to do this. I'm no javascript/jquery expert.
  5. Hi Guys, Is there any cash/price slide bar around like wonga dot com. Their code is a bit complicated so i want something very similar with a few rows of sliders.
  6. Thanks for that. My code is very similar. The problem i had was that i accidently had "die" at the end of the code which terminated the program after the first file was deleted
  7. Hi Guys, here is a problem i have with deleting a file(s) via a cron job. Now i have written a code which deleted all files in a directory .... but it's not what i want. i want to delete one or more files that all have the same value in the database table with an value of delete eg: $query = "SELECT * FROM files_uploaded WHERE file_id = 'delete'"; As my previous code deleted all files in a directory, i have now changed the code to below, but this only deletes one file and not two or more even tho they have the same file_id in the database. $address = '/home/www/mydir/files-uploaded/'; $file = $file_name; if (is_file($address.$file)) { unlink($address.$file); } In the code above the $file_name value is not being shown to you but is stored in the database and displays correctly. How do i get this to delete one or more files depending on the file_id in the database?
  8. I'm afraid jessirose is correct. The column months can be 32 .... Anyways to be more clear it has to be in the number of months and not a date from the users input. Well, it seems like the query works for jazzman1 if he's getting the correct result. I'll have to double check in a few days what was causing me to get a completely different total without any errors. Maybe it was calculating two different queries at the same time and gave me a strange result then. Thanks for your help guys.
  9. I want to get the SUM of "(amount - Newamount) * months" for all the rows from the table eg: amount Newamount months 10.00 5.00 10 100.00 40.00 12 The first rows total will be 50.00 while the second rows total will be 720.00. Then the SUM of it all should be 770.00. I hope this clear enough !
  10. In the table i have: amount double(10,2) NOT NULL DEFAULT '0.00' Newamount double(10,2) NOT NULL DEFAULT '0.00' months int(10) NOT NULL DEFAULT '0' I found another way around this by using php only with the following code "+=": $Newamount += ....... This allows me to calculate each row to get its total. However, i want to know about this sql query as i never leave things alone without knowing the answer.
  11. Can someone please tell me why this query is not working: $query = "SELECT SUM((amount - Newamount) * months) AS TOTAL FROM mytable WHERE Newamount != '0.00'"; Even if i use: $query = "SELECT SUM(amount - Newamount) AS TOTALSMALL FROM mytable WHERE Newamount != '0.00'"; It would return the right amount. But i want to do more calculations with the months added. Each row will have different months.
  12. That also sounds like using the full path like https://www.myweb.com/securefolder/test.php will also do the same trick from what you and that blog is saying. Doesn't this also mean doing redirects for the folders to make them https without a user changing it to http in the web browser.
  13. You say this is your last code: $insert = "INSERT INTO tblPurchasesHeader (Vendor, InvoiceDate,Invoice,TotalAmount,TaxAmount) VALUES (".$_POST['vendor']."' Why on earth did you not add ' in the very first $_post in the value? You were told to do so and it has to be there. That's exactly what that error means. Like: '".$_POST['vendor']."' If you still get an error or it's not inserting then always echo your query so you know where the problem is. Please close this thread as your going back to your original problem without any changes made.
  14. Can you not id or class a CSS to add the new styles with color:#000000 for a black colour? You really need to learn CSS for this. Google will help you.
  15. Hi guys, I'm not sure if this is the right forum to post. Please move if not. My problem is that I have a website with 5 child folders inside the www folder. Now what I want to do is buy 1 ssl .... Will I be able to secure just two of those folders and how via cpanel? Also, what do I have to do to make sure the key lock on the bottom of the screen is clean eg all href links and image links should be https .... Does it matter if the are in one of the child folders not secure but still uses https to access it as written in the code address. Also, am I not allowed to link to an external website in the secured folders?
  16. Hi, my webhost has the mail() function disabled. However, my emails are hosted in the offices sever and can't use smtp due to the firewall blocking it. How do I setup sendmail instead of the mail(). I tried googling this but keep coming across to the mail() functions.
  17. Hi Guys, here is a jquery/ajax code whichever it is. I took this from a website as it's gallery looked good and different to the rest. It's jquery code is listed below: typeof(myscript)!="object"&&(myscript={}); myscript.galleryPromo=function(){ $(".enable-gallerypromo").each(function(f){ var d=$(this).attr("data-options"); var a={el:$(this),imagepath:myscript.util.getoptions({opts:d,val:"imagepath"}),type:myscript.util.getoptions({opts:d,val:"type",def:"hover"}),length:$(this).find(".gallery-thumbs li").length,thickbox:myscript.util.getoptions({opts:d,val:"thickbox"})}; var h=0; var e=0; var c=false; var b=$(".gallery-thumbs"); var g=$(".gallery-thumbs li").length-1; if(a.length>0){ b.before('<ul class="gallery-pic"></ul>\n'); $("li",b).eq(0).addClass("on").end().mouseover(function(){if(c){var k=$(this).index(); $(".gallery-thumbs li, .gallery-pic li").removeClass("on"); $(this).addClass("on"); $(".gallery-pic li").eq(k).addClass("on")}}).each(function(n){$(".gallery-pic").append("<li></li>"); var m=$(this).find("a").attr("href"); var l=new Image(); var k=$(this).find("a").attr("rel"); var o=$(this).find("img").attr("src"); var q=o.split("/"); var p=$(this).find("a").attr("title"); q[5]=a.imagepath; o=q.join("/"); $(l).bind("load",function(s){$(".gallery-pic li").eq(n).append('<a href="'+m+'" class="image-'+n+'" ><img src="'+o+'" alt="'+p+'" /><div class="gallery-details"><h4>'+p+'</h4><p class="gallery-count">'+k+"</p></div></a>"); if(n==g){ c=true; $(".gallery-pic").find("li:first-child").addClass("on")}}).error(function(){}).attr("src",o)})}})}; How do i change this to make the image path as my desired location? If you need more information please let me know and i can provide this or an address to their website if desired. I just couldn't figure out how they are getting these images to show.
  18. Hi guys, These two questions maybe stupid questions but my brain has so many thoughts and I can't figure this out. My first question is that I have seen on one site that they cache their CSS files. What's the case of this? Also, if I was a user in a custom made CMS and changed the colors of texts and background colors in the CSS external file via that CMS with a select box. How do I get this to overwrite the external css file with a simple code? I know it can be done if the CSS was in the page and not an external file via php .... But I'm stuck with changing the external file. Can anyone help and explain this to me please.
  19. Thank you. That explains it. I'm now using a Decimal datafield which sorts it out.
  20. I have a table with a price and ID. My totals are shown in the table below with the price ID: ID Price 504 4720.00 504 864.00 504 16571.84 Now, i am trying to write a mysql ststement that allows me to get the lowest price in the database from the table above e.g 864.00 SELECT MIN(price) AS TOTALLEAST FROM mytable WHERE ID = '504' LIMIT 1 The above sql statement is only give me the 16571.84 result. Why exactly is this? And whats the correct statement?
  21. Oooops, my mistake. I should have read your post properly. Somehow i thought you wanted to send an email with image attachments too. Do you mean adding images as an attachment to the email? If so then the code i gave you should work for a mail server like outlook that accepts images as attachments. You will need to add in the html code for your mail and place it in the $html code above the line "$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';" with what i gave you. Can you provide the html form you have?
  22. Have you tried: <?php $mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\r\n"; $body = "This is a multi-part message in mime format.\n\n"; $body .= "--$mime_boundary\n"; $body .= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n"; $body .= "Content-Transfer-Encoding: 7bit\n\n"; $body .= $text; $body .= "\n\n"; $body .= "--$mime_boundary\n"; $body .= "Content-Type: text/html; charset=\"UTF-8\"\n"; $body .= "Content-Transfer-Encoding: 7bit\n\n"; $body .= $html; $body .= "\n\n"; $body .= "--$mime_boundary--\n"; $headers .= "From:\"$mymailtitle XXXX\" <$mymail>\r\n"; $headers .= "X-Sender-IP: $_SERVER[sERVER_ADDR]\r\n"; $headers .= 'Date: '.date('n/d/Y g:i A')."\r\n"; return mail($EmailTo, $Subject, $body, $headers); ?> Don't forget to add the $text and $html for the format of your mail in each.
  23. I have limited idea about SimpleXML but not with the code below and need to edit it so the results can be parsed into a html format. The problem i am having is the XML tags are stored in an existing variable returned from a third party server so need something that can parse this xml info into a html with tags being used. $xml = "<Inputs>"; $xml.= "<Authentication>"; $xml.= "<Username>$username</Username>"; $xml.= "<Password>$password</Password>"; $xml.= "<RequestType>Term</RequestType>"; $xml.= "<RequestFrom>$system_name</RequestFrom>"; $xml.= "<RequestFromCode>$system_code</RequestFromCode>"; $xml.= "</Authentication>"; $xml.= "<Life1>"; $xml.= "<DOB>$dob</DOB>"; $xml.= "<Sex>$sex</Sex>"; $xml.= "<Smoker>$smoker</Smoker>"; $xml.= "<LifeCover>$lifecover</LifeCover>"; $xml.= "<IllnessCover>N</IllnessCover>"; $xml.= "</Life1>"; $xml.= "<Life2>"; $xml.= "</Life2>"; $xml.= "<Plan>"; $xml.= "<Term>$term</Term>"; $xml.= "<Indexation>N</Indexation>"; $xml.= "<MortgageInterest>6</MortgageInterest>"; $xml.= "<Frequency>Monthly</Frequency>"; $xml.= "<QuoteLifeOnly>Y</QuoteLifeOnly>"; $xml.= "<QuoteLifeAccelerated>$accelerated</QuoteLifeAccelerated>"; $xml.= "<QuoteLifeIllness>N</QuoteLifeIllness>"; $xml.= "<QuoteIllnessOnly>N</QuoteIllnessOnly>"; $xml.= "</Plan>"; $xml.= "</Inputs>"; $url = 'URL NORMALLY HERE'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=".urlencode($xml)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $xml_result=curl_exec($ch); curl_close($ch); print("[$xml_result]"); /* simple xml */ $simplexml = new SimpleXMLElement($xml_result); $Name = $simplexml->Name; echo $Name; /* end */ $data = XML_unserialize($xml_result); $xml_result contains... (with usernames/passwords removed) <Result> <Errors></Errors> <Inputs><Authentication><Username>####</Username> <Password>####</Password><RequestType>Term</RequestType><RequestFrom>####</RequestFrom><RequestFromCode>####</RequestFromCode></Authentication><Life1><DOB>01/01/1969</DOB><Sex>Male</Sex><Smoker>Non-Smoker</Smoker><LifeCover>100,000</LifeCover><IllnessCover>N</IllnessCover></Life1><Life2></Life2><Plan><Term>10</Term><Indexation>N</Indexation><MortgageInterest>6</MortgageInterest><Frequency>Monthly</Frequency><QuoteLifeOnly>Y</QuoteLifeOnly><QuoteLifeAccelerated>Non-Smoker</QuoteLifeAccelerated><QuoteLifeIllness>N</QuoteLifeIllness><QuoteIllnessOnly>N</QuoteIllnessOnly></Plan></Inputs><Outputs> <Summary> <Life1>Male, 40 years 8 months (01/01/1969), Non-Smoker, life cover 100,000</Life1> <Life2></Life2> <Plan>10 year term, mortgage interest 6.00%, benefits and premiums not increasing.<p>1% levy included.</p></Plan> </Summary> <Quotes> <Type> <Desc>Life Cover Only</Desc> <Company> <Name key="1">Caledonian Life</Name> <PricePledge>False</PricePledge> <Underwriting1></Underwriting1> <SLevel key="2">14.50</SLevel> <SConvertible key="2">15.46</SConvertible> <SMortgage key="2">12.12</SMortgage> </Company> <Company> <Name key="2">Canada Life</Name> <PricePledge>False</PricePledge> <Underwriting1></Underwriting1> <SLevel key="2">15.15</SLevel> <SConvertible key="2">15.91</SConvertible> <SMortgage key="2">13.13</SMortgage> </Company> </Type> </Quotes> </Outputs> </Result> Any advice would be much appreciated
  24. It's ok .... should have googled "slidout tab"
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.