1
hi, i am currently using googlemaps module and mxdirectory. I am trying to link the map to the id of a particular listing i posted in with my mxdirectory, however, i had faced some troubles. i tried to add in a drop down menu to get the title when the admin wants to add a new point, however, the result is not being uploaded to sqldb.
as attached the lid is blank, please help me =)
this is the add point page
//Add in a new point
function pointAdd()
{
global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
$result2 = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("gmap_category")."");
list($numrows2) = $xoopsDB->fetchRow($result2);
if ( $numrows2 > 0 ) {
$result1 = $xoopsDB->query("select map_id, name from ".$xoopsDB->prefix("gmap_category")."");
$i = 0;
while ($array = $xoopsDB->fetchArray($result1)) {
$entry[$i]['map_id'] = $array['map_id'];
$entry[$i]['name'] = $array['name'];
$i++;
}
xoops_cp_header();
echo"n";
echo"n";
echo""._MD_ADDNEWPOINT." |
";
echo "
";
xoops_cp_footer();
}else{
redirect_header("index.php?op=catAdd",1,_MD_NOCATSADD);
}
}
//Insert the new point into the DB
function pointInsert()
{
global $xoopsConfig, $xoopsDB, $myts, $xoopsUser, $xoopsModule, $eh;
$title = $myts->makeTboxData4Save($_POST["title"]);
$lat = $myts->makeTboxData4Save($_POST["lat"]);
$lon = $myts->makeTboxData4Save($_POST["lon"]);
$zoom = $myts->makeTboxData4Save($_POST["zoom"]);
$category = $myts->makeTboxData4Save($_POST["category"]);
$description = $myts->makeTareaData4Save($_POST["description"]);
$lid = $myts->makeTboxData4Save($_POST["lid"]);
$submitter = $xoopsUser->uid();
$date = time();
$errormsg = '';
// Check if Title exist
if ( $title == "" ) {
$errormsg .= ""
;
$errormsg .= _MD_ERRORTITLE."";
$error =1;
}
// Check if Description exist
if ( $description == "" ) {
$errormsg .= ""
;
$errormsg .= _MD_ERRORDESC."";
$error =1;
}
if ( $error == 1 ) {
xoops_cp_header();
echo $errormsg;
xoops_cp_footer();
exit();
}
list($order) = $xoopsDB->fetchRow($xoopsDB->query("SELECT MAX(`order`) FROM ".$xoopsDB->prefix("gmap_points")." WHERE `map_id` = ".$category));
$order++;
$sql = "INSERT INTO ".$xoopsDB->prefix("gmap_points")." (`map_id` , `lat` , `lon` , `title` , `html` , `zoom` , `submitter` , `status` , `date`, `order`, `lid`) VALUES ('$category', '$lat', '$lon', '$title', '$description', '$zoom','$submitter', '1', '$date', '$order', '$lid')";
$xoopsDB->query($sql) or $eh->show("0013");
if ( $newid == 0 ) {
$newid = $xoopsDB->getInsertId();
}
redirect_header("index.php?op=linksConfigMenu",1,_MD_NEWPOINTADDED);
}
thank you very much !