<?php

/**
 * Class that operate on table 'tamweenda3mstatus'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2020-12-14 16:00
 */
class Tamweenda3mstatusMySqlExtDAO extends Tamweenda3mstatusMySqlDAO {

    public function queryRowByClientAndMonth($clientid, $month) {
        $sql = 'SELECT tamweenda3mstatus.*,user.employeename
                FROM tamweenda3mstatus
                left join user on user.userid = tamweenda3mstatus.useridTamween
                where clientid = ' . $clientid . ' and month = "' . $month . '" ';
        //echo $sql;
        $sqlQuery = new SqlQuery($sql);
        return $this->getRow($sqlQuery);
    }

    public function updateDa3m($da3mStatus, $user, $sysdate, $id) {
        $sql = 'UPDATE tamweenda3mstatus SET da3mStatus = ' . $da3mStatus . ', userid = ' . $user . ', sysdate = "' . $sysdate . '" WHERE id = ' . $id . '';
        $sqlQuery = new SqlQuery($sql);
        return $this->executeUpdate($sqlQuery);
    }

    public function updateTamween($tamweenStatus, $user, $sysdate, $id) {
        $sql = 'UPDATE tamweenda3mstatus SET tamweenStatus = ' . $tamweenStatus . ',useridTamween = ' . $user . ',sysdateTamween = "' . $sysdate . '" WHERE id = ' . $id . '';
        $sqlQuery = new SqlQuery($sql);
        return $this->executeUpdate($sqlQuery);
    }

}

?>