<?php

class Contract {
    public static function init_view(){
        global $wpdb;
        $type = $_POST["type"];
        $context = array();
        $context['siteUrl'] = get_site_url();
        $params = array(
            'business' => $_REQUEST['business'],
            'houseNumber' =>$_REQUEST['houseNumber'],
            'customerNumber' =>$_REQUEST['customerNumber'],
            'signedDate' =>$_REQUEST['signedDate'],
            'permitNumber' =>$_REQUEST['permitNumber'],
            'area' =>$_REQUEST['area'],
            'house_number' =>$_REQUEST['house_number'],
            'price' =>$_REQUEST['price'],
            'managerId' =>$_REQUEST['managerId'],
            'paymentMethod' =>$_REQUEST['paymentMethod'],
            'codicil' =>$_REQUEST['codicil'],
            'oName' =>$_REQUEST['oName'],
            'oPhone' =>$_REQUEST['oPhone'],
            'oID' =>$_REQUEST['oID'],
            'oCommission' =>$_REQUEST['oCommission'],
            'oAddress' =>$_REQUEST['oAddress'],
            'oPayBack' =>$_REQUEST['oPayBack'],
            'oMoney' =>$_REQUEST['oMoney'],
            'cName' =>$_REQUEST['cName'],
            'cPhone' =>$_REQUEST['cPhone'],
            'cID' =>$_REQUEST['cID'],
            'cCommission' =>$_REQUEST['cCommission'],
            'cAddress' =>$_REQUEST['cAddress'],
            'cPayBack' =>$_REQUEST['cPayBack'],
            'cMoney' =>$_REQUEST['cMoney']
        );
        if($type==1){

        }else if(isset($_GET['edit'])){

        }
        Timber::render("contract.html",$context);
    }

    public static function insert($params){
        global $wpdb;
        //$wpdb->insert(Config::);
    }

    public static function update($params){

    }
} 