<?php
	include_once('config.php');   
    if(!isset($_SESSION['custId'])) 
    {
         header("Location: ".ROOTPATH."/");
         die;
    }  

         if(isset($_POST['submitLogin']))
         { 
                $stmt=$conn->prepare("insert into   pw__newage (name,address,ph,Tdate) values(:name,:address,:ph,:Tdate) ");   
                $stmt->bindValue(':name', $_POST['agency'] , PDO::PARAM_STR); 
                $stmt->bindValue(':address', $_POST['address'] , PDO::PARAM_STR); 
                $stmt->bindValue(':ph', $_POST['phone'] , PDO::PARAM_STR);  
                $stmt->bindValue(':Tdate', date("d-M-Y"), PDO::PARAM_STR);  
                $stmt->execute();        
				$_SESSION['adAdd'] =1;
                header("Location: addAgency.php");
                die;
         }
         
        $stmt=$conn->prepare("select  *  from    MyWorks where  custId=:custId    order by id desc");   
        $stmt->bindValue(':custId', $_SESSION['custId'] , PDO::PARAM_STR); 
        $stmt->execute();   
        $FinalResult = $stmt->fetchAll(PDO::FETCH_OBJ); 


include_once("view/addAgency.php");
?>