korsygfhrtzangaiide
Elepffwdsff
/
home3
/
nmslyumy
/
www
/
odishaexpress
/
oe-admin
/
model
/
Upload FileeE
HOME
<?php class AllPage extends CommonAll { public function Addnewpage() { $sp="home.php?page=all-page"; $ep="home.php?page=add-page"; $title=trim($_POST["title"]); $content=trim($_POST["content"]); $its_urlkey=strtolower(str_replace(" ","-",$title)); $its_date=date("Y-m-d"); $tab="its_page"; $col="its_ptitle,its_urlkey,its_content,its_date"; $chcol="its_ptitle"; $val="'".$title."','".$its_urlkey."','".$content."','".$its_date."'"; $this->AddUniqRecord($tab,$col,$val,$chcol,$title,$sp,$ep); } public function updatepage() { $sp="home.php?page=all-page"; $ep="home.php?page=all-page"; $title=trim($_POST["title"]); $content=trim($_POST["content"]); $its_urlkey=strtolower(str_replace(" ","-",$title)); $its_date=date('Y/m/d'); $tab="its_page"; $ucolname="its_pid "; $uval="'".$_GET['eid']."'"; $colval="its_ptitle='".$title."',its_urlkey='".$its_urlkey."',its_content='".$content."',its_date='".$its_date."'"; $this->UpdateRecord($tab,$colval,$ucolname,$uval,$sp,$ep); } } $apcon=new AllPage; if(isset($_POST["save"])) { $ins=$apcon->Addnewpage(); } //GET aLL rECORD $grs=$apcon->getAllRecord("its_page","its_pid","desc"); //GET EDIT DETAILS if(!empty($_GET["eid"])) { $tab="its_page"; $wh="its_pid='".$_REQUEST['eid']."'"; $edt=$apcon->getAllRecordEdit($tab,$wh); } //CODE FOR UPDATE RECORD if(isset($_POST["update"])) { $upd=$apcon->updatepage(); } //CODE FOR DELETE RECORD if(!empty($_GET['did'])) { $sp="home.php?page=all-page"; $ep="home.php?page=all-page"; $col="its_pid"; $val="'".$_GET['did']."'"; $upd=$apcon->DeleteRecord("its_page",$col,$val,$sp,$ep); } ?>