Jump to content

max_w1

Members
  • Posts

    122
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

max_w1's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a from which i am trying to send it via mail with form data as csv the form also has a three file felds too, i want to add the csv file and the other files as a zip and send it to users email. so far i have tried to do something like this. include('connect.php'); session_start(); $Ptan= $Pcomp= $frm1= $frm= $fiefrmincom= $fileopt= $filesup= $txtChCnt= $txtMdIns= $filesup4= $filfrmoth= $filoatt=$frmPas1= $frmPas= $fiefrmincomPas= $fileoptPas= $filesupPas1= $filesupPas2= $filesupPas3= $filesupPas4= $filfrmothPas= $filoattPas= $fileopt=$filesupPas=''; $supdoc=$txtfrmcnt =0; $frmcnt=0; $uploadpath='uploads'; $file_folder = "uploads/"; // folder to load files $zip = new ZipArchive(); // Load zip library $zip_name = time().".zip"; if(isset($_FILES["txtfrm"]["tmp_name"])&& $_FILES["txtfrm"]["tmp_name"]!='') { $fname=explode('.', $_FILES["txtfrm"]["name"]); $fn=$fname[0].$_REQUEST['txtpan'].'.'.$fname[1]; move_uploaded_file($_FILES["txtfrm"]["tmp_name"], $uploadpath.'/'.$fn); $frm=$uploadpath.'/'.$fn; $frmpas=$_REQUEST["txtfrmPassword"]; $frmcnt=1; } if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder.$fn); // Adding files into zip } $zip->close(); if(isset($_REQUEST["txtaddInv"])) { $txtMdIns=$_REQUEST["txtaddInv"]; // $supdoc++; } if(isset($_REQUEST["txtChCnt"])) { $txtChCnt=$_REQUEST["txtChCnt"]; // $supdoc++; } if(isset($_REQUEST["txtMdIns"])) { $txtMdIns=$_REQUEST["txtMdIns"]; // $supdoc++; } //exit(0); $fileoptcnt=0; if(isset($_FILES["fileopt"]["tmp_name"]) && $_FILES["fileopt"]["tmp_name"]!='') { //mkdir("uploads/fileopt_".$_REQUEST['txtpan'], 0777); //$uploadpath=$uploadpath."/fileopt_".$_REQUEST['txtpan']; $fname=explode('.', $_FILES["fileopt"]["name"]); $fn=$fname[0].$_REQUEST['txtpan'].'.'.$fname[1]; move_uploaded_file($_FILES["fileopt"]["tmp_name"], $uploadpath.'/'.$fn); $fileopt=$uploadpath.'/'.$fn; $fileoptPas=$_REQUEST["fileoptPassword"]; $fileoptcnt=1; } if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder.$fn); // Adding files into zip } $zip->close(); $filmcnt=0;$txtfrm=0; if(isset($_FILES["filfrmoth"]["tmp_name"]) && $_FILES["filfrmoth"]["tmp_name"]!='') { // mkdir("uploads/filfrmoth_".$_REQUEST['txtpan'], 0777); // $uploadpath=$uploadpath."/filfrmoth_".$_REQUEST['txtpan']; $fname=explode('.', $_FILES["filfrmoth"]["name"]); $fn=$fname[0].$_REQUEST['txtpan'].'.'.$fname[1]; move_uploaded_file($_FILES["filfrmoth"]["tmp_name"], $uploadpath.'/'. $fn); $filfrmoth=$uploadpath.'/'.$fn; $filfrmothPas=$_REQUEST["filfrmothPassword"]; $filmcnt=1; } if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder.$fn); // Adding files into zip } $zip->close(); $fiefrmincomCnt=0; if(isset($_FILES["fiefrmincom"]["tmp_name"]) && $_FILES["fiefrmincom"]["tmp_name"]!='') { // mkdir("uploads/fiefrmincom_".$_REQUEST['txtpan'], 0777); //$uploadpath=$uploadpath."/fiefrmincom_".$_REQUEST['txtpan']; $fname=explode('.', $_FILES["fiefrmincom"]["name"]); $fn=$fname[0].$_REQUEST['txtpan'].'.'.$fname[1]; move_uploaded_file($_FILES["fiefrmincom"]["tmp_name"], $uploadpath.'/'. $fn); $fiefrmincom=$uploadpath.'/'.$fn; $fiefrmincomPas=$_REQUEST["fiefrmincomPassword"]; $fiefrmincomCnt=1; } if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder.$fn); // Adding files into zip } $zip->close(); $filoattcnt=0; if(isset($_FILES["filoatt"]["tmp_name"]) && $_FILES["filoatt"]["tmp_name"]!='') { //mkdir("uploads/filoatt_".$_REQUEST['txtpan'], 0777); // $uploadpath=$uploadpath."/filoatt_".$_REQUEST['txtpan']; $fname=explode('.', $_FILES["filoatt"]["name"]); $fn=$fname[0].$_REQUEST['txtpan'].'.'.$fname[1]; move_uploaded_file($_FILES["filoatt"]["tmp_name"], $uploadpath.'/'.$fn); $filoatt=$uploadpath.'/'.$fn; $filoattPas=$_REQUEST["filoattPassword"]; $filoattcnt=1; } $pecount=$_REQUEST['txtpemp']; for($i=1;$i<=$pecount;$i++){ if(isset($_REQUEST['txtpcmp'.$i])) { $Pcomp=$Pcomp.','.$_REQUEST['txtpcmp'.$i]; $Ptan=$Ptan.','.$_REQUEST['txtptan'.$i]; if(isset($_FILES["txtfrm_".$i]["tmp_name"]) && $_FILES["txtfrm_".$i] ["tmp_name"]!='') { move_uploaded_file($_FILES["txtfrm_".$i]["tmp_name"], $uploadpath.'/'. $_FILES["txtfrm_".$i]["name"]); $frm1= $frm1.','.$uploadpath.'/'.$_FILES["txtfrm_".$i]["name"]; $frmPas1= $frmPas1.','.$_REQUEST["txtfrmpswd".$i]; $txtfrmcnt++; } } if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder.$_FILES["txtfrm_".$i]["name"]); // Adding files into zip } $zip->close(); } if(isset($_REQUEST['Sub'])) { $Smail=$_REQUEST['Sub']; $Smail1=$_REQUEST['Sub'].'@itfiling.in'; } else { $Smail='mylar'; $Smail1='mylar@itfiling.in'; } $sql="call SP_InsertEmpDetails('".$_REQUEST['txtname']."','".$_REQUEST['txtfname']."','".$_REQUEST['txtpan']."',".$_REQUEST['txtmb'].", '".$_REQUEST['txtemail']."','".$_REQUEST['txtdob']."','".$_REQUEST['rdgender']."','".$_REQUEST['txtaccno']."','".$_REQUEST['txtmicr']."','".$_REQUEST['txtaddr1']."','".$_REQUEST['txtaddr2']."', '".$_REQUEST['txtaddr3']."','".$_REQUEST['txtaddr4']."','".$_REQUEST['txtstate']."',".$_REQUEST['txtpin'].",'".$_REQUEST['txtcmp']."','".$_REQUEST['txttan']."','".$frm."',".$_REQUEST['txtpemp'].", '".trim($Pcomp,',')."','".trim($Ptan,',')."','".trim($frm1,',')."','".$fileopt."','".$txtMdIns."','".$txtChCnt."', '".trim($txtMdIns,',')."','".trim($filesup4,',')."','".trim($filfrmoth,',')."','".trim($fiefrmincom,',')."','".trim($filoatt,',')."','".$frmPas."','".trim($frmPas1,',')."','".$fileoptPas."','".$filesupPas1."','".$filesupPas2."', '".trim($filesupPas3,',')."','".trim($filesupPas4,',')."','".trim($filfrmothPas,',')."','".trim($fiefrmincomPas,',')."','".trim($filoattPas,',')."','".$_REQUEST['txtcmnts']."','".$Smail."',".$_REQUEST['txtIncomeEarned'].")"; $rs=mysqli_query($Connection,$sql); $qry1="SELECT MAX(IT_Emp_Id) FROM it_emp_details"; $q111=mysqli_query($Connection,$qry1); //$q1=mysqli_num_rows($q111); $_SESSION['custname']=$_REQUEST['txtname'].' '.$_REQUEST['txtname']; $_SESSION['custAddress']=$_REQUEST['txtaddr1'].' '.$_REQUEST['txtaddr2'].' '.$_REQUEST['txtaddr3']; $_SESSION['custCity']=$_REQUEST['txtaddr4']; $_SESSION['custState']=$_REQUEST['txtstate']; $_SESSION['custPinCode']=$_REQUEST['txtpin']; $_SESSION['custMobileNo']=$_REQUEST['txtmb']; $_SESSION['custEmailId']=$_REQUEST['txtemail']; while( $row=mysqli_fetch_array($q111,MYSQL_NUM)) { $cus= $row[0]; } $amt=0; $qr='select set_Rate from tbl_user_info where partnerID="'.$Smail.'"'; $q1=mysqli_query($Connection,$qr); while($row=mysqli_fetch_array($q1,MYSQL_NUM)) { $amt= $row[0]; } $totamt=0; if(!empty($_REQUEST['txtaddInv'])){$totamt+=50;} if(!empty($_REQUEST['txtChCnt'])){$totamt+=50;} if(!empty($_REQUEST['txtChCnt'])){$totamt+=50;} $totamt+=$amt+(50*($_REQUEST['txtpemp'])); $netamt=(($totamt*5.2632)/100)+$totamt; $roundnetamt = round($netamt,2,PHP_ROUND_HALF_UP); $_SESSION['amt']=$roundnetamt; $csv_filename='user_'.$_REQUEST['txtpan'].'.csv'; $cr = "\n"; $csv_cnt=''; $pemp=$_REQUEST['txtpemp']; if($pemp>0) { for($i=1;$i<=$pemp;$i++) { $csv_cnt.="Company Name" . ',' .$_REQUEST['txtpcmp'.$i].','. $cr."Company TAN" . ',' .$_REQUEST['txtptan'.$i].','. $cr."Password".','.$_REQUEST['txtfrmpswd_'.$i].','. $cr; $csv_cnt.="" . ',' .','.$cr; } } $csvdata = "Income earned during the year" . ',' .$_REQUEST['txtIncomeEarned'] .','.$cr. "Name" . ',' .$_REQUEST['txtname'] .','.$cr. "Father Name" .','.$_REQUEST['txtfname'].','.$cr. "PAN" . ',' .$_REQUEST['txtpan'].','.$cr. "Mobile Number".','.$_REQUEST['txtmb'].','.$cr. "Email Id" . ',' .$_REQUEST['txtemail'].','.$cr. "DOB".','.$_REQUEST['txtdob'].','.$cr. "Gender" . ',' .$_REQUEST['rdgender'].','.$cr. "Bank Account Number".','.$_REQUEST['txtaccno'].','.$cr. "MICR Code" . ',' .$_REQUEST['txtmicr'].','.$cr. "Flat/Door/BulidRoad/Street".','.$_REQUEST['txtaddr1'].','.$cr. "Road/Street".','.$_REQUEST['txtaddr2'].','.$cr. "Area/Locality".','.$_REQUEST['txtaddr3'].','.$cr. "Town/City/District".','.$_REQUEST['txtaddr4'].','.$cr. "State" . ',' .$_REQUEST['txtstate'].','. $cr. "Pin" . ',' .$_REQUEST['txtpin'].','. $cr. "Company Name" . ',' .$_REQUEST['txtcmp'].','. $cr. "Company TAN" . ',' .$_REQUEST['txttan'].','. $cr. "Document Password if any" . ',' .$_REQUEST['txtfrmpswd'].','. $cr. "Additional Employers if any for the relevant tax period" . ',' .$_REQUEST['txtpemp'].','.$cr. $csv_cnt. "" . ',' .','.$cr. "Optional Attachment" . ',' .$_REQUEST['fileopt'].','. $cr. "Additional Investments/Savings not declared in Form 16(Optional)" . ',' .$_REQUEST['txtaddInv'].','. $cr. "Charitable contributions not declared in Form 16(Optional)" . ',' .$_REQUEST['txtChCnt'].','. $cr. "Medical Insurance not declared in Form 16 (Optional)" . ',' .$_REQUEST['txtMdIns'].','. $cr. "Form 16A of Interest and other documents" . ',' .$_REQUEST['filfrmoth'].','. $cr. "Comment / Any other addition information for filing Income Tax returns" . ',' .$_REQUEST['txtcmnts'] ; // $csvdata ="Income earned during the year" . ',' .$_REQUEST['txtIncomeEarned'] .','.$cr. "First Name" . ',' .$_REQUEST['txtname'] .','.$cr. "Father's Name" .','.$_REQUEST['txtfname'].','.$cr."PAN" . ',' .$_REQUEST['txtpan'].','.$cr. "Mobile No".','.$_REQUEST['txtmb'].','.$cr."Email" . ',' .$_REQUEST['txtemail'].','.$cr. "DOB".','.$_REQUEST['txtdob'].','.$cr."Gender" . ',' .$_REQUEST['rdgender'].','.$cr. "Bank Account Number".','.$_REQUEST['txtaccno'].','.$cr."MICR Code" . ',' .$_REQUEST['txtmicr'].','.$cr. "Flat/Door/BulidRoad/Street".','.$_REQUEST['txtaddr1'].','.$cr. "Road/Street ".','.$_REQUEST['txtaddr2'].','.$cr. "Area/Locality ".','.$_REQUEST['txtaddr3'].','.$cr. "Town/City/District".','.$_REQUEST['txtaddr4'].','.$cr."State" . ',' .$_REQUEST['txtstate'].','. $cr."PIN Code" . ',' .$_REQUEST['txtpin'].','. $cr."Company Name" . ',' .$_REQUEST['txtcmp'].','. $cr."Company TAN" . ',' .$_REQUEST['txttan'].','. $cr."No Of Prev employees" . ',' .$_REQUEST['txtpemp'].','.$cr.$csv_cnt ; // $thisfile = 'file.csv'; file_put_contents("uploads/UserDetails".$csv_filename, $csvdata); if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time<br/>"; } else { $zip->addFile($file_folder."UserDetails".$csv_filename); // Adding files into zip } $zip->close(); $my_file = $zip_name; //$my_path = $_SERVER['DOCUMENT_ROOT']."/uploads/"; $my_path = $_SERVER['DOCUMENT_ROOT']."/"; $my_name = "MYLAR"; $my_mail = $Smail1; $my_replyto = "mylar@itfiling.in"; $my_subject = "This is a mail with attachment."; $my_message = "Hai<br> Please find the attacheddocument"; mail_attachment($my_file, $my_path,$Smail1, $my_mail, $my_name, $my_replyto, $my_subject, $my_message); function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) { $file = $path.$filename; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); $header = "From: ".$from_name." <".$from_mail.">\r\n"; $header .= "Reply-To: ".$replyto."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"; $msg .= "This is a multi-part message in MIME format.\r\n"; $msg .= "--".$uid."\r\n"; $msg .= "Content-type:text/plain; charset=iso-8859-1\r\n"; $msg .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $msg .= $message."\r\n\r\n"; $msg .= "--".$uid."\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"; // use different content types here $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n"; $msg .= $content."\r\n\r\n"; $msg .= "--".$uid."--"; mail($mailto, $subject, $msg, $header) or die("unable to send mail"); } header('location:payamt.php?sub='.$Smail.'&cus='.$cus);
  2. Hello, A client of mine requires me to develop an application like CRM where he can manage his company records. he wants me to make it in a way that it will be easier for him to install new modules to the app. I think it is better to use the joomla backend because it has all the UI and great Pattern, it would reduce 50% of my work. i need to know how to use the administrator panel independently and what are the important files i need to keep. Any Help is much appreciated. Regards Max
  3. You can store the info in database with the user's IP, or just place a cookie in users computer with the information. as far as i know, sessions get destroyed when the browser is closed.
  4. you are welcome. You may mark this post as solved.
  5. Oh great, it works all perfect. thank you so much litebearer. the code you sent had very tiny corrections but it worked like magic. I must say you are example of a brilliant mind. Thank you again.
  6. a badly deformed table, with rows and columns all messed up. Here is the Table code i got from FireBug after compiling in firefox. <table width="200" border="1"> <tbody> <tr> <td>Product Name </td> <td>Quantity</td> <td>Price</td> </tr> <tr> <td> 2600x5</td> <td> NMx001</td> <td></td> <td>2</td> <td></td> <td>9</td> </tr> </tbody> </table>
  7. look at your line which has $id = $_SESSION ['id']; change $_SESSION['id'] to $_GET['id'] tell me if that works
  8. I have a string (Product1-Product2-Product3#2-4-1) where Product1-Product2-Product3 are products and 2-4-1 are quantities. I am struggling to make a table out of it where products and quantities are shown in rows. here is what i tried. list($products, $quantities) = explode("#", $specs); //to separate Quantities from products <?php foreach(preg_split("/-/", $products) as $product_list) { ?> <tr> <td> <?php echo $product_list; ?></td><? } ?> <?php foreach(preg_split("/-/", $quantities) as $qtylist) { ?> <td></td> <td><?php echo $qtylist; ?></td> <?php } ?> </tr> <?php //} ?> </table> I know something is wrong with this and its giving me unexpected reasult Please help me create a table out of the above string. Many Thanks -Max
  9. Hi, can someone tell me where i can find the good books and guides to prepare myself for zend examination? I am willing to pay to buy the books but it will be helpful if there are free online tutorials. Thanks
  10. Do you mean you want to borrow code?
  11. max_w1

    Wow.

    lol, the biggest flop
  12. Product export and advance search is not a problem, we can develop that, i think its better than developing everything from scratch. and if non SEO Friendly layout it is even better because the application will be for internal use of a company thus protecting their privacy.
  13. I wanted to create a lead and employee management system for my client, thought about starting from scratch. When you look at Joomla administrator panel you can find many useful things, like. the desing - which can be changed by designing templates thus offering more flexibility. already present jquery plugins, model boxes validations etc... already present ACL(Acess Level control) The framework and lot of things which will be really useful in the longrun . would like to know if it legal or permitted by joomla, and would also like to know if i can find a manual or a guide joomla administrator framework. Thanks
  14. hahahahha, that was a good one cs.punk. but i think neither of us but Google was having problems , lol
×
×
  • 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.