WaleedaaN 0 Newbie Poster

this is php code

$storeFolder = 'user_media/';   //2


if(isset($_FILES['image_file_arr'])){
foreach($_FILES['image_file_arr']['tmp_name'] as $key => $tmp_name)
{
    $file_name = $key.$_FILES['image_file_arr']['name'][$key];
    $file_size =$_FILES['image_file_arr']['size'][$key];
    $file_tmp =$_FILES['image_file_arr']['tmp_name'][$key];
    $file_type=$_FILES['image_file_arr']['type'][$key];  
move_uploaded_file($file_tmp,"$storeFolder".time().$file_name);
    echo "file: $file_name <br />";
}

}
WaleedaaN 0 Newbie Poster

i do this code with html

<html dir="rtl">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="ar-kw">
<title>اضاف حدث</title>



<style>

.thumb {
height:60px;
width:60px;
padding:2px;
margin: 5px;
border:1px solid #dedede;
}



input.file-upload{
display: none;    
}

.image-upload {
    cursor: pointer;
}

.remove_img_preview {
    position:relative;
    top:-6px;
    right:20px;
    background:black;
    color:white;
    border-radius:50px;
    font-size:0.9em;
    padding: 0 0.3em 0;
    text-align:center;
    cursor:pointer;
}
.remove_img_preview:before {
    content: "x";
}
</style>

<script>
$(function() {
    $('.image-upload').on('click', function() {
        $('.file-upload').click();
    });
});

</script>

</head>

<body>
<div align="center">
    <table border="0" width="600" align="left" dir="rtl" cellspacing="0" cellpadding="0">
 <form action="?posts=add" method="POST" enctype="multipart/form-data">
        <tr>
            <td align="center" colspan="2"><textarea rows="2" name="article_text" cols="20" class="article_box"  placeholder="الحد الاقصى 500 حرف"></textarea></td>
        </tr>
                <tr>
            <td align="left" colspan="2"><output id="list"></output></td>
        </tr>

        <tr>     

            <td align="right" width="50%">


<input type="submit" class="submit_article" value="ارسل الحدث" name="B1" title='رفع ملفات وصور وفيديو' id="upload">
</td>

            <td align="left" width="50%">
            <input type="file" id="files" name="image_file_arr[]" class="file-upload" accept="image/x-png, image/jpeg" multiple/>
<img class="image-upload" border='0' src="images/upload_file.png" title="اضافة صور"/>
</td>
    </tr>

        <tr>
            <td align="left" colspan="2">
&nbsp;</td>
        </tr></form>
    </table>

</div>

<script>
var count=0;
    function handleFileSelect(evt) {
        var $fileUpload = $("input#files[type='file']");
        count=count+parseInt($fileUpload.get(0).files.length);

        if (parseInt($fileUpload.get(0).files.length) > 3 || count>3) {
            alert("المسموح به 3 صور فقط");
            count=count-parseInt($fileUpload.get(0).files.length);
            evt.preventDefault();
            evt.stopPropagation();
            return false;
        }
        var files = evt.target.files;
        for (var i = 0, f; f = files[i]; i++) {
            if (!f.type.match('image.*')) {
            alert('الملف الذي تم اختياره غير مسموح فقط - JPG, PNG');
                continue;
            }
            var reader = new FileReader();

            reader.onload = (function (theFile) {
                return function (e) {
                    var span = document.createElement('span');
                    span.innerHTML = ['<span class="remove_img_preview"></span><img class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '"/>'].join('');
                    document.getElementById('list').insertBefore(span, null);
                };
            })(f);

            reader.readAsDataURL(f);
        }
    }

    $('#files').change(function(evt){
        handleFileSelect(evt);
    });  

    $('#list').on('click', '.remove_img_preview',function () …
WaleedaaN 0 Newbie Poster

hello,

i make a programing a code for uploading files on array but its not work fine and im working for 15day with it i tried so i need help please

i explain my idea maybe you have and ready code,

i have script php for article any user can post

so on click "new post"

show a box like twitter when you want tweet anything from website

i do the box code is working good.

i want the idea post like twitter:
i want the textarea with max 500 litter's not 140
and add files like twitter preview images before upload or cancel it and max 3 images to upload
if you can do better for me can add any file type i set it and if image preview small image
if another files show any image i set if video mp4 show small image and when click can see before upload any file

the idea its like twitter post on pc

but i need upgrade it to add any files i set

thanks

WaleedaaN 0 Newbie Poster

please move it to javascript forum

WaleedaaN 0 Newbie Poster

hello,,


i have create wysiwyg for me i add youtube icon to add video tube

this code is

function insertyoutube() {
 var video = '<object width="500" height="300"><param name="allowscriptaccess" value="always"></param><embed src="[B]ADD HERE AFTER REPLCE[/B]" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>'; 
 window.opener.insertHTML(video, qsParm['wysiwyg']);
  window.close();
}

i need when i put youtube link like this:
http://www.youtube.com/watch?v=U_csS0HehTw&feature=related

replce watch?v= to v/

so the link will come like this:
http://www.youtube.com/v/U_csS0HehTw&feature=relate

just this and add the link in src of embed you see add here in bold text


thanks

WaleedaaN 0 Newbie Poster

hi all,


i have system for buy tickets

now when i buy 1 ticket is printer good

but when i printer more then 1 tickets

every time i printer give's more space down

the first page with be perfect
and the next page it moves little down and therd page also and sub


my printer name: epson
model: lq-300 +II


thanks

WaleedaaN 0 Newbie Poster

thanks

and what about this array

$seatnumber = "d,s";
$array = array($seatnumber);
$count = count($array);
for ($i = 0; $i < $count; $i++) {
echo "ticket: $array[$i]";

	echo "</br>";
}

is not work check it please .

thanks

WaleedaaN 0 Newbie Poster

or i want just print second value the B

thanks

WaleedaaN 0 Newbie Poster

hello,

this my code how i can do it

$word = "a,b"; 

echo $first;  /// a
echo $second; /// b

thanks

WaleedaaN 0 Newbie Poster

play i need help with this code when i click the close window stop play first then closed window


thanks

WaleedaaN 0 Newbie Poster

hi dear,,,


i use this code facebox : http://chriswanstrath.com/facebox/


now i have first_page.html

example id: 
<?php
$id = 1; //// 1 for michal jakson 
?>

<a href=\"page/play.php?id=$id\" rel=\"facebox\">Play music <a>

now in play.php

<?php
$song = "mj.mp3"; /// all my songs is mp3
?>


<center>
<table border="0" width="100%" dir="rtl" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center">
			
			<object 
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
width="400" 
height="27" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="flashvars" value="audioUrl=[B]http://yoursite.com[/B]/upload/<?php echo $song; ?>" />
<param name="src" value="http://www.google.com/reader/ui/3523697345-audio-player.swf" />
<param name="movie">
<param name="quality" value="Best" />
<param name="loop" value="false">
<param name="menu" value="false">

</object>



			</td>
	</tr>
</table>

what's wrong this code when i click play sont lick michal jakson or anyone

is working 100% fine.
but when i click the image clock facebox still the music playing in background i want when i close the facebox or change or change to another play stop play the old music and start new and when close the facebox the window like facebook i want stop the music

i think its javascript command add and the image link like javascript(stop); like this i dont know about javascript


thanks im waiting my superman to help me :)

WaleedaaN 0 Newbie Poster

i dont know how to attachment in PM

this link to download file and sql
just do sql coonect and you will see my code

if you want create idea from your mind go head

http://www.daniweb.com/forums/attachment.php?attachmentid=17504&d=1286278342
http://www.daniweb.com/forums/attachment.php?attachmentid=17505&d=1286278397

dont care for my files :)

WaleedaaN 0 Newbie Poster

you want me upload files and send it to you by pm ?

WaleedaaN 0 Newbie Poster

i have time for 10 days :)

WaleedaaN 0 Newbie Poster

my seats From A to Z and every litter like A or B have 40 seat

thanks

WaleedaaN 0 Newbie Poster

when i block seat is come background color black if is free green when paid red all same file or what you what to do but i want it work :)


you can ue my files to know my idea and what i do


thanks very much

WaleedaaN 0 Newbie Poster

ok what the best why to create code php

for booking seats for show i have 2000 seat i want block,paid,free

and i have for 1 day more in 3 times show

how i can create best code of my code see ^^^ up ^^^ you will see my php file and sql


thanks

WaleedaaN 0 Newbie Poster

thanks for replay,,,


did you have any idea or code to give me


thanks

WaleedaaN 0 Newbie Poster

hi ,,,

i have create php page code for show booking online

and for free seat is come green color if paid red color and... blah blah

is working fine but can you fix it to be better and fast browseing page

this PHP file and MySql

ticket.php

tickets.txt

waiting Answer thanks

WaleedaaN 0 Newbie Poster

i have get help thanks

cancel this thread

WaleedaaN 0 Newbie Poster

thanks for help

i have done :)

WaleedaaN 0 Newbie Poster

i have create this code but not work 100% :(


please can you update it
html

<script  type="text/javascript"> 
 function toogle(element,id){

 var c = id; 
  c = id;

  if(element.checked) 
  { 
  c =  parseInt(document.getElementById('hel').value, 10) + c; 
  }
   else
  { 
  c =  parseInt(document.getElementById('hel').value, 10) - c; 
  }

    document.getElementById('hel').value= c; 
       } 

  </script> 
  
   <form name="orderForm">
   
     Prix 1:<input name="a" type="checkbox" value="1" onclick="toogle(this,'3')">
     <br /> 
      Prix 2: <input name="c" type="checkbox"  id="hello" value="10" onclick="toogle(this,'5')"/>       
      <br />
        <input name="d" type="text" id="hel"  value="0" readonly=""/>
        <br /> 
         </form>
WaleedaaN 0 Newbie Poster

hello all,

i have this code

<script type="text/JavaScript">

function checkbox_click (number)
{
   
 
alert("number is" + number);


    
}
</script>
echo "<input type=\"checkbox\" name=\"boxname\" " value=\"5\" onClick=\"checkbox_click('3');\" /> \n";

i want add more code in javascript
when is check show me in input text the number and when i check mutlti box's is + all number and when i uncheck box is - the number


please help me
thanks

WaleedaaN 0 Newbie Poster

Dear all,


i have checkbox
ex:

<?PHP
$price_1 = $100
$price_2 = $10

?>


<input type=checkbox name=products[] value=id_1> buy host
<input type=checkbox name=products[] value=id_2> buy domain
blah blah....

now i want added the javascript when check box someone
show the price in text input

ex:

<input type=checkbox name=products[] value=id_1 onclick="showprice($price_1)"> buy host
<input type=checkbox name=products[] value=id_2 onclick="showprice($price_2)">  buy domain

and then + all price's if check multi products and when you uncheck - the price from total

then show price in

<input type=text name=total value="Javascript(showallprice)">

like this idea what the code javascript need for that please help me

WaleedaaN 0 Newbie Poster

Dear all,


i have project for invoice system.
i use in this project php,mysql,html,javascript


first mysql table's

Products:
id,name,price

billing:
id,products,total_price

now i have create php file

with tables to get all product from products db to show in invoice file

javascript

<script  type="text/javascript"> 
  function toogle(element){ 


  var c = parseInt(element.value, 10); 
c = parseInt(element.value, 10); 
 if(element.checked) 
 { 
 c =  parseInt(document.getElementById('hel').value, 10) + c; 

 }
 else{
  c =  parseInt(document.getElementById('hel').value, 10) - c;
  }
  document.getElementById('hel').value = c; 
  document.getElementById('hel2').value = c; 
  }
  console.log();
  </script>
  
  <script language="Javascript">
  <!--

   function checkName(nameObj, displayObj) {
    if ( nameObj.value.length < 1 )
      alert("Please enter your number discount in the box!");
    else
      displayObj.value=document.getElementById('hel').value - nameObj.value;
   }
	
 // --></script>
  <SCRIPT language=Javascript>
      <!--
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
      //-->
   </SCRIPT>

php file

echo "
<form method='POST' action='?admin=invoice&do=add'>
<table border='0' width='80%' id='table2' cellspacing='0' cellpadding='0' height='30' >
	<tr>
		<td background='images/hbg.gif'>
		<p align='center'><b><font face='Tahoma' color='#FFFFFF'>New Invoice</font></b></td>
	</tr>
</table>
<table border='1' width='80%' id='table1' cellpadding='0' dir=ltr style='border-collapse: collapse' bordercolor='#C0C0C0'>
	<tr>
		<td width='222' align='center' bgcolor='#F3F3F3'>
		<font face='Tahoma' size='2' color='#0000FF'>Customer</font></td>
		<td>&nbsp;<select size='1' name='customer' dir='ltr'>
		<option value='error' selected>select customer</option>	
		
		";

		$result = mysql_query("SELECT * FROM users WHERE status='customer'");
$count=mysql_num_rows($result); 
			if ($count == "0") {
	echo "<option value='error'>there is not customers</option>";
	}
	else {
			while($row = mysql_fetch_array($result))
  {
   $id = $row["id"];
  $name = $row["name"];
		
		echo "<option value='$id'>$name</option>";
		}
		}
		echo"
		</select>
		</td>
	</tr> …
WaleedaaN 0 Newbie Poster

hello ,


i have products i create db
id,productname,price
------
1,cars,2000
2,renttv,20
3,blah,blah...


now i want make a checkbox for all this db

when you select the check box down give you total price

like if you select cars!

TOTAL PRICE: $2000

if you select 2 product like cars and renttv is come like this

TOTAL PRICE: $2020


all this in same page dont need to reload page


thank you