Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Posts posted by QuickOldCar

  1. If you want to use just the first one can do something like this.

    <?php
    $email = "john@test.com, peter@test.com";
    
    if(strstr($email, ',')){
    $exploded = explode(',',$email);
    $email = trim($exploded[0]);	
    }
    if(filter_var($email, FILTER_VALIDATE_EMAIL)){
        echo $email; 
    }else{
        echo $email." Failed";
    }
    ?>
    
  2. Look at your last php block, you had an else where should be an echo

     

    You can work out the if else issues if there is any

     

    A suggestion would be to do all php processing above and the html display below in your code.

    <?php
    include_once("init.php"); // Use session variable on this page. This function must put on the top of page.
    if (!isset($_SESSION['username']) || $_SESSION['usertype'] != 'admin') { // if session variable "username" does not exist.
        header("location: index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
        exit;
    } else {
        
        error_reporting(0);
        if (isset($_GET['sid'])) {
            echo $_GET['sid'];
        }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        
            <head>
             <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
            <title>Simple invoice in PHP</title>
                <style type="text/css">
                body {      
                    font-family: Verdana;;
                }
                
                div.invoice {
                border:1px solid #ccc;
                padding:10px;
                height:740pt;
                width:570pt;
                }
        
                div.company-address {
                    border:1px solid #ccc;
                    float:left;
                    width:200pt;
                }
                
                div.invoice-details {
                    border:1px solid #ccc;
                    float:right;
                    width:200pt;
                }
                
                div.customer-address {
                    border:1px solid #ccc;
                    float:right;
                    margin-bottom:50px;
                    margin-top:100px;
                    width:200pt;
                }
                
                div.clear-fix {
                    clear:both;
                    float:none;
                }
                
                table {
                    width:100%;
                }
                
                th {
                    text-align: left;
                }
                
                td {
                }
                
                .text-left {
                    text-align:left;
                }
                
                .text-center {
                    text-align:center;
                }
                
                .text-right {
                    text-align:right;
                }
                
                </style>
            </head>
        
            <body>
        
        
        
        
        <div class="invoice">
                <div class="company-address">
                <?php
        $sid  = $_GET['sid'];
        $line = $db->queryUniqueObject("SELECT * FROM stock_sales WHERE transactionid='$sid' ");
        
        $mysqldate = $line->date;
        
        $phpdate = strtotime($mysqldate);
        
        $phpdate = date("d/m/Y", $phpdate);
        echo $phpdate;
    ?><?php
        echo $sid;
    ?>
                  <?php
        $line4 = $db->queryUniqueObject("SELECT * FROM store_details ");
    ?>
                                             <?php
        echo $line4->name;
    ?>
                 <br />
                    <?php
        echo $line4->address;
    ?>,<?php
        echo $line4->place;
    ?>
                                         
                                                
                    <br />
                    LPhone
                                                <strong>:<?php
        echo $line4->phone;
    ?></strong>
                    <br />
                </div>
            
        
        
        
               <div class="invoice-details">
                    Invoice no : <?php
        echo $sid;
    ?>
                 <br />
                    Date: <?php
        $sid  = $_GET['sid'];
        $line = $db->queryUniqueObject("SELECT * FROM stock_sales WHERE transactionid='$sid' ");
        
        $mysqldate = $line->date;
        
        $phpdate = strtotime($mysqldate);
        
        $phpdate = date("d/m/Y", $phpdate);
        echo $phpdate;
    ?>
             </div>
                
                <div class="customer-address">
                    To:
                    <br />
                    <?php
        echo $line->customer_id;
        $cname = $line->customer_id;
        
        $line2 = $db->queryUniqueObject("SELECT * FROM customer_details WHERE customer_name='$cname' ");
        
        echo $line2->customer_address;
    ?>
                 <br />
                    123 Long Street
                    <br />
                    London, DC3P F3Z 
                    <br />
                </div>
        
        
        
                
                <div class="clear-fix"></div>
                    <table border='1' cellspacing='0'>
                        <tr>
                            <th width=250>Description</th>
                            <th width=80>Quantity</th>
                            <th width=100>Unit price</th>
                            <th width=100>Total price</th>
                        </tr>
        
        
        <?php
        
        $db->query("SELECT * FROM stock_sales where transactionid='$sid'");
        while ($line3 = $db->fetchNextObject()) {
    ?>
                               
                            echo("<tr>");
                            echo("<td><?php
            echo $line3->stock_name;
    ?></td>");
                            echo("<td class='text-center'><?php
            echo $line3->quantity;
    ?></td>");
                         echo("<td class='text-right'><?php
            echo $line3->selling_price;
    ?></td>");
                            echo("<td class='text-right'><?php
            echo $line3->amount;
    ?></td>");
                            echo("</tr>");
                    
                   }
        ?>
                    echo("<tr>");
                    echo("<td colspan='3' class='text-right'>Sub total</td>");
                    echo("<td class='text-right'><?php
            $subtotal = $line3->subtotal;
    ?></td>");
                    echo("</tr>");
                    echo("<tr>");
                    echo("<td colspan='3' class='text-right'>VAT</td>");
                    echo("<td class='text-right'><?php
            $discount = $line3->discount;
    ?></td>");
                    echo("</tr>");
                    echo("<tr>");
                    echo("<td colspan='3' class='text-right'><b>TOTAL</b></td>");
                    echo("<td class='text-right'><b><?php
            $payment = $line3->payment;
    ?></b></td>");
                    echo("</tr>");
                  
                    </table>
                </div>
            </body>
        
        </html>
        <?php
            
            echo "Error in processing printing the sales receipt";
        }
        
    }
    ?> 
    
  3. If this was written all the processing code up top and display output all below could have used header() prior to any output.

     

    You can add a meta refresh in the place you have header() commented out.

    echo "<meta http-equiv='refresh' content='5;URL='members_roster.php' />";
  4. This forum is designed to help people with problems their existing code, not make it.

     

    First you would have to detect it's file type.

    Depending what type it is handle in different ways.

     

    For pdf need something that can read,extract,convert the pages into plain text

    http://www.pdfparser.org/

     

    Once you can extract these document types into a similar format you can save them line by line.

     

    As for getting specific data, you can try regex and matching data, seems to me would be quite difficult to do different patterns in files because nothing would be similar named or positions. Also have to deal with languages.

     

    An online resume form and hiring a human as data entry is most likely the best solution to this.

    I'm not saying it can't be done, but surely is not going to be fast and easy.

    I would bet not one CV/Resume Parser is accurate.

  5. The op is calling the content being shared as shares.

     

    see this area?

    if ($lang->getTag() == 'it-IT') {
    $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls;
    
    $spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls;
    } else {
    $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls;
    
    $spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls;
    
    }
    

    remove the links that have https, I'll comment them out

    if ($lang->getTag() == 'it-IT') {
    $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls;
    
    //$spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls;
    } else {
    $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls;
    
    //$spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls;
    
    }
    
×
×
  • 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.