Jump to content

ibrahimjan

Members
  • Content count

    57
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ibrahimjan

  1. How can I get tr index

    Like astralaaron said using closest class and the index class in jquery you can get the index of the tr, have a look at the fiddle. https://jsfiddle.net/8hL46ftj/ hope this helps $('img').click(function(){ alert($(this).closest('tr').index()) })
  2. Data type SQL table limits

    Hi I created a relations sql statement between three tables, the problem is that my table tx and img is limited to only 1024 characters, is there a way I can change the data typ to display more than that, like use type = TEXT?? This is my statment: SELECTCONCAT('{"weID":"',wb.weID, ',"size_h":"',wb.size_h, ',"size_w":"', wb.size_w,'","text":[') as bs, CONCAT (GROUP_CONCAT(DISTINCT'{"weID":"',wt.weID,'","txtID":"',wt.txtID, '","txtText":"', wt.txtText, '","txtColour":"', wt.txtColour,'"}')) as txt, CONCAT(GROUP_CONCAT(DISTINCT '{"weID":"',wi.weID,'"',',"imgName":"',wi.imgName,'","imgName":"', wi.imgName,'","imgMTX5":"', wi.imgMTX5,'","imgMTX6":"',wi.imgMTX6,'","imgWidth":"',wi.imgWidth,'","imgHeight":"', wi.imgHeight,'","imgZindex":"', wi.ImgZindex,'"}'))as img FROM wb, wt, wi WHERE wb.weID = wt.weID and wb.weID = wi.weID GROUP BY wb.weID ORDER BY GROUP_CONCAT(DISTINCT wb.weID) ASC
  3. Data type SQL table limits

    thank you, what I did was changed the vale of group_concat_max_len from my.ini permanently, that worked very well.this is what I found out: The result is truncated to the maximum length that is given by the group_concat_max_len system variable, which has a default value of 1024. The value can be set higher, although the effective maximum length of the return value is constrained by the value of max_allowed_packet. The syntax to change the value of group_concat_max_len at runtime is as follows, where val is an unsigned integer: SET [GLOBAL | SESSION] group_concat_max_len = val;-- http://dev.mysql.com/doc/refman/5.0/...n_group-concat
  4. CONCAT sql

    Hi All, I got this sql connection to my table wb, it all seems to work fine in phpmyadmin, when testing sql, but when i want to us it, it comes up with: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING inC:\----------\test3.php on line 75 line 75 is the $query_wb $query_wb = "SELECT CONCAT( "[", GROUP_CONCAT( CONCAT("{weID:'",`weID`,"'"), CONCAT(",weName:'",`weName`,"'}") ) ,"]") AS json FROM wb;"; any Ideas how to make it work??
  5. Create Json data

    Please have a look at my json data to see what I want to do: [ { "weID": "-126555895", "size_h": "700", "size_w": "494", "images": [ { "imgID": "1535689403", "imgName": "1321865407" } ], "text": [ { "txtID": "-1892792786", "txtText": "4.99" }, { "txtID": "1583276033", "txtText": "$" } ] }, // i cant seem to loop through my data to get more results looking like this:{ "weID": "3444555435", "size_h": "500", "size_w": "294", "images": [ { "imgID": "-454646555", "imgName": "77774433" }, { "imgID": "1535689403", "imgName": "1321865407" } ], "text": [ { "txtID": "15834443333", "txtText": "more text" } ] }] //my PHP code: $back = mysql_query("SELECT weID, size_h, size_w FROM wb WHERE weID=-126555895");$images = mysql_query("SELECT imgID, imgName FROM wi WHERE weID=-126555895");$text= mysql_query("SELECT txtID, txtText FROM wt WHERE weID=-126555895"); //all my above SQL statements have weID in common, how can I link them together, to show all my results rather then one "-126555895"?? $model = array(); while($e = mysql_fetch_assoc($back)){ $model['weID'] = $e['weID']; $model['size_h'] = $e['size_h']; $model['size_w'] = $e['size_w']; while($h = mysql_fetch_assoc($images)) { $model['images'][] = array( 'imgID' => $h['imgID'], 'imgName' => $h['imgName'] ); while($f = mysql_fetch_assoc($text)){ $model['text'][] = array( 'txtID' => $f['txtID'], 'txtText' => $f['txtText'] );}; };}; echo json_encode ($model); mysql_close($con); I need it to loop through so it can display all the records in
  6. Create Json data

    Ok I think I got my SQL sorted, it's a full array now, but have to change my original PHP.Any help in changing my original PHP to outpu like the above json string, is much appreciated. "SELECT wb.weID, size_h, size_w, imgID, imgName, txtID, txtText FROM wb JOIN wi ON wi.weID = wb.weID JOIN wt ON wt.weID = wb.weID WHERE wb.weID = '-126555895'"
  7. Create Json data

    Ok, what I need to do is loop through $back to show all rows, at the moment its only displaying one which is "-126555895" obviously as set in the sql statement, but maybe I need to change my sql to show all records of $back, but $images and $text need all to show corresponding joint data by "weID" and I am having proper difficulties joining them. At the moment it's easy to set up because we are only showing one record "-126555895", I need to show all the records in the above json layout. I hope this makes senesce, its very hard to explain multidimensional arrays, any help is appreciated.
  8. Json Data issue

    Hi I have a json Data coming from an ASP script, this works all fine, please have a look at the data at:http://jancodesign.c...YID=-1422732274now I have created my JS to read this data please have a look at: http://jancodesign.com/js/JsonRead.js The problem is that I get the "DesignID" to show but not the "TxText" instead of the data to show I get "undefined"Any Ideas as why this is happening??Thank you
  9. Json Data issue

    If new data is created or updated on the server on a regular intervals, the js needs to check every 5sec or so to reload the new data, the ASP file is producing the new data. to prove that at the moment the only way to see the new data take place is by refreshing the full page. Can I not just refresh the Div's or that wont work?? thanks
  10. Json Data issue

    I added setinterval around the ajax, but I am getting the data to reload new set every 5sec, rather than refreshing the current data? please have a look. setInterval(function(){ $.ajax({ dataType: "json", url: "/jsondata.asp?LAYID=-1707637504", cache: false, success: function(data, status) { for(var i = 0, l = data.length; i < l; i++){var d = data[i]; $('.inner').append('<p><h1>' + d.DesignID + '</h1></p>'); //This is the Text Array/// for(var j = 0, k = d.Text.length; j < k; j++){ $('.inner').append('<p><h2>TEXT'+[j+1]+'</h2></p>'); $('.inner').append('<p>' + d.Text[j].TxText + '</p>');}}},});}, 5000);
  11. Json Data issue

    Hi I moved things around a bit, and came up with the following. Is there any way I can add a refresh function, to get new json data every 30 sec?? without refreshing the page. Thanks. $.ajax({ type: "GET",data: "{}",contentType: "text/plain",dataType: "json",url: "/jsondata.asp?LAYID=-1707637504", cache: false,success: function(data, status) { for(var i = 0, l = data.length; i < l; i++){ var d = data[i]; $('.inner').append('<p><h1>' + d.DesignID + '</h1></p>'); //This is the Text Array///for(var j = 0, k = d.Text.length; j < k; j++){ $('.inner').append('<p><h2>TEXT'+[j+1]+'</h2></p>'); $('.inner').append('<p>' + d.Text[j].TxText + '</p><hr>'); }}}});
  12. Json Data issue

    Thank you, I see what you mean, much better approach thanks. it seems to be working fine now, thank you for your time.
  13. Using ASPAjax

    Hi All,I was not to sure where to post this ASP or JS, anyways it has both elements in there so hopefully some one can help, I am using a ASPAJAX library for AJAX functionality, what I need the following code to do is refresh but still to use the "test1" variable, at the moment when it refreshes it does not load the request.query from the URL?? Any ideas how I can still use the same QueryString?? when it refreshes The library can be downloaded from the following link ASPajax with full SDK <!--#include virtual="/aspajax/aspajax.asp"--> <% ASPAjax.Open() ' Set up ASPajaxtest1 =request.QueryString("test1") ' Create an UpdatePanel to load the content into. dim myPanel Set myPanel = ASPAjax.CreateUpdatePanel myPanel.Id = "MainContent" myPanel.ChildrenAreTriggers = true myPanel.FetchWholeDocument = true ' Retrieve the whole target URL to the UpdatePanel myPanel.RefreshInterval = 5 ' UpdatePanel self refreshes every 5 seconds myPanel.RegisterTriggerGroup("PageNav") ' DOM object PageNav's child nodes now activate the UpdatePanel myPanel.Open%> <h1> Main Cotent </h1><%response.Write(test1)%><%myPanel.Close%><% ASPAjax.Close()' Close ASPajax at the end of the HTML %>
  14. Using ASPAjax

    I tried it with changing the JS, and it seams to refresh with the QueryString fine, please have a look at bottom part of the JS. <%test1 =request.QueryString("test1")%><script type='text/javascript' src='/aspajax/aspajax.asp?ixsf23x4sn=s83hjdhj'></script><script type='text/javascript' >ASPAjax.activateDOM('PageNav','MainContent',true,true,true); </script><span class='asp-ajax-loader' style='position:absolute' id='AJAXLOADER_____MainContent'></span><div style='display:inline' id='AJAX_____MainContent'> <h1> Main Cotent </h1><%response.Write(test1)%><script type='text/javascript' >ASPAjax.activateDOM('AJAX_____MainContent','MainContent',true,false,true);try{clearTimeout (DIC__MainContent)}catch(e){};DIC__MainContent = setTimeout (function(){ASPAjax.submit('test4.asp<%test1%>','MainContent')}, 5000);</script></div> is there away I can change it on the ASP code?? Thank you
  15. Using ASPAjax

    Ok this is my live link http://www.jancodesign.com/test3.asp?test1=testing The simple idea is to be able to pick up data from the DB up to date and constantly refreshing the new data on the page, thats where the refresh comes in, it seams to work fine with out a QueryString, if you modify the asp file manually and upload it to the server it seams to refresh the content without intervention. The code generated from the ASPAjax is: <script type='text/javascript' src='/aspajax/aspajax.asp?ixsf23x4sn=s83hjdhj'></script><script type='text/javascript' >ASPAjax.activateDOM('PageNav','MainContent',true,true,true); </script><span class='asp-ajax-loader' style='position:absolute' id='AJAXLOADER_____MainContent'></span><div style='display:inline' id='AJAX_____MainContent'> <h1> Main Cotent </h1>testing<script type='text/javascript' >ASPAjax.activateDOM('AJAX_____MainContent','MainContent',true,false,true);try{clearTimeout (DIC__MainContent)}catch(e){};DIC__MainContent = setTimeout (function(){ASPAjax.submit('','MainContent')}, 5000);</script></div>
  16. Aspupload

    Hi all,I am trying to use AspUpload from persits to get .png file info, I dont want to upload the image, I already have it on a directory on the server, all I want is to point aspupload to that image and get its size and path, any ideas. This is the code I am working with, any ideas how I can modify it to read a specified image and not to use the upload_form.asp?? upload_form.asp <FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="test2.asp"> Select an image (GIF, JPEG, BMP, PNG):<BR> <INPUT TYPE="FILE" SIZE="40" NAME="FILE1"><BR><INPUT TYPE=SUBMIT VALUE="Upload!"></FORM> upload_page.asp Set Upload = Server.CreateObject("Persits.Upload")' Capture and save uploaded imageFor Each File in Upload.Files If File.ImageType = "UNKNOWN" Then Response.Write "This is not an image." Response.End End If Response.Write File.Path & "<BR>" Response.Write "Type: " & File.ImageType & "<BR>" Response.Write "Size: " & File.ImageWidth & " x " & File.ImageHeight & " pixels"Next
  17. Js And Svg Editing

    Hi all, I am creating an SVG file dynamically, i need to convert the following inside the SVG file: <text transform="matrix(1 0 0 1 13 444)" fill="#00FF00" style="line-height:50px" font-size="24">Line1<br>line2<br>line3<br>line4<br></text> The line brakes and the "line-height" don't work inside the SVG file so I think a small java script inside the file to convert what ever <br> to the following before the SVG file loads the elements: <text transform="matrix(1 0 0 1 13 444)" fill="#00FF00" font-size="24">Line1<tspan x="0" dy="50px">Line2</tspan><tspan x="0" dy="50px">Line3</tspan><tspan x="0" dy="50px">Line4</tspan></text> any Ideas is much appreciated. Thanks
  18. Asp Image Size With Repeat

    Hi All,I have been trying to make this piece of code to work for some time, I have a sub routine in a repeat loop, the loop gets images from a database, the sub routine retrieve the image dimensions (width x height) then I simply need to do "IMG_width/iWidth". But every time I run this code I get the following: Microsoft VBScript compilation error '800a03ea' Syntax error /svg1.asp, line 97 sub ImgDimension(img)^Thanks Dim Repeat2__numRowsDim Repeat2__indexRepeat2__numRows = -1Repeat2__index = 0image_loop_numRows = image_loop_numRows + Repeat2__numRowsWhile ((Repeat2__numRows <> 0) AND (NOT image_loop.EOF)) dim iWidth, iheightdim myImg, fsdim IMG_width, IMG_height, Image_all, IMG_link, IMG_1MTX IMG_width=(image_loop.Fields.Item("Width").Value)IMG_height=(image_loop.Fields.Item("Height").Value)Image_all=(image_loop.Fields.Item("Image_all").Value)IMG_link= "/gallery/png_xph/"&Image_all&".png" sub ImgDimension(img)Set fs= CreateObject("Scripting.FileSystemObject")if not fs.fileExists(img) then exit subset myImg = loadpicture(img)iWidth = round(myImg.width / 26.4583)iheight = round(myImg.height / 26.4583)set myImg = nothingend subImgDimension(Server.MapPath(IMG_link)) IMG_1MTX=IMG_width/iWidth Repeat2__index=Repeat2__index+1 Repeat2__numRows=Repeat2__numRows-1 image_loop.MoveNext()Wend
  19. Asp Image Size With Repeat

    I figured out a different approach to this issue, I managed to find a small converter to run on the server, my idea is to convert the .png to .jpg to a temp location, read the width and the height, then delete the file. This is what I got so far for converting the file: dim CSet C=CreateObject("ImageConverter.ImageConverterX") 'this is line 10C.Convert "c:\veg.PNG", "c:\veg2.JPG", "-cJPG"Response.Write C.ErrorMessageset C = nothing The problem I am facing is that I have installed the ImageConverter.dll in the registry, but every time I run the above script I get the following error: Microsoft VBScript runtime error '800a0046' Permission denied: 'CreateObject' /test.asp, line 10 Any ideas to why this is happening??
  20. Asp Image Size With Repeat

    any ideas??
  21. Asp Image Size With Repeat

    I tried it this way, please have a look, but I have just found out that I cant use "loadpicture" on .png, it does not support it?? any other ideas how I can get the width and height of a .png file?? the code is inside the loop dim iWidth, iheightdim myImg, fsdim IMG_width, IMG_height, Image_all, IMG_link, IMG_1MTX IMG_width=(image_loop.Fields.Item("Width").Value)IMG_height=(image_loop.Fields.Item("Height").Value)Image_all=(image_loop.Fields.Item("Image_all").Value)IMG_link= "/gallery/png_xph/"&Image_all&".png"img= (Server.MapPath(IMG_link)) set myImg = loadpicture(img)iWidth = round(myImg.width / 26.4583)iheight = round(myImg.height / 26.4583)set myImg = nothing response.Write(iWidth&"x"&iheight)&"<p>"
  22. Asp Image Size With Repeat

    The code is not a function or a subroutine it is by it's self, also I have to keep ImgDimension inside the loop, as the value of IMG_link is dynamic and changes as it goes through the loop, to populate more than one image results, is there a way to make it work as it is inside the loop, can we change the code, instead of using subroutines?? to get the image dimensions.
  23. Convert Svg - Jpg Js

    Hi all, this small JS converts SVG-JPG, the script does what is says, but what I want it to do, is load and execute the script as the page loads, but at a sequential rate. The first thing should load is the SVG to Canvas function, then when that has fully executed, Canvas to JPG function should fire up?? I am sure its easy to do but my mind is gone blank. At the moment the script is activated by 2 links, svg-canvas and canvas-jpg. <script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script><script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> <script type="text/javascript">/*<![CDATA[*//*---->*/ function q(k) { var qs = window.location.search.substring(1); var t = qs.split("&"); for (i=0;i<t.length;i++) { kv = t[i].split("="); if (kv[0] == k) return unescape(kv[1]).replace('+',' '); } return null; } var context; function bodyonload() { if (typeof(FlashCanvas) != 'undefined') context = document.getElementById('canvas').getContext; var qUrl = q('url'); if (qUrl != null && qUrl != '') { r(); canvg('canvas', qUrl); } var qSvg = q('svg'); if (qSvg != null && qSvg != '') { r(); canvg('canvas', qSvg); } } function render() { var c = document.getElementById('canvas'); c.width = document.getElementById('width').value; c.height = document.getElementById('height').value; if (context) c.getContext = context; canvg(c, document.getElementById('svg').value); } function r() { var c = document.getElementById('canvas'); c.width = '600'; c.height = '600'; if (context) c.getContext = context; } function svgJPG() { var canvas = document.getElementById("canvas"); var img = canvas.toDataURL("image/jpeg", 1.0) ; document.write('<img src="'+img+'"/>');} window.onload=bodyonload(); /*--*//*]]>*/</script> <p><canvas id="canvas"></canvas></p><p><a href="javascript:r();canvg('canvas', '/svg_file.svg')">svg-canvas</a></p><p><a href="javascript:svgJPG()"> canvas-jpg</a></p>
  24. Convert Svg - Jpg Js

    thank you all for your help, that worked very nicely.
  25. Convert Svg - Jpg Js

    thank you that worked, is there a way to make bodyonload 1-100 () I want to provide variables from 1 to 100 because the canvas id will be created dynamically so I want to match them?? so instead of writing window.onload=function(){bodyonload1();bodyonload2();bodyonload3();bodyonload4();bodyonload5();.......and so on} I want something like this.. window.onload=function(){bodyonload1-100();}
×