Jump to content

need assistance


newcoder

Recommended Posts

i am trying to combine 4 separate .csv to use in a search page foe my client the files will be updated all the time so i am a lil confused on where i should go

 

here's the code and im wondering about an array_push???????

 

<?php
        $dbvoip = sqlite_open($_SERVER['DOCUMENT_ROOT']."/../data/voip.db");

        if ($dbvoip == false)
        {
                die ('Unable to open database');
        } else {
                //echo 'Database created.';
        }

$dbinfo1=file("atlMaster.csv");
$dbinfo2=file("cseMaster.csv");
$dbinfo3=file("pacMaster.csv");
$dbinfo4=file("parMaster.csv");

foreach ($dbinfo as  $dbquery);
{

   //$data =implode(",",$dbquery);
  

   
$dbquery = "INSERT INTO voiplog ( number1, number2, type, number3, linetype, c1, dial, c2, date1, date2,
   date3, c3, c4, anw, Documentaion, unix)
   VALUES ($dbquery)";
   echo($dbquery);
    
}
           //sqlite_close($dbvoip)



$pageQuery = "SELECT * FROM voiplog ";

$pageResult = sqlite_query($dbvoip, $pageQuery); 

//echo $pageResult;

if(isset($_GET['submitted']) && $_GET["submitted"] == "send")// line check
{
if ($_GET["number1"] !="")
	$conditions[]  = " number1 =\"" .$_GET["number1"]."\"";
if ($_GET["number2"] !="")
	$conditions[] = " number2=\"".$_GET["number2"]."\"";
if ($_GET["type"] !="")
	$conditions[] = " type=\"".$_GET["type"]."\"";
if ($_GET["number3"] !="")
	$conditions[] = " number3=\"".$_GET["number3"]."\"";
if ($_GET["linetype"] !="")
	$conditions[] = " linetype=\"".$_GET["linetype"]."\"";
if ($_GET["c1"] !="")
	$conditions[] = " c1=\"".$_GET["c1"]."\"";
if ($_GET["dial"] !="")
	$conditions[] = " dial=\"".$_GET["dial"]."\"";
if ($_GET["c2"] !="")
	$conditions[] = " c2=\"".$_GET["c2"]."\"";
if ($_GET["date1"] !="")
	$conditions[] = " date1=\"".$_GET["date1"]."\"";
if ($_GET["date2"] !="")
	$conditions[] = " date2=\"".$_GET["date2"]."\"";
if ($_GET["date3"] !="")
	$conditions[] = " date3=\"".$_GET["dtae3"]."\"";
if ($_GET["c3"] !="")
	$conditions[] = " c3=\"".$_GET["c3"]."\"";
if ($_GET["c4"] !="")
	$conditions[] = " c4=\"".$_GET["c4"]."\"";
if ($_GET["anw"] !="")
	$conditions[] = " anw=\"".$_GET["anw"]."\"";
if ($_GET["Documentaion"] !="")
	$conditions[] = " Documentaion=\"".$_GET["Documentaion"]."\"";
if ($_GET["unix"] !="")
	$conditions[] = " unix=\"".$_GET["unix"]."\"";

}

?>
<html>
<head>
<title>VOIP DB</title>  
</head>
<body>
<h1 align=center><b>--VOIP SEARCH--</b></h1>
<h1 align=left>Please enter search fields:</h1>
<body bgcolor="000000" text="FFFFFF">
<form method="get">
: 
<select name="page">
<option value=""></option>


</select>
:
<select name=" ">
<option value=""></option>


</select>
: 
<input type=" " name=" ">
<option value=""></option>
:
<input type=" " name=" ">
<option value=""></option>
<p><input name="submitted" type="submit" value="send"/></p></form>
<style type='text/css'>
<table {
border-width: 1px;
border-spacing:0px ;
border-style: double;
border-color: black;
border-collapse: separate;
background-color: #0000FF;
}
table tr { 
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: black;
background-color: #0000FF;
}
table th {
border-width: 1px;
padding: 0px;
border-style: solid;
border-color: black;
background-color: #0000FF;
}
table td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: black;
background-color: #0000FF;
}
</style>
<table class='db'; cellspacing=\"0px\">";

</html>




Link to comment
https://forums.phpfreaks.com/topic/137411-need-assistance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.